Querying the Task List
Function
Query the task list.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/csms/tasks
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| secret_name | No | String | Secret name |
| status | No | String | Task status. The value can be:
|
| task_id | No | String | Task ID. If this parameter is specified, other search criteria cannot be specified. |
| limit | No | Integer | Number of records returned on each page. The default value is 50. |
| marker | No | String | Start task ID of pagination query. If this parameter is left blank, only the first page is queried. |
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| total | Integer | Number of tasks |
| tasks | Array of SecretTask objects | Secret tasks |
| next_marker | String | Address for querying the next page (ID of the last task on the current page). |
| Parameter | Type | Description |
|---|---|---|
| task_id | String | Task ID |
| secret_name | String | Secret name |
| rotation_func_urn | String | URN of the FunctionGraph function |
| task_status | String | Task status |
| operate_type | String | Rotation type |
| task_time | Long | Task creation time |
| attempt_nums | Integer | Number of rotation attempts |
| task_error_code | String | Task error code |
| task_error_msg | String | Task error message |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error codes |
| error_msg | String | Error description |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error codes |
| error_msg | String | Error description |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error codes |
| error_msg | String | Error description |
Status code: 404
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error codes |
| error_msg | String | Error description |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error codes |
| error_msg | String | Error description |
Status code: 502
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error codes |
| error_msg | String | Error description |
Status code: 504
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error codes |
| error_msg | String | Error description |
Example Requests
-
Query the secret task whose ID is xxxxx.
/v1/xxxxx/csms/tasks?task_id=xxxxx
-
Query the secret task whose name is xx. The task status is FAILED. There are 10 returned records on each page. The start task ID of each page is xxxx.
/v1/xxxxx/csms/tasks?secret_name=xx&status=FAILED&limit=10&marker=xxxx
Example Responses
Status code: 200
Request succeeded.
{
"total" : 1,
"tasks" : [ {
"task_id" : "xxxx",
"secret_name" : "xxxx",
"rotation_func_urn" : "urn:fss:cn-north-4:xxxxxxxx:function:default:xxxx:xxxxx",
"task_status" : "SUCCESS",
"attempt_nums" : 3,
"operate_type" : "MULTI_USER",
"task_time" : 1715436899000
} ],
"next_marker" : "xxxxxx"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
| 400 | Invalid request parameter. |
| 401 | Username and password are required for the requested page. |
| 403 | Authentication failed. |
| 404 | The resource does not exist. |
| 500 | Internal service error. |
| 502 | Request failed. The server has received an invalid response. |
| 504 | Gateway timed out. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.