更新时间:2025-10-21 GMT+08:00
查询任务列表
功能介绍
该API用于查询并显示完整的任务列表。(注:任务列表中的任务没有任何顺序关系)
URI
GET /v2/{project_id}/optverse/{service_type}/tasks
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
project_id | 是 | String | 项目ID,获取方式请参见获取Project_id。 |
service_type | 是 | String | 服务类型,包括:
|
size | 否 | String | 分页大小 |
offset | 否 | String | 页序号 |
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Auth-Token | 是 | String | 用户凭证。 |
响应参数
参数 | 参数类型 | 说明 |
|---|---|---|
count | Int | 总的任务数 |
tasks | Array of objects | 任务列表 |
请求示例
GET /v2/{project_id}/optverse/{service_type}/tasks
curl --location --request GET 'https://optverse.cn-north-4.myhuaweicloud.com/v2/{project_id}/optverse/{service_type}/tasks' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token; xxxxxxxxx' 响应示例
成功响应示例
{
"count": 2,
"tasks": [
{
"task_id": "32xxxxxx-cxxx-4xxx-ad65-52xxxxxbb621",
"status": "Succeeded",
"start_time": "2024-10-30T10:01:09.77Z",
"end_time": "2024-10-30T10:02:15.422Z",
"create_time": "2024-10-30T10:01:01.445Z"
},
{
"task_id": "fafxxxxx-fcxx-4exx-9exx-6e3xxxxx4a13",
"status": "Failed",
"start_time": "2024-07-01T03:28:45.182Z",
"end_time": "2024-07-01T03:28:58.85Z",
"create_time": "2024-07-01T03:28:44.587Z"
}
] 状态码
请参见状态码
错误码
请参见错误码
父主题:API

