Skip to content

Commit

Permalink
chore: add example in backup policy create
Browse files Browse the repository at this point in the history
  • Loading branch information
lizzy-0323 committed Dec 17, 2024
1 parent 1b5ced9 commit fa09536
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/cli/cmd/backup/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ import (
"github.com/oceanbase/ob-operator/internal/cli/utils"
)

var createExample = `
# Create a backup policy by OSS
obocli backup create <tenant_name> --archive-path=oss://<bucket_name>/<path> --bak-data-path=oss://<bucket_name>/<path> --oss-access-id=<access_id> --oss-access-key=<access_id>
# Create a backup policy by NFS
obocli backup create <tenant_name> --archive-path=nfs://<nfs_server>/<path> --bak-data-path=nfs://<nfs_server>/<path> --bak-encryption-password=<password>
`

// NewCreateCmd create an new backup policy
func NewCreateCmd() *cobra.Command {
o := backup.NewCreateOptions()
Expand All @@ -28,6 +36,7 @@ func NewCreateCmd() *cobra.Command {
Use: "create <tenant_name>",
Short: "Create a backup policy for the specified ob tenant",
Long: `Create a backup policy for the specified ob tenant.`,
Example: createExample,
Args: cobra.ExactArgs(1),
PreRunE: o.Parse,
Run: func(cmd *cobra.Command, args []string) {
Expand Down

0 comments on commit fa09536

Please sign in to comment.