6. API Manager Settings - Axway-API-Management-Plus/apim-cli GitHub Wiki

Starting with version 1.3.0 of the APIM-CLI you can also manage the API Manager Settings as external configuration artifacts. This includes:

  • API-Manager Config
  • API Manager Governance Alerts
  • Remote hosts
    This also makes it possible to transport configuration artifacts between different API Manager versions.

Import settings
Imports the API manager configuration based on configuration files.

Export settings
Export the current API-Manager settings to console or JSON-Configuration files.

Import Settings

You can use the CLI to import the API-Manager setting for the base configuration, alerts and remote hosts. All three entities can be stored in one or different files.
To get started use the CLI with the following command: apim settings import -h which provides you with a complete usage.

The mandatory required parameters are the stage (alternatively host/username/password) and the configuration file. The following examples should help you to get started:

Command Comment/Description
apim settings import -s qa -c apimanager-config.json Imports API-Manager setup from the given config file
apim settings import -s prod -c apimanager-config.json When providing a file apimanager-config.prod.json this is used as an overlay

Configuration file structure

The following shows only the structure extremely shortened.

{
  "config" : {
    "portalName" : "Axway API Manager"
  },
  "remoteHosts" : {
    "another.remote.host7485" : {
      "name" : "another.remote.host7485",
      "port" : 5555,
      "createdOn" : 1602878814463,
      "createdBy" : "apiadmin"
    }
  },
  "alerts" : {
    "runSysquotaExceeded" : false
  }

Export settings

Export the current API Manager configuration to the console or to JSON configuration files.
To get started use the CLI with the following command: apim settings get -h which provides you with a complete usage.

Filter the list of Organizations

You can filter the list of Organizations. 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 settings get -s prod Prints the entire configuration to console. This also include the configured policies.
apim settings get -s prod -ultra Prints the entire configuration, with all available information on console.
apim settings get -s prod -type config Export the base configuration to console
apim settings get -s prod -type alerts -o json Export alert configuration to JSON files
apim settings get -s qa -type remotehosts -o json Exports all remote hosts to JSON-Files
apim settings get -s qa -type remotehosts -n "*backend1*" -o json Export all remote hosts with hostname backend1 to JSON-Files

Export Format

By default the get operation is using the console view and generates a table representation of the exported data. However, you can provide --output or -o parameter to the get operation to control the export format you want.

JSON

This format gives you the JSON format as it's required to import the settings with apim settings import. Required sub-folders are created automatically.

You can provide the option: -deleteTargetif you would like to replace existing folders.

Console view

----------------------------------------------------------------------------------------
API-Manager CLI: 1.3.0-SNAPSHOT

To report issues or get help, please visit:
https://github.com/Axway-API-Management-Plus/apim-cli
----------------------------------------------------------------------------------------
Module: API-Manager - S E T T I N G S (1.3.0-SNAPSHOT)
----------------------------------------------------------------------------------------
1577   INFO     APIManagerAdapter| Successfully connected to API-Manager (7.7.20200730) on: https://api-env:8075

Configuration for: 'Axway API Manager API-ENV' Version: 7.7.20200730

API Manager settings:
API Manager name .....................: Axway API Manager API-ENV
API Manager host .....................: 172.17.0.1
Email reply-to .......................: N/A
Email bounce .........................: N/A
Trial mode ...........................: false
Default trial duration ...............: 0
API-Manager version ..................: 7.7.20200730
API-Manager OS .......................: Linux

API Portal settings:
API Portal name ......................: N/A
API Portal host and port .............: N/A
API Portal ...........................: false
....
Alerts for: 'Axway API Manager API-ENV' Version: 7.7.20200730

Application:
Application request created ..........: false
Application request approved .........: false
Application deleted ..................: false
Application enabled ..................: false
Application disabled .................: false

Application - API access:
API access request created ...........: false
API access request approved ..........: false
API access deleted ...................: false
API access enabled ...................: false
API access disabled ..................: false

Application Credentials:
Application credential created .......: false
Application credential updated .......: false
Application credential deleted .......: false
Application credential enabled .......: false
Application credential disabled ......: false

Application developer:
Developer request created ............: false
....
Remote hosts for: 'Axway API Manager API-ENV' Version: 7.7.20200730

+--------------------------------------+-------------------------+------+----------------------+--------------+
| Id                                   | Name                    | Port | Organization         | Related APIs |
+--------------------------------------+-------------------------+------+----------------------+--------------+
| 5eaf9e4e-234b-410c-8fa5-b55d54f34365 | another.remote.host7485 | 5555 | API Development 7744 | 0            |
| 5eb7417e-9597-4ce0-a3d6-f2be033bd044 | another.remote.host6192 | 5555 | API Development 4339 | 0            |
| 0eac672c-4a8b-4712-8f42-7e26fcd13f8e | another.remote.host267  | 9999 | API Development 2723 | 0            |
| 2b612eb3-ceb1-41ee-aaec-43d5a36a7b2a | sample.remote.host1527  | 8888 | API Development 3443 | 0            |
| c2fdda4d-8436-411a-bcbe-73a150991634 | my.host-259.com         | 8786 | API Development 4440 | 0            |
| 7d28d63b-4a2e-46da-94e4-71d307e5019f | sample.remote.host7485  | 8888 | API Development 7744 | 0            |
| 01ea6542-eccb-4902-802e-efc84949688c | sample.remote.host6192  | 8888 | API Development 4339 | 0            |
| 637aa838-96a9-4f26-a931-3ec021f9f3e2 | my.host-818.com         | 8786 | API Development 9452 | 0            |
| a04f3987-ec7a-45bf-be61-e5564111dad1 | my.host-437.com         | 8786 | API Development 7581 | 0            |
| 38fbf010-f6a7-4913-9ea5-2e74ebdae939 | sample.remote.host4113  | 8888 | API Development 7475 | 0            |
| 3f6a010d-3158-42d8-bb6c-5545a0d0b291 | my.host-268.com         | 8786 | API Development 7683 | 0            |
| 4da2405f-ef70-4135-9d22-9696d621136b | my.host-166.com         | 8786 | API Development 5993 | 0            |
| 91ce27da-4d3c-43db-a317-6cb91737d26b | another.remote.host3235 | 9999 | API Development 8679 | 0            |
....
Policies hosts for: 'Axway API Manager API-ENV' Version: 7.7.20200730

+-----------------------+----------------------+------+
| Policy-Name           | Type                 | APIs |
+-----------------------+----------------------+------+
| Default Fault Handler | Fault-Handler        | 0    |
| Default Fault Handler | Global Fault-Handler | 0    |
+-----------------------+----------------------+------+
You may use 'apim api get -policy <PolicyName> -s api-env' to list all APIs using this policy
2848   INFO    APIManagerSetupApp| API-Manager configuration successfully exported.
⚠️ **GitHub.com Fallback** ⚠️