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.
Authorization Information
Each account has permissions to call all APIs, but IAM users must have the required permissions specifically assigned.
- If you are using role/policy-based authorization, see the required permissions in Permissions Policies and Supported Actions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
das:clouddba:createSqlLimitRules
Write
Instance
-
-
-
URI
POST /v3/{project_id}/instances/{instance_id}/sql-limit/parse
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID of a tenant in a region To obtain this 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 Unique ID of an instance Constraints N/A Range The value can contain 32 characters. Only letters and digits are allowed. Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
datastore_type |
Yes |
String |
Definition Database type Constraints Currently, only MySQL, MariaDB, and TaurusDB are supported. Range
Default Value N/A |
|
original_sql |
Yes |
String |
Definition Original SQL statement Constraints Enter a valid SQL statement. Range Minimum length: 1 character Maximum length: 1024 characters Default Value N/A |
|
use_template |
Yes |
Boolean |
Definition Whether SQL statements need to be verified Constraints N/A Range
Default Value N/A |
|
keep_operators |
Yes |
Boolean |
Definition Whether operators need to be retained Constraints N/A Range
Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
rule |
String |
Definition SQL throttling keyword Range N/A |
Example Requests
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 Responses
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot