/policyengine/v1/policyhistory: DELETE
Deletes the policy execution history and logs.
This endpoint helps you delete the policy execution history and logs of all policies that you can access.
The following table displays the roles that can access this REST API endpoint:
Data admin | Data user | Collection Admin | Collection user | Admin | Service user |
---|---|---|---|---|---|
✓ | ✓ | ✓ | X | Χ | Χ |
Synopsis of the request URL
curl -k -H 'Authorization: Bearer <token>' https://<spectrum_discover_host>/policyengine/v1/policyhistory -X DELETE -H ’Accept: application/json’ [-d ‘{“days_older_than”: <int>}’]
Note: You can specify an override to the default retention of 30 days in the JSON input data field,
{days_older_than
:
<int>}
. When specified, it ensures that only the policy history records and log files
that are older than the input value provided, are removed. Supported request types and response formats
Supported request types:
- DELETE
Supported response formats:
- JSON
Examples
The following example deletes the policy history entries and run logs, for any policy executions
that you have permission to view and that are older than 30 days.
- Issue the following request in one
line.
curl -k -H 'Authorization: Bearer ${TOKEN}' https://<spectrum_discover_host>/policyengine/v1/policyhistory -X DELETE -H ’Accept: application/json’
- The following response is
returned.
[ {"status": "Success. Deleted 12 policy history records."} ]
Response data
The response data can be explained as shown.
- status
- The response returns an indication whether the request succeeded or failed. For a successful request, this information field also indicates the number of policy execution history entries and the corresponding log files that were purged.