doc-exports/docs/rds/api-ref/rds_log_0003.html
Ru, Li Yi 48f239743a rds_api
Reviewed-by: Boka, Ladislav <ladislav.boka@t-systems.com>
Co-authored-by: Ru, Li Yi <liyiru7@huawei.com>
Co-committed-by: Ru, Li Yi <liyiru7@huawei.com>
2024-02-05 10:08:10 +00:00

186 lines
16 KiB
HTML

<a name="rds_log_0003"></a><a name="rds_log_0003"></a>
<h1 class="topictitle1">Obtaining an Audit Log List</h1>
<div id="body1569294095034"><div class="section" id="rds_log_0003__section61759636"><h4 class="sectiontitle">Function</h4><p id="rds_log_0003__p33831530">This API is used to obtain an audit log list.</p>
<ul id="rds_log_0003__ul12259155218373"><li id="rds_log_0003__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_0003__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_0003__section13341536702"><h4 class="sectiontitle">Constraints</h4><p id="rds_log_0003__en-us_topic_0000001496953953_p121571021134413">This API is available only to RDS for MySQL.</p>
</div>
<div class="section" id="rds_log_0003__section18965813"><h4 class="sectiontitle">URI</h4><ul id="rds_log_0003__ul13194498"><li id="rds_log_0003__li41603465301">URI format<p id="rds_log_0003__p11160246123012"><a name="rds_log_0003__li41603465301"></a><a name="li41603465301"></a>GET https://{<em id="rds_log_0003__i11252164981618">Endpoint</em>}/v3/{project_id}/instances/{instance_id}/auditlog?start_time={start_time}&amp;end_time={end_time}&amp;offset={offset}&amp;limit={limit}</p>
</li></ul>
<ul id="rds_log_0003__ul55999443"><li id="rds_log_0003__li21405046">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_log_0003__table58427690" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="rds_log_0003__row1482002"><th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.3.3.1.1.2.4.1.1"><p id="rds_log_0003__p52933326"><strong id="rds_log_0003__b6524186915">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.3.3.1.1.2.4.1.2"><p id="rds_log_0003__p59740974"><strong id="rds_log_0003__b11934201812913">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="57.99999999999999%" id="mcps1.3.3.3.1.1.2.4.1.3"><p id="rds_log_0003__p7180698"><strong id="rds_log_0003__b0887195171314">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_log_0003__row44765691"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.1.1.2.4.1.1 "><p id="rds_log_0003__p2142393">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.1.1.2.4.1.2 "><p id="rds_log_0003__p39316155">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="57.99999999999999%" headers="mcps1.3.3.3.1.1.2.4.1.3 "><p id="rds_log_0003__p30492010">Specifies the project ID of a tenant in a region.</p>
<p id="rds_log_0003__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_log_0003__row5992637"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.1.1.2.4.1.1 "><p id="rds_log_0003__p15641626">instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.1.1.2.4.1.2 "><p id="rds_log_0003__p59012183">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="57.99999999999999%" headers="mcps1.3.3.3.1.1.2.4.1.3 "><p id="rds_log_0003__p15257500">Specifies the ID of the queried DB instance.</p>
</td>
</tr>
<tr id="rds_log_0003__row10362162619518"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.1.1.2.4.1.1 "><p id="rds_log_0003__p24007821174547">start_time</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.1.1.2.4.1.2 "><p id="rds_log_0003__p65585369174547">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="57.99999999999999%" headers="mcps1.3.3.3.1.1.2.4.1.3 "><p id="rds_log_0003__p19820153492918">Specifies the start time for obtaining the backup list. The format of the start time is "yyyy-mm-ddThh:mm:ssZ".</p>
<p id="rds_log_0003__p148207340293"></p>
<p id="rds_log_0003__p14820173452918"><strong id="rds_log_0003__b842352706151812">T</strong> is the separator between the calendar and the hourly notation of time. <strong id="rds_log_0003__b842352706153833">Z</strong> indicates the time zone offset. </p>
</td>
</tr>
<tr id="rds_log_0003__row18204123319519"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.1.1.2.4.1.1 "><p id="rds_log_0003__p32183997174547">end_time</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.1.1.2.4.1.2 "><p id="rds_log_0003__p56766964174547">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="57.99999999999999%" headers="mcps1.3.3.3.1.1.2.4.1.3 "><p id="rds_log_0003__p94810713013">Specifies the end time for obtaining the backup list. The format of the end time is "yyyy-mm-ddThh:mm:ssZ" and the end time must be later than the start time. The time span cannot be longer than 30 days.</p>
<p id="rds_log_0003__p2483783017"><strong id="rds_log_0003__b934614111412">T</strong> is the separator between the calendar and the hourly notation of time. <strong id="rds_log_0003__b1034710419142">Z</strong> indicates the time zone offset. </p>
</td>
</tr>
<tr id="rds_log_0003__row17867193065114"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.1.1.2.4.1.1 "><p id="rds_log_0003__p11832481174547">offset</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.1.1.2.4.1.2 "><p id="rds_log_0003__p18906893174547">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="57.99999999999999%" headers="mcps1.3.3.3.1.1.2.4.1.3 "><p id="rds_log_0003__p4966579018">Specifies the index position.</p>
<p id="rds_log_0003__p55063325174547">If <strong id="rds_log_0003__b12943823194110">offset</strong> is set to <em id="rds_log_0003__i09471323164112">N</em>, the resource query starts from the N+1 piece of data. The value is <strong id="rds_log_0003__b1194882312413">0</strong> by default, indicating that the query starts from the first piece of data. The value must be a positive number.</p>
</td>
</tr>
<tr id="rds_log_0003__row1887952814518"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.1.1.2.4.1.1 "><p id="rds_log_0003__p10063368174547">limit</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.3.1.1.2.4.1.2 "><p id="rds_log_0003__p9826466174547">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="57.99999999999999%" headers="mcps1.3.3.3.1.1.2.4.1.3 "><p id="rds_log_0003__p57746301174547">Specifies the number of records to be queried. The value range is from 1 to 50.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="rds_log_0003__section36474591"><h4 class="sectiontitle">Request</h4><ul id="rds_log_0003__ul1183180183717"><li id="rds_log_0003__li1283110163719">Request parameters<p id="rds_log_0003__p848415163614"><a name="rds_log_0003__li1283110163719"></a><a name="li1283110163719"></a>None</p>
</li></ul>
<ul id="rds_log_0003__ul97141152195913"><li id="rds_log_0003__li4411135064210">Example<p id="rds_log_0003__p1454414211213"><a name="rds_log_0003__li4411135064210"></a><a name="li4411135064210"></a>GET https://rds.eu-de.otc.t-systems.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/auditlog?start_time=2019-11-06T09:00:00+0800&amp;end_time=2019-11-07T10:40:15+0800&amp;offset=0&amp;limit=10</p>
</li></ul>
</div>
<div class="section" id="rds_log_0003__section59835867"><h4 class="sectiontitle">Response</h4><ul id="rds_log_0003__ul66273227"><li id="rds_log_0003__li59588135">Normal response
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_log_0003__table29752153" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="rds_log_0003__row62070345"><th align="left" class="cellrowborder" valign="top" width="23.880000000000003%" id="mcps1.3.5.2.1.1.2.4.1.1"><p id="rds_log_0003__p61642077"><strong id="rds_log_0003__b1031531152712">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="31.119999999999997%" id="mcps1.3.5.2.1.1.2.4.1.2"><p id="rds_log_0003__p26952341"><strong id="rds_log_0003__b65283121278">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="45%" id="mcps1.3.5.2.1.1.2.4.1.3"><p id="rds_log_0003__p35656026"><strong id="rds_log_0003__b33971013202719">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_log_0003__row49943891183823"><td class="cellrowborder" valign="top" width="23.880000000000003%" headers="mcps1.3.5.2.1.1.2.4.1.1 "><p id="rds_log_0003__p1040411073116">auditlogs</p>
</td>
<td class="cellrowborder" valign="top" width="31.119999999999997%" headers="mcps1.3.5.2.1.1.2.4.1.2 "><p id="rds_log_0003__p28299952183823">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.5.2.1.1.2.4.1.3 "><p id="rds_log_0003__p10594789183823">Indicates detailed information.</p>
<p id="rds_log_0003__p9886152615558">For details, see <a href="#rds_log_0003__table66531170">Table 3</a>.</p>
</td>
</tr>
<tr id="rds_log_0003__row29657875143522"><td class="cellrowborder" valign="top" width="23.880000000000003%" headers="mcps1.3.5.2.1.1.2.4.1.1 "><p id="rds_log_0003__p56278588143531">total_record</p>
</td>
<td class="cellrowborder" valign="top" width="31.119999999999997%" headers="mcps1.3.5.2.1.1.2.4.1.2 "><p id="rds_log_0003__p62271785143531">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.5.2.1.1.2.4.1.3 "><p id="rds_log_0003__p10849843143531">Indicates the total number of records.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="rds_log_0003__table66531170"></a><a name="table66531170"></a><table cellpadding="4" cellspacing="0" summary="" id="rds_log_0003__table66531170" frame="border" border="1" rules="all"><caption><b>Table 3 </b>auditlogs field data structure description</caption><thead align="left"><tr id="rds_log_0003__row12984378"><th align="left" class="cellrowborder" valign="top" width="24.47%" id="mcps1.3.5.2.1.2.2.4.1.1"><p id="rds_log_0003__p45101667"><strong id="rds_log_0003__b36071495278">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="30.769999999999996%" id="mcps1.3.5.2.1.2.2.4.1.2"><p id="rds_log_0003__p29356372"><strong id="rds_log_0003__b145281650172713">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.76%" id="mcps1.3.5.2.1.2.2.4.1.3"><p id="rds_log_0003__p29055926"><strong id="rds_log_0003__b1361125152719">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_log_0003__row4719792"><td class="cellrowborder" valign="top" width="24.47%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="rds_log_0003__p17182453133118">id</p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="rds_log_0003__p218295310316">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.76%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="rds_log_0003__p121822053193117">Indicates the audit log ID.</p>
</td>
</tr>
<tr id="rds_log_0003__row154615419615"><td class="cellrowborder" valign="top" width="24.47%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="rds_log_0003__p12182153183110">name</p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="rds_log_0003__p6182115363112">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.76%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="rds_log_0003__p4182253123118">Indicates the audit log file name.</p>
</td>
</tr>
<tr id="rds_log_0003__row5801050"><td class="cellrowborder" valign="top" width="24.47%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="rds_log_0003__p218285318315">size</p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="rds_log_0003__p141821653113114">Long</p>
</td>
<td class="cellrowborder" valign="top" width="44.76%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="rds_log_0003__p13182853193117">Indicates the size in KB of the audit log.</p>
</td>
</tr>
<tr id="rds_log_0003__row206101624119"><td class="cellrowborder" valign="top" width="24.47%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="rds_log_0003__p8182453163119">begin_time</p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="rds_log_0003__p17182153173112">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.76%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="rds_log_0003__p14182165318319">Indicates the start time of the audit log. The format is "yyyy-mm-ddThh:mm:ssZ".</p>
<p id="rds_log_0003__p16118331811"><strong id="rds_log_0003__b2785153432915">T</strong> is the separator between the calendar and the hourly notation of time. <strong id="rds_log_0003__b47864348295">Z</strong> indicates the time zone offset. </p>
</td>
</tr>
<tr id="rds_log_0003__row92051366119"><td class="cellrowborder" valign="top" width="24.47%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="rds_log_0003__p6206767118">end_time</p>
</td>
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="rds_log_0003__p82061461712">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.76%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="rds_log_0003__p3183195383119">Indicates the end time of the audit log. The format is "yyyy-mm-ddThh:mm:ssZ".</p>
<p id="rds_log_0003__p1618345383117"><strong id="rds_log_0003__b3137115512911">T</strong> is the separator between the calendar and the hourly notation of time. <strong id="rds_log_0003__b10138555122911">Z</strong> indicates the time zone offset. </p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="rds_log_0003__ul26818564"><li id="rds_log_0003__li40040492">Example normal response<pre class="codeblock" id="rds_log_0003__codeblock1246522131615">{
"auditlogs": [{
"id": "fa163ea0e2bet11e9d832166a2cf894c5br01",
"name": "317156_20190916032844_eb8fe5d181ec44a2850302691541f760in01_Audit_166a2cf8-d832-11e9-94c5-fa163ea0e2be",
"size": 20481.835938,
"begin_time": "2019-11-06T09:03:34+0800",
"end_time": "2019-11-06T10:39:15+0800"
}, {
"id": "fa163ea0e2bet11e9d832136a668094c5br01",
"name": "317162_20190916032838_eb8fe5d181ec44a2850302691541f760in01_Audit_136a6680-d832-11e9-94c5-fa163ea0e2be",
"size": 20481.835938,
"begin_time": "2019-11-07T09:04:35+0800",
"end_time":"2019-11-07T10:38:16+0800"
}],
"total_record": 2
}</pre>
</li><li id="rds_log_0003__li1953636143515">Abnormal response<p id="rds_log_0003__p46896054"><a name="rds_log_0003__li1953636143515"></a><a name="li1953636143515"></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_0003__section4778540915440"><h4 class="sectiontitle">Status Code</h4><ul id="rds_log_0003__en-us_topic_0032347778_ul7858132212142"><li id="rds_log_0003__en-us_topic_0032347778_li58581622171411">Normal<p id="rds_log_0003__en-us_topic_0032347778_p1040982941020"><a name="rds_log_0003__en-us_topic_0032347778_li58581622171411"></a><a name="en-us_topic_0032347778_li58581622171411"></a>200</p>
</li><li id="rds_log_0003__en-us_topic_0032347778_li11583183218149">Abnormal<p id="rds_log_0003__en-us_topic_0032347778_p0723374409"><a name="rds_log_0003__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_0003__section1183074220016"><h4 class="sectiontitle">Error Code</h4><p id="rds_log_0003__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>