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-12-04 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, MySQL, MariaDB, and TaurusDB 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.

Enumerated values:

  • zh-cn
  • en-us

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

datastore_type

Yes

String

Database type, which can be MySQL, MariaDB, and TaurusDB

Enumerated values:

  • MySQL
  • MariaDB
  • TaurusDB

original_sql

Yes

String

Original SQL Statement.

Minimum length: 1 character

Maximum length: 1024 characters

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 Request

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 Response

Status code: 200

Return of generating SQL concurrency control keywords

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

Status Codes

Status Code

Description

200

Return of generating SQL concurrency control keywords.

Error Codes

For details, see Error Codes.