Updated on 2024-11-07 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/{task_id}

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

task_id

Yes

Throttling task ID.

instance_id

Yes

Instance ID.

Request Parameters

Table 2 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 3 Response body parameters

Parameter

Type

Description

task_name

String

Throttling task name.

limit_type

String

Throttling task type.

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).

limit_count

Integer

Throttling times.

task_running_time

Integer

Running duration of a throttling task.

memory_utilization

Integer

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

cpu_utilization

Integer

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

rule_name

String

Rule name.

limit_task_rule_info_list

Array of objects

Nodes of throttling tasks. For details, see Table 4.

Table 4 LimitTaskRuleInfoList

Parameter

Type

Description

node_id

String

Node ID.

rule_id

String

Throttling task ID.

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.

Example Request

https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0611f1bd8b00d5d32f17c017f15b599f/instances/3d39c18788b54a919bab633874c159dfin14/limit-task/96854ba7-8d50-4a3c-8fd8-210a7390e9d1

Example Response

  • Throttling tasks whose type is SQL_ID queried.
    {
        "task_name": "123",
        "limit_type": "SQL_ID",
        "parallel_size": 0,
        "start_time": "2024-08-19T07:12:31Z",
        "end_time": "2024-09-30T07:10:59Z",
        "limit_count": 1,
        "task_running_time": 16258,
        "rule_name": "bca08a79-8557-42c2-ab73-09a14d178c57",
        "limit_task_rule_info_list": [
            {
                "node_id": "e37a7df4ec694a3cbfeae1aee583d70fno14",
                "rule_id": "2",
                "status": "EXCUTING"
            }
        ]
    }
  • Throttling tasks whose type is SQL_TYPE queried.
    {
        "task_name": "123",
        "limit_type": "SQL_TYPE",
        "parallel_size": 0,
        "start_time": "2024-08-20T06:54:42Z",
        "end_time": "2024-09-09T06:53:43Z",
        "limit_count": 0,
        "task_running_time": 0,
        "rule_name": "476faedc-0583-4327-9f48-91fa1703e910",
        "limit_task_rule_info_list": [
            {
                "node_id": "e37a7df4ec694a3cbfeae1aee583d70fno14",
                "rule_id": "1",
                "status": "WAIT_EXCUTE"
            }
        ]
    }
  • Throttling tasks whose type is SESSION_ACTIVE_MAX_COUNT queried.
    {
        "task_name": "89",
        "limit_type": "SESSION_ACTIVE_MAX_COUNT",
        "parallel_size": 0,
        "limit_count": 0,
        "task_running_time": 16283,
        "memory_utilization": 1,
        "cpu_utilization": 0,
        "rule_name": "37b6232c-58ea-4d62-a5b5-54fc215c2115",
        "limit_task_rule_info_list": [
            {
                "node_id": "e37a7df4ec694a3cbfeae1aee583d70fno14",
                "rule_id": "3",
                "status": "EXCUTING"
            }
        ]
    }

Status Code

Error Code

For details, see Error Codes.