/policyengine/v1/policyhistory: GET
Retrieves policy history information for all the policies.
The /policyengine/v1/policyhistory retrieves the policy execution history details for all the policies that you have permission to view within the system. The entries contain detailed information on the specified policy execution. It also provides the location of the run log file.
The following table shows which roles can access this REST API endpoint:
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/policyhistory -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 history information for all policies for which you have
view permissions.
- Issue the following request in one
line.
curl -k -H 'Authorization: Bearer ${TOKEN}' https://<spectrum_discover_host>/policyengine/v1/policyhistory -X GET
- The following response is
returned.
[ { "id": 893909178, "policyid": "patent_pol", "state": "complete", "status": null, "starttime": "2020-09-22T20:34:32.000Z", "endtime": "2020-09-22T20:35:19.000Z", "logfile": "/policy_logs/patent_pol-2020-09-22 20:34:32/run.log", "startedby": null, "scheduled": null, "totalcount": 7, "failedcount": 0, "skippedcount": 0, "successcount": 7, "totalsize": null, "policyfilter": "path = '/mnt/datadump/patent_dataset/'", "type": "CONTENTSEARCH", "additional_info": "{\"explicit\": \"true\"}" }, { "id": 3465755378, "policyid": "dicom_hdr_extract", "state": "complete with fail", "status": null, "starttime": "2020-09-22T21:30:59.000Z", "endtime": "2020-09-22T21:31:09.000Z", "logfile": "/policy_logs/dicom_hdr_extract-2020-09-22 21:30:59/run.log", "startedby": null, "scheduled": null, "totalcount": 26, "failedcount": 9, "skippedcount": 0, "successcount": 17, "totalsize": null, "policyfilter": "project='watson_health' and filetype='dcm'", "type": "CONTENTSEARCH", "additional_info": "{\"explicit\": \"true\"}" } ]
Response data
The response data can be explained as shown.
- id
- The response returns the unique run id for the specified policy execution.
- policy_id
- The response returns the name of the policy that is being run.
- state
- The response returns the current or final state of the policy execution.
- status
- The response returns the additional information about the run state (for example, a failure message).
- starttime
- The response returns the date or timestamp when the policy execution was started.
- endtime
- The response returns the date or timestamp when the policy execution completes if the policy is not still running.
- logfile
- The response returns the log file identifier for this policy execution.
- startedby
- This information field is reserved for future use.
- scheduled
- This information field is reserved for future use.
- totalcount
- The response returns the total number of records that meet the policy filter criteria.
- failedcount
- The response returns the number of records that are marked as failed during the policy execution.
- skippedcount
- The response returns the number of records that are marked as skipped during the policy execution.
- successcount
- The response returns the number of records that are marked as successfully processed after the policy execution is completed.
- totalsize
- This information field is reserved for future use.
- policyfilter
- The response returns the filter criteria that defined the set of records to be processed in the policy execution.
- type
- The response returns the type of policy that is being run.
- additional_info/explicit
- The response returns the Boolean value that displays True if the policy execution was for a user-defined policy or False if it was run for a system-generated policy.