Skip to content

Commit

Permalink
Merge pull request #261 from wasuradananjith/remove-tenant-flag
Browse files Browse the repository at this point in the history
Remove tenant flag from "apictl export-apis" command
  • Loading branch information
npamudika authored Apr 3, 2020
2 parents bb1b683 + 4c3fcf4 commit 640521e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
8 changes: 3 additions & 5 deletions import-export-cli/cmd/exportAPIs.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const exportAPIsCmdShortDesc = "Export APIs for migration"

const exportAPIsCmdLongDesc = "Export all the APIs of a tenant from one environment, to be imported " +
"into another environment"
const exportAPIsCmdExamples = utils.ProjectName + ` ` + exportAPIsCmdLiteral + ` -e production -t wso2.org --force
const exportAPIsCmdExamples = utils.ProjectName + ` ` + exportAPIsCmdLiteral + ` -e production --force
` + utils.ProjectName + ` ` + exportAPIsCmdLiteral + ` -e production
NOTE: The flag (--environment (-e)) is mandatory`

Expand All @@ -55,7 +55,7 @@ var credential credentials.Credential

var ExportAPIsCmd = &cobra.Command{
Use: exportAPIsCmdLiteral + " (--environment " +
"<environment-from-which-artifacts-should-be-exported> -t <Tenant-domain-of-the-resources-to-be-exported> --force)",
"<environment-from-which-artifacts-should-be-exported> --format <export-format> --preserveStatus --force)",
Short: exportAPIsCmdShortDesc,
Long: exportAPIsCmdLongDesc,
Example: exportAPIsCmdExamples,
Expand Down Expand Up @@ -280,9 +280,7 @@ func getAPIList() (count int32, apis []utils.API) {
func init() {
RootCmd.AddCommand(ExportAPIsCmd)
ExportAPIsCmd.Flags().StringVarP(&cmdExportEnvironment, "environment", "e",
"", "Environment to which the API should be exported")
ExportAPIsCmd.Flags().StringVarP(&cmdResourceTenantDomain, "tenant", "t", "",
"Tenant domain of the resources to be exported")
"", "Environment from which the APIs should be exported")
ExportAPIsCmd.PersistentFlags().BoolVarP(&cmdForceStartFromBegin, "force", "", false,
"Clean all the previously exported APIs of the given target tenant, in the given environment if "+
"any, and to export APIs from beginning")
Expand Down
7 changes: 3 additions & 4 deletions import-export-cli/docs/apictl_export-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,25 @@ Export APIs for migration
Export all the APIs of a tenant from one environment, to be imported into another environment

```
apictl export-apis (--environment <environment-from-which-artifacts-should-be-exported> -t <Tenant-domain-of-the-resources-to-be-exported> --force) [flags]
apictl export-apis (--environment <environment-from-which-artifacts-should-be-exported> --format <export-format> --preserveStatus --force) [flags]
```

### Examples

```
apictl export-apis -e production -t wso2.org --force
apictl export-apis -e production --force
apictl export-apis -e production
NOTE: The flag (--environment (-e)) is mandatory
```

### Options

```
-e, --environment string Environment to which the API should be exported
-e, --environment string Environment from which the APIs should be exported
--force Clean all the previously exported APIs of the given target tenant, in the given environment if any, and to export APIs from beginning
--format string File format of exported archives(json or yaml)
-h, --help help for export-apis
--preserveStatus Preserve API status when exporting. Otherwise API will be exported in CREATED status (default true)
-t, --tenant string Tenant domain of the resources to be exported
```

### Options inherited from parent commands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,6 @@ _apictl_export-apis()
local_nonpersistent_flags+=("--help")
flags+=("--preserveStatus")
local_nonpersistent_flags+=("--preserveStatus")
flags+=("--tenant=")
two_word_flags+=("-t")
local_nonpersistent_flags+=("--tenant=")
flags+=("--insecure")
flags+=("-k")
flags+=("--verbose")
Expand Down
6 changes: 3 additions & 3 deletions import-export-cli/shell-completions/apictl_zsh_completions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ case $state in
;;
level2)
case $words[2] in
add)
_arguments '2: :(api help)'
;;
change)
_arguments '2: :(help registry)'
;;
Expand All @@ -32,9 +35,6 @@ case $state in
update)
_arguments '2: :(api help)'
;;
add)
_arguments '2: :(api help)'
;;
*)
_arguments '*: :_files'
;;
Expand Down

0 comments on commit 640521e

Please sign in to comment.