ESB API Controller (APICTL)¶
The ESB API Controller (apictl) is the command-line tool of MWARE ESB. This allows you to move APIs, API Products, and Applications across API-M environments and to perform CI/CD operations. It can also be used to perform these same tasks on a Kubernetes deployment. Also, apictl can be used as a developer CLI tool for Choreo Connect. Furthermore, it can be used with the Micro Integrator (ESB MI) for monitoring integration artifacts and performing management/administrative tasks from the command line.
Get Started¶
Follow the steps given below to get started:
-
Go to the MWARE ESB website -> TRY IT NOW -> Tooling, and download the API Controller.
-
Extract the downloaded distribution and initialize apictl by executing the following command from your terminal.
apictl init -
Add environments
Execute the following command to add API-M or Micro Integrator servers:
apictl add env <environment-name>Find out more about the
apictl add envoption in the APICTL Reference. -
Log in
Execute the following command to log in to the required server environment. You are prompted to enter the username and password.
apictl login <environment-name>Alternatively, you can pass the user name and password in a single command:
Note
If you are on Windows, you must always log in with the following command.
apictl login <environment-name> -u <username> -p <password>To logout from apictl, use the following command:
apictl logout <environment-name>
Once you are logged in, you can use the available options and commands.
APICTL Reference¶
You can execute the following command to see the available sub commands:
apictl
Listed below are all the apictl commands available.
apictl global flags¶
The following global flags can be used with all the apictl options and subcommands.
-h, --help
|
Get help for apictl commands and options. |
|---|---|
-k, --insecure
|
Allow connections to SSL endpoints without certifications. |
--verbose
|
Enable verbose mode. |
apictl version¶
Use the version option to get the version of the running apictl tool.
apictl version
apictl init¶
Use init to initialize the CLI tool.
apictl init
apictl add¶
Add a new environment (API-M or MI) and its related endpoints to the configuration file of apictl. This will connect apictl with the added environments.
-
Usage
apictl add [option] [argument] [flag] -
Option
envSpecifies that a new environment is being added. -
Argument
environment nameEnter the name of given to the environment. -
Flags
--apimUse this flag to add an API-M environment. --registrationIf the --apimflag is not used, use this flag to specify the API-M server url.--publisherIf the --apimflag is not used, use this flag to specify the API-M Publisher url.--devportalIf the --apimflag is not used, use this flag to specify the API-M Developer Portal url.--adminIf the --apimflag is not used, use this flag to specify the API-M Admin Portal url.--tokenIf the --apimflag is not used, use this flag to specify the API-M Token url.--miUse this flag to add a Micro Integrator environment. --environmentThis flag is mandatory when passing an environment. -eThis flag is mandatory when passing an environment.
apictl login¶
Log in to an ESB environment using credentials.
-
Usage
apictl login [argument] [global-flags] -
Arguments
environmentSpecify the name of the environment to which you want to log in. -
Flags
-u,--username stringUsername to login. -p,---password stringThe login password. --password-stdinGet the login password from stdin.
apictl logout¶
Log out from an ESB environment.
-
Usage
apictl logout [argument] [global-flags] -
Arguments
environmentLog in to the API-M runtime instance.
apictl get¶
Displays a list containing all the APIs, all the API Products, applications of a specific user, all the environments or log levels of APIs.
-
Usage
apictl get [option] [argument] [flag] [argument] -
Options
envsDisplay the list of environments. apisDisplay a list of APIs in an environment. api-productsDisplay a list of API Products in an environment. appsDisplay a list of Applications in an environment specific to an owner. api-revisionsDisplay a list of Revisions for the API. keysGenerate access token to invoke the API or API product. api-loggingDisplay log level of the API or APIs. correlation-loggingDisplay a list of correlation logging components available. -
Argument
environment nameEnter the name of given to the environment. -
Flags
-eUse this flag to specify from which environment to get the APIs, API products, or APPs. --environmentUse this flag to specify from which environment to get the APIs, API products, or APPs.
apictl import¶
Import an API, API product, or application to a specific environment.
-
Usage
apictl import [option] [argument] [flag] [argument] -
Subcommands
apiSpecify an API to import. api-productSpecify an API product to import. appSpecify an application to import. -
Flags
-fUse this flag to specify file path of the API, API product, or App.
apictl export¶
Export APIs, API Products, and Applications of a specific user in the specified environment.
-
Usage
apictl export [option] [argument] [flag] [argument] -
Options
apiSpecifies the API to export. apisSpecifies the APIs to export. api-productSpecify an API product to export. appSpecify an application to export. -
Flags
-nName of the API, API product, or APP to export. -vThe version of the API you are exporting. -rThe user role that is assigned. -eThe environment from which the APIs, API product, or App is being exported.
apictl delete¶
Delete APIs, API Products, and Applications of a specific user in the specified environment.
-
Usage
apictl delete [option] [argument] [flag] [argument] -
Options
apiSpecifies the API to delete. api-productSpecify an API product to delete. appSpecify an application to delete. -
Flags
-nName of the API, API product, or APP to delete. -vThe version of the API you are deleting. -rThe user role that is assigned. -eThe environment from which the APIs, API product, or App is being deleted.
apictl change-status¶
Change the lifecycle status of an API in an environment
-
Usage
apictl change-status [option] [argument] [flag] [argument] -
Options
apiSpecifies the API for which you want to change the status. -
Flags
-aThe new status that should apply to the API. -nThe name of the API for which the new status should apply. -vThe version of the API you are deleting. -rThe user role that is assigned. -eThe environment from which the APIs, API product, or App is being deleted.
apictl bundle¶
Archive API, Application, or API Product projects to a zip format. The bundle name will have the project name and version.
-
Usage
apictl bundle [flag] [argument] -
Flags
-sThe source of the API, or API project directory that should be bundled and archived. --sourceThe source of the API, or API product directory that should be bundled and archived. --dThe destination where the bundled ZIP file of the API/API product director is saved. --destinationThe destination where the bundled ZIP file of the API/API product director is saved.
apictl mg¶
Deploy, Update, Undepoly an apictl project to/from Choreo Connect.
-
Usage
apictl mg [subcommand] [argument] [flag] -
Subcommands
addAdds a Choreo Connect environment. deployDeploy an API (apictl project) in Choreo Connect. getList APIs deployed in the Choreo Connect environment. loginLog in to the Choreo Connect environment. logoutLog out from the Choreo Connect environment. removeRemove an environment from the Choreo Connect environment. undeployUndeploy an API in Choreo Connect.
apictl set¶
Set configuration parameters. You can use one of the following flags.
-
Usage
apictl set [flag] [argument] -
Flags
--http-request-timeoutSpecify the request timout in milliseconds. --tls-renegotiation-modeSpecify the regeneration mode: never, once, or freely. --export-directoryThe directory path where APIs should be saved. --vcs-deletion-enabledEnable/Disable project deletion via vcs. --vcs-config-pathThe directory path to the custom vcs configuration file. --vcs-deployment-repo-pathThe directory path to the deployment repo for vcs. --vcs-source-repo-pathThe directory path to the source repo for vcs.
Use api-logging option to set the log level of the API.
apictl set api-logging [flag] [argument]
Use correlation-logging option to set the correlation configs for a correlation logging component.
apictl set correlation-logging [flag] [argument]
apictl k8s¶
Managing APIs in a Kubernetes API-M environment.
-
Usage
apictl k8s [subcommand] [option] [argument] [flag] [argument] -
Subcommands
add apiAdd an API to the kubernetes cluster. update apiUpdate an API to the kubernetes cluster delete apiDelete resources related to kubernetes. genGenerate deployment directory for K8S operator. -
Flags
-nThe name of the API that should be added or updated in the K8s environment. -fTHe file path to the Swagger resource. --namespace=[value]The namespace associated with the API that should be added or updated in the K8s environment.
apictl aws¶
AWS API Gateway related commands such as init. Be sure to install and configure the AWS CLI before executing the aws init command. See the AWS documentation for more information.
-
Usage
apictl aws [subcommand] [flag] [argument] -
Subcommands
initInitialize an API project for an AWS API. -
Flags
-nThe name of the API project that should be initialized. -sThe stage of the environment. --stageThe stage of the environment.
apictl vcs¶
Checks status and deploys projects to the specified environment. To use this command, 'git' must be installed in the system.'
-
Usage
apictl vcs [subcommand] [flag] [argument] -
Subcommands
initInitializes a GIT repository with API Controller. deployDeploys projects to the specified environment. statusShows the list of projects that are ready to deploy. -
Flags
-eThe environment to which a project should be deployed.
apictl undeploy¶
Undeploy an API/API Product revision that is available in the specified environment from the specified gateway.
-
Usage
apictl undeploy [option] [argument] [flag] [argument] -
Options
apiSpecifies the API to be undeployed. -
Flags
-nName of the API, API product, or APP to undeploy. -vThe version of the API you are undeploying. -rThe user role that is assigned. -rev.... -gThe APIs matching the listed labels are undeployed. -eThe environment from which the API is being undeployed.
apictl mi¶
Use this command to manage Micro Integrator artifacts. You can get, add, update, delete, activate, and deactivate integration artifacts and logs.
-
Usage
apictl mi [subcommand] [option] [argument] [global-flag] -
Subcommands
loginLogin to a Micro Integrator. logoutLogout from a Micro Integrator. getGet information about artifacts deployed in a Micro Integrator instance. addAdd new users or loggers to a Micro Integrator instance. deleteDelete users from a Micro Integrator instance. updateUpdate log level of Loggers in a Micro Integrator instance. activateActivate artifacts deployed in a Micro Integrator instance. deactivateDeactivate artifacts deployed in a Micro Integrator instance. -
Options
apisGet details of APIs deployed in the Micro Integrator. connectorsGet details of integration connectors deployed in the Micro Integrator. data-servicesGet details of data services deployed in the Micro Integrator. mi get endpointsGet details of endpoints deployed in the Micro Integrator. inbound-endpointsGet details of inbound endpoints deployed in the Micro Integrator. local-entriesGet details of local entries deployed in the Micro Integrator. message-processorsUse this option with the getoractivatesubcommands to get details or to activate the status.message-storesGet details of message stores deployed in the Micro Integrator. proxy-servicesGet details of proxy services deployed in the Micro Integrator. tasksGet details of scheduled tasks deployed in the Micro Integrator. templatesGet details of templates deployed in the Micro Integrator. log-levelsUse this option with the mi get,mi add, ormi updatecommands to manage loggers in the Micro Integrator environment.
apictl secret¶
Encrypt secrets to be used in the Micro Integrator.
-
Usage
apictl secret [subcommand] [argument] -
Subcommands
initInitializes the keystore used for encryption. createEncrypt the secrets.