How to update the policy definition version to the latest version against an API in API Manager?
Suppose I have an API and a Client ID Enforcement policy with version 1.3.0 associated with it. I found that the latest version 1.3.1 is available for the policy definition and I want to update to that particular version of the policy definition.
To update to the latest policy definition version:
1. We can remove the policy and then reapply the policy again with the latest version in the UI (API Manager). Or follow step 2.
2. Call REST API to update by executing the command below.
curl 'https://anypoint.mulesoft.com/apimanager/api/v1/organizations/<orgId>/environments/<envId>/apis/<apiVersionId>/policies/<policyId>' \
-X 'PATCH' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Authorization: <token>' \
--data-raw '{"groupId":<policyGroupId>, "assetId":<policyAssetId>,"assetVersion":<latestPolicyVersion>,"apiId":<apiVersionId>}'
Note: The latestPolicyVersion should be the latest version available (1.3.1in this case). Also, all the information needed for making this curl can be found in the UI URL.
Now the question arises, what does “Check for updates” imply against an API Policy in API manager?
Ans:
The “Check for updates” against an API policy in API manager basically checks for any newer version of API implementation is available for the same Policy Definition and update to that version if it finds any. It doesn’t check for API definition version.
Let’s take one example:
We have a policy (e.g. Client ID Enforcement) of version 1.3.0 is associated to an API in API manager but latest policy definition with version 1.3.1 is available now.
The "check for updates" feature does not upgrade the policy version, instead, it searches for new policy implementations associated with the configured policy version, in this case 1.3.0.
The addition of flex gateway to the platform introduced a change where now, every policy definition has many implementations (for flex, for mule, etc) giving the user the possibility of decoupling definitions from implementations. So this button in the UI, "check for upgrades", tries to search for new version of policy implementations for those runtimes, associated with the configured policy. For example, if a new client id enforcement policy implementation is released for flex gateways, that feature will automatically update the implementation for that runtime, but the policy config would still be the same, the one the user configured, the policy with version 1.3.0.
001115247

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.