Help Center/ GaussDB/ API Reference/ APIs (Recommended)/ SQL Throttling/ Modifying a SQL Throttling Task (v3.1)
Updated on 2025-12-26 GMT+08:00

Modifying a SQL Throttling Task (v3.1)

Function

This API is used to update a throttling task based on the new conditions. Before calling this API:

Debugging

You can debug this API in API Explorer.

URI

PUT /v3.1/{project_id}/instances/{instance_id}/limit-task/{task_id}

Table 1 URI parameters

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

task_id

Yes

String

Definition

Throttling task ID.

Constraints

N/A

Range

N/A

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.

After a response is returned, the value of X-Subject-Token in the response header is the token.

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

start_time

No

String

Definition

Task start time. If the value is earlier than the current time, the time obtained by subtracting two minutes from the current time is used.

Constraints

N/A

Range

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

Default Value

N/A

end_time

No

String

Definition

Task end time.

Constraints

N/A

Range

The value must be later than the task start time. The format must be yyyy-mm-ddThh:mm:ssZ. The current time is the UTC time.

Default Value

N/A

key_words

No

String

Definition

Keyword.

Constraints

This parameter is optional only when limit_type is set to SQL_TYPE.

Range

A maximum of 100 keywords are allowed. Multiple keywords can be separated by commas (,). Each keyword can contain up to 64 characters.

Default Value

N/A

parallel_size

No

Integer

Definition

Maximum concurrency.

Constraints

N/A

Range

An integer greater than or equal to 0.

Default Value

N/A

task_name

No

String

Definition

Throttling task name.

Constraints

N/A

Range

Only letters, underscores (_), digits, and dollar signs ($) are allowed.

Default Value

N/A

cpu_utilization

No

Integer

Definition

CPU usage threshold.

Constraints

If limit_type is set to SESSION_ACTIVE_MAX_COUNT, at least one of this parameter or memory_utilization must be specified.

Range

The value is an integer in the range [0,100).

Default Value

N/A

memory_utilization

No

Integer

Definition

Memory usage threshold.

Constraints

If limit_type is set to SESSION_ACTIVE_MAX_COUNT, at least one of this parameter or cpu_utilization must be specified.

Range

The value is an integer in the range [0,100).

Default Value

N/A

databases

No

String

Definition

Database group on a CN node.

Constraints

N/A

Range

Database strings must be separated by commas (,).

Default Value

N/A

node_id

Yes

String

Definition

ID of the node where the throttling task is executed.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Table 4 Response body parameters

Parameter

Type

Description

job_id

String

Definition

Job ID.

Range

N/A

Example Request

  • Modifying a throttling task whose type is SQL_ID
    PUT https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3.1/4f07d3f50ce2466a9a7c014337b36409/instances/7912cd1077b2413fbd6f39a044777537in14/limit-task/96854ba7-8d50-4a3c-8fd8-210a7390e9d1
    {
    	"task_name": "t_limit_updated",
    	"parallel_size": 3,
    	"start_time": "2025-09-18T10:23:49+0000",
    	"end_time": "2025-09-18T10:35:53+0000",
    	"node_id": "dc96ae0de3b04d7a8679406c3a21fa90no14"
    }
  • Modifying a throttling task whose type is SQL_TYPE
    PUT https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3.1/4f07d3f50ce2466a9a7c014337b36409/instances/7912cd1077b2413fbd6f39a044777537in14/limit-task/96854ba7-8d50-4a3c-8fd8-210a7390e9d1
    {
    	"task_name": "t_limit_key_word",
    	"parallel_size": 4,
    	"start_time": "2025-09-18T11:26:00+0000",
    	"end_time": "2025-09-18T12:47:03+0000",
    	"key_words": "abc,def,ghi",
    	"databases": "db_liujian,t_limit",
    	"node_id": "dc96ae0de3b04d7a8679406c3a21fa90no14"
    }
  • Modifying a throttling task whose type is SESSION_ACTIVE_MAX_COUNT
    PUT https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3.1/4f07d3f50ce2466a9a7c014337b36409/instances/7912cd1077b2413fbd6f39a044777537in14/limit-task/96854ba7-8d50-4a3c-8fd8-210a7390e9d1
    {
    	"parallel_size": 2,
    	"task_name": "t_limit_resource_updated",
    	"cpu_utilization": 17,
    	"memory_utilization": 43,
    	"node_id": "2702e57f535b4a6f8cc82d9ba52f0464no14"
    }

Example Response

{ 
  "job_id" : "d8819ac11297598d06e591b5786aab86" 
}

Status Code

Error Codes

For details, see Error Codes.