Querying Snapshot Tasks
Function
This API is used to query one or more snapshot tasks. The task results will be returned, including the status, input, and output.
URI
GET /v1/{project_id}/thumbnails
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details about how to obtain a project ID, see Obtaining a Project ID. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| task_id | No | Array | Task ID. A maximum of 10 task IDs can be queried at a time. |
| status | No | String | Task status. Possible values are:
|
| start_time | No | String | Start time. If task_id is specified, this parameter is invalid. Its format is yyyymmddhhmmss. The value must be a UTC time irrelevant to the time zone. |
| end_time | No | String | End time. If task_id is specified, this parameter is invalid. Its format is yyyymmddhhmmss. The value must be a UTC time irrelevant to the time zone. |
| page | No | Integer | Page number. If task_id is specified, this parameter is invalid. Default value: 0. |
| size | No | Integer | Number of records on each page. If task_id is specified, this parameter is invalid. The value ranges from 1 to 100. Default value: 10 |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | No | String | User token. The token is obtained by calling the IAM API used to obtain a user token. The token is the value of X-Subject-Token in the response header. |
| Authorization | No | String | Authentication information. This parameter is mandatory when AK/SK-based authentication is used. |
| X-Project_Id | No | String | Project ID. This parameter is mandatory when AK/SK-based authentication is used. It is same as the project ID in path parameters. |
| X-Sdk-Date | No | String | Time when the request is sent. This parameter is mandatory when AK/SK-based authentication is used. |
| x-language | No | String | Client language. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| task_array | Array of ThumbTask objects | Query results |
| is_truncated | Integer | Whether the query results are truncated. Possible values are:
|
| total | Integer | Total number of queried snapshot tasks |
| Parameter | Type | Description |
|---|---|---|
| task_id | String | Task ID. A maximum of 10 task IDs can be queried at a time. |
| status | String | Task status |
| create_time | String | Start time. If task_id is specified, this parameter is invalid. Its format is yyyymmddhhmmss. The value must be a UTC time irrelevant to the time zone. |
| end_time | String | End time. If task_id is specified, this parameter is invalid. Its format is yyyymmddhhmmss. The value must be a UTC time irrelevant to the time zone. |
| input | ObsObjInfo object | Storage location of an input file |
| output | ObsObjInfo object | Storage location of an output file |
| output_file_name | String | Name of the generated snapshot file. |
| user_data | String | User data |
| description | String | Snapshot task description. |
| thumbnail_info | Array of PicInfo objects | Snapshot file information |
| Parameter | Type | Description |
|---|---|---|
| bucket | String | OBS bucket name |
| location | String | Region where an OBS bucket is located. It must be the same as the region where MPC is deployed. |
| object | String | File path.
|
| file_name | String | Name of an output file. This parameter is valid only for packaging tasks.
|
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code |
| error_msg | String | Error description |
Example Requests
GET https://{endpoint}/v1/{project_id}/thumbnails?task_id=7684
Example Responses
Status code: 200
Snapshot task queried successfully.
{
"task_array" : [ {
"task_id" : 7684,
"status" : "SUCCEEDED",
"create_time" : 20201118121333,
"end_time" : 20201118121336,
"input" : {
"bucket" : "obs-apitest-01",
"location" : "cn-north-5",
"object" : "ts/22.ts"
},
"output" : {
"bucket" : "obs-apitest-01",
"location" : "cn-north-5",
"object" : "out_gamma/thumbnails/query_02"
},
"thumbnail_info" : [ {
"pic_name" : "9.jpg"
}, {
"pic_name" : "5.jpg"
} ]
} ],
"is_truncated" : 0,
"total" : 1
} Status code: 400
Failed to query the snapshot task.
{
"error_code" : "MPC.10212",
"error_msg" : "Operation failed."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Snapshot task queried successfully. |
| 400 | Failed to query the snapshot task. |
Error Codes
See Error Codes.
Last Article: Creating a Snapshot Task
Next Article: Canceling a Snapshot Task
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.