Tasks APIs

Tasks APIs

APIs for managing Tasks

Table of Contents

1. Get the Tasks

1.1. Prerequisites API

None

1.2. Steps API

  • 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" : "a87fb029-1b0b-4ca5-a015-19bf0b5f43e0",
    "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" : "b60cb148-448a-45c8-abb5-6875c9f4c8f2",
      "type" : "HOST"
    } ],
    "resolutionStatus" : "UNRESOLVED",
    "isCancellable" : false,
    "isRetryable" : false
  }, {
    "id" : "04c9d1a9-caac-4caa-96ad-0c4c37511cba",
    "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" : "520e5a53-2160-4687-a9ff-d9f7b0b845e2",
      "type" : "HOST"
    } ],
    "resolutionStatus" : "UNRESOLVED",
    "isCancellable" : false,
    "isRetryable" : false
  } ],
  "pageMetadata" : {
    "pageNumber" : 1,
    "pageSize" : 10,
    "totalElements" : 2,
    "totalPages" : 1
  }
}

[_gettasks] API [_gettask] API

2. Get a Task

2.1. Prerequisites API

The following data is required

  • ID of the task

2.2. Steps API

  • Invoke the API by providing the ID of the task as input.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/tasks/ddb91d1c-efbf-4ed1-a067-a11a9b064278' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/tasks/ddb91d1c-efbf-4ed1-a067-a11a9b064278 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" : "ddb91d1c-efbf-4ed1-a067-a11a9b064278",
  "name" : "Vi workload Domain Creation",
  "status" : "FAILED",
  "creationTimestamp" : "1970-01-20T21:28:58.036Z",
  "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" : "1aaa5fb3-eaf9-4309-8882-8283398f6eb4",
    "type" : "HOST"
  } ],
  "resolutionStatus" : "UNRESOLVED",
  "isCancellable" : false,
  "isRetryable" : false
}

[_gettasks] API [_gettask] API

3. Retry a Task

Used to retry a failed task/workflow.

3.1. Prerequisites API

The following data is required

  • ID of the failed task

3.2. Steps API

  • Invoke the API by providing the ID of the task as input.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/tasks/7878934d-7a3d-432b-b877-a21f9a28f959' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

PATCH /v1/tasks/7878934d-7a3d-432b-b877-a21f9a28f959 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.

[_gettasks] API [_gettask] API
Last updated 2024-06-21 01:22:12 -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