Policy bundling of multiple policies on request and response flow

Not applicable

Is it possible to create a custom policy with set of multiple built-in policies and use it in entry/exit flow. For example I wish to apply Quota, Json Threat Protection and JsonToXML on a proxy. Now instead adding them manually at both request and response segments, I need to bundle into one single policy and apply it on both ends.

Solved Solved
1 1 156
1 ACCEPTED SOLUTION

At this time I know of no way to accomplish this as you describe. However, there are a couple of approaches I might take.

First, if this is something you think you'll do with every proxy you create, you may want to create a "starter bundle" that you provide to users when they make new proxies. Build a proxy with the policies you want, then download the current revision as a zip file. When creating new proxies, select "API Bundle" and use that zip file to create the new proxy.

119-untitled.png

The new proxy will have your template policies in all the right places, ready to use or customize as necessary.

You could also do something similar via a repo and using the management APIs when creating new proxies. It's relatively straightforward to use the APIs directly or to use one of the command line tools you can find in the Apigee github (1) to build a developer workflow that would accomplish this.

A third option you might explore is using code rather than the built in policies. Depending on what capabilities you want to include, you may be able to build everything into one or two extension policies.

I think that's where I'd start today, based on what I know about what you want to do.

(1) https://github.com/apigee/

View solution in original post

1 REPLY 1

At this time I know of no way to accomplish this as you describe. However, there are a couple of approaches I might take.

First, if this is something you think you'll do with every proxy you create, you may want to create a "starter bundle" that you provide to users when they make new proxies. Build a proxy with the policies you want, then download the current revision as a zip file. When creating new proxies, select "API Bundle" and use that zip file to create the new proxy.

119-untitled.png

The new proxy will have your template policies in all the right places, ready to use or customize as necessary.

You could also do something similar via a repo and using the management APIs when creating new proxies. It's relatively straightforward to use the APIs directly or to use one of the command line tools you can find in the Apigee github (1) to build a developer workflow that would accomplish this.

A third option you might explore is using code rather than the built in policies. Depending on what capabilities you want to include, you may be able to build everything into one or two extension policies.

I think that's where I'd start today, based on what I know about what you want to do.

(1) https://github.com/apigee/