Help Center/ Data Admin Service/ API Reference/ APIs (in OBT)/ Intelligent O&M/ Generating Keywords of a SQL Throttling Rule Based On the Original SQL Statement
Updated on 2025-05-19 GMT+08:00

Generating Keywords of a SQL Throttling Rule Based On the Original SQL Statement

Function

This API is used to generate keywords of a SQL throttling rule based on the original SQL statement. Currently, MySQL, MariaDB, and TaurusDB are supported.

Precautions

The SQL throttling keywords generated based on the original SQL statement are for reference only. When creating a SQL throttling rule, compare the original SQL statement with the SQL throttling keywords.

URI

POST /v3/{project_id}/instances/{instance_id}/sql-limit/parse

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Explanation:

Project ID of a tenant in a region

To obtain this value, see Obtaining a Project ID.

Constraints:

N/A

Values:

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

Default value:

N/A

instance_id

Yes

String

Explanation:

Unique ID of an instance

Constraints:

N/A

Values:

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

Default value:

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

datastore_type

Yes

String

Explanation:

Database type

Constraints:

Currently, only MySQL, MariaDB, and TaurusDB are supported.

Values:

  • MySQL
  • MariaDB
  • TaurusDB

Default value:

N/A

original_sql

Yes

String

Explanation:

Original SQL statement

Constraints:

Enter a valid SQL statement.

Values:

Minimum length: 1 character

Maximum length: 1024 characters

Default value:

N/A

use_template

Yes

Boolean

Explanation:

Whether SQL statements need to be verified

Constraints:

N/A

Values:

  • true
  • false

Default value:

N/A

keep_operators

Yes

Boolean

Explanation:

Whether operators need to be retained

Constraints:

N/A

Values:

  • true
  • false

Default value:

N/A

Response Parameters

Status code: 200

Table 3 Response body parameter

Parameter

Type

Description

rule

String

Explanation:

SQL throttling keyword

Values:

N/A

Example Request

Generating Keywords of a SQL throttling rule based on the original SQL statement

https://das.cn-north-1.myhuaweicloud.com/v3/054c630ff780d4cc2f40c00d7f6fb21d/instances/da304cd5bbb944de828759bc7be3d3fein01/sql-limit/parse 

{ 
  "datastore_type" : "MySQL", 
  "original_sql" : "select * from das_conn_info", 
  "use_template" : true, 
  "keep_operators" : true 
}

Example Response

Status code: 200

The generated keywords are returned.

{ 
  "rule" : "select~from~das_conn_info" 
}

Status Codes

Status Code

Description

200

The generated keywords are returned.

Error Codes

See Error Codes.