Files
doc-exports/docs/rds/api-ref/rds_20_0005.html
wangdengke2 1ddaec1a62 rds_api
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>
2026-01-29 11:28:26 +00:00

165 lines
15 KiB
HTML

<a name="rds_20_0005"></a><a name="rds_20_0005"></a>
<h1 class="topictitle1">Enabling or Disabling a SQL Throttling Rule or Disabling All SQL Throttling Rules</h1>
<div id="body0000002376358594"><div class="section" id="rds_20_0005__en-us_topic_0000001789916316_section4850156117316"><h4 class="sectiontitle">Function</h4><p id="rds_20_0005__en-us_topic_0000001789916316_p52780252141331">This API is used to enable or disable a SQL throttling rule or disable all SQL throttling rules.</p>
<ul id="rds_20_0005__ul10163594121"><li id="rds_20_0005__en-us_topic_0240111818_li836513175363">Before calling an API, you need to understand the API in <a href="rds_03_0001.html">Authentication</a>.</li><li id="rds_20_0005__en-us_topic_0240111818_li1991981933613">Before calling this API, obtain the required <a href="https://docs.otc.t-systems.com/en-us/endpoint/index.html" target="_blank" rel="noopener noreferrer">region and endpoint</a>.</li></ul>
</div>
<div class="section" id="rds_20_0005__section7996151810239"><h4 class="sectiontitle">Constraints</h4><p id="rds_20_0005__p103496270212">Before enabling SQL throttling, you must set the RDS for PostgreSQL kernel parameter <strong id="rds_20_0005__b14152165285213">rds_pg_sql_ccl.enable_ccl</strong> to <strong id="rds_20_0005__b542885510524">ON</strong>. For details, see <a href="rds_09_0303.html">Modifying a Parameter Template</a>.</p>
<p id="rds_20_0005__en-us_topic_0000001829962645_p03111646102918">By default, the kernel parameter <strong id="rds_20_0005__b3470104025318">rds_pg_sql_ccl.enable_ccl</strong> is set to <strong id="rds_20_0005__b2986104205310">OFF</strong>.</p>
</div>
<div class="section" id="rds_20_0005__en-us_topic_0000001789916316_section28961517113719"><h4 class="sectiontitle">URI</h4><ul id="rds_20_0005__en-us_topic_0000001789916316_ul16391217184115"><li id="rds_20_0005__en-us_topic_0000001789916316_li363951734111">URI format<p id="rds_20_0005__en-us_topic_0000001789916316_p119751919257"><a name="rds_20_0005__en-us_topic_0000001789916316_li363951734111"></a><a name="en-us_topic_0000001789916316_li363951734111"></a>PUT https://{<em id="rds_20_0005__en-us_topic_0000001789916316_i2135182742516">Endpoint</em>}/v3/{project_id}/instances/{instance_id}/sql-limit/switch</p>
</li></ul>
<ul id="rds_20_0005__en-us_topic_0000001789916316_ul49831254144655"><li id="rds_20_0005__en-us_topic_0000001789916316_li15430535">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_20_0005__en-us_topic_0000001789916316_table4657088" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters</caption><thead align="left"><tr id="rds_20_0005__en-us_topic_0000001789916316_row60083059"><th align="left" class="cellrowborder" valign="top" width="20.93%" id="mcps1.3.3.3.1.1.2.4.1.1"><p id="rds_20_0005__en-us_topic_0000001789916316_p34889605"><strong id="rds_20_0005__b1935191344014">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.6%" id="mcps1.3.3.3.1.1.2.4.1.2"><p id="rds_20_0005__en-us_topic_0000001789916316_p7485743"><strong id="rds_20_0005__b1066681694010">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="62.470000000000006%" id="mcps1.3.3.3.1.1.2.4.1.3"><p id="rds_20_0005__en-us_topic_0000001789916316_p2365466"><strong id="rds_20_0005__b11946151764011">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_20_0005__en-us_topic_0000001789916316_row57385070"><td class="cellrowborder" valign="top" width="20.93%" headers="mcps1.3.3.3.1.1.2.4.1.1 "><p id="rds_20_0005__en-us_topic_0000001789916316_p69633355250">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.6%" headers="mcps1.3.3.3.1.1.2.4.1.2 "><p id="rds_20_0005__en-us_topic_0000001789916316_p13963113520251">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="62.470000000000006%" headers="mcps1.3.3.3.1.1.2.4.1.3 "><p id="rds_20_0005__p30492010">Specifies the project ID of a tenant in a region.</p>
<p id="rds_20_0005__p7139608914">For details about how to obtain the project ID, see <a href="rds_03_0002.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="rds_20_0005__en-us_topic_0000001789916316_row2864326155157"><td class="cellrowborder" valign="top" width="20.93%" headers="mcps1.3.3.3.1.1.2.4.1.1 "><p id="rds_20_0005__en-us_topic_0000001789916316_p3963163516252">instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.6%" headers="mcps1.3.3.3.1.1.2.4.1.2 "><p id="rds_20_0005__en-us_topic_0000001789916316_p20963335192520">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="62.470000000000006%" headers="mcps1.3.3.3.1.1.2.4.1.3 "><p id="rds_20_0005__en-us_topic_0000001789916316_p64450739155220">Instance ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="rds_20_0005__en-us_topic_0000001789916316_section3074340117316"><h4 class="sectiontitle">Request</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_20_0005__table12536623333" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="rds_20_0005__row153612211337"><th align="left" class="cellrowborder" valign="top" width="19.7%" id="mcps1.3.4.2.2.5.1.1"><p id="rds_20_0005__p95111733143318">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.780000000000001%" id="mcps1.3.4.2.2.5.1.2"><p id="rds_20_0005__p13511123373311">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.959999999999999%" id="mcps1.3.4.2.2.5.1.3"><p id="rds_20_0005__p125111433133312">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="53.559999999999995%" id="mcps1.3.4.2.2.5.1.4"><p id="rds_20_0005__p551110331335">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="rds_20_0005__row353717218338"><td class="cellrowborder" valign="top" width="19.7%" headers="mcps1.3.4.2.2.5.1.1 "><p id="rds_20_0005__p18511533163317">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="13.780000000000001%" headers="mcps1.3.4.2.2.5.1.2 "><p id="rds_20_0005__p13511153333312">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.959999999999999%" headers="mcps1.3.4.2.2.5.1.3 "><p id="rds_20_0005__p55111833183319">String</p>
</td>
<td class="cellrowborder" valign="top" width="53.559999999999995%" headers="mcps1.3.4.2.2.5.1.4 "><p id="rds_20_0005__p35111331332">The content type.</p>
<p id="rds_20_0005__p1351133311330">The default value is <strong id="rds_20_0005__b105111133143310">application/json</strong>.</p>
</td>
</tr>
<tr id="rds_20_0005__row05378213331"><td class="cellrowborder" valign="top" width="19.7%" headers="mcps1.3.4.2.2.5.1.1 "><p id="rds_20_0005__p1163015550331">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="13.780000000000001%" headers="mcps1.3.4.2.2.5.1.2 "><p id="rds_20_0005__p1963035563316">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.959999999999999%" headers="mcps1.3.4.2.2.5.1.3 "><p id="rds_20_0005__p1630105520331">String</p>
</td>
<td class="cellrowborder" valign="top" width="53.559999999999995%" headers="mcps1.3.4.2.2.5.1.4 "><p id="rds_20_0005__p1086851153317">Specifies the user token.</p>
<p id="rds_20_0005__p1057635831">The user token is a response to the API used to <a href="https://docs.otc.t-systems.com/en-us/api/iam/en-us_topic_0057845583.html" target="_blank" rel="noopener noreferrer">obtain a user token</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_20_0005__en-us_topic_0000001789916316_table156101520194220" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameters</caption><thead align="left"><tr id="rds_20_0005__en-us_topic_0000001789916316_row5679132013427"><th align="left" class="cellrowborder" valign="top" width="16.43%" id="mcps1.3.4.3.2.5.1.1"><p id="rds_20_0005__en-us_topic_0000001789916316_p66795203422"><strong id="rds_20_0005__b19450194415406">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.92%" id="mcps1.3.4.3.2.5.1.2"><p id="rds_20_0005__en-us_topic_0000001789916316_p66798203421"><strong id="rds_20_0005__b118116457403">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.47%" id="mcps1.3.4.3.2.5.1.3"><p id="rds_20_0005__en-us_topic_0000001789916316_p8679152011425"><strong id="rds_20_0005__b924854794011">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="61.18%" id="mcps1.3.4.3.2.5.1.4"><p id="rds_20_0005__en-us_topic_0000001789916316_p8679112016428"><strong id="rds_20_0005__b1462574816405">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_20_0005__en-us_topic_0000001789916316_row1768013208423"><td class="cellrowborder" valign="top" width="16.43%" headers="mcps1.3.4.3.2.5.1.1 "><p id="rds_20_0005__p18853156155718">db_name</p>
</td>
<td class="cellrowborder" valign="top" width="9.92%" headers="mcps1.3.4.3.2.5.1.2 "><p id="rds_20_0005__p685311568577">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.47%" headers="mcps1.3.4.3.2.5.1.3 "><p id="rds_20_0005__p1285325610579">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.18%" headers="mcps1.3.4.3.2.5.1.4 "><p id="rds_20_0005__p178532056115719">Database name. For example: "<strong id="rds_20_0005__b2044683010394">postgres</strong>".</p>
</td>
</tr>
<tr id="rds_20_0005__en-us_topic_0000001789916316_row1068014202425"><td class="cellrowborder" valign="top" width="16.43%" headers="mcps1.3.4.3.2.5.1.1 "><p id="rds_20_0005__p385415565579">id</p>
</td>
<td class="cellrowborder" valign="top" width="9.92%" headers="mcps1.3.4.3.2.5.1.2 "><p id="rds_20_0005__p13854205605714">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.47%" headers="mcps1.3.4.3.2.5.1.3 "><p id="rds_20_0005__p15854105613576">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.18%" headers="mcps1.3.4.3.2.5.1.4 "><p id="rds_20_0005__p10918897104">SQL throttling rule ID.</p>
</td>
</tr>
<tr id="rds_20_0005__en-us_topic_0000001789916316_row10680112084214"><td class="cellrowborder" valign="top" width="16.43%" headers="mcps1.3.4.3.2.5.1.1 "><p id="rds_20_0005__p6854185613576">action</p>
</td>
<td class="cellrowborder" valign="top" width="9.92%" headers="mcps1.3.4.3.2.5.1.2 "><p id="rds_20_0005__p17854195610573">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.47%" headers="mcps1.3.4.3.2.5.1.3 "><p id="rds_20_0005__p1585425695718">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.18%" headers="mcps1.3.4.3.2.5.1.4 "><p id="rds_20_0005__p1870317222108">Action applied to the SQL throttling rule.</p>
<ul id="rds_20_0005__ul14308339105916"><li id="rds_20_0005__li123081639155916"><strong id="rds_20_0005__b7893152717437">open</strong>: Enable the SQL throttling rule.</li><li id="rds_20_0005__li9308439155917"><strong id="rds_20_0005__b13866159449">close</strong>: Disable the SQL throttling rule.</li><li id="rds_20_0005__li1308339155918"><strong id="rds_20_0005__b555063364420">disable_all</strong>: Disable all SQL throttling rules.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="rds_20_0005__section3906111111120"><h4 class="sectiontitle">Example Request</h4><p id="rds_20_0005__p1353361551213">Enable a SQL throttling rule.</p>
<pre class="screen" id="rds_20_0005__screen686832615123">PUT https://rds.eu-de.otc.t-systems.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/ 49b9dd1d6f464ba4bc91df5cbd2e52ebin03/sql-limit/switch
{
"db_name" : "postgres",
"id" : "1",
"action" : "open"
}</pre>
</div>
<div class="section" id="rds_20_0005__en-us_topic_0000001789916316_section28521534113742"><h4 class="sectiontitle">Response</h4><ul id="rds_20_0005__en-us_topic_0000001789916316_ul12573920"><li id="rds_20_0005__en-us_topic_0000001789916316_li46056421">Normal response
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_20_0005__en-us_topic_0000001789916316_table32267243" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Parameters</caption><thead align="left"><tr id="rds_20_0005__en-us_topic_0000001789916316_row9230088"><th align="left" class="cellrowborder" valign="top" width="22.5022502250225%" id="mcps1.3.6.2.1.1.2.4.1.1"><p id="rds_20_0005__en-us_topic_0000001789916316_p9439626"><strong id="rds_20_0005__b5380122154612">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="29.24292429242924%" id="mcps1.3.6.2.1.1.2.4.1.2"><p id="rds_20_0005__en-us_topic_0000001789916316_p26412257"><strong id="rds_20_0005__b57361434460">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="48.254825482548256%" id="mcps1.3.6.2.1.1.2.4.1.3"><p id="rds_20_0005__en-us_topic_0000001789916316_p59018101"><strong id="rds_20_0005__b161425515465">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_20_0005__en-us_topic_0000001789916316_row15736877"><td class="cellrowborder" valign="top" width="22.5022502250225%" headers="mcps1.3.6.2.1.1.2.4.1.1 "><p id="rds_20_0005__p15327121416589">resp</p>
</td>
<td class="cellrowborder" valign="top" width="29.24292429242924%" headers="mcps1.3.6.2.1.1.2.4.1.2 "><p id="rds_20_0005__p6327131418580">String</p>
</td>
<td class="cellrowborder" valign="top" width="48.254825482548256%" headers="mcps1.3.6.2.1.1.2.4.1.3 "><p id="rds_20_0005__en-us_topic_0000001835093082_en-us_topic_0000001818123618_p8319746113518">Returns <strong id="rds_20_0005__b1831403194812">successful</strong> if the calling is successful.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="rds_20_0005__en-us_topic_0000001789916316_ul16665627"><li id="rds_20_0005__en-us_topic_0000001789916316_li15772917">Example normal response<pre class="screen" id="rds_20_0005__screen545185653513">{
"resp" : "successful"
}</pre>
</li><li id="rds_20_0005__en-us_topic_0000001789916316_li28023262501">Abnormal response<p id="rds_20_0005__p46896054"><a name="rds_20_0005__en-us_topic_0000001789916316_li28023262501"></a><a name="en-us_topic_0000001789916316_li28023262501"></a>For details, see <a href="en-us_topic_0032488197.html">Abnormal Request Results</a>.</p>
</li></ul>
</div>
<div class="section" id="rds_20_0005__section4778540915440"><h4 class="sectiontitle">Status Code</h4><ul id="rds_20_0005__en-us_topic_0032347778_ul7858132212142"><li id="rds_20_0005__en-us_topic_0032347778_li58581622171411">Normal<p id="rds_20_0005__en-us_topic_0032347778_p1040982941020"><a name="rds_20_0005__en-us_topic_0032347778_li58581622171411"></a><a name="en-us_topic_0032347778_li58581622171411"></a>200</p>
</li><li id="rds_20_0005__en-us_topic_0032347778_li11583183218149">Abnormal<p id="rds_20_0005__en-us_topic_0032347778_p0723374409"><a name="rds_20_0005__en-us_topic_0032347778_li11583183218149"></a><a name="en-us_topic_0032347778_li11583183218149"></a>For details, see <a href="en-us_topic_0032488240.html">Status Codes</a>.</p>
</li></ul>
</div>
<div class="section" id="rds_20_0005__section1183074220016"><h4 class="sectiontitle">Error Code</h4><p id="rds_20_0005__en-us_topic_0032347778_p19357163913406">For details, see <a href="en-us_topic_0032488241.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rds_20_0000.html">SQL Throttling (RDS for PostgreSQL)</a></div>
</div>
</div>