List all Apigee X proxies with their associated products and apps

Hi @dchiesa1 ,

I am working on document were I need list of all Apigee X proxies with their associated products and apps within a org.

Is there any way by which we can grab all this details in one go?

That sounds like a graph! The relationship between proxies, apps, and products represents a graph. It would be cool if all of that data were available via a graphQL query, but… alas, there is no graphQL interface for the Apigee entity model.

The way to get the list, then, is to perform nested loops. Get the list of all proxies, Get the list of all products, for each product, examine the proxies embedded in the product, and for each product, list the apps for that product. All of this information is available via the REST API for Apigee, you just have to call it in the right order and assemble the data the way you want.

There is no single script or tool that does this, exactly the way you described. But if you know a scripting language, like shell or nodejs or python or powershell, it should be a “simple matter of programming” to get the data you want in the form you want it.

With the nodejs module apigee-edge-js , you can list products like this;

apigee.connect(options)
  .then(org =>
        org.products.get({})
        .then(resp => // X/hybrid vs Edge
              (resp.apiProduct) ? resp.apiProduct: resp)
        .then(a => a.map(x => x.name)))
  .then(results => console.log('results: ' + JSON.stringify(results, null, 2)))
  .catch( e => console.error('error: ' + util.format(e) ) );

One can imagine doing THAT, also listing proxies, and then doing a “for each” loop for each product, getting the details for it, and examining the configuration to determine which proxies go into which products.

How you represent that… is sort of up to you.

There are some examples like listProducts, listProxies, findAppForApiProxy , that you can use to crib from.