Querying Scheduled Tasks
Function
This API is used to query scheduled tasks.
- Before calling this API, learn how to authenticate it.
- Before calling this API, learn about request header parameters.
URI
- URI format
    GET /v3/{project_id}/schedule-tasks?offset={offset}&limit={limit}&instance_name={instance_name}&instance_id={instance_id}&status={status}&start_time={start_time}&end_time={end_time} 
- Parameter description 
    Table 1 Parameters Parameter Mandatory Type Description project_id Yes String Definition Project ID of a tenant in a region. To obtain the value, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A offset No Integer Definition Index offset. Constraints N/A Range The query starts from the next piece of data indexed by this parameter. The value must be a number and cannot be a negative number. Default Value 0: The query starts from the first data record. limit No Integer Definition Number of records returned by a query. Constraints N/A Range The value must be a positive integer ranging from 1 to 50. Default Value 10 instance_id No String Definition Instance ID, which can be used for filtering. Constraints N/A Range N/A Default Value N/A instance_name No String Definition Instance name, which can be used for filtering. Constraints N/A Range N/A Default Value N/A status No String Definition Task status, which can be used for filtering. Constraints N/A Range - Initing: The task is being initialized.
- Pending: The task is pending.
- Running: The task is running.
- Completed: The task is complete.
- Failed: The task failed.
- Unauthorized: The task is unauthorized.
- Canceled: The task is canceled.
 Default Value N/A start_time No String Definition Task start time. Constraints If start_time is specified, end_time is mandatory. The value is in the UTC timestamp format. Range N/A Default Value N/A end_time No String Definition Task end time. Constraints If start_time is specified, end_time is mandatory. The value is in the UTC timestamp format. Range N/A Default Value N/A 
Request
None
Example Request
GET https://{Endpoint}/v3/54623db08b174c858ba779d2aa7923a3/schedule-tasks?offset=1&limit=3&instance_id=43e4feaab48f11e89039fa163ebaa7e4in04&instance_name=sqlserver_instance&start_time=1747919701390&end_time=1748524501390
 Response
- Normal response 
    Table 2 Parameters Parameter Type Description schedule_tasks Array of objects Definition Scheduled task list. For details, see Table 3. total_count Integer Definition Total number of tasks. Range N/A Table 3 schedule_tasks field description Parameter Type Description id String Definition Task ID. Range N/A name String Definition Task name. Range N/A instance_id String Definition Instance ID. Range N/A instance_name String Definition Instance name. Range N/A instance_status String Definition Instance status. Range - BUILD: The instance is being created.
- CREATE FAIL: The instance failed to be created.
- ACTIVE: The instance is normal.
- FAILED: The instance is abnormal.
- FROZEN: The instance is frozen.
- MODIFYING: The instance is being scaled up.
- REBOOTING: The instance is being rebooted.
- RESTORING: The instance is being restored.
- MODIFYING INSTANCE TYPE: The instance is being changed to primary/standby.
- SWITCHOVER: A primary/standby switchover is being performed.
- MIGRATING: The instance is being migrated.
- BACKING UP: The instance is being backed up.
- MODIFYING DATABASE PORT: The database port is being changed.
- STORAGE FULL: The instance storage is full.
 project_id String Definition Project ID. Range N/A create_time String Definition Task creation time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800. Range N/A start_time String Definition Planned task start time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800. Range N/A end_time String Definition Planned task end time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800. Range N/A order String Definition Task priority. Range An integer ranging from 1 to 100. A smaller value indicates a higher priority. status String Definition Task status. Range - Initing: The task is being initialized.
- Pending: The task is pending.
- Running: The task is running.
- Completed: The task is complete.
- Failed: The task failed.
- Unauthorized: The task is unauthorized.
- Canceled: The task is canceled.
- Deleted: The task is deleted.
 datastore_type String Definition Database type. Range N/A volume_type String Definition Storage type. Range N/A target_config object Definition Target configuration. For details, see Table 4. Table 4 target_config Parameter Type Description flavor String Definition Instance class. Range If name is set to RESIZE_FLAVOR, this parameter indicates the target instance class. cpu String Definition Instance vCPUs. Range If name is set to RESIZE_FLAVOR, this parameter indicates the target vCPUs. mem String Definition Instance memory. Range If name is set to RESIZE_FLAVOR, this parameter indicates the target memory. 
- Example normal response
    { "schedule_tasks" : [ { "id" : "5ed6a9e95f2747f7bac1b5899ddd1316", "instance_id" : "3d2929b2c7ea4fe9bd27f21061d037ccin01", "instance_name" : "rds-zfs-test-56-44", "instance_status" : "ACTIVE", "project_id" : "54623db08b174c858ba779d2aa7923a3", "name" : "RESIZE_FLAVOR", "create_time" : "2020-07-15T07:46:10+0000", "start_time" : "2020-07-15T08:46:10+0000", "end_time" : "2020-07-15T09:46:10+0000", "order" : "1", "status" : "Canceled", "datastore_type" : "mysql", "target_config" : { "flavor" : "rds.mysql.n1.xlarge.2", "mem" : "8", "cpu" : "4" }, "volume_type" : "CLOUDSSD" } ], "total_count" : 1 }
- Abnormal response
    For details, see Abnormal Request Results. 
Status Code
- Normal
- Abnormal
    For details, see Status Codes. 
Error Code
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot 
    