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

{
  "elements" : [ {
    "id" : "389c2fb6-3cea-47d7-b830-e701f4cf9aed",
    "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" : "f0f2f355-c91a-4d29-ba55-1c5e73608baa",
      "type" : "HOST"
    } ],
    "resolutionStatus" : "UNRESOLVED",
    "isCancellable" : false
  }, {
    "id" : "5e709a5e-029f-4f1f-b53d-a79f3f452f74",
    "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" : "a87cea04-50f1-4f0a-a890-a7fc591d082f",
      "type" : "HOST"
    } ],
    "resolutionStatus" : "UNRESOLVED",
    "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/63eb8b2c-c3b9-4aed-919a-26ac1315d359' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/tasks/63eb8b2c-c3b9-4aed-919a-26ac1315d359 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" : "63eb8b2c-c3b9-4aed-919a-26ac1315d359",
  "name" : "Vi workload Domain Creation",
  "status" : "FAILED",
  "creationTimestamp" : "1970-01-20T06:19:07.495Z",
  "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" : "ada40180-15e1-4e7b-9110-8c90bad6e382",
    "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/e2cd5fb5-319c-41c5-89a3-db1319e1ef9d' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

PATCH /v1/tasks/e2cd5fb5-319c-41c5-89a3-db1319e1ef9d 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-04-27 11:11:39 PDT

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