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.
The revert operation updates the status of the update requests and the enrollment event notification in the following manner:
The operation updates the status of update requests, and the enrollment event notifications that have matching policy Global Identifier(GID) with the reverting policy. |
-
When reverting the first version of the policy:
-
Policy Update Request:
-
The operation sets the Loaded and Failed status of the policy update request to Rejected.
-
The operation removes the policy GID from all the policy-update requests with matching GID.
-
Matched policy code on the policy update request is set to null
-
-
Enrollment Event Notification:
-
The operation deletes all the enrollment event notifications.
-
-
-
If the operation brings the policy back to its previously-approved version:
-
Policy Update Request:
-
The operation sets the Loaded and Failed status of the policy update request to Queued.
-
Matched policy code on the policy update request is updated if the policy code changed after policy revert operation
-
-
Enrollment Event Notification:
-
The operation sets the Ready, and Waiting for policy approval status enrollment event notifications 'Obsolete?' flag to 'Yes'.
-
-
Resource Representation
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.