Skip to main content

Workflow 1: Updating the cluster contact and checking job state

This workflow updates the cluster contact information. Because the request is processed asynchronously, it also illustrates how to determine if the background job completes successfully.

1. Update the contact information for the cluster

You can issue an API call to update the contact information. Because the request runs asynchronously, you must confirm success of the associated job.

CategoryHTTP methodPath
ClusterPATCH/cluster
Processing type
Asynchronous
Curl
curl -X PATCH -H 'Content-Type: application/json' -u admin:password -k -d @step01 'https://10.222.81.101/api/cluster'
JSON input (step01)
{
"contact": "support@company-demo.com"
}
JSON output
A job object with the associated identifier is returned.
{  "job": {
"uuid": "d877f5bb-3aa7-11e9-b6c6-005056a78c89",
"_links": {
"self": {
"href": "/api/cluster/jobs/d877f5bb-3aa7-11e9-b6c6-005056a78c89"
}
}
}
}

2. Retrieve the status of the job

You must retrieve the state of the job to determine if the asynchronous request has completed successfully.

CategoryHTTP methodPath
ClusterGET/cluster/jobs/{uuid}
Processing type
Synchronous
Curl
curl -X GET -H 'Content-Type: application/json' -u admin:password -k 'https://10.222.81.101/api/cluster/jobs/uuid'
Output
A job object with the state and other fields is returned.
{
"uuid": "d877f5bb-3aa7-11e9-b6c6-005056a78c89",
"description": "PATCH /api/cluster",
"state": "success",
"message": "success",
"code": 0,
"_links": {
"self": {
"href": "/api/cluster/jobs/d877f5bb-3aa7-11e9-b6c6-005056a78c89"
}
}
}