Querying Whether an Instance Has Scheduled Tasks of the Same Type
Function
This API is used to check whether an instance has any scheduled tasks of the same type in the task center.
Calling Method
For details, see Calling APIs.
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 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.
URI
POST /v3/{project_id}/instances/{instance_id}/schedule-tasks/exist
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID. Constraints N/A Range The value contains 32 characters. Only letters and digits are allowed. Default Value N/A |
| instance_id | Yes | String | Definition Instance ID, which uniquely identifies an instance. To obtain this value, see Querying DB Instances. Constraints N/A Range The value contains 36 characters with a suffix of in07. Only letters and digits are allowed. Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Language | No | String | Definition Request language type. Constraints N/A Range Default Value en-us |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| schedule_type | Yes | String | Definition Type of a scheduled task. Constraints N/A Range
Default Value N/A |
| proxy_id | No | String | Definition Proxy instance ID. To obtain this value, see Querying Proxy Instances. Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| exist | Boolean | Definition Whether the scheduled task type exists. Range |
| scheduled_tasks | Array of ScheduledTaskV3 objects | Definition List of scheduled task details. When exist is true, this list contains information about existing tasks. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| create_time | Long | Definition Time when a task was created. Range N/A |
| datastore_type | String | Definition Database type. Range Only gaussdb-mysql is supported. |
| end_time | Long | Definition Task end time. Range N/A |
| instance_id | String | Definition ID of the instance associated with the task. Range N/A |
| instance_name | String | Definition Name of the instance associated with the task. Range N/A |
| instance_status | String | Definition Status of the instance associated with the task. Range |
| project_id | String | Definition Tenant project ID. Range N/A |
| proxy_id | String | Definition ID of the proxy instance used by the task. Range N/A |
| proxy_name | String | Definition Name of the proxy instance used by the task. Range N/A |
| start_time | Long | Definition Task start time. Range N/A |
| target_config | Map<String,String> | Definition Target configuration information of the task, which is stored in key-value pairs. Range N/A |
| task_id | String | Definition Task ID, which uniquely identifies a task. Range N/A |
| task_name | String | Definition Task name. Range N/A |
| task_order | Integer | Definition Task execution order. Range N/A |
| task_status | String | Definition Task status. Range |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Example Request
Checking whether an instance has any scheduled REBOOT_NODE tasks in the task center
POST https://{endpoint}/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/61a4ea66210545909d74a05c27a7179ein07/schedule-tasks/exist
{
"schedule_type" : "REBOOT_NODE"
} Example Response
Status code: 200
Success.
{
"exist" : true,
"scheduled_tasks" : [ {
"task_id" : "1d19619a68b047b08c82b2d57dfb907b",
"instance_id" : "61a4ea66210545909d74a05c27a7179ein07",
"instance_name" : null,
"instance_status" : null,
"project_id" : "619d3e78f61b4be68bc5aa0b59edcf7b",
"task_name" : "REBOOT_NODE",
"create_time" : 1779955044142,
"start_time" : 1779991200000,
"end_time" : 1780005600000,
"task_order" : null,
"task_status" : "Pending",
"datastore_type" : null,
"target_config" : null,
"proxy_id" : null,
"proxy_name" : null
} ]
} Status Code
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