Get active task
All of the requests made to the BlueXP REST API are processed asynchronously except those using the HTTP GET method. Each of these asynchronous requests is assigned a unique identifier which is returned to the caller in the response. You can use the request ID to retrieve information about the background task including its status.
Step 1. Get the request identifier
After issuing any REST API call, the associated request identifier is returned in the X-Response_Id
header. You must extract this value and use it in the path variable in the next step.
Step 2. Get the task
You can issue the REST API call to retrieve the task.
This REST API call uses the following method and endpoint.
HTTP method | Resource path |
---|---|
GET |
/occm/api/audit/activeTask/{request_id} |
curl --request GET \
--location "https://cloudmanager.cloud.netapp.com/occm/api/audit/activeTask/<REQUEST_ID>" \
--header "Content-Type: application/json" \
--header "x-agent-id: <AGENT_ID>" \
--header "Authorization: Bearer <ACCESS_TOKEN>"
Path parameter that contains the request identifier <REQUEST_ID>
for the original task.
The JSON output example includes the list of returned values. The status
contains one of three values indicating the status of the task.
Status | Description |
---|---|
1 |
The asynchronous task completed successfully. |
0 |
The background task is still running and has not completed. |
-1 |
The asynchronous task completed but failed. |
{ "status": 0, "closeTime": -2147483648, "actionName": "Create Vsa Working Environment", "error": null }