-
Notifications
You must be signed in to change notification settings - Fork 19
2.2 Export and report APIs
The Axway API-Management CLI tool allows you to export APIs from the API-Manager for instance in order to promote them into the next stage or update the configuration.
To get started use the CLI with the following command: apim api get -h which provides you with a complete usage.
You can filter the list of APIs. Multiple filters are combined with AND. The following provides you with a few examples. Please check the usage for all filter options:
| Command | Comment/Description |
|---|---|
apim api get -s prod |
Lists ALL APIs with standard information on the console |
apim api get -s prod -policy "*Security*" -wide |
Lists ALL APIs using a policy Security on the console on a wider format |
apim api get -s prod -name "*Banking*" -ultra |
Gets All APIs named Banking and prints them with all available information |
By default the get operation is using the console view and generates a table representation of the exported data. However, you can provide a --output or -o parameter to the get operation to control the export format you want.
This format gives you the JSON format as it's required to import the APIs with apim api import. For each exported API an export folder is created.
| Command | Comment/Description |
|---|---|
apim api get -s prod |
Lists ALL APIs with standard information on the console |
apim api get -s prod -id 8f7bd987-0736-43b.... -o json |
Export the API with the provided UUID into the current folder. Keep in mind the is changed, whenever the API is recreated. |
apim api get -s qa --output json -t C:/axway/apis |
Gets All APIs from the QA-Stage exported into the given local folder. For each exported API a folder is automatically created. |
You can provide the option: -deleteTargetif you would like to replace existing folders.
A CSV based report allow your to see current applications subscriptions, which policies by each API and more information. Also this export is using the flags: -wide and -ulta to get more or less data.
| Command | Comment/Description |
|---|---|
apim api get -s prod -o csv -wide |
Reports ALL APIs with standard information into the CSV-File |
apim api get -s prod -policy "*Security Policy 1*" -o csv |
Exports all APIs using Security Policy 1 into the CSV-File. |
apim api get -s qa --output csv -t C:/axway/apis/my_qa_apis.csv -ultra |
Gets All APIs from the QA-Stage exported into the given CSV-File. |
If no target is given using the parameter -tor --target, the CSV-File is created in the current folder using the following naming convention: api_export_<stage|hostname>_<loginname>_<YYYYMMdd_HHmm>.csv
