Skip to main content
A newer release of this product is available.

Cluster jobs endpoint overview

Contributors

Summary

This API is used to view and manipulate jobs. Jobs provide information about asynchronous operations. Some long-running jobs are paused or cancelled by calling PATCH. Individual operations will mention if they support PATCH on the job. Once a job transitions to a terminal state, it is deleted after a default time of 300 seconds. Attempts to GET or PATCH the job will return a 404 error code once the job has been deleted.

Example

The following examples show how to retrieve and update a job state

1) Retrieve job information


# The API:
/api/cluster/jobs/{uuid}

# The call:
curl -X GET "https://<mgmt-ip>/api/cluster/jobs/b5145e1d-b53b-11e8-8252-005056bbd8f5" -H "accept: application/json"

# The response:
{
  "uuid": "b5145e1d-b53b-11e8-8252-005056bbd8f5",
  "code": 0,
  "description": "Cluster Backup Job",
  "state": "running",
  "message": "creating_node_backups",
  "_links": {
      "self": {
          "href": "/api/cluster/jobs/b5145e1d-b53b-11e8-8252-005056bbd8f5"
      }
  }
}

2) Update a job that supports the new state


# The API:
/api/cluster/jobs/{uuid}

# The call:
curl -X PATCH "https://<mgmt-ip>/api/cluster/jobs/b5145e1d-b53b-11e8-8252-005056bbd8f5?action=cancel" -H "accept: application/json"