Is there a Analytics API to show all the API methods/operations deployed to Edge irrespective of traffic served or not

We have a use case wherein the management wants to see a metrics at the API proxy - operation (Resource Path)/method level deployed to Apigee Edge irrespective of whether that operation/method has served any traffic or not.

We can fetch all the API Proxy resources if it that particular resource has served any traffic >0 based on the Traffic (Sum) metrics and Resource Path dimension.

We are looking for the same analytics call or combination of calls to show a unique count of all the API methods/operation currently deployed to the Apigee Edge platform.

Any pointers would be highly appreciated.

Thanks

Solved Solved
0 2 374
1 ACCEPTED SOLUTION

Hmmmm, Apigee Edge can tell you the combination of { vhost, basePath } that each API Proxy is listening on. But Apigee Edge cannot tell you what you want: the verb + path combinations for each of those.

The reason: It is not required that an administrator of Apigee Edge configure ("whitelist") all verb + path endpoints. I could configure an API proxy that passes through every verb + path request. ?? if the base path is /foo , then any of the following will be proxied :

..and so on.

You CAN get the list of {vhost, basePath} combinations by querying the Administrative API, not the analytics API. Something like this, in pseudo code:

for each proxy in org : 
   for each revision of the proxy:
      for each environment to which the proxy revision is deployed:
         for each ProxyEndpoint in proxy revision :
            for each vhost in ProxyEndpoint :
               return {vhost, basePath} 

in actual code you would tickle these urls:

  • /v1/o/ORGNAME/apis
  • /v1/o/ORGNAME/apis/PROXYNAME/revisions
  • /v1/o/ORGNAME/apis/PROXYNAME/revision/N/deployments
  • /v1/o/ORGNAME/apis/PROXYNAME/revision/N/proxies
  • /v1/o/ORGNAME/apis/PROXYNAME/revision/N/proxies/ENDPOINTNAME
  • inspect the virtual hosts and basePath from the above.

It is POSSIBLE that your organization has configured every API Proxy to whitelist every verb/path that the proxy handles. This would be done with Condition statements inside the flows of the ProxyEndpoint.

In that case you'd run through the same steps as described above and then also enumerate the verb + path combinations, in addition to the vhost + base path.

View solution in original post

2 REPLIES 2

Hmmmm, Apigee Edge can tell you the combination of { vhost, basePath } that each API Proxy is listening on. But Apigee Edge cannot tell you what you want: the verb + path combinations for each of those.

The reason: It is not required that an administrator of Apigee Edge configure ("whitelist") all verb + path endpoints. I could configure an API proxy that passes through every verb + path request. ?? if the base path is /foo , then any of the following will be proxied :

..and so on.

You CAN get the list of {vhost, basePath} combinations by querying the Administrative API, not the analytics API. Something like this, in pseudo code:

for each proxy in org : 
   for each revision of the proxy:
      for each environment to which the proxy revision is deployed:
         for each ProxyEndpoint in proxy revision :
            for each vhost in ProxyEndpoint :
               return {vhost, basePath} 

in actual code you would tickle these urls:

  • /v1/o/ORGNAME/apis
  • /v1/o/ORGNAME/apis/PROXYNAME/revisions
  • /v1/o/ORGNAME/apis/PROXYNAME/revision/N/deployments
  • /v1/o/ORGNAME/apis/PROXYNAME/revision/N/proxies
  • /v1/o/ORGNAME/apis/PROXYNAME/revision/N/proxies/ENDPOINTNAME
  • inspect the virtual hosts and basePath from the above.

It is POSSIBLE that your organization has configured every API Proxy to whitelist every verb/path that the proxy handles. This would be done with Condition statements inside the flows of the ProxyEndpoint.

In that case you'd run through the same steps as described above and then also enumerate the verb + path combinations, in addition to the vhost + base path.

Thank you @Dino for providing the right pointer. We were missing the below piece -

  • /v1/o/ORGNAME/apis/PROXYNAME/revision/N/proxies/ENDPOINTNAME

This is going to be a savior, as currently we are really overdoing with a custom Java program to grab the deployed bundle from Edge, unzip, grab the endpoint.xml (what your above API is going to provide)........... ....anyways Thanks again.