Tasks APIs

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: 2052

{
  "elements" : [ {
    "id" : "1310311b-551d-4ade-bbf9-76627cdb0199",
    "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" : "061c6842-ea8c-44cb-8fc9-51a55f261df6",
      "type" : "HOST"
    } ],
    "resolutionStatus" : "UNRESOLVED",
    "isCancellable" : false
  }, {
    "id" : "227e26b1-a985-4ac3-b9c1-73e3ec0f9387",
    "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" : "c40fde02-f54c-426a-a4c2-b429c1c08497",
      "type" : "HOST"
    } ],
    "resolutionStatus" : "UNRESOLVED",
    "isCancellable" : 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/f1ea4012-ae24-4e96-a46d-7f2552e79e1a' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/tasks/f1ea4012-ae24-4e96-a46d-7f2552e79e1a 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: 960

{
  "id" : "f1ea4012-ae24-4e96-a46d-7f2552e79e1a",
  "name" : "Vi workload Domain Creation",
  "status" : "FAILED",
  "creationTimestamp" : "1970-01-20T13:52:12.083Z",
  "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" : "f365a747-a560-4397-ad2b-988a442ea30b",
    "type" : "HOST"
  } ],
  "resolutionStatus" : "UNRESOLVED",
  "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/6c25ef20-1472-48dd-913d-63a2d83869e4' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

PATCH /v1/tasks/6c25ef20-1472-48dd-913d-63a2d83869e4 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 2023-09-23 19:05:04 -0700

Operations
DELETE
Cancel Task
Cancel a Task
GET
Get Task
Retrieve a task by its ID
GET
Get Tasks
Retrieve a list of all tasks
PATCH
Retry Task
Retry a Task