Management APIs to fetch list of deployed APIs along with base paths

Hi @dchiesa1 ,

I’m trying to use the management apis mentioned in documentation, https://docs-edgeapis.apigee.io/docs/deployments/1/routes/organizations/%7Borg_name%7D/deployments/get to fetch the list of deployed APIs along with basepaths. But I’m getting an error.

cURL that I’m using:

curl --location 'https://apigee.googleapis.com/v1/organizations/{org_name}/deployments?includeServerStatus=true&includeApiConfig=true’
–header ‘Accept: application/json’
–header ‘includeApiConfig: true’
–header ‘Authorization: Bearer {gcloud auth print-access-token}’

Response that I’m getting:

{
“error”: {
“code”: 400,
“message”: “Invalid JSON payload received. Unknown name "includeApiConfig": Cannot bind query parameter. Field ‘includeApiConfig’ could not be found in request message.\nInvalid JSON payload received. Unknown name "includeServerStatus": Cannot bind query parameter. Field ‘includeServerStatus’ could not be found in request message.”,
“status”: “INVALID_ARGUMENT”,
“details”: [
{
@type”: “type.googleapis.com/google.rpc.BadRequest”,
“fieldViolations”: [
{
“description”: “Invalid JSON payload received. Unknown name "includeApiConfig": Cannot bind query parameter. Field ‘includeApiConfig’ could not be found in request message.”
},
{
“description”: “Invalid JSON payload received. Unknown name "includeServerStatus": Cannot bind query parameter. Field ‘includeServerStatus’ could not be found in request message.”
}
]
}
]
}
}

Why is it giving me 400 when I pass includeApiConfig & includeServerStatus as part of query? Am I using it wrongly? I’ve used the same what ever that is mentioned in the documents.

Kindly help on the above query.

Thanks in Advance!

Manoj T.

2 Likes

Hi Manoj,

I think the stuff documented at edgeapis.apigee.io pertains to Apigee Edge, not to Apigee X.

If you want Aipgee X or hybrid, you need to use AIPs that are documented here: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest

And specifically for your case, GET deployedIngressConfig will return the information you are seeking. Try:

curl -i -H "Authorization: Bearer $(gcloud auth print-access-token)" \
 -X GET \
 "https://apigee.googleapis.com/v1/organizations/${ORG}/deployedIngressConfig"
2 Likes

Thanks for replying, @dchiesa1 ,

The above cURL is fetching all the basepaths of an ORG and that’s awesome. Do we also have a cURL for fetching the basepaths along with proxy names, by any chance?

Thanks in advance!
Manoj Sai T.

2 Likes

I do not have a single curl command that can do that. But there’s a script that collects that information by invoking a sequence of Apigee API calls:

node listProxyBasepaths.js --token $TOKEN --apigeex --org $ORG --env $ENV

from https://github.com/DinoChiesa/apigee-edge-js-examples/blob/main/listProxyBasepaths.js

2 Likes

Thanks for the solution, @dchiesa1 !!