<pointcut>
<api-platform-gw:api-pointcut apiName="{{apiName}}" apiVersion="{{apiVersionName}}"/>
</pointcut>
To Add Resource Level Policy Support to a Custom Policy
You need to add some YAML and XML code to existing custom policy configuration and definition files, respectively, to support resource level policies in Mule 3.8.1 and later.
-
In the XML definition file, change the standard pointcut definition as follows:
FROM:
TO:
{{#pointcutData.length}} {{#pointcutData}} <pointcut> <api-platform-gw:api-pointcut apiName="{{apiName}}" apiVersion="{{apiVersionName}}"/> <resource methodRegex="{{methodRegex}}" uriTemplateRegex="{{uriTemplateRegex}}"/> </pointcut> {{/pointcutData}} {{/pointcutData.length}} {{^pointcutData.length}} <pointcut> <api-platform-gw:api-pointcut apiName="{{apiName}}" apiVersion="{{apiVersionName}}"/> </pointcut> {{/pointcutData.length}}
-
Add the following key/value pair to the YAML file:
resourceLevelSupported: true
-
In Anypoint Platform, click API Manager.
-
In API Administration, choose Custom policies.
-
Click Add Custom Policy.
-
In Add Custom Policy, give the new policy a name, for example myResourceLevelPolicy.
-
Browse to and select the YAML and XML files you created or downloaded.