您可以調用DescribeTaskInfo介面,查詢叢集任務的詳細資料,例如任務類型、運行狀態、運行階段等。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
cs:DescribeTaskInfo |
get |
*全部資源
|
無 | 無 |
請求文法
GET /tasks/{task_id} HTTP/1.1
路徑參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| task_id |
string |
是 |
任務 ID。 |
T-5faa48fb31b6b8078d00**** |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
當前API無需請求參數
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
返回體資料。 |
||
| task_id |
string |
任務 ID。 |
T-5faa48fb31b6b8078d000006 |
| cluster_id |
string |
叢集 ID。 |
c78592bfe92244365b3c3ad47f1de**** |
| task_type |
string |
任務類型,擴容任務的類型為 |
cluster_scaleout |
| state |
string |
代表任務的運行狀態。取值:
|
running |
| created |
string |
任務建立時間。 |
2020-11-10T16:02:04+08:00 |
| updated |
string |
任務更新時間。 |
2020-11-10T16:03:06+08:00 |
| target |
object |
任務執行對象。 |
|
| id |
string |
任務執行物件識別碼。 |
c78592bfe92244365b3c3ad47f1de**** |
| type |
string |
任務執行物件類型。 |
cluster |
| parameters |
object |
任務參數。 |
|
| stages |
array<object> |
任務階段。 |
|
|
array<object> |
任務階段。 |
||
| state |
string |
任務階段狀態。 |
running |
| start_time |
string |
任務階段開始時間。 |
2022-12-15 23:00:00 |
| end_time |
string |
任務階段結束時間。 |
2022-12-15 23:00:00 |
| message |
string |
任務階段資訊。 |
success to xxxxx |
| outputs |
object |
任務階段輸出。 |
|
| current_stage |
string |
任務當前運行階段。 |
DrainNodes |
| events |
array<object> |
任務產生的事件。 |
|
|
object |
事件詳情。 |
||
| action |
string |
事件動作。 |
start |
| level |
string |
事件等級。 |
Normal |
| message |
string |
事件訊息。 |
start to xxx |
| reason |
string |
事件原因。 |
NodePoolUpgradeStart |
| source |
string |
事件來源。 |
ACK |
| timestamp |
string |
事件產生時間。 |
1669706229286 |
| task_result |
array<object> |
任務執行詳情。 |
|
|
object |
任務詳情。 |
||
| data |
string |
任務操作的資源,例如:擴容時操作資源是執行個體,那麼此處就是執行個體 ID。 |
i-xxx |
| status |
string |
資源擴容的狀態。取值:
|
success |
| error |
object |
任務錯誤資訊。 |
|
| code |
string |
錯誤碼。 |
400 |
| message |
string |
錯誤訊息。 |
failed to xxx |
| outputs |
object |
樣本
正常返回樣本
JSON格式
{
"task_id": "T-5faa48fb31b6b8078d000006",
"cluster_id": "c78592bfe92244365b3c3ad47f1de****",
"task_type": "cluster_scaleout",
"state": "running",
"created": "2020-11-10T16:02:04+08:00",
"updated": "2020-11-10T16:03:06+08:00",
"target": {
"id": "c78592bfe92244365b3c3ad47f1de****\n",
"type": "cluster"
},
"parameters": {
"test": "test",
"test2": 1
},
"stages": [
{
"state": "running",
"start_time": "2022-12-15 23:00:00",
"end_time": "2022-12-15 23:00:00",
"message": "success to xxxxx",
"outputs": {
"test": "test",
"test2": 1
}
}
],
"current_stage": "DrainNodes",
"events": [
{
"action": "start",
"level": "Normal",
"message": "start to xxx",
"reason": "NodePoolUpgradeStart",
"source": "ACK",
"timestamp": "1669706229286"
}
],
"task_result": [
{
"data": "i-xxx",
"status": "success"
}
],
"error": {
"code": "400",
"message": "failed to xxx"
},
"outputs": {
"test": "test",
"test2": 1
}
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。