Help Center/ GaussDB/ API Reference/ APIs (Recommended)/ SQL Throttling/ Querying SQL Throttling Tasks Based on Specified Criteria (v3.1)
Updated on 2025-10-20 GMT+08:00

Querying SQL Throttling Tasks Based on Specified Criteria (v3.1)

Function

This API is used to query throttling tasks based on specified criteria. Before calling this API:

Debugging

You can debug this API in API Explorer.

URI

POST /v3.1/{project_id}/instances/{instance_id}/limit-task-list

Table 1 Parameter description

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

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID, which uniquely identifies an instance.

Constraints

N/A

Range

The value can contain 36 characters. Only letters and digits are allowed.

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token.

You can obtain the token by calling the IAM API used to obtain a user token.

The value of X-Subject-Token in the response header is the token value.

Constraints

N/A

Range

N/A

Default Value

N/A

X-Language

No

String

Definition

Language.

Constraints

N/A

Range

  • zh-cn
  • en-us

Default Value

en-us

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

task_scope

No

String

Definition

Throttling task scope.

Constraints

N/A

Range

The value can be SQL or SESSION.

Default Value

N/A

limit_type

No

String

Definition

Throttling type.

Constraints

N/A

Range

The value can be SQL_ID, SQL_TYPE, or SESSION_ACTIVE_MAX_COUNT.

Default Value

N/A

limit_type_value

No

String

Definition

Throttling type value. Fuzzy match is supported.

Constraints

N/A

Range

The value can contain 1 to 19 characters, including only letters, digits, and underscores (_).

Default Value

N/A

task_name

No

String

Definition

Throttling task name. Fuzzy match is supported.

Constraints

N/A

Range

The value can contain 1 to 100 characters, including only letters, digits, hyphens (-), underscores (_), and dollar signs ($).

Default Value

N/A

rule_name

No

String

Definition

Rule name.

Constraints

N/A

Range

N/A

Default Value

N/A

offset

Yes

Integer

Definition

Index offset. The query starts from the next piece of data indexed by this parameter.

Constraints

N/A

Range

0–10000

Default Value

0: The query starts from the first data record.

limit

Yes

Integer

Definition

Number of records returned by a query.

Constraints

N/A

Range

The value must be a positive integer ranging from 1 to 100.

Default Value

10

sql_id

No

String

Definition

SQL ID of a throttling task.

Constraints

N/A

Range

The value can be a positive integer consisting of 1 to 19 digits. The first digit cannot be 0.

Default Value

N/A

node_ids

No

Array of String

Definition

Node IDs for the throttling tasks.

Constraints

N/A

Response Parameters

Table 4 Response body parameters

Parameter

Type

Description

limit_task_list

Array of objects

Definition

Throttling tasks. For details, see Table 5.

limit

Integer

Definition

Number of records returned by a query.

Range

N/A

offset

Integer

Definition

Index offset.

Range

N/A

total_count

Integer

Definition

Total number.

Range

N/A

Table 5 ListLimitTaskResponseResult

Parameter

Type

Description

task_id

String

Definition

Throttling task ID.

Range

N/A

task_scope

String

Definition

Throttling task scope.

Range

N/A

limit_type

String

Definition

Throttling task type.

Range

N/A

limit_type_value

String

Definition

Throttling task type value.

Range

N/A

task_name

String

Definition

Throttling task name.

Range

N/A

databases

String

Definition

Database group on a CN node.

Range

Database strings must be separated by commas (,).

key_words

String

Definition

Keyword.

Range

N/A

status

String

Definition

Throttling task status.

Range

The value can be CREATING, UPDATING, DELETING, WAIT_EXECUTE, EXECUTING, TIME_OVER, DELETED, CREATE_FAILED, UPDATE_FAILED, DELETE_FAILED, EXCEPTION, or NODE_SHUT_DOWN.

instance_id

AnyType

Definition

Instance ID.

Range

N/A

rule_name

String

Definition

Rule name.

Range

N/A

parallel_size

Integer

Definition

Maximum concurrency.

Range

N/A

start_time

String

Definition

Throttling task start time.

Range

The time format must be yyyy-mm-ddThh:mm:ssZ. The current time is the UTC time.

end_time

String

Definition

Throttling task end time.

Range

The time format must be yyyy-mm-ddThh:mm:ssZ. The current time is the UTC time.

cpu_utilization

Integer

Definition

CPU usage. A value is assigned only when limit_type is set to SESSION_ACTIVE_MAX_COUNT.

Range

N/A

memory_utilization

Integer

Definition

Memory usage. A value is assigned only when limit_type is set to SESSION_ACTIVE_MAX_COUNT.

Range

N/A

Example Request

Querying throttling tasks based on specified criteria

POST https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3.1/0611f1bd8b00d5d32f17c017f15b599f/instances/3d39c18788b54a919bab633874c159dfin14/limit-task-list
{ 
  "limit_type" : "SQL_ID", 
  "offset" : 1, 
  "limit" : 10, 
  "node_ids" : [ "cf521ccca2d74c9e89569a9828b6adcbno14" ] 
}

Example Response

{ 
  "limit_task_list" : [ { 
    "task_id" : "59b6a1a278844ac48119d86512e0000", 
    "task_scope" : "SQL", 
    "limit_type" : "SQL_ID", 
    "status" : "creating", 
    "key_words" : null, 
    "instance_id" : "39b6a1a278844ac48119d86512e0000bin06", 
    "parallel_size" : 100, 
    "rule_name" : "dsa48119d86512e0000bin066a1a27", 
    "databases" : "test1", 
    "task_name" : "test1", 
    "start_time" : "2023-12-30T02:00:00Z", 
    "end_time" : "2023-12-30T02:00:00Z", 
    "cpu_utilization" : null, 
    "memory_utilization" : null
  } ], 
  "total_count" : 1, 
  "limit" : 10, 
  "offset" : 1 
}

Status Codes

Error Codes

For details, see Error Codes.