Retreive Policies from Apigee X through the Apigee Api

Hello everyone!
I'm recently moved from Apigee Edge to Apigee X.  In both tools, I'm working with Python3.7 and the Apigee Api to retrieve data. 

First of all, I have noticed that there are quite differences between those two Apis. My problem is that I'm struggling with retrieve basic data from the ApigeeX Api.

When I was working with Apigee Edge I used to retrieve the policies using the following Api: https://apidocs.apigee.com/docs/policies/1/routes/organizations/%7Borg_name%7D/apis/%7Bapi_name%7D/r... 

But I'm not able to find that same Api in the ApigeeX Api. Is there any way to retrieve the Policies and its content from an Api proxy or a Shared Flow in ApigeeX using its Api?

Thank you very much!

Solved Solved
0 3 427
1 ACCEPTED SOLUTION

Is there any way to retrieve the Policies and its content from an Api proxy or a Shared Flow in ApigeeX using its Api?

Not directly . The API for Apigee X changed a little from the API Apigee Edge in this regard. In Apigee Edge it is possible to extract /retrieve , and even (shudder) UPDATE an individual policy in a revision of a proxy. In Apigee X or hybrid, twiddling with individual policies via the API is not possible.

The way to do what you want is to export the entire API proxy revision as a bundle, then examine THAT. You may need to unzip the bundle into a temporary directory in the filesystem, or in some in-memory representation to allow you to look at individual policies.

You would use this API to export the bundle. This will work similarly for SharedFlows and API Proxies. 

Does this make sense?

View solution in original post

3 REPLIES 3

Is there any way to retrieve the Policies and its content from an Api proxy or a Shared Flow in ApigeeX using its Api?

Not directly . The API for Apigee X changed a little from the API Apigee Edge in this regard. In Apigee Edge it is possible to extract /retrieve , and even (shudder) UPDATE an individual policy in a revision of a proxy. In Apigee X or hybrid, twiddling with individual policies via the API is not possible.

The way to do what you want is to export the entire API proxy revision as a bundle, then examine THAT. You may need to unzip the bundle into a temporary directory in the filesystem, or in some in-memory representation to allow you to look at individual policies.

You would use this API to export the bundle. This will work similarly for SharedFlows and API Proxies. 

Does this make sense?

Hello there dchiesa1: 

Thank you for your response :).


Is there any way that Google release this feature in the future for the ApigeeX Api?

 

Thank you for your response :).

Hello there FrankieEm! And you're welcome.

Is there any way that Google release this feature in the future for the ApigeeX Api?

I'm confident the answer to that is "No". That was a decision taken some time ago, and the eng+pm team are satisfied that they made the right call there.

The workaround is to download the proxy archive as a zip and unzip it, maybe into a temporary directory. Then you can just scan the files in the filesystem. Is that workaround acceptable to you? If not, tell me more about what you're doing, and why it wouldn't work to download the zips.