All Products
Search
Document Center

Cloud Control API:GetTask

Last Updated:Mar 06, 2025

Calls this operation to query a specified asynchronous task.

Operation description

GET /api/v1/tasks/{taskId}.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

GET /api/v1/tasks/{taskId} HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
taskIdstringYes

The ID of the task.

task-433aead756057fff8189a7ce5****

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

requestIdstring

The ID of a request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****
taskobject

The information about the task.

createTimestring

The time when the task was created.

2022-10-09T00:46:03Z
errorobject

The error returned for the task.

codestring

The error code.

OperationFailure.OperationFailed
messagestring

The error message.

{ "requestId": "123****", "errorCode": "InvalidRamUser.NoPermission", "errorMsg": "Ram user is not authorized to perform the operation." }
productstring

The code of the service.

ECS
regionIdstring

The region ID.

cn-beijing
resourceIdstring

The ID of the resource.

i-8vbascjthm7kzhp3****
resourcePathstring

The path of the resources. The relative resource ID. The resource path contains the complete resource location (parent resource/child resource).

Instance/i-8vbascjthm7kzhp3**** Instance/r-8vbf5abe31c9c4d4/Account/cctest
resourceTypestring

The resource type.

Instance
statusstring

The task state.

Pending

Running

Succeeded

Failed

Cancelling

Cancelled.

Succeeded
taskActionstring

The type of the task operation. Valid values: Create, Update, and Delete.

Create
taskIdstring

The ID of the task.

task-433aead756057fff8189a7ce5****

Examples

Sample success responses

JSONformat

{
  "requestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "task": {
    "createTime": "2022-10-09T00:46:03Z",
    "error": {
      "code": "OperationFailure.OperationFailed",
      "message": "{\n     \"requestId\": \"123****\",\n     \"errorCode\": \"InvalidRamUser.NoPermission\",\n     \"errorMsg\": \"Ram user is not authorized to perform the operation.\"\n}"
    },
    "product": "ECS",
    "regionId": "cn-beijing",
    "resourceId": "i-8vbascjthm7kzhp3****\n",
    "resourcePath": "Instance/i-8vbascjthm7kzhp3****\nInstance/r-8vbf5abe31c9c4d4/Account/cctest",
    "resourceType": "Instance",
    "status": "Succeeded",
    "taskAction": "Create",
    "taskId": "task-433aead756057fff8189a7ce5****"
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-07-04The internal configuration of the API is changed, but the call is not affectedView Change Details