Tasks APIs
APIs for managing Tasks
Table of Contents
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: 2106
{
"elements" : [ {
"id" : "8ee55c24-b1c2-4516-bbae-03646e65248a",
"name" : "Commissioning host(s) sfo01-w01-esx05.rainpole.io to VMware Cloud Foundation",
"status" : "Failed",
"creationTimestamp" : "2019-06-20T12:03:18.890Z",
"subTasks" : [ {
"name" : "HostVibValidationAction",
"description" : "Validate the hosts for any disallowed VIBS",
"status" : "SUCCESSFUL",
"creationTimestamp" : "2019-06-20T12:03:18.890Z"
}, {
"name" : "HostMaintenanceModeValidationAction",
"description" : "Verifies that none of the hosts are in maintenance mode",
"status" : "FAILED",
"creationTimestamp" : "2019-06-20T12:03:18.890Z"
}, {
"name" : "FetchDnsAndNtpAction",
"description" : "Fetches DNS \\u0026 NTP IPs",
"status" : "PENDING",
"creationTimestamp" : "2019-06-20T12:03:18.890Z"
} ],
"errors" : [ {
"errorCode" : "COMMISION_HOST_FAILED",
"errorType" : "ERROR",
"message" : "Failed to Commissioning host(s) sfo01-w01-esx05.rainpole.io to VMware Cloud Foundation",
"causes" : [ ]
} ],
"resources" : [ {
"resourceId" : "d54d7b89-b68e-4a44-91bc-679d29ab5335",
"type" : "HOST"
} ],
"resolutionStatus" : "UNRESOLVED",
"isCancellable" : false,
"isRetryable" : false
}, {
"id" : "de85b414-3416-4dd3-aefc-71a8d0010279",
"name" : "Credentials rotate operation",
"status" : "Successful",
"creationTimestamp" : "2019-06-20T12:03:18.890Z",
"subTasks" : [ {
"name" : "sfo-vcf01.rainpole.io:FTP",
"description" : "Password rotate for sfo-vcf01.rainpole.io and credential type FTP",
"status" : "SUCCESSFUL",
"creationTimestamp" : "2019-06-20T12:03:18.890Z"
} ],
"errors" : [ ],
"resources" : [ {
"resourceId" : "ccad2864-af46-4802-84b7-133faccd6c9b",
"type" : "HOST"
} ],
"resolutionStatus" : "UNRESOLVED",
"isCancellable" : false,
"isRetryable" : false
} ],
"pageMetadata" : {
"pageNumber" : 1,
"pageSize" : 10,
"totalElements" : 2,
"totalPages" : 1
}
}
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/8ee4c270-3934-462f-a5b9-e980739e0e19' -i -X GET \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer etYWRta....'
HTTP Request
GET /v1/tasks/8ee4c270-3934-462f-a5b9-e980739e0e19 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: 985
{
"id" : "8ee4c270-3934-462f-a5b9-e980739e0e19",
"name" : "Vi workload Domain Creation",
"status" : "FAILED",
"creationTimestamp" : "1970-01-20T17:52:32.275Z",
"subTasks" : [ {
"name" : "HostVibValidationAction",
"description" : "Validate the hosts for any disallowed VIBS",
"status" : "SUCCESSFUL",
"creationTimestamp" : "2019-06-20T12:03:18.890Z"
}, {
"name" : "HostMaintenanceModeValidationAction",
"description" : "Verifies that none of the hosts are in maintenance mode",
"status" : "FAILED",
"creationTimestamp" : "2019-06-20T12:03:18.890Z"
}, {
"name" : "FetchDnsAndNtpAction",
"description" : "Fetches DNS \\u0026 NTP IPs",
"status" : "PENDING",
"creationTimestamp" : "2019-06-20T12:03:18.890Z"
} ],
"errors" : [ ],
"resources" : [ {
"resourceId" : "9ad98430-eefe-4c6b-ac69-4b405ee476c8",
"type" : "HOST"
} ],
"resolutionStatus" : "UNRESOLVED",
"isCancellable" : false,
"isRetryable" : 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/6bd49cf9-a986-4662-8702-a7c7f9cfda3f' -i -X PATCH \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer etYWRta....'
HTTP Request
PATCH /v1/tasks/6bd49cf9-a986-4662-8702-a7c7f9cfda3f 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 2024-02-29 05:35:20 -0800
Operations
GET
Get Tasks
Get the Tasks
GET
Get Task
Get a Task
DELETE
Cancel Task
Cancel a Task
PATCH
Retry Task
Retry a Task