/policyengine/v1/policyhistory/<pol_id>/<log_id>: GET
Retrieves the policy run log for a policy execution.
This endpoint helps you retrieve and view the policy run log information for all policy executions that you have access to. It provides you with a direct access to the policy execution log data without having to search for it on the file system.
The following table displays the roles that 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/<pol_id>/<log_id> -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 log execution details for the policies that you have
access to:
- Issue the following request in one
line.
curl -k -H 'Authorization: Bearer ${TOKEN}' https://<spectrum_discover_host>/policyengine/v1/policyhistory/patent_pol/893909178 -X GET -H ’Accept: application/json’
- The following response is
returned.
[ { "log": "[2020-09-22 20:34:32] - Execution beginning for policy (patent_pol)\n[2020-09-22 20:34:33] - Policy status change to (running)\n[2020-09-22 20:34:33] - Policy stats update: {'pol_id': 'patent_pol', 'execution_info': '{\"start_time\": \"2020-09-22 20:34:32\", \"total_count\": 0, \"submitted_count\": 0, \"failed_count\": 0, \"completed_count\": 0, \"skipped_count\": 0, \"ctrl_submitted_count\": 0, \"ctrl_completed_count\": 0, \"contentsearch_count\": 0, \"run_id\": null}'}\n[2020-09-22 20:34:33] - Policy stats update: {'pol_id': 'patent_pol', 'execution_info': '{\"start_time\": \"2020-09-22 20:34:32\", \"total_count\": 7, \"submitted_count\": 0, \"failed_count\": 0, \"completed_count\": 0, \"skipped_count\": 0, \"ctrl_submitted_count\": 0, \"ctrl_completed_count\": 0, \"contentsearch_count\": 0, \"run_id\": null}'}\n[2020-09-22 20:34:35] - Applying action 'CONTENTSEARCH' to 7 documents\n[2020-09-22 20:34:38] - Policy stats update: {'pol_id': 'patent_pol', 'execution_info': '{\"start_time\": \"2020-09-22 20:34:32\", \"total_count\": 7, \"submitted_count\": 7, \"failed_count\": 0, \"completed_count\": 0, \"skipped_count\": 0, \"ctrl_submitted_count\": 0, \"ctrl_completed_count\": 0, \"contentsearch_count\": 0, \"run_id\": \"ab0d0623dd844fd7b21276fce892d6ed\"}'}\n[2020-09-22 20:34:38] - Policy stats update: {'pol_id': 'patent_pol', 'execution_info': '{\"start_time\": \"2020-09-22 20:34:32\", \"total_count\": 7, \"submitted_count\": 7, \"failed_count\": 0, \"completed_count\": 0, \"skipped_count\": 0, \"ctrl_submitted_count\": 0, \"ctrl_completed_count\": 0, \"contentsearch_count\": 0, \"run_id\": \"ab0d0623dd844fd7b21276fce892d6ed\"}'}\n[2020-09-22 20:34:45] - Policy stats update: {'pol_id': 'patent_pol', 'execution_info': '{\"start_time\": \"2020-09-22 20:34:32\", \"total_count\": 7, \"submitted_count\": 7, \"failed_count\": 0, \"completed_count\": 0, \"skipped_count\": 0, \"ctrl_submitted_count\": 0, \"ctrl_completed_count\": 0, \"contentsearch_count\": 0, \"run_id\": \"ab0d0623dd844fd7b21276fce892d6ed\"}'}\n[2020-09-22 20:34:56] - Policy stats update: {'pol_id': 'patent_pol', 'execution_info': '{\"start_time\": \"2020-09-22 20:34:32\", \"total_count\": 7, \"submitted_count\": 7, \"failed_count\": 0, \"completed_count\": 0, \"skipped_count\": 0, \"ctrl_submitted_count\": 0, \"ctrl_completed_count\": 0, \"contentsearch_count\": 0, \"run_id\": \"ab0d0623dd844fd7b21276fce892d6ed\"}'}\n[2020-09-22 20:35:06] - Policy stats update: {'pol_id': 'patent_pol', 'execution_info': '{\"start_time\": \"2020-09-22 20:34:32\", \"total_count\": 7, \"submitted_count\": 7, \"failed_count\": 0, \"completed_count\": 0, \"skipped_count\": 0, \"ctrl_submitted_count\": 0, \"ctrl_completed_count\": 0, \"contentsearch_count\": 0, \"run_id\": \"ab0d0623dd844fd7b21276fce892d6ed\"}'}\n[2020-09-22 20:35:16] - Policy stats update: {'pol_id': 'patent_pol', 'execution_info': '{\"start_time\": \"2020-09-22 20:34:32\", \"total_count\": 7, \"submitted_count\": 7, \"failed_count\": 0, \"completed_count\": 0, \"skipped_count\": 0, \"ctrl_submitted_count\": 0, \"ctrl_completed_count\": 0, \"contentsearch_count\": 0, \"run_id\": \"ab0d0623dd844fd7b21276fce892d6ed\"}'}\n[2020-09-22 20:35:19] - Policy stats update: {'pol_id': 'patent_pol', 'execution_info': '{\"start_time\": \"2020-09-22 20:34:32\", \"total_count\": 7, \"submitted_count\": 7, \"failed_count\": 0, \"completed_count\": 7, \"skipped_count\": 0, \"ctrl_submitted_count\": 0, \"ctrl_completed_count\": 0, \"contentsearch_count\": 0, \"run_id\": \"ab0d0623dd844fd7b21276fce892d6ed\"}'}\n[2020-09-22 20:35:20] - Policy stats update: {'pol_id': 'patent_pol', 'execution_info': '{\"start_time\": \"2020-09-22 20:34:32\", \"total_count\": 7, \"submitted_count\": 7, \"failed_count\": 0, \"completed_count\": 7, \"skipped_count\": 0, \"ctrl_submitted_count\": 0, \"ctrl_completed_count\": 0, \"contentsearch_count\": 0, \"run_id\": \"ab0d0623dd844fd7b21276fce892d6ed\", \"end_time\": \"2020-09-22 20:35:19\"}'}\n[2020-09-22 20:35:20] - Policy patent_pol run ending\n[2020-09-22 20:35:20] - Policy patent_pol run completed\n[2020-09-22 20:35:20] - Policy status change to (complete)\n" } ]
Response data
The response data can be explained as shown.
- log
- The response returns the policy run log output details that is displayed as a string.