diff --git a/api-ref/source/apis_recommended/index.rst b/api-ref/source/apis_recommended/index.rst index 6600034..f93a766 100644 --- a/api-ref/source/apis_recommended/index.rst +++ b/api-ref/source/apis_recommended/index.rst @@ -14,6 +14,7 @@ APIs (Recommended) - :ref:`Database Proxy ` - :ref:`Log Management ` - :ref:`Tag Management ` +- :ref:`SQL Statement Concurrency Control ` - :ref:`Task Center ` .. toctree:: @@ -29,4 +30,5 @@ APIs (Recommended) database_proxy/index log_management/index tag_management/index + sql_statement_concurrency_control/index task_center/index diff --git a/api-ref/source/apis_recommended/managing_db_instances/changing_a_database_port.rst b/api-ref/source/apis_recommended/managing_db_instances/changing_a_database_port.rst new file mode 100644 index 0000000..a0935b5 --- /dev/null +++ b/api-ref/source/apis_recommended/managing_db_instances/changing_a_database_port.rst @@ -0,0 +1,119 @@ +:original_name: UpdateGaussMySqlInstancePort.html + +.. _UpdateGaussMySqlInstancePort: + +Changing a Database Port +======================== + +Function +-------- + +This API is used to change the database port of a DB instance. Before calling this API: + +- Learn how to :ref:`authorize and authenticate ` it. +- Obtain the required :ref:`region and endpoint `. + +URI +--- + +PUT /v3/{project_id}/instances/{instance_id}/port + +.. table:: **Table 1** URI parameters + + =========== ========= ====== ===================================== + Parameter Mandatory Type Description + =========== ========= ====== ===================================== + project_id Yes String Project ID of a tenant in a region. + instance_id Yes String Instance ID of a tenant in a project. + =========== ========= ====== ===================================== + +Request Parameters +------------------ + +.. table:: **Table 2** Request header parameters + + ============ ========= ====== =========== + Parameter Mandatory Type Description + ============ ========= ====== =========== + X-Auth-Token Yes String User token. + X-Language No String Language. + ============ ========= ====== =========== + +.. table:: **Table 3** Request body parameters + + +-----------------+-----------------+-----------------+--------------------------------------------------------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +=================+=================+=================+============================================================================================+ + | port | Yes | Integer | Port number. | + | | | | | + | | | | Value range: 1024 to 65535, excluding 5342 to 5345, 12017, 20000, 20201, 20202, and 33062. | + +-----------------+-----------------+-----------------+--------------------------------------------------------------------------------------------+ + +Response Parameters +------------------- + +**Status code: 200** + +.. table:: **Table 4** Response body parameter + + ========= ====== =========== + Parameter Type Description + ========= ====== =========== + job_id String Task ID. + ========= ====== =========== + +**Status code: 400** + +.. table:: **Table 5** Response body parameter + + ========== ====== ============== + Parameter Type Description + ========== ====== ============== + error_code String Error code. + error_msg String Error message. + ========== ====== ============== + +**Status code: 500** + +.. table:: **Table 6** Response body parameter + + ========== ====== ============== + Parameter Type Description + ========== ====== ============== + error_code String Error code. + error_msg String Error message. + ========== ====== ============== + +Example Request +--------------- + +.. code-block:: text + + PUT https://gaussdb-mysql.eu-de.otc.t-systems.com/v3/056538411200d4cd2f79c003c7606412/instances/096c0fc43e804757b59946b80dc27f8bin07/port + + { + "port" : 8836 + } + +Example Response +---------------- + +**Status code: 200** + +Success. + +.. code-block:: + + { + "job_id" : "e0fbbfc8-1ac4-4721-b9e9-7dd685c5bdd7" + } + +Status Code +----------- + +For details, see :ref:`Status Codes `. + +Error Code +---------- + +For details, see :ref:`Error Codes `. diff --git a/api-ref/source/apis_recommended/managing_db_instances/index.rst b/api-ref/source/apis_recommended/managing_db_instances/index.rst index 5801d8b..7cd8e94 100644 --- a/api-ref/source/apis_recommended/managing_db_instances/index.rst +++ b/api-ref/source/apis_recommended/managing_db_instances/index.rst @@ -16,6 +16,7 @@ Managing DB Instances - :ref:`Changing DB Instance Specifications ` - :ref:`Changing the Collection Period of Monitoring by Seconds ` - :ref:`Querying the Collection Period of Monitoring by Seconds ` +- :ref:`Changing a Database Port ` .. toctree:: :maxdepth: 1 @@ -32,3 +33,4 @@ Managing DB Instances changing_db_instance_specifications changing_the_collection_period_of_monitoring_by_seconds querying_the_collection_period_of_monitoring_by_seconds + changing_a_database_port diff --git a/api-ref/source/apis_recommended/sql_statement_concurrency_control/configuring_concurrency_control_rules_of_sql_statements.rst b/api-ref/source/apis_recommended/sql_statement_concurrency_control/configuring_concurrency_control_rules_of_sql_statements.rst new file mode 100644 index 0000000..a61e574 --- /dev/null +++ b/api-ref/source/apis_recommended/sql_statement_concurrency_control/configuring_concurrency_control_rules_of_sql_statements.rst @@ -0,0 +1,196 @@ +:original_name: SetSqlFilterRule.html + +.. _SetSqlFilterRule: + +Configuring Concurrency Control Rules of SQL Statements +======================================================= + +Function +-------- + +This API is used to configure concurrency control rules of SQL statements. Before calling this API: + +- Learn how to :ref:`authorize and authenticate ` it. +- Obtain the required :ref:`region and endpoint `. + +URI +--- + +PUT /v3/{project_id}/instances/{instance_id}/sql-filter/rules + +.. table:: **Table 1** URI parameters + + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +=================+=================+=================+============================================================================+ + | project_id | Yes | String | Project ID of a tenant in a region. | + | | | | | + | | | | To obtain this value, see :ref:`Obtaining a Project ID `. | + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + | instance_id | Yes | String | DB instance ID. | + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + +Request Parameters +------------------ + +.. table:: **Table 2** Request header parameters + + ============ ========= ====== =========== + Parameter Mandatory Type Description + ============ ========= ====== =========== + X-Auth-Token Yes String User token. + X-Language No String Language. + ============ ========= ====== =========== + +.. table:: **Table 3** Request body parameters + + +------------------+-----------+------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +==================+===========+==============================================================================================================================+========================================================+ + | sql_filter_rules | Yes | Array of :ref:`NodeSqlFilterRuleInfo ` objects | Concurrency control rules of SQL statements for nodes. | + +------------------+-----------+------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------+ + +.. _setsqlfilterrule__en-us_topic_0000001374871969_request_nodesqlfilterruleinfo: + +.. table:: **Table 4** NodeSqlFilterRuleInfo + + +-----------+-----------+----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +===========+===========+======================================================================================================================+=====================================================================================+ + | node_id | Yes | String | Node ID. | + +-----------+-----------+----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ + | rules | Yes | Array of :ref:`NodeSqlFilterRule ` objects | Concurrency control rules of SQL statements. The **sql_type** value must be unique. | + +-----------+-----------+----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ + +.. _setsqlfilterrule__en-us_topic_0000001374871969_request_nodesqlfilterrule: + +.. table:: **Table 5** NodeSqlFilterRule + + +-----------------+-----------------+------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +=================+=================+====================================================================================================================================+==============================================+ + | sql_type | Yes | String | SQL statement type. | + | | | | | + | | | | Valid value: | + | | | | | + | | | | - SELECT | + | | | | - UPDATE | + | | | | - DELETE | + +-----------------+-----------------+------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------+ + | patterns | Yes | Array of :ref:`NodeSqlFilterRulePattern ` objects | Concurrency control rules of SQL statements. | + +-----------------+-----------------+------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------+ + +.. _setsqlfilterrule__en-us_topic_0000001374871969_request_nodesqlfilterrulepattern: + +.. table:: **Table 6** NodeSqlFilterRulePattern + + +-----------------+-----------+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +=================+===========+=========+================================================================================================================================================================================================================================================================================+ + | pattern | Yes | String | A concurrency control rule of SQL statements. A rule can consist of up to 128 keywords. The keywords are separated by tildes (~), for example, **select~from~t1**. The rule cannot contain backslashes (\\), commas (,), or double tildes (~~). It cannot end with tildes (~). | + +-----------------+-----------+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | max_concurrency | Yes | Integer | Maximum number of concurrent SQL statements. Value: a non-negative integer. | + +-----------------+-----------+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Response Parameters +------------------- + +**Status code: 200** + +.. table:: **Table 7** Response body parameters + + +-----------+--------+-----------------------------------------------------------------------------+ + | Parameter | Type | Description | + +===========+========+=============================================================================+ + | job_id | String | ID of the task for configuring concurrency control rules of SQL statements. | + +-----------+--------+-----------------------------------------------------------------------------+ + +**Status code: 400** + +.. table:: **Table 8** Response body parameters + + ========== ====== ============== + Parameter Type Description + ========== ====== ============== + error_code String Error code. + error_msg String Error message. + ========== ====== ============== + +**Status code: 500** + +.. table:: **Table 9** Response body parameters + + ========== ====== ============== + Parameter Type Description + ========== ====== ============== + error_code String Error code. + error_msg String Error message. + ========== ====== ============== + +Example Request +--------------- + +Configuring concurrency control rules of SQL statements + +.. code-block:: + + PUT https://gaussdb-mysql.eu-de.otc.t-systems.com/v3/054e292c9880d4992f02c0196d3ea468/instance/af315b8e6aaa41799bd9a31f2de15abcin07/sql-filter/rules + { + "sql_filter_rules" : [ { + "node_id" : "c01a5645eb2c4fb6a9373542f5366e50no07", + "rules" : [ { + "sql_type" : "SELECT", + "patterns" : [ { + "pattern" : "select~from~t1", + "max_concurrency" : 0 + }, { + "pattern" : "select~from~t3~where~id", + "max_concurrency" : 10 + } ] + }, { + "sql_type" : "UPDATE", + "patterns" : [ { + "pattern" : "update~t3~where~id", + "max_concurrency" : 10 + } ] + } ] + }, { + "node_id" : "b234a5645eb2c4ji3b9372342f5362397no07", + "rules" : [ { + "sql_type" : "SELECT", + "patterns" : [ { + "pattern" : "select~from~t3~where~id", + "max_concurrency" : 10 + } ] + }, { + "sql_type" : "DELETE", + "patterns" : [ { + "pattern" : "delete~t3~where~id", + "max_concurrency" : 10 + } ] + } ] + } ] + } + +Example Response +---------------- + +**Status code: 200** + +Success. + +.. code-block:: + + { + "job_id" : "aef6a470-fb63-4d5b-b644-12ead7e019b3" + } + +Status Code +----------- + +For details, see :ref:`Status Codes `. + +Error Code +---------- + +For details, see :ref:`Error Codes `. diff --git a/api-ref/source/apis_recommended/sql_statement_concurrency_control/deleting_concurrency_control_rules_of_sql_statements.rst b/api-ref/source/apis_recommended/sql_statement_concurrency_control/deleting_concurrency_control_rules_of_sql_statements.rst new file mode 100644 index 0000000..0cf2273 --- /dev/null +++ b/api-ref/source/apis_recommended/sql_statement_concurrency_control/deleting_concurrency_control_rules_of_sql_statements.rst @@ -0,0 +1,169 @@ +:original_name: DeleteSqlFilterRule.html + +.. _DeleteSqlFilterRule: + +Deleting Concurrency Control Rules of SQL Statements +==================================================== + +Function +-------- + +This API is used to delete concurrency control rules of SQL statements. Before calling this API: + +- Learn how to :ref:`authorize and authenticate ` it. +- Obtain the required :ref:`region and endpoint `. + +URI +--- + +DELETE /v3/{project_id}/instances/{instance_id}/sql-filter/rules + +.. table:: **Table 1** URI parameters + + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +=================+=================+=================+============================================================================+ + | project_id | Yes | String | Project ID of a tenant in a region. | + | | | | | + | | | | To obtain this value, see :ref:`Obtaining a Project ID `. | + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + | instance_id | Yes | String | Instance ID. | + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + +Request Parameters +------------------ + +.. table:: **Table 2** Request header parameters + + ============ ========= ====== =========== + Parameter Mandatory Type Description + ============ ========= ====== =========== + X-Auth-Token Yes String User token. + X-Language No String Language. + ============ ========= ====== =========== + +.. table:: **Table 3** Request body parameters + + +------------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +==================+===========+=============================================================================================================================================+========================================================+ + | sql_filter_rules | Yes | Array of :ref:`DeleteNodeSqlFilterRuleInfo ` objects | Concurrency control rules of SQL statements for nodes. | + +------------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------+ + +.. _deletesqlfilterrule__en-us_topic_0000001323271972_request_deletenodesqlfilterruleinfo: + +.. table:: **Table 4** DeleteNodeSqlFilterRuleInfo + + +-----------+-----------+-------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +===========+===========+=====================================================================================================================================+==============================================+ + | node_id | Yes | String | Node ID. | + +-----------+-----------+-------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------+ + | rules | Yes | Array of :ref:`DeleteNodeSqlFilterRule ` objects | Concurrency control rules of SQL statements. | + +-----------+-----------+-------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------+ + +.. _deletesqlfilterrule__en-us_topic_0000001323271972_request_deletenodesqlfilterrule: + +.. table:: **Table 5** DeleteNodeSqlFilterRule + + +-----------------+-----------------+------------------+----------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +=================+=================+==================+==============================================+ + | sql_type | Yes | String | SQL statement type. | + | | | | | + | | | | Valid value: | + | | | | | + | | | | - SELECT | + | | | | - UPDATE | + | | | | - DELETE | + +-----------------+-----------------+------------------+----------------------------------------------+ + | patterns | Yes | Array of strings | Concurrency control rules of SQL statements. | + +-----------------+-----------------+------------------+----------------------------------------------+ + +Response Parameters +------------------- + +**Status code: 200** + +.. table:: **Table 6** Response body parameters + + +-----------+--------+--------------------------------------------------------------------------+ + | Parameter | Type | Description | + +===========+========+==========================================================================+ + | job_id | String | ID of the task for deleting concurrency control rules of SQL statements. | + +-----------+--------+--------------------------------------------------------------------------+ + +**Status code: 400** + +.. table:: **Table 7** Response body parameters + + ========== ====== ============== + Parameter Type Description + ========== ====== ============== + error_code String Error code. + error_msg String Error message. + ========== ====== ============== + +**Status code: 500** + +.. table:: **Table 8** Response body parameters + + ========== ====== ============== + Parameter Type Description + ========== ====== ============== + error_code String Error code. + error_msg String Error message. + ========== ====== ============== + +Example Request +--------------- + +Deleting concurrency control rules of SQL statements + +.. code-block:: + + DELETE https://gaussdb-mysql.eu-de.otc.t-systems.com/v3/054e292c9880d4992f02c0196d3ea468/instance/af315b8e6aaa41799bd9a31f2de15abcin07/sql-filter/rules + { + "sql_filter_rules" : [ { + "node_id" : "c01a5645eb2c4fb6a9373542f5366e50no07", + "rules" : [ { + "sql_type" : "SELECT", + "patterns" : [ "select~from~t1", "select~from~t2" ] + }, { + "sql_type" : "UPDATE", + "patterns" : [ "udpate~t3~where~id" ] + } ] + }, { + "node_id" : "b234a5645eb2c4ji3b9372342f5362397no07", + "rules" : [ { + "sql_type" : "SELECT", + "patterns" : [ "select~from~t1", "select~from~t2" ] + }, { + "sql_type" : "DELETE", + "patterns" : [ "delete~t3~where~id" ] + } ] + } ] + } + +Example Response +---------------- + +**Status code: 200** + +Success. + +.. code-block:: + + { + "job_id" : "aef6a470-fb63-4d5b-b644-12ead7e019b3" + } + +Status Code +----------- + +For details, see :ref:`Status Codes `. + +Error Code +---------- + +For details, see :ref:`Error Codes `. diff --git a/api-ref/source/apis_recommended/sql_statement_concurrency_control/enabling_or_disabling_sql_statement_concurrency_control.rst b/api-ref/source/apis_recommended/sql_statement_concurrency_control/enabling_or_disabling_sql_statement_concurrency_control.rst new file mode 100644 index 0000000..4ece685 --- /dev/null +++ b/api-ref/source/apis_recommended/sql_statement_concurrency_control/enabling_or_disabling_sql_statement_concurrency_control.rst @@ -0,0 +1,133 @@ +:original_name: UpdateSqlFilterControl.html + +.. _UpdateSqlFilterControl: + +Enabling or Disabling SQL Statement Concurrency Control +======================================================= + +Function +-------- + +This API is used to enable or disable SQL Statement Concurrency Control. Before calling this API: + +- Learn how to :ref:`authorize and authenticate ` it. +- Obtain the required :ref:`region and endpoint `. + +URI +--- + +POST /v3/{project_id}/instances/{instance_id}/sql-filter/switch + +.. table:: **Table 1** URI parameters + + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +=================+=================+=================+============================================================================+ + | project_id | Yes | String | Project ID of a tenant in a region. | + | | | | | + | | | | To obtain this value, see :ref:`Obtaining a Project ID `. | + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + | instance_id | Yes | String | Instance ID. | + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + +Request Parameters +------------------ + +.. table:: **Table 2** Request header parameters + + ============ ========= ====== =========== + Parameter Mandatory Type Description + ============ ========= ====== =========== + X-Auth-Token Yes String User token. + X-Language No String Language. + ============ ========= ====== =========== + +.. table:: **Table 3** Request body parameters + + +-----------------+-----------------+-----------------+--------------------------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +=================+=================+=================+==============================================================+ + | switch_status | Yes | String | Whether SQL Statement Concurrency Control is enabled. Value: | + | | | | | + | | | | - **ON**: enabled | + | | | | - **OFF**: disabled | + +-----------------+-----------------+-----------------+--------------------------------------------------------------+ + +Response Parameters +------------------- + +**Status code: 200** + +.. table:: **Table 4** Response body parameters + + +-----------+--------+-----------------------------------------------------------------------------+ + | Parameter | Type | Description | + +===========+========+=============================================================================+ + | job_id | String | ID of the task for enabling or disabling SQL Statement Concurrency Control. | + +-----------+--------+-----------------------------------------------------------------------------+ + +**Status code: 400** + +.. table:: **Table 5** Response body parameters + + ========== ====== ============== + Parameter Type Description + ========== ====== ============== + error_code String Error code. + error_msg String Error message. + ========== ====== ============== + +**Status code: 500** + +.. table:: **Table 6** Response body parameters + + ========== ====== ============== + Parameter Type Description + ========== ====== ============== + error_code String Error code. + error_msg String Error message. + ========== ====== ============== + +Example Request +--------------- + +- Enabling SQL Statement Concurrency Control + + .. code-block:: text + + POST https://gaussdb-mysql.eu-de.otc.t-systems.com/v3/054e292c9880d4992f02c0196d3ea468/instance/af315b8e6aaa41799bd9a31f2de15abcin07/sql-filter/switch + { + "switch_status" : "ON" + } + +- Disabling SQL Statement Concurrency Control + + .. code-block:: text + + POST https://gaussdb-mysql.eu-de.otc.t-systems.com/v3/054e292c9880d4992f02c0196d3ea468/instance/af315b8e6aaa41799bd9a31f2de15abcin07/sql-filter/switch + { + "switch_status" : "OFF" + } + +Example Response +---------------- + +**Status code: 200** + +Success. + +.. code-block:: + + { + "job_id" : "aef6a470-fb63-4d5b-b644-12ead7e019b3" + } + +Status Code +----------- + +For details, see :ref:`Status Codes `. + +Error Code +---------- + +For details, see :ref:`Error Codes `. diff --git a/api-ref/source/apis_recommended/sql_statement_concurrency_control/index.rst b/api-ref/source/apis_recommended/sql_statement_concurrency_control/index.rst new file mode 100644 index 0000000..3d1e191 --- /dev/null +++ b/api-ref/source/apis_recommended/sql_statement_concurrency_control/index.rst @@ -0,0 +1,22 @@ +:original_name: topic_300000012.html + +.. _topic_300000012: + +SQL Statement Concurrency Control +================================= + +- :ref:`Enabling or Disabling SQL Statement Concurrency Control ` +- :ref:`Querying Whether SQL Statement Concurrency Control Is Enabled ` +- :ref:`Configuring Concurrency Control Rules of SQL Statements ` +- :ref:`Querying Concurrency Control Rules of SQL Statements ` +- :ref:`Deleting Concurrency Control Rules of SQL Statements ` + +.. toctree:: + :maxdepth: 1 + :hidden: + + enabling_or_disabling_sql_statement_concurrency_control + querying_whether_sql_statement_concurrency_control_is_enabled + configuring_concurrency_control_rules_of_sql_statements + querying_concurrency_control_rules_of_sql_statements + deleting_concurrency_control_rules_of_sql_statements diff --git a/api-ref/source/apis_recommended/sql_statement_concurrency_control/querying_concurrency_control_rules_of_sql_statements.rst b/api-ref/source/apis_recommended/sql_statement_concurrency_control/querying_concurrency_control_rules_of_sql_statements.rst new file mode 100644 index 0000000..c2a9c1c --- /dev/null +++ b/api-ref/source/apis_recommended/sql_statement_concurrency_control/querying_concurrency_control_rules_of_sql_statements.rst @@ -0,0 +1,176 @@ +:original_name: ShowSqlFilterRule.html + +.. _ShowSqlFilterRule: + +Querying Concurrency Control Rules of SQL Statements +==================================================== + +Function +-------- + +This API is used to query concurrency control rules of SQL statements. Before calling this API: + +- Learn how to :ref:`authorize and authenticate ` it. +- Obtain the required :ref:`region and endpoint `. + +URI +--- + +GET /v3/{project_id}/instances/{instance_id}/sql-filter/rules?node_id={node_id} + +.. table:: **Table 1** URI parameters + + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +=================+=================+=================+============================================================================+ + | project_id | Yes | String | Project ID of a tenant in a region. | + | | | | | + | | | | To obtain this value, see :ref:`Obtaining a Project ID `. | + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + | instance_id | Yes | String | DB instance ID. | + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + +.. table:: **Table 2** Query parameters + + +-----------+-----------+--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +===========+===========+========+=======================================================================================================================================================================================================+ + | node_id | Yes | String | Node ID. | + +-----------+-----------+--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | type | No | String | SQL statement type. The value can be **SELECT**, **UPDATE**, and **DELETE** (case-insensitive). If this parameter is not specified, concurrency control rules of all types of statements are queried. | + +-----------+-----------+--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Request Parameters +------------------ + +.. table:: **Table 3** Request header parameters + + ============ ========= ====== =========== + Parameter Mandatory Type Description + ============ ========= ====== =========== + X-Auth-Token Yes String User token. + X-Language No String Language. + ============ ========= ====== =========== + +Response Parameters +------------------- + +**Status code: 200** + +.. table:: **Table 4** Response body parameters + + +------------------+----------------------------------------------------------------------------------------------------------------+----------------------------------------------+ + | Parameter | Type | Description | + +==================+================================================================================================================+==============================================+ + | node_id | String | Node ID. | + +------------------+----------------------------------------------------------------------------------------------------------------+----------------------------------------------+ + | sql_filter_rules | Array of :ref:`SqlFilterRule ` objects | Concurrency control rules of SQL statements. | + +------------------+----------------------------------------------------------------------------------------------------------------+----------------------------------------------+ + +.. _showsqlfilterrule__en-us_topic_0000001323591588_response_sqlfilterrule: + +.. table:: **Table 5** SqlFilterRule + + +-----------------------+------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------+ + | Parameter | Type | Description | + +=======================+==============================================================================================================================+==============================================+ + | sql_type | String | SQL statement type. | + | | | | + | | | Valid value: | + | | | | + | | | - SELECT | + | | | - UPDATE | + | | | - DELETE | + +-----------------------+------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------+ + | patterns | Array of :ref:`SqlFilterRulePattern ` objects | Concurrency control rules of SQL statements. | + +-----------------------+------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------+ + +.. _showsqlfilterrule__en-us_topic_0000001323591588_response_sqlfilterrulepattern: + +.. table:: **Table 6** SqlFilterRulePattern + + =============== ======= ============================================= + Parameter Type Description + =============== ======= ============================================= + pattern String A concurrency control rule of SQL statements. + max_concurrency Integer Maximum number of concurrent SQL statements. + =============== ======= ============================================= + +**Status code: 400** + +.. table:: **Table 7** Response body parameters + + ========== ====== ============== + Parameter Type Description + ========== ====== ============== + error_code String Error code. + error_msg String Error message. + ========== ====== ============== + +**Status code: 500** + +.. table:: **Table 8** Response body parameters + + ========== ====== ============== + Parameter Type Description + ========== ====== ============== + error_code String Error code. + error_msg String Error message. + ========== ====== ============== + +Example Request +--------------- + +Querying concurrency control rules of SQL statements + +.. code-block:: text + + GET https://gaussdb-mysql.eu-de.otc.t-systems.com/v3/054e292c9880d4992f02c0196d3ea468/instance/af315b8e6aaa41799bd9a31f2de15abcin07/sql-filter/rules?node_id=c01a5645eb2c4fb6a9373542f5366e50no07 + +Example Response +---------------- + +**Status code: 200** + +Success. + +.. code-block:: + + { + "node_id" : "c01a5645eb2c4fb6a9373542f5366e50no07", + "sql_filter_rules" : [ { + "sql_type" : "SELECT", + "patterns" : [ { + "pattern" : "select~from~t1", + "max_concurrency" : 0 + }, { + "pattern" : "select~from~t2~where~id", + "max_concurrency" : 10 + } ] + }, { + "sql_type" : "UDPATE", + "patterns" : [ { + "pattern" : "update~t1", + "max_concurrency" : 0 + }, { + "pattern" : "update~t2~where~id", + "max_concurrency" : 10 + } ] + }, { + "sql_type" : "DELETE", + "patterns" : [ { + "pattern" : "delete~from", + "max_concurrency" : 0 + } ] + } ] + } + +Status Code +----------- + +For details, see :ref:`Status Codes `. + +Error Code +---------- + +For details, see :ref:`Error Codes `. diff --git a/api-ref/source/apis_recommended/sql_statement_concurrency_control/querying_whether_sql_statement_concurrency_control_is_enabled.rst b/api-ref/source/apis_recommended/sql_statement_concurrency_control/querying_whether_sql_statement_concurrency_control_is_enabled.rst new file mode 100644 index 0000000..e8a48c7 --- /dev/null +++ b/api-ref/source/apis_recommended/sql_statement_concurrency_control/querying_whether_sql_statement_concurrency_control_is_enabled.rst @@ -0,0 +1,115 @@ +:original_name: ShowSqlFilterControl.html + +.. _ShowSqlFilterControl: + +Querying Whether SQL Statement Concurrency Control Is Enabled +============================================================= + +Function +-------- + +This API is used to query whether SQL Statement Concurrency Control is enabled. Before calling this API: + +- Learn how to :ref:`authorize and authenticate ` it. +- Obtain the required :ref:`region and endpoint `. + +URI +--- + +GET /v3/{project_id}/instances/{instance_id}/sql-filter/switch + +.. table:: **Table 1** URI parameters + + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + | Parameter | Mandatory | Type | Description | + +=================+=================+=================+============================================================================+ + | project_id | Yes | String | Project ID of a tenant in a region. | + | | | | | + | | | | To obtain this value, see :ref:`Obtaining a Project ID `. | + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + | instance_id | Yes | String | Instance ID. | + +-----------------+-----------------+-----------------+----------------------------------------------------------------------------+ + +Request Parameters +------------------ + +.. table:: **Table 2** Request header parameters + + ============ ========= ====== =========== + Parameter Mandatory Type Description + ============ ========= ====== =========== + x-auth-token Yes String User token. + X-Language No String Language. + ============ ========= ====== =========== + +Response Parameters +------------------- + +**Status code: 200** + +.. table:: **Table 3** Response body parameters + + +-----------------------+-----------------------+-------------------------------------------------------+ + | Parameter | Type | Description | + +=======================+=======================+=======================================================+ + | switch_status | String | Whether SQL Statement Concurrency Control is enabled. | + | | | | + | | | Value: | + | | | | + | | | - **ON**: enabled | + | | | - **OFF:** disabled | + +-----------------------+-----------------------+-------------------------------------------------------+ + +**Status code: 400** + +.. table:: **Table 4** Response body parameters + + ========== ====== ============== + Parameter Type Description + ========== ====== ============== + error_code String Error code. + error_msg String Error message. + ========== ====== ============== + +**Status code: 500** + +.. table:: **Table 5** Response body parameters + + ========== ====== ============== + Parameter Type Description + ========== ====== ============== + error_code String Error code. + error_msg String Error message. + ========== ====== ============== + +Example Request +--------------- + +Querying whether SQL Statement Concurrency Control is enabled + +.. code-block:: text + + GET https://gaussdb-mysql.eu-de.otc.t-systems.com/v3/054e292c9880d4992f02c0196d3ea468/instance/af315b8e6aaa41799bd9a31f2de15abcin07/sql-filter/switch + +Example Response +---------------- + +**Status code: 200** + +Success. + +.. code-block:: + + { + "switch_status" : "ON" + } + +Status Code +----------- + +For details, see :ref:`Status Codes `. + +Error Code +---------- + +For details, see :ref:`Error Codes `. diff --git a/api-ref/source/change_history.rst b/api-ref/source/change_history.rst index 8e9b63c..263a430 100644 --- a/api-ref/source/change_history.rst +++ b/api-ref/source/change_history.rst @@ -8,6 +8,15 @@ Change History +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Released On | Description | +===================================+=========================================================================================================================================================================================================================+ +| 2024-04-15 | Added the following content: | +| | | +| | - :ref:`Changing a Database Port ` | +| | - :ref:`Enabling or Disabling SQL Statement Concurrency Control ` | +| | - :ref:`Querying Whether SQL Statement Concurrency Control Is Enabled ` | +| | - :ref:`Configuring Concurrency Control Rules of SQL Statements ` | +| | - :ref:`Querying Concurrency Control Rules of SQL Statements ` | +| | - :ref:`Deleting Concurrency Control Rules of SQL Statements ` | ++-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 2024-02-28 | Modified the following content: | | | | | | Added precautions in :ref:`Configuring Resource Quotas ` and :ref:`Modifying Resource Quotas `. |