/policyengine/v1/policies/<policy_name>/preview: GET

Previews a policy.

This endpoint helps to display policy preview information for a specific policy. The following information is available for preview:
Estimation information
Displays the total count and size of documents. The size of documents on the disk is calculated based on the list of documents the policy applies to and those that are returned.
Execution information
Displays whether the policy has been previously executed or is currently running. The information returned also includes the number and size of documents completed, the start time and, the duration of the policy in seconds.
Policy schedule
Displays the policy schedule, if any.
Policy run time
Displays the future run date and time that has been scheduled for the policy.
The following table displays the roles that can access the REST API endpoint.
Table 1. Access by role
Data admin Data user Collection Admin Collection user Admin Service user
Χ Χ

Synopsis of the request URL

curl -k -H 'Authorization: Bearer <token>' https://<spectrum_discover_host>/policyengine/v1/
policies/<policy_name>/preview -X GET -H ’Accept: application/json’

Supported request types and response formats

Supported request types:
  • GET
Supported response formats:
  • JSON

Examples

The following example returns the policy preview information about a specific policy that is configured in the system.

Issue the following request in one line:

curl -k -H 'Authorization: Bearer <token>' 
https://<spectrum_discover_host>
/policyengine/v1/policies/policy1/preview -X GET -H ’Accept: application/json’
The following response is returned:
{
  "schedule": {
    "minute": "18",
    "hour": "12",
    "dayOfMonth": "*",
    "month": "*",
    "dayOfWeek": "*",
    "timezone": "UTC"
  },
  "next_run_time": "2020-03-19 12:18PM",
  "estimation_info" : { 
    "document_count": 152467,
    "total_size": 24935050549,
    "total_size_on_disk": 25610976130
   },
  "execution_info": {
    "start_time": "",
    "duration": 3000,
    "tier_count": 10345,
   "tier_size": 1000000,
   "failed_count": 0
  }
}