Help Center/ Data Admin Service/ API Reference/ APIs (in OBT)/ Cloud DBA/ Generate Keywords of a Concurrency Control Rule from the Original SQL Statement
Updated on 2024-08-05 GMT+08:00

Generate Keywords of a Concurrency Control Rule from the Original SQL Statement

Function

This API is used to generate keywords of a concurrency control rule from the original SQL statement. Currently, RDS for MySQL, RDS for MariaDB, and GaussDB(for MySQL) engines are supported.

URI

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

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

To obtain this value, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

X-Auth-Token

Yes

String

User token.

X-Language

No

String

Language.

Values:

  • zh-cn
  • en-us

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

datastore_type

Yes

String

Database type. Currently, RDS for MySQL, RDS for MariaDB, and GaussDB(for MySQL) are supported.

Values:

  • MySQL
  • MariaDB
  • GaussDB(for MySQL)

original_sql

Yes

String

Original SQL Statement.

Minimum length: 1

Maximum length: 1024

use_template

Yes

Boolean

Indicates whether to verify SQL statements.

keep_operators

Yes

Boolean

Whether to retain operators.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

rule

String

SQL concurrency control keyword.

Example Requests

Generating keywords of a concurrency control rule from 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

Return of generating SQL concurrency control keywords

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

Status Code

Status Code

Description

200

Return of generating SQL concurrency control keywords.

Error Code

For details, see Error Codes.