-
Notifications
You must be signed in to change notification settings - Fork 18
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.
The amount of data shown in the console view depends on the toggle -wide
or -ultra
. If only ONE API is returned additionally to the data table a detail section is generated like in the example below.
+--------------------------------------+------------------------+--------------------+---------+--------+-------------+----------------------------+-------------+----------+-----------------+
| API-Id | Path | Name | Version | V-Host | State | Backend | Security | Policies | Organization |
+--------------------------------------+------------------------+--------------------+---------+--------+-------------+----------------------------+-------------+----------+-----------------+
| 528f9bf1-3597-465e-abf7-af1f7b2db640 | /sample/minimal/api/v1 | Sample Minimal API | 1.0.0 | | unpublished | http://petstore.swagger.io | passThrough | | API Development |
+--------------------------------------+------------------------+--------------------+---------+--------+-------------+----------------------------+-------------+----------+-----------------+
A P I - D E T A I L S
Organization: API Development
Created On: Wed Jun 24 22:45:50 CEST 2020
Created By: API Administrator
Granted Organizations: API Development
Subscribed applications:
Custom-Policies: {REQUEST=[], FAULT_HANDLER=[], RESPONSE=[], ROUTING=[]}
Tags:
Custom-Properties:
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: -deleteTarget
if 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 -t
or --target
, the CSV-File is created in the current folder using the following naming convention: api_export_<stage|hostname>_<loginname>_<YYYYMMdd_HHmm>.csv