Tasks APIs

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

{
  "elements" : [ {
    "id" : "e1ee0254-348d-43ce-9852-2485f12b6689",
    "name" : "Enable VMware Customer Experience Improvement Program",
    "status" : "Failed",
    "creationTimestamp" : "2019-06-20T12:03:18.890Z",
    "subTasks" : [ null, null, null, null ],
    "errors" : [ {
      "errorCode" : "ERROR_CODE_1",
      "errorType" : "ERROR",
      "arguments" : [ "arg1", "arg2", "arg3" ],
      "message" : "Error Response message for error 1",
      "referenceToken" : "J8RRKM"
    }, {
      "errorCode" : "ERROR_CODE_2",
      "errorType" : "ERROR",
      "arguments" : [ "arg1", "arg2", "arg3" ],
      "message" : "Error Response message for error 2",
      "referenceToken" : "J8RRKM"
    }, {
      "errorCode" : "ERROR_CODE_3",
      "errorType" : "WARNING",
      "arguments" : [ "arg1", "arg2", "arg3" ],
      "message" : "Error Response message for warning 1",
      "referenceToken" : "J8RRKM"
    }, {
      "errorCode" : "ERROR_CODE_4",
      "errorType" : "WARNING",
      "arguments" : [ "arg1", "arg2", "arg3" ],
      "message" : "Error Response message for warning 2",
      "referenceToken" : "J8RRKM"
    } ],
    "resources" : [ {
      "resourceId" : "37e74bdf-f12d-40c3-8ffb-ccefafac9c36",
      "type" : "HOST"
    } ],
    "isCancellable" : false
  }, {
    "id" : "65cc8768-abe7-44dc-ae8e-cffe48780cf2",
    "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" : "J8RRKM"
    }, {
      "errorCode" : "ERROR_CODE_2",
      "errorType" : "ERROR",
      "arguments" : [ "arg1", "arg2", "arg3" ],
      "message" : "Error Response message for error 2",
      "referenceToken" : "J8RRKM"
    }, {
      "errorCode" : "ERROR_CODE_3",
      "errorType" : "WARNING",
      "arguments" : [ "arg1", "arg2", "arg3" ],
      "message" : "Error Response message for warning 1",
      "referenceToken" : "J8RRKM"
    }, {
      "errorCode" : "ERROR_CODE_4",
      "errorType" : "WARNING",
      "arguments" : [ "arg1", "arg2", "arg3" ],
      "message" : "Error Response message for warning 2",
      "referenceToken" : "J8RRKM"
    } ],
    "resources" : [ {
      "resourceId" : "d6c30a25-b878-4ff6-9ff4-316f694ff2cf",
      "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