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

Gets policy status.

The status endpoint retrieves the policy status information for a specific policy.

The response includes the following information:
  • total_count
  • completed_count
  • failed_count
  • submitted_count
  • start_time
  • end_time

The response returned depends on three possible policy scenarios. These include Never Run, Running, and Finished. If the policy is never executed (Never Run), then the response only returns the policy status.

If the policy is running, the counts mentioned in the preceding list contain the current values and an end time is not returned.

If the policy is finished then the counts contain the final values and an end time is returned.

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
1 1 Χ Χ
1 Users with Collection Admin role can access this endpoint only if they are owners of the policy or can access one or more collections that are included in the policy.

Users with Data User role can access the endpoint only if they are owners of the policy.

Synopsis of the request URL

curl -k -H 'Authorization: Bearer <token>' https://<spectrum_discover_host>/policyengine/v1/
policies/<policy_name>/status -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 policy status information about a specific policy.

Issue the following request in one line:

curl -k -H 'Authorization: Bearer <token>' 
https://<spectrum_discover_host>
/policyengine/v1/policies/policy1/status -X GET -H ’Accept: application/json’
The following response is returned:
{
    "status": "running",
    "total_count": 15000,
    "completed_count": 14000,
    "failed_count": 0,
    "submitted_count": 15000,
    "start_time": "2020-03-27_11:12:10"
}