Reviewed-by: Gladkov, Maksim <mgladkov@noreply.gitea.eco.tsi-dev.otc-service.com> Co-authored-by: wangdengke2 <wangdengke2@huawei.com> Co-committed-by: wangdengke2 <wangdengke2@huawei.com>
19 KiB
Querying SQL Throttling Rule
Function
This API is used to query SQL throttling rules.
- Before calling an API, you need to understand the API in Authentication.
- Before calling this API, obtain the required region and endpoint.
URI
- URI format
GET https://{endpoint}/v3/{project_id}/instances/{instance_id}/sql-limit?db_name={db_name}&offset={offset}&limit={limit}
- Parameter description
Table 1 Parameters Parameter
Mandatory
Type
Description
project_id
Yes
String
Specifies the project ID of a tenant in a region.
For details about how to obtain the project ID, see Obtaining a Project ID.
instance_id
Yes
String
Instance ID.
db_name
Yes
String
Database name. For example: "postgres".
offset
No
Integer
Index offset. If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value must be a number but cannot be a negative number.
limit
No
Integer
Number of query records. The default value is 10. The value must be a positive integer. The minimum value is 1 and the maximum value is 100.
Request
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
X-Auth-Token |
Yes |
String |
Specifies the user token. The user token is a response to the API used to obtain a user token. |
Example Request
GET https://rds.eu-de.otc.t-systems.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/49b9dd1d6f464ba4bc91df5cbd2e52ebin03/sql-limit?db_name=postgres&offset=0&limit=10
Response
- Normal response
Table 3 Parameters Parameter
Type
Description
count
Integer
Number of SQL throttling rules.
sql_limit_objects
Array of objects
SQL throttling rule details.
For details, see Table 4.
Table 4 sql_limit_objects field data structure description Parameter
Type
Description
id
String
SQL throttling rule ID.
query_id
String
Internal hash code calculated by the SQL parse tree. The default value is 0. The value range is from -9223372036854775808 to 9223372036854775807.
query_string
String
Text format of an SQL statement.
max_concurrency
Integer
Number of SQL statements that can be executed at the same time. If the value is less than or equal to 0, the number is not limited. The default value is 0. The value range is from -1 to 50000.
is_effective
Boolean
Wether the rule is effective.
max_waiting
Integer
Maximum waiting time, in seconds.
search_path
String
Schema search order set for names that are not schema-qualified. The default value is public.
- Example normal response
{ "count": 2, "sql_limit_objects": [ { "id": "3", "query_id": "1147616880456321454", "query_string": "select 1;", "max_concurrency": 10, "is_effective": false, "max_waiting": 10, "search_path": "public" }, { "id": "4", "query_id": "-7472493489976133824", "query_string": "select * from pg_type;", "max_concurrency": 10, "is_effective": false, "max_waiting": 10, "search_path": "public" } ] } - Abnormal response
For details, see Abnormal Request Results.
Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Code
For details, see Error Codes.