-
Notifications
You must be signed in to change notification settings - Fork 19
1. How to get started
Getting started with the API-Manager CLI is very simple.
- an API-Manager Version 7.X up & running
- the project has been tested with version 7.6.2 SP2, 7.6.2 SP3, 7.6.2 SP4 & 7.7 (you can verify compatibility yourself as described here)
- Either an environment to execute a very simple Shell-Script or BAT-File, which wraps a Java-Program
- or executing a binary when installed with Chocolately.org
- an installed Java Runtime Environment 8 or higher
- the machine must have access to the API-Manager REST-API on Default-Port: 8075
- Download the latest release from here
- best is to extract the archive including the folder: (e.g. apim-cli-1.0.0) somewhere on your disk
C:\Axway\Tools\apim-cli-1.2.3
- Create a environment variable:
AXWAY_APIM_CLI_HOME
and set it to the extracted folder:
AXWAY_APIM_CLI_HOME=C:\Axway\Tools\apim-cli-1.2.3
- Add the following to your PATH environment variable:
%AXWAY_APIM_CLI_HOME%\scripts
- You can now run the CLI with with:
apim - On the next update you extract the archive to a new folder and update the environment variable
AXWAY_APIM_CLI_HOME
accordingly.
Please note, that the environment variable AXWAY_APIM_CLI_HOME is also used internally by the CLI.
- best is to extract the archive including the folder: (e.g. apim-cli-1.0.0) somewhere on your disk
If you want to use the API-Management CLI on Windows and you are already using Chocolately.org the installation is just that simple:
choco install axway-apim-cli
To upgrade to the newest version just say:
choco upgrade axway-apim-cli
After installation you can just run apim
Once you have loaded the APIM CLI, you can start using it immediately, but it is recommended that you perform the following configurations to make working with the CLI easier.
Even if it is not absolutely necessary, it is recommended to add the environment variable: AXWAY_APIM_CLI_HOME This must point to the installation directory.
Example:
AXWAY_APIM_CLI_HOME=C:\Axway\Tools\apim-cli-1.3.0
Is the variable set if it is used by the APIM-CLI start scripts as well as internally, e.g. to load configuration files from the conf folder.
In order to simplify the use of the CLI and to be able to call it at any place via apim
, the operating-system search path should be set accordingly. Here it is recommended to use the environment variable: AXWAY_APIM_CLI_HOME
. This way you can simply change only one variable with each update.
Example for Windows:
%AXWAY_APIM_CLI_HOME%\scripts
Instead of having to specify the environment parameters of your API-Management platform every time you call the CLI, it is better to create an environment file in the folder $AXWAY_APIM_CLI_HOME/conf
.
For example for the QA-Environment:
$AXWAY_APIM_CLI_HOME/conf/env.qa.properties
This file may contain a number of parameters, but should be at least
host=apimanager-hostname
username=myuser
password=mypassword
With that file in place, it's possible to call the CLI like so:
apim api get -s qa
For a complete overview of the possible parameters please refer to the file: env.properties.sample. More information about the environment files can be found here.
You may use Maven-Dependencies as part of your Java-Project to streamline communication with the API-Manager or just create a Jenkins Maven-Based pipeline workflow. Please check yourself on Maven-Central for the last available version: https://mvnrepository.com/artifact/com.github.axway-api-management-plus.apim-cli
If you would like to manage APIs use the following dependency for your project:
<dependency>
<groupId>com.github.axway-api-management-plus.apim-cli</groupId>
<artifactId>apimcli-apis</artifactId>
<version>1.2.1</version>
</dependency>
This dependency allows you to import/replicate and export APIs from your API-Manager. This is especially interesting when integrated into a pipeline based on Maven.
<dependency>
<groupId>com.github.axway-api-management-plus.apim-cli</groupId>
<artifactId>apimcli-apps</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>com.github.axway-api-management-plus.apim-cli</groupId>
<artifactId>apimcli-organizations</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>com.github.axway-api-management-plus.apim-cli</groupId>
<artifactId>apimcli-users</artifactId>
<version>1.2.1</version>
</dependency>