Management API to query proxy dependencies

I'd like to query for proxies with a dependency on another resource in Apigee. For example, I have a shared flow that needs changed. I'd like to know what proxies have a dependency on the shared flow to determine impact.

This same request applies to other resources as well, like which proxies are using a given target server alias.

I've not see options for querying or filtering much through the management APIs (outside of the analytics API). It seems I need to run APIs then parse through the responses to evaluate the answer. One issue is that the responses don't really return a full dependency tree for the proxy.

Thoughts?

1 1 391
1 REPLY 1

This is a Good question, and you raise a good point.

There is not a good way to query dependencies via the Apigee edge Management API. I think of the Edge data as a graph, and it would be really nice to be able to query it via something like graphQL. That would provide a good, flexible query capability that would satisfy thew general requirement you described.

BUT, even today, while there are no GOOD options, there are options.

Brute force is an option.

The way to do it is to examine each proxy for all proxy endpoints and target endpoints, and examine the flows there to look for references to a FlowCallout policy that specifically references your target sharedflow. To be complete, You'd also need to consider all revisions of each proxy. But maybe you want to examine only the latest revision.

Either way, the approach requires a bunch of distinct API calls (hence it is not a GOOD way to query) but it does work.

For a good example of how this works, you can see this script:

https://github.com/DinoChiesa/apigee-edge-js/blob/master/examples/findPoliciesWithKvmAccess.js

...which relies on a JS wrapper of the Apigee Edge Admin APIs to look for KVM policies, or... to look for KVM policies that connect to a specific, named KVM map.

Using that as a model, It should be pretty easy to build a similar script to look for FlowCallouts, or target alias. . .


EDIT

Here's a script to find flow callouts.

https://github.com/DinoChiesa/apigee-edge-js/blob/master/examples/findFlowCallouts.js