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

{
  "elements" : [ {
    "id" : "3e96a398-c0cb-43e1-b373-e8aea599a25e",
    "name" : "Enable VMware Customer Experience Improvement Program",
    "status" : "Failed",
    "creationTimestamp" : "2019-06-20T12:03:18.890Z",
    "subTasks" : [ {
      "name" : "FetchEntitiesForCEIPChangeAction",
      "description" : "Obtain Resources for Configuring Customer Experience Improvement Program (CEIP) Setting",
      "status" : "SUCCESSFUL",
      "creationTimestamp" : "2019-06-20T12:03:18.890Z"
    }, {
      "name" : "UpdateCeipForEsxiAction",
      "description" : "Configure Customer Experience Improvement Program (CEIP) Setting on ESXi Hosts",
      "status" : "FAILED",
      "creationTimestamp" : "2019-06-20T12:03:18.890Z"
    }, {
      "name" : "UpdateCeipOnNsxTAction",
      "description" : "Configure Customer Experience Improvement Program (CEIP) Setting on NSX-T",
      "status" : "PENDING",
      "creationTimestamp" : "2019-06-20T12:03:18.890Z"
    }, {
      "name" : "SaveResourceCeipStatusAction",
      "description" : "Save Customer Experience Improvement Program (CEIP) Status to Local Datastore",
      "status" : "PENDING",
      "creationTimestamp" : "2019-06-20T12:03:18.890Z"
    } ],
    "errors" : [ {
      "errorCode" : "VCF_ENABLE_CEIP_ERROR",
      "errorType" : "ERROR",
      "message" : "Unable to modify CEIP operation on VCF",
      "causes" : [ ]
    } ],
    "resources" : [ {
      "resourceId" : "6d53ec04-cb09-4c5b-b37a-1c5dafbb9142",
      "type" : "HOST"
    } ],
    "resolutionStatus" : "UNRESOLVED",
    "isCancellable" : false,
    "isRetryable" : false
  }, {
    "id" : "2021c089-55e5-4e6b-acd6-56e96fe8a322",
    "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" : "d2b6d332-ea18-451d-8ef2-d27af78349c5",
      "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/dde82722-4cbb-4bf8-bc7e-ab1e25f60869' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/tasks/dde82722-4cbb-4bf8-bc7e-ab1e25f60869 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" : "dde82722-4cbb-4bf8-bc7e-ab1e25f60869",
  "name" : "Vi workload Domain Creation",
  "status" : "FAILED",
  "creationTimestamp" : "1970-01-20T15:11:03.655Z",
  "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" : "9a097841-6cb5-41fe-9e50-0ed872bbaace",
    "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/994a3db0-9fb9-429d-9750-dc9112d0642a' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

PATCH /v1/tasks/994a3db0-9fb9-429d-9750-dc9112d0642a 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-03-14 07:59:42 -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