MCPcopy Index your code
hub / github.com/Axway-API-Management-Plus/apim-cli

github.com/Axway-API-Management-Plus/apim-cli @1.14.13

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.14.13 ↗ · + Follow
4,731 symbols 20,025 edges 573 files 80 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Axway API-Management CLI

License Apache2 Latest Release

Security Rating Reliability Rating Maintainability Rating Vulnerabilities Bugs

Coverage Lines of Code

downloads

This CLI allows you to control the Axway API management solution without access through the Web UI. You can call the CLI manually or integrate it into a CI/CD pipeline. The CLI is based on Swagger-Promote, which has been refactored to support more use-cases than only API-Import and -Export.

Everything as code

The basic idea for the so-called "Everything as code" approach is that the desired state of something (API, Application, etc.) is declared in a configuration file which stored in your version management system. A tool, like this CLI, is then replicating that declared state to become the actual state in the target environment. This is used for instance to manage complex Cloud-Infrastructure called Infrastructure as code. You may read more here: https://hackernoon.com/everything-as-code-explained-0ibg32a3

This CLI is following the same approach for your APIs, Applications, etc. Everything is declared as code in a config file and stored in your version management system. The CLI transfers this desired state manually or automatically via a pipeline into the API management platform to become the actual state.
Additionally the CLI supports basic administrative commands for instance to list and filter entities and perform simple tasks. More will be added very soon.

Watch this video (28 min): https://youtu.be/2i8i1zMAMps to get an overview + demo.

With that, an API developer or the operations team is just providing the desired state configuration of the API, Application. When checked in, the CI/CD-Pipeline picks it up and replicates it into the API Manager.

API Manager CLI overview

Supported commands

The CLI is flexible and is extended with new functions via modules. These can be accessed and discovered via the CLI on the basis of groups and their commands.
To get an overview about the groups just call apim:

Available commands and options:
apim app             Manage your applications 
apim settings        Manage your API-Manager Config/Remote-Hosts & Alerts
apim org             Manage your organizations
apim api             Manage your APIs 
apim user            Manage your users 

To get for instance a wide list of APIs on the stage: prod execute the following command:

apim api get -s prod -wide
....
+--------------------------------------+-----------------+----------------+---------+---------------------+-------------+-------------+----------+----------------------+
| API-Id                               | Path            | Name           | Version | V-Host              | State       | Security    | Policies | Organization         |
+--------------------------------------+-----------------+----------------+---------+---------------------+-------------+-------------+----------+----------------------+
| 518b15c9-350c-47d8-9ad6-16ce02ef9dfe | /vhost-test-950 | VHost Test 950 |   1.0.0 | api123.customer.com | unpublished | passThrough | None     | API Development 5538 |
| 39b7b2aa-7df8-44e0-b399-4e9d59dbad6d | /vhost-test-411 | VHost Test 411 |   1.0.0 | api123.customer.com |   published | passThrough | None     | API Development 5916 |
+--------------------------------------+-----------------+----------------+---------+---------------------+-------------+-------------+----------+----------------------+
......

To get a list of commands for each group call for instance apim app

The CLI is flexible and already provides a lot of commands & utility functions. For an up-to-date list of the supported groups and commands, see the documentation.

Quality assurance process

By using this CLI to control your Axway API management infrastructure it becomes a key component of your CI/CD process. Product quality is therefore very important so that you can be confident this CLI is doing what it's supposed to do.
To achieve this quality bar, the tools was developed from the beginning in a way that it can be tested fully automatically.
In addition to a number of executed unit-tests, sophisticated integration tests are performed. These integration tests are executed against different API-Management versions and consists of a number of different scenarios. Each scenrioa contains various Desired states, which are transferred into Actual state by the CLI and finally checked if the Actual State in the API-Manager is as expected. This is performed for APIs and applications.

The automated End-2-End test suite contains of 116 different scenarios, which includes more than 284 executions of CLI (Import & Export) following each by a validation step. The test suite is executed at Travis CI for the following versions and you may check yourself what is done by clicking on the badge icon:

Version Branch Status Comment
7.7-20250228 develop Build Status Requires version >=1.14.12
7.7-20240830 test-with-7.7-20240830 Build Status Requires version >=1.14.7
7.7-20240530 test-with-7.7-20240530 Build Status Requires version >=1.14.5
7.7-20240228 test-with-7.7-20240228 Build Status Requires version >=1.14.4
7.7-20230130 test-with-7.7-20231130 Build Status Requires version >=1.14.3
7.7-20230830 test-with-7.7-20230830 Build Status Requires version >=1.14.2
7.7-20230530 test-with-7.7-20230530 Build Status Requires version >=1.14.0
7.7-20230228 test-with-7.7-20230228 Build Status Requires version >=1.13.4
7.7-20221130 test-with-7.7-20221130 APIM CLI Integration test Requires version >=1.13.2, Multi-Org supported from version 1.13.3
7.7-20220830 test-with-7.7-20220830 APIM CLI Integration test Requires version >=1.13.0, Multi-Org is not yet supported
7.7-20220530 test-with-7.7-20220530 Build Status Requires version >=1.12.0, Multi-Org is not yet supported
7.7-20220228 test-with-7.7-20220228 Build Status Requires version >=1.10.1, Multi-Org is not yet supported
7.7-20211130 test-with-7.7-20211130 Build Status Requires version >=1.3.11, Multi-Org is not yet supported

At least version 7.7-20211130 is required.

Get started

To get started, you have several options to download the CLI and then just run the CLI as shown in the example below

scripts\apim api import -c samples/basic/minimal-config-api-definition.json -s api-env

This command is reading the API-Management platform configuration details from the environment file: env.api-env.properties and replicates the given desired API state in the configuration file: minimal-config-api-definition.json into the API-Management platform.

Please see the documentation for more information.

Changelog

See change log

Contributing

Contributions welcome

Please read Contributing.md for details on our code of conduct, and the process for submitting pull requests to us.
Also please read this page on how to contribute to this project.

Team

alt text Axway Team

License

Apache License 2.0

Extension points exported contracts — how you extend this code

Parameters (Interface)
(no doc) [13 implementers]
modules/apim-adapter/src/main/java/com/axway/apim/lib/Parameters.java
APIMCLIServiceProvider (Interface)
(no doc) [22 implementers]
modules/apim-cli/src/main/java/com/axway/apim/cli/APIMCLIServiceProvider.java
APIFilterParams (Interface)
(no doc) [4 implementers]
modules/apis/src/main/java/com/axway/apim/api/export/lib/params/APIFilterParams.java
UserFilterParams (Interface)
(no doc) [2 implementers]
modules/users/src/main/java/com/axway/apim/users/lib/params/UserFilterParams.java
OrgFilterParams (Interface)
(no doc) [2 implementers]
modules/organizations/src/main/java/com/axway/apim/organization/lib/OrgFilterParams.java
CustomPropertiesFilter (Interface)
(no doc) [20 implementers]
modules/apim-adapter/src/main/java/com/axway/apim/lib/CustomPropertiesFilter.java
RollbackAction (Interface)
(no doc) [3 implementers]
modules/apis/src/main/java/com/axway/apim/apiimport/rollback/RollbackAction.java
CustomPropertiesEntity (Interface)
(no doc) [9 implementers]
modules/apim-adapter/src/main/java/com/axway/apim/api/model/CustomPropertiesEntity.java

Core symbols most depended-on inside this repo

get
called by 1474
modules/apim-adapter/src/main/java/com/axway/apim/lib/APIMCLICache.java
println
called by 423
modules/apim-adapter/src/main/java/com/axway/apim/lib/utils/rest/Console.java
getName
called by 418
modules/apim-cli/src/main/java/com/axway/apim/cli/APIMCLIServiceProvider.java
validate
called by 337
modules/apis/src/main/java/com/axway/apim/api/export/impl/RevokeAccessAPIHandler.java
build
called by 335
modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/OrgFilter.java
put
called by 310
modules/apim-adapter/src/main/java/com/axway/apim/lib/APIMCLICache.java
size
called by 254
modules/apim-adapter/src/main/java/com/axway/apim/lib/EnvironmentProperties.java
getId
called by 222
modules/apim-adapter/src/main/java/com/axway/apim/api/model/CustomPropertiesEntity.java

Shape

Method 4,110
Class 571
Enum 42
Interface 8

Languages

Java100%

Modules by API surface

modules/apim-adapter/src/main/java/com/axway/apim/api/model/Config.java121 symbols
modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIFilter.java113 symbols
modules/apim-adapter/src/main/java/com/axway/apim/api/model/Alerts.java89 symbols
modules/apim-adapter/src/main/java/com/axway/apim/api/API.java85 symbols
modules/apim-adapter/src/main/java/com/axway/apim/lib/CoreParameters.java69 symbols
modules/apim-adapter/src/main/java/com/axway/apim/api/model/RemoteHost.java64 symbols
modules/apim-adapter/src/test/java/com/axway/apim/adapter/apis/APIManagerAPIAdapterTest.java63 symbols
modules/apim-adapter/src/main/java/com/axway/apim/adapter/client/apps/ClientAppFilter.java62 symbols
modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerAPIAdapter.java52 symbols
modules/apim-adapter/src/main/java/com/axway/apim/api/model/CustomProperty.java49 symbols
modules/apim-adapter/src/main/java/com/axway/apim/api/model/User.java47 symbols
modules/apim-adapter/src/test/java/com/axway/lib/utils/UtilsTest.java44 symbols

For agents

$ claude mcp add apim-cli \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact