Updated on 2024-11-15 GMT+08:00

Querying SQL Throttling Tasks

Function

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

URI

GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/limit-task-list

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Explanation:

Project ID of a tenant in a region.

For details about how to obtain the value, see Obtaining a Project ID.

Restrictions:

None

Value range:

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

Default value:

None

instance_id

Yes

Instance ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

task_scope

No

String

Throttling task scope. Currently, SQL and SESSION are supported.

limit_type

No

String

Throttling type. The value can be SQL_ID, SQL_TYPE, or SESSION_ACTIVE_MAX_COUNT.

limit_type_value

No

String

Throttling type value. Fuzzy match is supported.

task_name

No

String

Throttling task name. Fuzzy match is supported.

sql_model

No

String

SQL template. Fuzzy match is supported.

rule_name

No

String

Rule name.

start_time

No

String

Start time of the throttling task in the format of yyyy-mm-ddThh:mm:ssZ (UTC time).

end_time

No

String

End time of the throttling task in the format of yyyy-mm-ddThh:mm:ssZ (UTC time).

offset

No

Integer

Index offset. If offset is set to N, the resource query starts from the N+1 data entry. The default value is 0, indicating that the query starts from the first data entry. The value cannot be a negative number.

Value range: 0 to 10000

limit

No

Integer

Number of records to be queried. The default value is 10. The value cannot be a negative number. The minimum value is 1 and the maximum value is 100.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

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

After the request is processed, the value of X-Subject-Token in the message header is the token value.

X-Language

No

String

Language.

Default value: en-us

Value range:

  • zh-cn
  • en-us

Response Parameters

Table 4 Response body parameters

Parameter

Type

Description

limit_task_list

Array of objects

Throttling task information in the list. For details, see Table 5.

limit

Integer

Number of records to be queried.

offset

Integer

Index offset.

total_count

Integer

Total number of throttling tasks.

Table 5 ListLimitTaskResponseResult

Parameter

Type

Description

task_id

String

Throttling task ID.

task_scope

String

Throttling task scope.

limit_type

String

Throttling task type.

limit_type_value

String

Throttling task type value.

task_name

String

Throttling task name.

databases

String

Databases of the instance. Databases are separated by commas (,).

sql_model

String

SQL template. This parameter is returned only when the task type is SQL_ID.

key_words

String

Keyword. This parameter is returned only when the task type is SQL_TYPE.

status

String

Throttling task status. 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

String

Instance ID.

rule_name

String

Rule name.

parallel_size

Integer

Maximum concurrency.

start_time

String

Start time of the throttling task in the format of yyyy-mm-ddThh:mm:ss+0000 (UTC time).

end_time

String

End time of the throttling task in the format of yyyy-mm-ddThh:mm:ss+0000 (UTC time).

cpu_utilization

Integer

CPU usage. This parameter is returned only when the task type is SESSION_ACTIVE_MAX_COUNT.

memory_utilization

Integer

Memory usage. This parameter is returned only when the task type is SESSION_ACTIVE_MAX_COUNT.

created

String

Creation time in the format of yyyy-mm-ddThh:mm:ssZ (UTC time).

updated

String

Update time in the format of yyyy-mm-ddThh:mm:ssZ (UTC time).

creator

String

Creator.

modifier

String

Modifier.

node_infos

Array of objects

CN information. For details, see Table 6.

Table 6 ShowLimitTaskNodeOption

Parameter

Type

Description

node_id

String

Node ID.

sql_id

String

ID of the SQL statement executed on the node.

Example Request

https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0611f1bd8b00d5d32f17c017f15b599f/instances/3d39c18788b54a919bab633874c159dfin14/limit-task-list?offset=1&limit=10&limit_type=SQL_ID&task_name=test

Example Response

{
   "limit_task_list" : [ {
     "task_id" : "59b6a1a278844ac48119d86512e0000",
     "task_scope" : "SQL",
     "limit_type" : "SQL_ID",
     "limit_type_value" : 2348983611,
     "sql_model" : "select * from table where id = {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",
     "created" : "2023-12-28T01:55:08Z,",
     "updated" : "2023-12-28T01:55:08Z,",
     "creator" : "test,",
     "modifier" : "null,",
     "cpu_utilization" : null,
     "memory_utilization" : null,
     "node_infos" : [ {
         "node_id" : "cf521ccca2d74c9e89569a9828b6adcbno14",
         "sql_id" : 2348983611
         } ]
      } ],
    "total_count" : 1,
    "limit" : 10,
    "offset" : 1
}

Status Code

Error Code

For details, see Error Codes.