全部產品
Search
文件中心

Cloud Control API:GetTask - 查詢任務

更新時間:Dec 11, 2025

通過此介面查詢指定非同步任務詳情。

介面說明

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

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求文法

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

路徑參數

名稱

類型

必填

描述

樣本值

taskId

string

任務 id。

task-433aead756057fff8189a7ce5****

請求參數

名稱

類型

必填

描述

樣本值

當前API無需請求參數

返回參數

名稱

類型

描述

樣本值

object

返回結構。

requestId

string

請求 ID。

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

task

object

任務資訊。

createTime

string

任務建立時間

2022-10-09T00:46:03Z

error

object

任務錯誤資訊。

code

string

錯誤碼。

OperationFailure.OperationFailed

message

string

錯誤資訊

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

product

string

產品 code。

ECS

regionId

string

地區 ID。

cn-beijing

resourceId

string

資源 ID。

i-8vbascjthm7kzhp3****

resourcePath

string

資源路徑。相對資源 id,資源路徑會包含完整的資源定位(父資源/子資源)。

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

resourceType

string

資源類型。

Instance

status

string

任務狀態。

Pending 排隊中

Running 進行中

Succeeded 成功完成

Failed 失敗

Cancelling 取消中

Cancelled 已取消。

枚舉值:

  • Succeeded :

    Succeeded

  • Failed :

    Failed

  • Running :

    Running

  • Cancelled :

    Cancelled

  • Pending :

    Pending

  • Cancelling :

    Cancelling

Succeeded

taskAction

string

任務操作類型(Create | Update | Delete)。

枚舉值:

  • Delete :

    Delete

  • Create :

    Create

  • Update :

    Update

Create

taskId

string

任務 ID。

task-433aead756057fff8189a7ce5****

樣本

正常返回樣本

JSON格式

{
  "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****"
  }
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情