
# 查询任务列表
#### 功能介绍
该API用于查询并显示完整的任务列表。（注：任务列表中的任务没有任何顺序关系）
#### URI
GET /v2/{project_id}/optverse/{service_type}/tasks
表1路径参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|:---|:---|:---|:---|
| project_id   | 是    | String | 项目ID，获取方式请参见[获取项目ID](https://support.huaweicloud.com/api-optverse/optverse_04_0026.html)。                                                                                                                                                                                                                                                                                                                                                                                                     |
| service_type | 是    | String | 服务类型，包括： - regular-plate：二维切割-方形件  - irregular-textile：二维切割-异形件  - optverse-mpsolver：数学规划求解器  - route-planning：运输计划   |
| size         | 否    | String | 分页大小                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| offset       | 否    | String | 页序号                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述    |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户凭证。 |
   
#### 响应参数
表3响应参数说明 
| 参数    | 参数类型             | 说明    |
|:---|:---|:---|
| 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"
        }
    ]
```
#### 状态码
请参见[状态码](https://support.huaweicloud.com/api-cce/ErrorCode.html)
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-cce/ErrorCode.html)
