Help Center/ Cloud Operations Center/ API Reference/ API/ Scheduled O&M/ Querying Historical Scheduled O&M Records
Updated on 2025-10-24 GMT+08:00

Querying Historical Scheduled O&M Records

Function

This API is used to query execution history of scheduled O&M tasks based on specified conditions.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    coc:schedule:getHistories

    Read

    schedule *

    g:EnterpriseProjectId

    -

    -

URI

GET /v1/schedule/task/history

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

task_id

Yes

String

Definition

ID of a scheduled task.

Constraints

An existing task.

Range

A string of 26 characters starting with ST.

Default Value

N/A

id

No

String

Definition

ID of the script service ticket or job service ticket associated with the scheduled task.

Constraints

ID of a service ticket that actually exists in script management or job management.

Range

N/A

Default Value

N/A

region

No

String

Definition

Region to which a scheduled task belongs.

Constraints

N/A

Range

N/A

Default Value

N/A

status

No

String

Definition

Execution status of a scheduled task.

Constraints

N/A

Range

The value can be READY, PROCESSING, ABNORMAL, PAUSED, CANCELED, and FINISHED.

Default Value

N/A

started_start_time

No

Long

Definition

Start timestamp of the query interval for the execution start time of the scheduled task.

Constraints

N/A

Range

Milliseconds-level UTC timestamp.

Default Value

N/A

started_end_time

No

Long

Definition

End timestamp of the query interval for the execution start time of the scheduled task.

Constraints

N/A

Range

Milliseconds-level UTC timestamp.

Default Value

N/A

finished_start_time

No

Long

Definition

Start timestamp of the query interval for the execution end time of the task.

Constraints

N/A

Range

Milliseconds-level UTC timestamp.

Default Value

N/A

finished_end_time

No

Long

Definition

End timestamp of the query interval for the execution end time of the task.

Constraints

N/A

Range

Milliseconds-level UTC timestamp.

Default Value

N/A

marker

No

String

Definition

Used for pagination query.

Constraints

ID of the last record on the previous page.

Range

N/A

Default Value

N/A

offset

No

Integer

Definition

Offset pointers queried by page.

Constraints

N/A

Range

N/A

Default Value

N/A

limit

Yes

Integer

Definition

Number of queried results, by page.

Constraints

N/A

Range

N/A

Default Value

N/A

sort_key

No

String

Definition

Name of the field to be sorted.

Constraints

N/A

Range

  • create_time: time when the scheduled task is created.

  • update_time: time when the scheduled task is updated.

  • started_time: time when the scheduled task starts to be executed.

  • finished_time: time when the scheduled task execution ends.

Default Value

N/A

sort_dir

No

String

Definition

Sorting method, which is used together with sort_key.

Constraints

N/A

Range

  • asc: ascending order.

  • desc: descending order.

Default Value

desc

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

count

Long

Definition

Total number of scheduled task historical execution records.

Range

N/A

next_maker

String

Definition

Pagination marker.

Range

N/A

scheduled_task_history_list

Array of ScheduledTaskHistory objects

Definition

Scheduled task historical execution records.

Range

For details, see the constraints on the value of ScheduledTaskHistory.

Table 3 ScheduledTaskHistory

Parameter

Type

Description

id

String

Definition

ID of the scheduled task historical execution record.

Range

N/A

task_type

String

Definition

Type of the task associated with a scheduled task.

Range

  • SCRIPT: script

  • RUNBOOK: job

execution_id

String

Definition

ID of the service ticket associated with a scheduled task.

Range

N/A

associated_task_name

String

Definition

Name of the task associated with a scheduled task.

Range

N/A

associated_task_name_en

String

Definition

Name of the task associated with a scheduled task.

Range

N/A

region

String

Definition

Region where the instance resource associated with the scheduled task is located.

Range

N/A

created_by

String

Definition

IAM user ID of the creator of a scheduled task.

Range

N/A

started_time

Long

Definition

Timestamp of the scheduled task start execution.

Range

N/A

finished_time

Long

Definition

Timestamp of the scheduled task end execution.

Range

N/A

status

String

Definition

Execution status of a scheduled task.

Range

The value can be READY, PROCESSING, ABNORMAL, PAUSED, CANCELED, and FINISHED.

execution_msg

String

Definition

Description of the scheduled task execution result.

Range

N/A

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Result code.

Range

N/A

error_msg

String

Definition

Error description.

Range

N/A

Example Requests

Query the first 10 successful execution records by task ID. The results are displayed in descending order by start time.

GET /v1/schedule/task/history?task_id=ST****&limit=10&offset=0&sort_key=started_time&sort_dir=desc&status=FINISHED

Example Responses

Status code: 200

Request result is returned.

{
  "count" : 1,
  "next_maker" : "****",
  "scheduled_task_history_list" : [ {
    "associated_task_name" : "****",
    "created_by" : "****",
    "execution_id" : "SC****",
    "finished_time" : 1745659982000,
    "id" : "****",
    "region" : "***",
    "started_time" : 1745659970000,
    "status" : "FINISHED",
    "task_type" : "SCRIPT"
  } ]
}

Status Codes

Status Code

Description

200

Request result is returned.

400

The server failed to process the request is returned.

Error Codes

See Error Codes.