Help Center/ TaurusDB/ API Reference/ APIs (Recommended)/ Instance Management/ Querying Whether an Instance Has Scheduled Tasks of the Same Type
Updated on 2026-06-12 GMT+08:00

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.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependency

    gaussdbformysql:instance:getScheduleTask

    Read

    instance *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    gaussdb:instance:list

    -

URI

POST /v3/{project_id}/instances/{instance_id}/schedule-tasks/exist

Table 1 URI parameters

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

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Language

No

String

Definition

Request language type.

Constraints

N/A

Range

  • en-us

  • zh-cn

Default Value

en-us

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

schedule_type

Yes

String

Definition

Type of a scheduled task.

Constraints

N/A

Range

  • PROXY_VERSION_UPGRADE: upgrading the minor version of a proxy instance

  • VERSION_UPGRADE: upgrading the minor version of a DB instance

  • RESIZE_FLAVOR: changing instance specifications

  • REBOOT_NODE: rebooting a node

  • REBOOT_INSTANCE: rebooting a DB instance

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

Table 4 Response body parameters

Parameter

Type

Description

exist

Boolean

Definition

Whether the scheduled task type exists.

Range

  • true: The specified scheduled task type already exists.

  • false: The specified scheduled task type does not exist.

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

Table 5 ScheduledTaskV3

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

  • NORMAL: The instance is normal.

  • BACKING_UP: The instance is being backed up.

  • MODIFYING: The instance is being modified.

  • REBUILDING: The instance is being rebuilt.

  • RESTORING: The instance is being restored.

  • FROZEN: The instance is frozen.

  • FAILED: The instance is abnormal.

  • DELETING: The instance is being deleted.

  • CREATE_FAILED: The instance failed to be created.

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

  • Running: The task is being executed.

  • Failed: The task failed to be executed.

  • Canceled: The task is canceled.

  • Pending: The task is waiting for execution.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

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.