Command Line tool for importing and exporting APIs and Applications between different API Environments
Select a generated archive suitable for your platform (Mac, Windows, Linux) and extract it to a desired
location and cd
into it.
Then execute apictl
to start the application.
NOTE: Execute
./apictl
if the working directory is the same where the executable residesAdd the location of extracted folder to your system's $PATH variable to access the executable from anywhere
Execute apictl --help
for further instructions.
Add environments by either manually editing $HOME/.wso2apictl/main_config.yaml
or using the
command
apictl add-env
.
NOTE: Directory structure for configuration files (
$HOME/.wso2apictl
) will be created upon execution ofapictl
Execute apictl add-env --help
for detailed instructions
Under environment,
api_manager_endpoint
,registration_endpoint
,token_endpoint
fields are mandatory. Others are optional
Copy the file apictl_bash_completion.sh
to /etc/bash_completion.d/
and source it
with
source /etc/bash_completion.d/apictl_bash_completion.sh
to enable bash
auto-completion.
apictl [command]
--verbose
Enable verbose logs (Provides more information on execution)
--insecure, -k
Allow connections to SSL sites without certs
--help, -h
Display information and example usage of a command
Flags:
Required:
--name, -n
--version, -v
--provider, -r
--environment, -e
Optional:
--username, -u
--password, -p
NOTE: user will be prompted to enter credentials if they are not provided with these flags
Examples:
apictl export-api -n TestAPI -v 1.0.1 -r admin -e staging
apictl export-api -n TestAPI -v 1.0.1 -r admin -e staging -u admin -p 123456
apictl export-api -n TestAPI -v 1.0.1 -r admin -e staging -u admin
apictl export-api -n TestAPI -v 1.0.1 -r admin -e staging -p 123456
Flags:
Required:
--file, -f
--environment, -e
Optional:
--username, -u
--password, -p
NOTE: user will be prompted to enter credentials if they are not provided with these flags
Examples:
apictl import-api -f dev/TestAPI_1.0.0.zip -e dev
apictl import-api -f qa/TestAPI_2.0.0.zip -e dev -u admin -p 123456
apictl import-api -f staging/TestAPI_1.1.zip -e dev -u admin
apictl import-api -f production/TestAPI_3.0.1.zip -e dev -p 123456
apictl import-api -f TestAPI -e dev
Flags:
Required:
--name, -n
--owner, -o
--environment, -e
Optional:
--username, -u
--password, -p
NOTE: user will be prompted to enter credentials if they are not provided with these flags
Examples:
apictl export-app -n SampleApp -o admin -e dev
apictl export-app -n SampleApp -o admin -e prod
Flags:
Required
--file, -f
--environment, -e
Optional
--skipSubscriptions, -s
--owner, -o
--preserveOwner, -r
--file, -f
--environment, -e
Examples:
apictl import-app -f qa/apps/sampleApp.zip -e dev
apictl Import App -f staging/apps/sampleApp.zip -e prod -o testUser -u admin -p admin
apictl import-app -f qa/apps/sampleApp.zip --preserveOwner --skipSubscriptions -e staging
Flags:
Required:
--environment, -e
Optional:
--username, -u
--password, -p
NOTE: user will be prompted to enter credentials if they are not provided with these flags
--query, -q
Examples:
apictl list apis -e dev
apictl list apis -e prod -q version:1.0.0
apictl list apis -e prod -q provider:admin
apictl list apis -e staging
apictl list apis -e staging -u admin -p 123456
apictl list apis -e staging -p 123456
Flags:
Required
--environment, -e
--owner, -o
Optional
--username, -u
--password, -p
Examples:
apictl list apps -e dev -o admin
apictl list apps -e staging -o sampleUser -u admin -p 123456
Flags:
None
Example:
apictl list envs
Flags:
Required:
--environment, -e (Name of the environment)
--apim (API Manager endpoint)
--registration (Registration Endpoint)
--token (Token Endpoint)
Optional:
--list (API List endpoint for environment)
Examples:
apictl add-env -e dev \
--apim https://localhost:9443 \
--registration https://localhost:9443/client-registration/v0.15/register \
--token https://localhost:9443/oauth2/token
apictl add-env -e prod \
--apim https://localhost:9443 \
--registration https://localhost:9443/client-registration/v0.15/register \
--api_list https://localhost:9443/api/am/publisher/v0.15/apis \
--app_list https://localhost:9443/api/am/admin/v0.15/applications \
--token https://localhost:9443/oauth2/token
Flags:
Required:
--environment, -e (Name of the environment)
Examples:
apictl remove-env -e dev
Flags
--environment, -e
Examples:
apictl reset-user -e dev
apictl version
Flags
--http-request-timeout
--export-directory
Examples:
apictl set --http-request-timeout 10000
apictl set --export-directory /home/user/exported
Flags:
Required:
--name, -n
--version, -v
--environment, -e
Optional:
--username, -u
--password, -p
NOTE: user will be prompted to enter credentials if they are not provided with these flags
Examples:
apictl get-keys -n PizzaShackAPI --version 1.0.0 -e dev --provider admin