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: 2052
{
  "elements" : [ {
    "id" : "ef307228-b80b-4ff1-a893-8a72f9a55eed",
    "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" : "064780df-c074-44c1-9b9a-a76a059ed6af",
      "type" : "HOST"
    } ],
    "resolutionStatus" : "UNRESOLVED",
    "isCancellable" : false
  }, {
    "id" : "c6a42024-a6da-413f-871b-c47c52d205d9",
    "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" : "61b9d42d-1815-434d-8c30-8f470f8dd027",
      "type" : "HOST"
    } ],
    "resolutionStatus" : "UNRESOLVED",
    "isCancellable" : 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/dd6abefa-752a-49aa-a44b-81f5044d7621' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'
HTTP Request
GET /v1/tasks/dd6abefa-752a-49aa-a44b-81f5044d7621 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" : "dd6abefa-752a-49aa-a44b-81f5044d7621",
  "name" : "Vi workload Domain Creation",
  "status" : "FAILED",
  "creationTimestamp" : "1970-01-20T11:50:04.492Z",
  "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" : "35cfce4c-e4ab-46c3-9410-f5531a592f7d",
    "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/5ae8d27e-138a-41d8-a984-60fa877d59aa' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer etYWRta....'
HTTP Request
PATCH /v1/tasks/5ae8d27e-138a-41d8-a984-60fa877d59aa 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-05-21 23:30:49 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                                
                                                    