Revert Policy to Previous Version
Once an approved policy is edited, it creates a new policy version. This operation makes it possible to delete the latest policy version in the edit or the pended status and revert the policy to its previous version. This operation also deletes the person updates related to the reverted policy version.
This operation is available for a policy in the status edit or pended. Reverting the first version of a policy removes the policy from the system. 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:
{ ... policy properties ... "links": [ { "href": "http://<host>:<port>/[api-context-root]/generic/policies/<id>", "rel": "self" }, { "href": "http://<host>:<port>/[api-context-root]/policies/<id>/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/<id>", "rel": "self" }, ] }
The revert operation deletes the current policy version including a cascade delete of the underlying policy details related to this version and brings the policy back to it previously approved version. If the current version is the first version, the revert operation deletes the first version, cascade deletes the underlying details related to this version and deletes the version-independent details like attached policy data, enrollment events and history records.
Response
Success
HTTP Status 200 after the operation is completed successfully, request is redirected to policies API and a resource representation of the previous policy version (now latest) is returned.
If the system successfully reverts version 1 of a policy (that is, removed the policy completely) it also returns HTTP Status 200.
Failure
Response | Description |
---|---|
HTTP 401 |
Unauthorized |
HTTP 404 |
Policy is unknown |
POL-HTTP-023 |
Policy must be in status edit or pended |
When a policy is not in a revertible status, the system returns ' POL-HTTP-023'.
Please refer to the 'Response Messages' section in the HTTP API Integration Points part of the Common Features book for more details.