apim-cli icon indicating copy to clipboard operation
apim-cli copied to clipboard

Apim-cli export as json/yaml for apis doesn't work properly in November 2023 API Gateway Manager

Open biancaatsh opened this issue 2 years ago • 4 comments

APIM-CLI version

1.14.3

API-Management version

7.7.20231130

Bug description

When try to export an api as json or yaml, it says successfully exported but there is no export created in the folder. But the same works fine for CSV.

Steps to reproduce

The issue is happening with only 1.14.3 on these API Gateway Versions:

  • August 2022
  • November 2022
  • February 2023
  • May 2023
  • August 2023
  • November 2023

Tested and confirm the 1.14.3 works as expected on May 2022. For all the above version we can export properly the apis as yaml/json with 1.14.0

Relevant log output

$ ./apim.sh api get -h apim-d-management.de.bosch.com -u [email protected] -p ************* -id 5e0c49d5-7c53-412e-93b9-c0104150bee0 -o yaml
2024-02-13 10:16:59,536 [APIManagerCLI] INFO : API-Manager CLI: 1.14.3
2024-02-13 10:16:59,538 [APIManagerCLI] INFO : Module: API - E X P O R T / U T I L S  (1.14.3)
2024-02-13 10:16:59,546 [EnvironmentProperties] DEBUG: Trying to load environment properties from file: env.properties ... not found.
2024-02-13 10:17:00,813 [APIMHttpClient] DEBUG: API Manager CLI http client timeout : 30000
2024-02-13 10:17:00,855 [RestAPICall] DEBUG: Http verb:POST and URI: https://apim-d-management.de.bosch.com:8075/api/portal/v1.4/login
2024-02-13 10:17:03,072 [RestAPICall] DEBUG: Http verb:GET and URI: https://apim-d-management.de.bosch.com:8075/api/portal/v1.4/currentuser
2024-02-13 10:17:03,327 [APIManagerOrganizationAdapter] WARN : Using OrgAdmin only to load all organizations.
2024-02-13 10:17:03,328 [APIManagerOrganizationAdapter] DEBUG: Load organizations from API-Manager using filter: OrgFilter [name=null, id=788e0399-a2dc-4f39-a000-037cc1e83d20]
2024-02-13 10:17:03,328 [APIManagerOrganizationAdapter] DEBUG: Load organization with URI: https://apim-d-management.de.bosch.com:8075/api/portal/v1.4/organizations/788e0399-a2dc-4f39-a000-037cc1e83d20
2024-02-13 10:17:03,328 [RestAPICall] DEBUG: Http verb:GET and URI: https://apim-d-management.de.bosch.com:8075/api/portal/v1.4/organizations/788e0399-a2dc-4f39-a000-037cc1e83d20
2024-02-13 10:17:03,480 [APIManagerOrganizationAdapter] DEBUG: Organization id to be cached : /788e0399-a2dc-4f39-a000-037cc1e83d20
2024-02-13 10:17:03,554 [RestAPICall] DEBUG: Http verb:GET and URI: https://apim-d-management.de.bosch.com:8075/api/portal/v1.4/config
2024-02-13 10:17:03,721 [APIManagerAdapter] INFO : Organization Administrator Self Service Enabled : false
2024-02-13 10:17:03,722 [APIManagerAdapter] INFO : Successfully connected to API-Manager (7.7.20231130) on: https://apim-d-management.de.bosch.com:8075
2024-02-13 10:17:03,725 [APIManagerCustomPropertiesAdapter] DEBUG: Read configured custom properties from API-Manager
2024-02-13 10:17:03,725 [RestAPICall] DEBUG: Http verb:GET and URI: https://apim-d-management.de.bosch.com:8075/api/portal/v1.4/config/customproperties
2024-02-13 10:17:03,919 [RestAPICall] DEBUG: Http verb:GET and URI: https://apim-d-management.de.bosch.com:8075/api/portal/v1.4/proxies/5e0c49d5-7c53-412e-93b9-c0104150bee0
2024-02-13 10:17:04,121 [APIManagerOrganizationAdapter] WARN : Using OrgAdmin only to load all organizations.
2024-02-13 10:17:04,122 [APIManagerOrganizationAdapter] DEBUG: Load organizations from API-Manager using filter: OrgFilter [name=null, id=f8c0d3a0-5e29-4f09-9c18-3b055d640f3f]
2024-02-13 10:17:04,122 [APIManagerOrganizationAdapter] DEBUG: Load organization with URI: https://apim-d-management.de.bosch.com:8075/api/portal/v1.4/organizations/f8c0d3a0-5e29-4f09-9c18-3b055d640f3f
2024-02-13 10:17:04,122 [RestAPICall] DEBUG: Http verb:GET and URI: https://apim-d-management.de.bosch.com:8075/api/portal/v1.4/organizations/f8c0d3a0-5e29-4f09-9c18-3b055d640f3f
2024-02-13 10:17:04,272 [APIManagerOrganizationAdapter] DEBUG: Organization id to be cached : /f8c0d3a0-5e29-4f09-9c18-3b055d640f3f
2024-02-13 10:17:04,280 [APIManagerAPIAdapter] DEBUG: Found: 1 exposed API(s):
2024-02-13 10:17:04,293 [APIManagerAPIAdapter] DEBUG: Download API spec URL :https://apim-d-management.de.bosch.com:8075/api/portal/v1.4/apirepo/ac781b4f-4488-4642-92ba-ed2340c46298/download?original=true
2024-02-13 10:17:04,293 [RestAPICall] DEBUG: Http verb:GET and URI: https://apim-d-management.de.bosch.com:8075/api/portal/v1.4/apirepo/ac781b4f-4488-4642-92ba-ed2340c46298/download?original=true
2024-02-13 10:17:04,452 [APIManagerAdapter] DEBUG: Closing cache ...
2024-02-13 10:17:04,640 [RestAPICall] DEBUG: Http verb:DELETE and URI: https://apim-d-management.de.bosch.com:8075/api/portal/v1.4/login

biancaatsh avatar Feb 20 '24 13:02 biancaatsh

Hi @biancaatsh

Can you test with axway-apimcli-1.14.4-SNAPSHOT.tar.gz

rathnapandi avatar Feb 20 '24 18:02 rathnapandi

Hi @rathnapandi , I tested it, but the behavior it's the same. ./apim.sh api get -h localhost -u apiadmin -p changeme1 -id d0fdecc8-4190-4ba5-8479-9132b0421c8d -o yaml 2024-02-21 09:59:24,427 [APIManagerCLI] INFO : API-Manager CLI: 1.14.4-SNAPSHOT 2024-02-21 09:59:24,429 [APIManagerCLI] INFO : Module: API - E X P O R T / U T I L S (1.14.4-SNAPSHOT) 2024-02-21 09:59:24,436 [EnvironmentProperties] DEBUG: Trying to load environment properties from file: env.properties ... not found. 2024-02-21 09:59:25,300 [APIMHttpClient] DEBUG: API Manager CLI http client timeout : 30000 2024-02-21 09:59:25,337 [RestAPICall] DEBUG: Http verb:POST and URI: https://localhost:8075/api/portal/v1.4/login 2024-02-21 09:59:25,532 [RestAPICall] DEBUG: Http verb:GET and URI: https://localhost:8075/api/portal/v1.4/currentuser 2024-02-21 09:59:25,603 [RestAPICall] DEBUG: Http verb:GET and URI: https://localhost:8075/api/portal/v1.4/config 2024-02-21 09:59:25,696 [APIManagerAdapter] INFO : Successfully connected to API-Manager (7.7.20231130) on: https://localhost:8075 2024-02-21 09:59:25,700 [APIManagerCustomPropertiesAdapter] DEBUG: Read configured custom properties from API-Manager 2024-02-21 09:59:25,700 [RestAPICall] DEBUG: Http verb:GET and URI: https://localhost:8075/api/portal/v1.4/config/customproperties 2024-02-21 09:59:25,734 [RestAPICall] DEBUG: Http verb:GET and URI: https://localhost:8075/api/portal/v1.4/proxies/d0fdecc8-4190-4ba5-8479-9132b0421c8d 2024-02-21 09:59:25,799 [APIManagerOrganizationAdapter] DEBUG: Load organizations from API-Manager using filter: OrgFilter [name=null, id=3519dca6-7a9f-414c-ae9c-5079cdee6be1] 2024-02-21 09:59:25,799 [APIManagerOrganizationAdapter] DEBUG: Load organization with URI: https://localhost:8075/api/portal/v1.4/organizations/3519dca6-7a9f-414c-ae9c-5079cdee6be1 2024-02-21 09:59:25,799 [RestAPICall] DEBUG: Http verb:GET and URI: https://localhost:8075/api/portal/v1.4/organizations/3519dca6-7a9f-414c-ae9c-5079cdee6be1 2024-02-21 09:59:25,814 [APIManagerOrganizationAdapter] DEBUG: Organization id to be cached : /3519dca6-7a9f-414c-ae9c-5079cdee6be1 2024-02-21 09:59:25,827 [APIManagerAPIAdapter] DEBUG: Found: 1 exposed API(s): 2024-02-21 09:59:25,828 [APIManagerQuotaAdapter] DEBUG: Load quotas with ID: 00000000-0000-0000-0000-000000000001 from API-Manager URI : https://localhost:8075/api/portal/v1.4/quotas/00000000-0000-0000-0000-000000000001 2024-02-21 09:59:25,828 [RestAPICall] DEBUG: Http verb:GET and URI: https://localhost:8075/api/portal/v1.4/quotas/00000000-0000-0000-0000-000000000001 2024-02-21 09:59:25,847 [APIManagerQuotaAdapter] DEBUG: Load quotas with ID: 00000000-0000-0000-0000-000000000000 from API-Manager URI : https://localhost:8075/api/portal/v1.4/quotas/00000000-0000-0000-0000-000000000000 2024-02-21 09:59:25,847 [RestAPICall] DEBUG: Http verb:GET and URI: https://localhost:8075/api/portal/v1.4/quotas/00000000-0000-0000-0000-000000000000 2024-02-21 09:59:25,862 [APIManagerOrganizationAdapter] DEBUG: Load organizations from API-Manager using filter: OrgFilter [name=null, id=null] 2024-02-21 09:59:25,862 [APIManagerOrganizationAdapter] DEBUG: Load organization with URI: https://localhost:8075/api/portal/v1.4/organizations 2024-02-21 09:59:25,862 [RestAPICall] DEBUG: Http verb:GET and URI: https://localhost:8075/api/portal/v1.4/organizations 2024-02-21 09:59:25,879 [APIManagerAPIAccessAdapter] TRACE: Return APIAccess for organizations : 3519dca6-7a9f-414c-ae9c-5079cdee6be1 from cache. 2024-02-21 09:59:25,880 [APIManagerAPIAccessAdapter] TRACE: Return APIAccess for organizations : 1bd54185-78e3-4299-bb1a-84284d84a774 from cache. 2024-02-21 09:59:25,886 [APIManagerAPIAdapter] DEBUG: Download API spec URL :https://localhost:8075/api/portal/v1.4/apirepo/ec4586fe-91b4-4f92-a904-faf0ee5e8302/download?original=true 2024-02-21 09:59:25,886 [RestAPICall] DEBUG: Http verb:GET and URI: https://localhost:8075/api/portal/v1.4/apirepo/ec4586fe-91b4-4f92-a904-faf0ee5e8302/download?original=true 2024-02-21 09:59:25,906 [APIManagerAdapter] DEBUG: Closing cache ... 2024-02-21 09:59:25,965 [APIManagerAdapter] TRACE: Cache Closed. 2024-02-21 09:59:25,966 [RestAPICall] DEBUG: Http verb:DELETE and URI: https://localhost:8075/api/portal/v1.4/login

biancaatsh avatar Feb 21 '24 08:02 biancaatsh

Hello @rathnapandi, any updates?

biancaatsh avatar Feb 29 '24 15:02 biancaatsh

@biancaatsh,

The latest CLI is not working with JRE1.8, use JRE11 embedded with Nov 2023 APIM. Need to validate why it is not working on JRE8.

rathnapandi avatar Mar 05 '24 21:03 rathnapandi

@biancaatsh CLi requires java 11 and above.

rathnapandi avatar Jul 13 '24 02:07 rathnapandi