Tasks APIs
APIs for managing Tasks
1. Get the Tasks
1.1. Prerequisites
None
1.2. Steps
- Invoke the API
cURL Request
$ curl 'https://sfo-vcf01.rainpole.io/v1/tasks' -i -X GET \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer etYWRta....'
HTTP Request
GET /v1/tasks HTTP/1.1
Content-Type: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....
HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2537
{
"elements" : [ {
"id" : "329bc7f4-f339-4abb-a934-6367601e8e67",
"name" : "Commissioning host(s) sfo01-w01-esx05.rainpole.io to VMware Cloud Foundation",
"status" : "Failed",
"creationTimestamp" : "2019-06-20T12:03:18.890Z",
"subTasks" : [ null, null, null ],
"errors" : [ {
"errorCode" : "ERROR_CODE_1",
"errorType" : "ERROR",
"arguments" : [ "arg1", "arg2", "arg3" ],
"message" : "Error Response message for error 1",
"referenceToken" : "971D81"
}, {
"errorCode" : "ERROR_CODE_2",
"errorType" : "ERROR",
"arguments" : [ "arg1", "arg2", "arg3" ],
"message" : "Error Response message for error 2",
"referenceToken" : "971D81"
}, {
"errorCode" : "ERROR_CODE_3",
"errorType" : "WARNING",
"arguments" : [ "arg1", "arg2", "arg3" ],
"message" : "Error Response message for warning 1",
"referenceToken" : "971D81"
}, {
"errorCode" : "ERROR_CODE_4",
"errorType" : "WARNING",
"arguments" : [ "arg1", "arg2", "arg3" ],
"message" : "Error Response message for warning 2",
"referenceToken" : "971D81"
} ],
"resources" : [ {
"resourceId" : "4f0e7e03-63ac-4108-92a1-8606e4012d52",
"type" : "HOST"
} ],
"isCancellable" : false
}, {
"id" : "1b086716-8208-4fb2-ae22-8323f5efe2c1",
"name" : "Credentials rotate operation",
"status" : "Successful",
"creationTimestamp" : "2019-06-20T12:03:18.890Z",
"subTasks" : [ null ],
"errors" : [ {
"errorCode" : "ERROR_CODE_1",
"errorType" : "ERROR",
"arguments" : [ "arg1", "arg2", "arg3" ],
"message" : "Error Response message for error 1",
"referenceToken" : "971D81"
}, {
"errorCode" : "ERROR_CODE_2",
"errorType" : "ERROR",
"arguments" : [ "arg1", "arg2", "arg3" ],
"message" : "Error Response message for error 2",
"referenceToken" : "971D81"
}, {
"errorCode" : "ERROR_CODE_3",
"errorType" : "WARNING",
"arguments" : [ "arg1", "arg2", "arg3" ],
"message" : "Error Response message for warning 1",
"referenceToken" : "971D81"
}, {
"errorCode" : "ERROR_CODE_4",
"errorType" : "WARNING",
"arguments" : [ "arg1", "arg2", "arg3" ],
"message" : "Error Response message for warning 2",
"referenceToken" : "971D81"
} ],
"resources" : [ {
"resourceId" : "99289c8d-2e98-4723-917a-12df375f5a24",
"type" : "HOST"
} ],
"isCancellable" : false
} ]
}
2. Get a Task
2.1. Prerequisites
The following data is required
- ID of the task
2.2. Steps
- Invoke the API by providing the ID of the task as input.
cURL Request
$ curl 'https://sfo-vcf01.rainpole.io/v1/tasks/43773acc-6b75-47f6-8b1d-27e1aa52de88' -i -X GET \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer etYWRta....'
HTTP Request
GET /v1/tasks/43773acc-6b75-47f6-8b1d-27e1aa52de88 HTTP/1.1
Content-Type: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....
HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1163
{
"id" : "43773acc-6b75-47f6-8b1d-27e1aa52de88",
"name" : "Vi workload Domain Creation",
"status" : "FAILED",
"creationTimestamp" : "1970-01-20T00:23:47.753Z",
"subTasks" : [ null, null, null ],
"errors" : [ {
"errorCode" : "ERROR_CODE_1",
"errorType" : "ERROR",
"arguments" : [ "arg1", "arg2", "arg3" ],
"message" : "Error Response message for error 1",
"referenceToken" : "UTNEGU"
}, {
"errorCode" : "ERROR_CODE_2",
"errorType" : "ERROR",
"arguments" : [ "arg1", "arg2", "arg3" ],
"message" : "Error Response message for error 2",
"referenceToken" : "UTNEGU"
}, {
"errorCode" : "ERROR_CODE_3",
"errorType" : "WARNING",
"arguments" : [ "arg1", "arg2", "arg3" ],
"message" : "Error Response message for warning 1",
"referenceToken" : "UTNEGU"
}, {
"errorCode" : "ERROR_CODE_4",
"errorType" : "WARNING",
"arguments" : [ "arg1", "arg2", "arg3" ],
"message" : "Error Response message for warning 2",
"referenceToken" : "UTNEGU"
} ],
"resources" : [ {
"resourceId" : "cb3ecb44-8e6b-4c4c-a0ee-067bc03dc07e",
"type" : "HOST"
} ],
"isCancellable" : false
}
3. Retry a Task
Used to retry a failed task/workflow.
3.1. Prerequisites
The following data is required
- ID of the failed task
3.2. Steps
- Invoke the API by providing the ID of the task as input.
cURL Request
$ curl 'https://sfo-vcf01.rainpole.io/v1/tasks/513df83c-8466-4048-8d63-68f75246ce79' -i -X PATCH \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer etYWRta....'
HTTP Request
PATCH /v1/tasks/513df83c-8466-4048-8d63-68f75246ce79 HTTP/1.1
Content-Type: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....
HTTP Response
HTTP/1.1 200 OK
Note : The credentials' update/rotate password tasks cannot be retried using this API. Refer to Retry a failed credentials task for a given ID API section.
Last updated 2022-01-24 06:18:36 PST
Operations
DELETE
Cancel Task
Cancel a Task
GET
Get Task
Get a Task
GET
Get Tasks
Get the Tasks
PATCH
Retry Task
Retry a Task