forked from laiweijian4/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com> Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
106 lines
9.9 KiB
HTML
106 lines
9.9 KiB
HTML
<a name="rds_log_0001"></a><a name="rds_log_0001"></a>
|
|
|
|
<h1 class="topictitle1">Setting SQL Audit</h1>
|
|
<div id="body1569294095034"><div class="section" id="rds_log_0001__section61759636"><h4 class="sectiontitle">Function</h4><p id="rds_log_0001__p33831530">This API is used to set a policy for SQL audit logs.</p>
|
|
<ul id="rds_log_0001__ul12259155218373"><li id="rds_log_0001__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_log_0001__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_log_0001__section13341536702"><h4 class="sectiontitle">Constraints</h4><p id="rds_log_0001__p162531141002">This API is supported for MySQL only.</p>
|
|
</div>
|
|
<div class="section" id="rds_log_0001__section18965813"><h4 class="sectiontitle">URI</h4><ul id="rds_log_0001__ul13194498"><li id="rds_log_0001__li41603465301">URI format<p id="rds_log_0001__p11160246123012"><a name="rds_log_0001__li41603465301"></a><a name="li41603465301"></a>PUT https://{<em id="rds_log_0001__i11252164981618">Endpoint</em>}/v3/{project_id}/instances/{instance_id}/auditlog-policy</p>
|
|
</li></ul>
|
|
<ul id="rds_log_0001__ul55999443"><li id="rds_log_0001__li21405046">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_log_0001__table65777232" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="rds_log_0001__row46529701"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.3.1.1.2.4.1.1"><p id="rds_log_0001__p10809459"><strong id="rds_log_0001__b1848761262013">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.3.1.1.2.4.1.2"><p id="rds_log_0001__p3150961"><strong id="rds_log_0001__b132621717205">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.3.1.1.2.4.1.3"><p id="rds_log_0001__p53901255"><strong id="rds_log_0001__b99151417102019">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="rds_log_0001__row3925534"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.3.1.1.2.4.1.1 "><p id="rds_log_0001__p49532829">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.3.1.1.2.4.1.2 "><p id="rds_log_0001__p52736237">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.3.1.1.2.4.1.3 "><p id="rds_log_0001__p43776822">Specifies the project ID of a tenant in a region.</p>
|
|
<p id="rds_log_0001__p186761044260">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_log_0001__row19780235152911"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.3.1.1.2.4.1.1 "><p id="rds_log_0001__p41557789155220">instance_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.3.1.1.2.4.1.2 "><p id="rds_log_0001__p10737742155220">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.3.1.1.2.4.1.3 "><p id="rds_log_0001__p64450739155220">Specifies the DB instance ID.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="rds_log_0001__section36474591"><h4 class="sectiontitle">Request</h4><ul id="rds_log_0001__ul1677317341210"><li id="rds_log_0001__li1830813567439">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_log_0001__table6426756154514" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="rds_log_0001__row142645664510"><th align="left" class="cellrowborder" valign="top" width="25.252525252525253%" id="mcps1.3.4.2.1.1.2.5.1.1"><p id="rds_log_0001__p17490046"><strong id="rds_log_0001__b7960833202020">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="21.21212121212121%" id="mcps1.3.4.2.1.1.2.5.1.2"><p id="rds_log_0001__p7407659"><strong id="rds_log_0001__b12721935112015">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.171717171717173%" id="mcps1.3.4.2.1.1.2.5.1.3"><p id="rds_log_0001__p63149496"><strong id="rds_log_0001__b1641853610204">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="36.36363636363637%" id="mcps1.3.4.2.1.1.2.5.1.4"><p id="rds_log_0001__p14835533"><strong id="rds_log_0001__b229173742014">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="rds_log_0001__row34264566458"><td class="cellrowborder" valign="top" width="25.252525252525253%" headers="mcps1.3.4.2.1.1.2.5.1.1 "><p id="rds_log_0001__p1965465321213">keep_days</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.3.4.2.1.1.2.5.1.2 "><p id="rds_log_0001__p60181840">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.171717171717173%" headers="mcps1.3.4.2.1.1.2.5.1.3 "><p id="rds_log_0001__p46861368136">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="36.36363636363637%" headers="mcps1.3.4.2.1.1.2.5.1.4 "><p id="rds_log_0001__p1968815263519">Specifies the number of days for storing audit logs. The value range is from 0 to 732.</p>
|
|
<ul id="rds_log_0001__ul85011828115116"><li id="rds_log_0001__li11501828185111"><strong id="rds_log_0001__b1868614685311">0</strong>: indicates that SQL audit is disabled.</li><li id="rds_log_0001__li132627302512"><strong id="rds_log_0001__b1918762914543">1</strong> to <strong id="rds_log_0001__b15825834185418">732</strong>: indicates the retention days for audit logs after SQL audit is enabled.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="rds_log_0001__row17969183142714"><td class="cellrowborder" valign="top" width="25.252525252525253%" headers="mcps1.3.4.2.1.1.2.5.1.1 "><p id="rds_log_0001__p1497073122718">reserve_auditlogs</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.3.4.2.1.1.2.5.1.2 "><p id="rds_log_0001__p9970183116275">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.171717171717173%" headers="mcps1.3.4.2.1.1.2.5.1.3 "><p id="rds_log_0001__p1697018315274">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="36.36363636363637%" headers="mcps1.3.4.2.1.1.2.5.1.4 "><p id="rds_log_0001__p156899547365">This parameter is valid only when SQL audit is disabled.</p>
|
|
<ul id="rds_log_0001__ul261711566365"><li id="rds_log_0001__li69339014371"><strong id="rds_log_0001__b1965001612211">true</strong> (default value): indicates that historical audit logs are retained when SQL audit is disabled.</li><li id="rds_log_0001__li46176569364"><strong id="rds_log_0001__b1799514200213">false</strong>: indicates that existing historical audit logs are deleted when SQL audit is disabled.</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="rds_log_0001__ul3429936125814"><li id="rds_log_0001__li4411135064210">Example<p id="rds_log_0001__p1454414211213"><a name="rds_log_0001__li4411135064210"></a><a name="li4411135064210"></a>PUT https://rds.eu-de.otc.t-systems.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/auditlog-policy</p>
|
|
</li></ul>
|
|
<ul id="rds_log_0001__ul173917421580"><li id="rds_log_0001__li1373924245817">Request example<div class="p" id="rds_log_0001__p1473984220585"><a name="rds_log_0001__li1373924245817"></a><a name="li1373924245817"></a><strong id="rds_log_0001__b20739194210582">Update the policy for SQL audit logs:</strong><pre class="codeblock" id="rds_log_0001__codeblock137391342175815">{
|
|
"keep_days":5
|
|
}</pre>
|
|
</div>
|
|
<p id="rds_log_0001__p87399422581"></p>
|
|
<p id="rds_log_0001__p8739242195813"><strong id="rds_log_0001__b157391442125810">Disable the policy for SQL audit logs:</strong></p>
|
|
<pre class="codeblock" id="rds_log_0001__codeblock1873913429581">{
|
|
"keep_days":0,
|
|
"reserve_auditlogs":false
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="rds_log_0001__section59835867"><h4 class="sectiontitle">Response</h4><ul id="rds_log_0001__ul396612717394"><li id="rds_log_0001__li49661427193912">Normal response<p id="rds_log_0001__p824011811104"><a name="rds_log_0001__li49661427193912"></a><a name="li49661427193912"></a>None</p>
|
|
</li><li id="rds_log_0001__li8200143916396">Abnormal response<p id="rds_log_0001__p29415884"><a name="rds_log_0001__li8200143916396"></a><a name="li8200143916396"></a>For details, see <a href="en-us_topic_0032488197.html">Abnormal Request Results</a>.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="rds_log_0001__section4778540915440"><h4 class="sectiontitle">Status Code</h4><ul id="rds_log_0001__en-us_topic_0032347778_ul7858132212142"><li id="rds_log_0001__en-us_topic_0032347778_li58581622171411">Normal<p id="rds_log_0001__en-us_topic_0032347778_p1040982941020"><a name="rds_log_0001__en-us_topic_0032347778_li58581622171411"></a><a name="en-us_topic_0032347778_li58581622171411"></a>200</p>
|
|
</li><li id="rds_log_0001__en-us_topic_0032347778_li11583183218149">Abnormal<p id="rds_log_0001__en-us_topic_0032347778_p0723374409"><a name="rds_log_0001__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_log_0001__section1183074220016"><h4 class="sectiontitle">Error Code</h4><p id="rds_log_0001__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="en-us_topic_0056887472.html">Log Information Queries</a></div>
|
|
</div>
|
|
</div>
|
|
|