Updated on 2025-08-28 GMT+08:00

Querying the Task List

Function

Query the task list.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/csms/tasks

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

secret_name

No

String

Secret name

status

No

String

Task status. The value can be:

  • SUCCESS: Task rotated.

  • FAILED: Task rotation failed.

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

Table 3 Response body parameters

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).

Table 4 SecretTask

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

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error codes

error_msg

String

Error description

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error codes

error_msg

String

Error description

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error codes

error_msg

String

Error description

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error codes

error_msg

String

Error description

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error codes

error_msg

String

Error description

Status code: 502

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error codes

error_msg

String

Error description

Status code: 504

Table 11 Response body parameters

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.