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

{
  "elements" : [ {
    "id" : "2d6b764b-9e7d-4ce2-99f3-39f33d71ee36",
    "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" : "e43b90cd-e635-4f30-ae49-5d3e72d15212",
      "type" : "HOST"
    } ],
    "resolutionStatus" : "UNRESOLVED",
    "isCancellable" : false,
    "isRetryable" : false
  }, {
    "id" : "939c96fe-a8ce-402a-9fc7-9e27126c37ec",
    "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" : "a7dd8cbf-7afa-4cd6-9b85-05c5a61c007e",
      "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/bc32f3be-a777-434b-a156-3fa54e8d2ded' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/tasks/bc32f3be-a777-434b-a156-3fa54e8d2ded 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" : "bc32f3be-a777-434b-a156-3fa54e8d2ded",
  "name" : "Vi workload Domain Creation",
  "status" : "FAILED",
  "creationTimestamp" : "1970-01-20T23:06:29.526Z",
  "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" : "d74692f3-27da-468e-b3a7-bfc37c1d7d87",
    "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/0db2c528-da06-427a-9762-a639579ad426' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

PATCH /v1/tasks/0db2c528-da06-427a-9762-a639579ad426 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-08-27 16:13:54 -0700

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