Skip to content

9.4 Docker Image

Rathna edited this page Apr 3, 2023 · 5 revisions

Running APIM CLI as docker image

Sample Dockerfile located at root directory

Use Existing Docker Image

Use prebuilt docker image hosted on ghcr.io/axway-api-management-plus/apimcli:1.13.6

Run Docker image

docker run -e LOG_LEVEL=debug ghcr.io/axway-api-management-plus/apimcli:1.13.6 app get -u apiadmin -p changeme2 -h 10.129.61.129 
2023-04-03 18:44:31,362 [APIManagerCLI] INFO : API-Manager CLI: 1.13.5
2023-04-03 18:44:31,365 [APIManagerCLI] INFO : Module: Application - E X P O R T / U T I L S (1.13.5)
2023-04-03 18:44:31,374 [EnvironmentProperties] DEBUG: Trying to load environment properties from file: /conf/env.properties ... not found.
2023-04-03 18:44:32,796 [APIMHttpClient] DEBUG: API Manager CLI timeout : 30000
2023-04-03 18:44:32,855 [RestAPICall] DEBUG: Http verb:POST and URI: https://10.129.61.129:8075/api/portal/v1.4/login
2023-04-03 18:44:33,301 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.61.129:8075/api/portal/v1.4/currentuser
2023-04-03 18:44:33,418 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.61.129:8075/api/portal/v1.4/config
2023-04-03 18:44:33,529 [APIManagerAdapter] INFO : Successfully connected to API-Manager (7.7.20221130) on: https://10.129.61.129:8075
2023-04-03 18:44:33,532 [APIManagerCustomPropertiesAdapter] DEBUG: Read configured custom properties from API-Manager
2023-04-03 18:44:33,533 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.61.129:8075/api/portal/v1.4/config/customproperties
2023-04-03 18:44:33,605 [APIMgrAppsAdapter] DEBUG: Sending request to find existing applications: https://10.129.61.129:8075/api/portal/v1.4/applications
2023-04-03 18:44:33,605 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.61.129:8075/api/portal/v1.4/applications
2023-04-03 18:44:33,700 [APIManagerOrganizationAdapter] DEBUG: Load organizations from API-Manager using filter: OrgFilter [name=null, id=9379ee58-312e-46b3-a06c-dc413d593603]
2023-04-03 18:44:33,701 [APIManagerOrganizationAdapter] DEBUG: Load organization with URI: https://10.129.61.129:8075/api/portal/v1.4/organizations/9379ee58-312e-46b3-a06c-dc413d593603
2023-04-03 18:44:33,701 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.61.129:8075/api/portal/v1.4/organizations/9379ee58-312e-46b3-a06c-dc413d593603
2023-04-03 18:44:33,733 [APIManagerOrganizationAdapter] DEBUG: Organization id to be cached : /9379ee58-312e-46b3-a06c-dc413d593603
2023-04-03 18:44:33,763 [APIManagerOrganizationAdapter] DEBUG: Load organizations from API-Manager using filter: OrgFilter [name=null, id=987b2afc-b027-41fd-a920-bef182eb4a94]
2023-04-03 18:44:33,763 [APIManagerOrganizationAdapter] DEBUG: Load organization with URI: https://10.129.61.129:8075/api/portal/v1.4/organizations/987b2afc-b027-41fd-a920-bef182eb4a94
2023-04-03 18:44:33,763 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.61.129:8075/api/portal/v1.4/organizations/987b2afc-b027-41fd-a920-bef182eb4a94
2023-04-03 18:44:33,790 [APIManagerOrganizationAdapter] DEBUG: Organization id to be cached : /987b2afc-b027-41fd-a920-bef182eb4a94
2023-04-03 18:44:33,793 [APIMgrAppsAdapter] DEBUG: Found: 20 applications
Loading details of 20 applications [*********-] 90%
2023-04-03 18:44:33,801 [ApplicationExportApp] INFO : Found 20 application(s).
2023-04-03 18:44:33,813 [APIManagerUserAdapter] DEBUG: Load users from API-Manager using filter: UserFilter [loginName=null, id=7463fb84-25ff-4a0c-8bb0-0c548f821e7b]
2023-04-03 18:44:33,813 [APIManagerUserAdapter] DEBUG: Load users with URI: https://10.129.61.129:8075/api/portal/v1.4/users/7463fb84-25ff-4a0c-8bb0-0c548f821e7b
2023-04-03 18:44:33,814 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.61.129:8075/api/portal/v1.4/users/7463fb84-25ff-4a0c-8bb0-0c548f821e7b
2023-04-03 18:44:33,854 [APIManagerUserAdapter] DEBUG: Load users from API-Manager using filter: UserFilter [loginName=null, id=40dd53a4-0b13-4485-82e8-63c687404c2f]
2023-04-03 18:44:33,854 [APIManagerUserAdapter] DEBUG: Load users with URI: https://10.129.61.129:8075/api/portal/v1.4/users/40dd53a4-0b13-4485-82e8-63c687404c2f
2023-04-03 18:44:33,855 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.61.129:8075/api/portal/v1.4/users/40dd53a4-0b13-4485-82e8-63c687404c2f
2023-04-03 18:44:33,881 [APIManagerUserAdapter] DEBUG: Load users from API-Manager using filter: UserFilter [loginName=null, id=2f126140-db10-4ccb-be9d-e430d9fe9c45]
2023-04-03 18:44:33,882 [APIManagerUserAdapter] DEBUG: Load users with URI: https://10.129.61.129:8075/api/portal/v1.4/users/2f126140-db10-4ccb-be9d-e430d9fe9c45
2023-04-03 18:44:33,882 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.61.129:8075/api/portal/v1.4/users/2f126140-db10-4ccb-be9d-e430d9fe9c45
+--------------------------------------+-------------------------+----------+-----------------+---------+------------+
| Application-Id                       | Name                    | State    | Email           | Enabled | Created by |
+--------------------------------------+-------------------------+----------+-----------------+---------+------------+
| 5c62125e-6fc8-43b0-8eec-da2574c9142b | Shared-App-7131         | approved |                 |   false | testoadmin |
| 2f58825c-f1cc-4f9c-b386-48307f0aeb2d | My-App-4728             | approved | user@domain.com |    true |   apiadmin |
| 8ecbada4-f782-4057-b0c7-13f2b9a7a9b9 | My-Custom-Prop-App-1495 | approved | user@domain.com |    true | testoadmin |
| fa963ba4-b159-4e4b-81c5-d6d9b6c797cb | My-Custom-Prop-App-7540 | approved | user@domain.com |    true | testoadmin |
| 055ca1a6-0b90-4915-8b38-b376e5385d6b | My-Custom-Prop-App-7006 | approved | user@domain.com |    true | testoadmin |
| f4a0324e-b1b6-48fa-83cb-b02ca46aaaa2 | My-Custom-Prop-App-6905 | approved | user@domain.com |    true | testoadmin |
| 88afa7fd-19f2-4ec1-a141-3f0aac41d6dc | My-Custom-Prop-App-4698 | approved | user@domain.com |    true | testoadmin |
| 5642021f-d8c9-43fb-8825-7752ace6886c | My-App-9770             | approved | user@domain.com |    true |   apiadmin |
| 01cf2fd6-6687-4927-b2d5-4977c960587a | My-App-85               | approved | user@domain.com |    true |   apiadmin |
| dffd50d2-9fee-4e38-bbbd-d7c328355ef2 | My-App-2192             | approved | user@domain.com |    true |   apiadmin |
| 00c761b0-9d6f-4655-9153-866e2920a40b | My-App-9257             | approved | user@domain.com |    true |   apiadmin |
| 84a4bd25-7571-43fc-869b-dbb6590e74b0 | My-App-8369             | approved | user@domain.com |    true |   apiadmin |
| 6d86368d-f003-465f-a48b-66cd08705995 | My-App-7745             | approved | user@domain.com |    true |   apiadmin |
| daf09353-b69c-4bb6-9263-075aad85435d | My-App-3863             | approved | user@domain.com |    true |   apiadmin |
| b3b26a26-80c1-4f8b-bba5-482bf5f82a8d | My-App-7453             | approved | user@domain.com |    true |   apiadmin |
| cda1445e-bfca-48dd-ad83-42b0e9b71dc0 | My-App-5634             | approved | user@domain.com |    true |   apiadmin |
| e5a6fbd1-9940-4b4c-a2c3-1ff026eb1a25 | testappquota            | approved |                 |    true |      usera |
| d70e1f3f-675f-4510-8b9d-4f0616390e51 | My-App-2198             | approved | user@domain.com |    true |   apiadmin |
| f6e67531-07cb-4a3c-97d5-badb81973451 | Shared-App-1592         | approved |                 |   false | testoadmin |
| 5feb31fe-fb8b-4c21-8132-39f01e2c6440 | Test_Consumer           | approved |                 |    true |   apiadmin |
+--------------------------------------+-------------------------+----------+-----------------+---------+------------+
2023-04-03 18:44:33,943 [ApplicationExportApp] DEBUG: Successfully exported 20 application(s).
2023-04-03 18:44:33,943 [APIManagerAdapter] DEBUG: Closing cache ...
2023-04-03 18:44:34,108 [RestAPICall] DEBUG: Http verb:DELETE and URI: https://10.129.61.129:8075/api/portal/v1.4/login

The logs are streamed to standard output and Log Level can be changed via environment variable LOG_LEVEL=debug.

Build Docker Image

docker build -t apimcli .

Above build hardcode with the release version 1.12.1

  • Build docker image with specific apim-cli version
docker build -t apimcli --build-arg APIM_CLI_ARCHIVE=axway-apimcli-1.12.0.tar.gz .

Run Docker image

docker run -e LOG_LEVEL=debug apimcli app get -u apiadmin -p changeme2 -h 172.17.0.1