I want to add a policy to an existing proxy, and I don’t want to use UI for it, I want to add the polcy through a rest API call. Can we do this in APIGEE X?
No, there is no granular API to add the policy through a rest API call.
Yes, you can achieve what you want by using your preferred scripting/programming language. You script the steps to:
-
Download a proxy you want to amend
-
Unzip the downloaded proxy, add a policy in question, edit proxy xml to ‘hook’ it in the right place. Then zip the result.
-
Upload and deploy the proxy.
You use tools like apigeecli or sackmesser or maven plugin to execute steps 1 and 3 as a high-level coarse-grained operations that wrap rest calls to management API. You can use management API directly for download/upload proxy though, if you wish.
https://github.com/apigee/apigeecli
https://github.com/apigee/devrel/tree/main/tools/apigee-sackmesser