-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Describe the bug
Given an App that is using an API Product that has manual approval
And the App's API Product has been manually approved before it was exported
apigeecli apps import does not use the status in API Product on the App to set the API Product status
By default the status of the API Product is "pending" because of the manual approval on the API Product
apigeecli needs to check the status returned from the call that associates the API Product to the API Key and compare to the value in the exported app
If it's different (e.g. pending when it should be approved) then call
https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.developers.apps.keys.apiproducts/updateDeveloperAppKeyApiProduct to set the status.
For example:
curlx -X POST https://apigee.googleapis.com/v1/organizations/apigeex-custom-non-prod/developers/ca16969b-f6d2-4ce8-8939-78f4678172da/apps/pingstatus-manual-exco/keys/XKxTStBSdFwhS2Wdse73la4kA03gUCLf/apiproducts/pingstatus-v1-manual?action=approve
Version
apigeecli version 2.11.0 date: 2025-03-31T20:08:55Z [commit: 95cc9d1]
To Reproduce
Create the test scenario:
- Create / use developer
- Create API for use in API Product
- Create API Product with manual approval
- Approve the API Product in the App
Reproduce the issue:
- Export the developers, products and apps
- Delete the app
- Edit the exported apps.json to use only the app that was deleted
- Import the apps using:
apigeecli --org=$X_ORG apps import \
--file=$X_IMPORT_DIR/apps_test.json \
--dev-file=$X_IMPORT_DIR/developers.json
Expected behavior
The Apps API Product should be "approved"