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
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
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
datastore_type |
Yes |
String |
Explanation: Database type Constraints: Currently, only MySQL, MariaDB, and TaurusDB are supported. Values:
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:
Default value: N/A |
keep_operators |
Yes |
Boolean |
Explanation: Whether operators need to be retained Constraints: N/A Values:
Default value: N/A |
Response Parameters
Status code: 200
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.
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