通过此接口查询指定异步任务详情。
接口说明
GET /api/v1/tasks/{taskId}。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求语法
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 |
| taskAction |
string |
任务操作类型(Create | Update | Delete)。 枚举值:
|
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****"
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。