Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gateway env flag for mg undeploy API command #680

Merged
merged 3 commits into from
Apr 2, 2021

Conversation

renuka-fernando
Copy link
Contributor

@renuka-fernando renuka-fernando commented Apr 2, 2021

Purpose

$subject
fix https://github.com/wso2/product-apim-tooling/issues/681

Read gateway environments from --gateway-env flag and pass it to the Adapter Rest API query param environments
--gateway-env reads multiple gw envs (same as for synapse gateway) with args and set to Adapter Rest API query param with joining gw envs with ":"

Samples

$ apictl mg undeploy api --help
Undeploy an API in Microgateway by specifying name, version, environment, username and optionally vhost

Usage:
  apictl mg undeploy api [flags]

Examples:
  apictl mg undeploy api --environment dev -n petstore -v 0.0.1
  apictl mg undeploy api -n petstore -v 0.0.1 -e dev --vhost www.pets.com
  apictl mg undeploy api -n petstore -v 0.0.1 -e dev -g "Production and Sandbox" -g Label1 -g Label2
  apictl mg undeploy api -n petstore -v 0.0.1 -e dev --vhost www.pets.com --gateway-env "Production and Sandbox"
  apictl mg undeploy api -n SwaggerPetstore -v 0.0.1 --environment dev

Note: The flags --name (-n), --version (-v), --environment (-e) are mandatory.
If the flag (--gateway-env (-g)) is not provided, API will be undeployed from all deployed gateway environments.
If the flag (--vhost (-t)) is not provided, API with all VHosts will be undeployed.
The user needs to be logged in to use this command.

Flags:
  -e, --environment string    Microgateway adapter environment to be undeployed from
  -g, --gateway-env strings   Gateway environments the API needs to be undeployed from
  -h, --help                  help for api
  -n, --name string           API name
  -v, --version string        API version
  -t, --vhost string          Virtual host the API needs to be undeployed from

Global Flags:
  -k, --insecure   Allow connections to SSL endpoints without certs
      --verbose    Enable verbose mode

Test environment

macOS

@wasuradananjith
Copy link
Contributor

Shall we generate docs as well for the above changes?

@renuka-fernando
Copy link
Contributor Author

Shall we generate docs as well for the above changes?

fixed with ee5f56e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for flag --gateway-env for mg undeploy command
6 participants