Revert Policy to Previous Version
Once an approved policy is edited, it creates a new policy verison. This operation makes it possible to delete the latest policy version in the edit status and revert the policy to its previous version.
This operation is available for a policy in the status edit and when it is not the first version of the policy. Whether a policy can be reverted or not, can be derived by the presence or absence of the "revert" link.
Resource representation of a policy that can be submitted:
{cl ... policy properties ... "links": [ { "href": "http://<host>:<port>/[api-context-root]/generic/policies/", "rel": "self" }, { "href": "http://<host>:<port>/[api-context-root]/policies//revert", "rel": "policy:revert" "httpMethod": "POST" } ] }
In the resource representation of a policy that can’t be reverted, the revert link is missing:
{ ... policy properties ... "links": [ { "href": "http://<host>:<port>/[api-context-root]/generic/policies/", "rel": "self" }, ] }
Operation revert, deletes the current policy version including a cascade delete of the underlying all the policy details related to this version and brings the policy back to it previously approved version.
Response
Success
HTTP Status 200 after the operation is completed successfully, request is redirected to policies API and a resource representation of the the previous policy version (now latest) is returned.
__
Failure__
Response | Description |
---|---|
HTTP 401 |
Unauthorized |
HTTP 404 |
Policy is unknown |
POL-HTTP-009 |
Policy must be in status edit |
POL-HTTP-010 |
First policy version cannot be reverted |
When a policy is not in a revertible status, system returns ' POL-HTTP-009'. For a policy with no previous version, system returns ' POL-HTTP-010'.
Please refer to the 'Response Messages' section in the HTTP API Integration Points part of the Common Features book for more details.