forked from docs/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>
190 lines
16 KiB
HTML
190 lines
16 KiB
HTML
<a name="dds_api_0095"></a><a name="dds_api_0095"></a>
|
|
|
|
<h1 class="topictitle1">Querying Database Error Logs</h1>
|
|
<div id="body0000001072355002"><div class="section" id="dds_api_0095__section61759636"><h4 class="sectiontitle">Function</h4><p id="dds_api_0095__p33831530">This API is used to query database error logs.</p>
|
|
</div>
|
|
<div class="section" id="dds_api_0095__section1239972118494"><h4 class="sectiontitle">Constraints</h4><p id="dds_api_0095__p141259655619">A maximum of 2000 records can be queried within the period specified by <strong id="dds_api_0095__b6896161416299">start_date</strong> and <strong id="dds_api_0095__b28971214172920">end_date</strong>.</p>
|
|
</div>
|
|
<div class="section" id="dds_api_0095__section18965813"><h4 class="sectiontitle">URI</h4><ul id="dds_api_0095__ul55999443"><li id="dds_api_0095__li34232944">URI format<p id="dds_api_0095__p39661040"><a name="dds_api_0095__li34232944"></a><a name="li34232944"></a>GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/errorlog?offset={offset}&limit={limit}&start_date={start_date}&end_date={end_date}&type={type}&node_id={node_id}</p>
|
|
</li><li id="dds_api_0095__li21405046">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0095__table58427690" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="dds_api_0095__row1482002"><th align="left" class="cellrowborder" valign="top" width="21.3%" id="mcps1.3.3.2.2.1.2.4.1.1"><p id="dds_api_0095__p52933326">Name</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="14.91%" id="mcps1.3.3.2.2.1.2.4.1.2"><p id="dds_api_0095__p59740974">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="63.79%" id="mcps1.3.3.2.2.1.2.4.1.3"><p id="dds_api_0095__p7180698">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dds_api_0095__row17851661144942"><td class="cellrowborder" valign="top" width="21.3%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="dds_api_0095__p2142393">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="dds_api_0095__p39316155">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.79%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="dds_api_0095__p30492010">Specifies the project ID of a tenant in a region.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dds_api_0095__row44765691"><td class="cellrowborder" valign="top" width="21.3%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="dds_api_0095__p15641626">instance_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="dds_api_0095__p59012183">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.79%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="dds_api_0095__p15257500">Specifies the instance ID, which can be obtained by calling the API for querying instances. If you do not have an instance, you can call the API used for creating an instance.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dds_api_0095__row5992637"><td class="cellrowborder" valign="top" width="21.3%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="dds_api_0095__p2185194811389">start_date</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="dds_api_0095__p11853485387">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.79%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="dds_api_0095__p551472711406">Specifies the start time in the "yyyy-mm-ddThh:mm:ssZ" format.</p>
|
|
<p id="dds_api_0095__p19682171183911"><strong id="dds_api_0095__b6672132713301">T</strong> is the separator between the calendar and the hourly notation of time. <strong id="dds_api_0095__b9674142718307">Z</strong> indicates the time zone offset.</p>
|
|
<div class="caution" id="dds_api_0095__note64616179393"><span class="cautiontitle"> CAUTION: </span><div class="cautionbody"><p id="dds_api_0095__p3471517203919">The start time is 31 days earlier than the current time.</p>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
<tr id="dds_api_0095__row4338161118585"><td class="cellrowborder" valign="top" width="21.3%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="dds_api_0095__p1548810211398">end_date</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="dds_api_0095__p1448872113913">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.79%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="dds_api_0095__p19353113319402">Specifies the end time in the "yyyy-mm-ddThh:mm:ssZ" format.</p>
|
|
<ul id="dds_api_0095__ul17760836152315"><li id="dds_api_0095__li1476012363239"><strong id="dds_api_0095__b77345354300">T</strong> is the separator between the calendar and the hourly notation of time. <strong id="dds_api_0095__b117361735173011">Z</strong> indicates the time zone offset.</li><li id="dds_api_0095__li1467115611234">Only error logs generated within the last month can be queried.</li></ul>
|
|
<div class="note" id="dds_api_0095__note14850121122414"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="dds_api_0095__p208536111245">The end time cannot be later than the current time.</p>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
<tr id="dds_api_0095__row9204151375819"><td class="cellrowborder" valign="top" width="21.3%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="dds_api_0095__p280819614016">node_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="dds_api_0095__p198086616406">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.79%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="dds_api_0095__p15408205118261">Specifies the node ID. For details, see <a href="dds_api_0023.html#dds_api_0023__table3426155424213">Table 8</a>.</p>
|
|
<p id="dds_api_0095__p8615104010405">If this parameter is left blank, all nodes in the instance can be queried.</p>
|
|
<p id="dds_api_0095__p66158402404">Nodes that can be queried:</p>
|
|
<ul id="dds_api_0095__ul46103620243"><li id="dds_api_0095__li56173672414">mongos, shard, and config nodes in a cluster instance.</li><li id="dds_api_0095__li78125389247">All nodes in a replica set or single node instance.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="dds_api_0095__row0181415195810"><td class="cellrowborder" valign="top" width="21.3%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="dds_api_0095__p18496559103919">type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="dds_api_0095__p18496155918396">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.79%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="dds_api_0095__p138228488405">Specifies the statement type. If it is left blank, all statement types are queried. Valid value:</p>
|
|
<ul id="dds_api_0095__ul098811512814"><li id="dds_api_0095__li179884152817">WARNING</li><li id="dds_api_0095__li139883157818">ERROR</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="dds_api_0095__row14709161665818"><td class="cellrowborder" valign="top" width="21.3%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="dds_api_0095__p158521312113910">offset</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="dds_api_0095__p178521212173920">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.79%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="dds_api_0095__p891313565407">Specifies the index position. Its value range is <strong id="dds_api_0095__b11205536143315">[0, 1999]</strong>.</p>
|
|
<p id="dds_api_0095__p09131356144018">If <strong id="dds_api_0095__b115861737133313">offset</strong> is set to <em id="dds_api_0095__i12588143719331">N</em>, the resource query starts from the N+1 piece of data. The value is <strong id="dds_api_0095__b11589153783313">0</strong> by default, indicating that the query starts from the first piece of data. The value cannot be a negative number.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dds_api_0095__row19239181811585"><td class="cellrowborder" valign="top" width="21.3%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="dds_api_0095__p991171617396">limit</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="dds_api_0095__p791616183915">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63.79%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="dds_api_0095__p553110111412">Specifies the number of resources to be queried. The value ranges from 1 to 100. The default value is <strong id="dds_api_0095__b13400134418336">10</strong>, indicating that 10 records are returned by default.</p>
|
|
<div class="note" id="dds_api_0095__note811092412279"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="dds_api_0095__p911182420278">The sum of <strong id="dds_api_0095__b1733014464334">limit</strong> and <strong id="dds_api_0095__b1233113461332">offset</strong> values must be less than or equal to 2000.</p>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="dds_api_0095__section36474591"><h4 class="sectiontitle">Requests</h4><ul id="dds_api_0095__ul18395133132815"><li id="dds_api_0095__li1339510320287">Example request<ul id="dds_api_0095__ul14281133012814"><li id="dds_api_0095__li10281143022812">Querying database error logs.<p id="dds_api_0095__p24916461856"><a name="dds_api_0095__li10281143022812"></a><a name="li10281143022812"></a>GET https://dds.eu-de.otc.t-systems.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/6ade8143870047b8999aba8f1891b48ein02/errorlog?start_date=2018-08-06T10:41:14+0800&end_date=2018-08-07T10:41:14+0800</p>
|
|
</li><li id="dds_api_0095__li1626773815284">Querying database error logs based on specified conditions.<p id="dds_api_0095__p17342319468"><a name="dds_api_0095__li1626773815284"></a><a name="li1626773815284"></a>GET https://dds.eu-de.otc.t-systems.com/v3/0549b4a43100d4f32f51c01c2fe4acdb/instances/6ade8143870047b8999aba8f1891b48ein02/errorlog?type=WARNING&offset=1&limit=20&node_id=a7c84462483642798cf159237343135fno06&start_date=2018-08-06T10:41:14+0800&end_date=2018-08-07T10:41:14+0800</p>
|
|
</li></ul>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="dds_api_0095__section13542203818326"><h4 class="sectiontitle">Responses</h4><ul id="dds_api_0095__ul9542183818328"><li id="dds_api_0095__li254216381322">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0095__table454210389327" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="dds_api_0095__row1654383810323"><th align="left" class="cellrowborder" valign="top" width="16.6%" id="mcps1.3.5.2.1.1.2.4.1.1"><p id="dds_api_0095__p145431338113210">Name</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50.07%" id="mcps1.3.5.2.1.1.2.4.1.2"><p id="dds_api_0095__p354316381321">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33%" id="mcps1.3.5.2.1.1.2.4.1.3"><p id="dds_api_0095__p8543938183216">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dds_api_0095__row125431389323"><td class="cellrowborder" valign="top" width="16.6%" headers="mcps1.3.5.2.1.1.2.4.1.1 "><p id="dds_api_0095__p9543103820322">error_log_list</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.07%" headers="mcps1.3.5.2.1.1.2.4.1.2 "><p id="dds_api_0095__p05431938103218">Array of objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.5.2.1.1.2.4.1.3 "><p id="dds_api_0095__p9543173814325">Indicates detailed information.</p>
|
|
<p id="dds_api_0095__p15543738193213">For details, see <a href="#dds_api_0095__table11544193873211">Table 3</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dds_api_0095__row254416385328"><td class="cellrowborder" valign="top" width="16.6%" headers="mcps1.3.5.2.1.1.2.4.1.1 "><p id="dds_api_0095__p1254433873215">total_record</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.07%" headers="mcps1.3.5.2.1.1.2.4.1.2 "><p id="dds_api_0095__p4544438123217">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.5.2.1.1.2.4.1.3 "><p id="dds_api_0095__p45448383321">Indicates the total number of records.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="dds_api_0095__table11544193873211"></a><a name="table11544193873211"></a><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0095__table11544193873211" frame="border" border="1" rules="all"><caption><b>Table 3 </b>error_log_list field data structure description</caption><thead align="left"><tr id="dds_api_0095__row14544123816323"><th align="left" class="cellrowborder" valign="top" width="15.659999999999998%" id="mcps1.3.5.2.1.2.2.4.1.1"><p id="dds_api_0095__p354411380323">Name</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.1%" id="mcps1.3.5.2.1.2.2.4.1.2"><p id="dds_api_0095__p6544538173219">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="69.24%" id="mcps1.3.5.2.1.2.2.4.1.3"><p id="dds_api_0095__p135441138143220">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dds_api_0095__row9545838103212"><td class="cellrowborder" valign="top" width="15.659999999999998%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="dds_api_0095__p1554573819322">node_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.1%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="dds_api_0095__p154573811321">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="69.24%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="dds_api_0095__p16545143818327">Indicates the node name.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dds_api_0095__row19545938143216"><td class="cellrowborder" valign="top" width="15.659999999999998%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="dds_api_0095__p13545193813321">level</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.1%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="dds_api_0095__p1154533816322">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="69.24%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="dds_api_0095__p95451038173216">Indicates the log level.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dds_api_0095__row1754513823211"><td class="cellrowborder" valign="top" width="15.659999999999998%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="dds_api_0095__p105451938163218">time</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.1%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="dds_api_0095__p155454385325">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="69.24%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="dds_api_0095__p1654533873217">Indicates the time in the UTC format.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dds_api_0095__row15545133833220"><td class="cellrowborder" valign="top" width="15.659999999999998%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="dds_api_0095__p11545163814327">content</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.1%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="dds_api_0095__p145451438163218">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="69.24%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="dds_api_0095__p14545338163213">Indicates the log content.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="dds_api_0095__ul11545113810325"><li id="dds_api_0095__li15545203814320">Response example<pre class="codeblock" id="dds_api_0095__codeblock1546193893212">{
|
|
"error_log_list": [
|
|
{
|
|
"node_name": "Test_replica_node_2",
|
|
"level": "WARNING",
|
|
"time": "2020-12-15T08:53:01.868+0000",
|
|
"content": "W NETWORK [LogicalSessionCacheReap] Unable to reach primary for set replica"
|
|
}
|
|
],
|
|
"total_record": 1
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="dds_api_0095__section5382712154838"><h4 class="sectiontitle">Status Code</h4><p id="dds_api_0095__dds_api_0018_p16131712193312">Status Code:200.</p>
|
|
<p id="dds_api_0095__dds_api_0018_p480617135329">For more information, see <a href="dds_status_code.html">Status Code</a>.</p>
|
|
</div>
|
|
<div class="section" id="dds_api_0095__section6522193710339"><h4 class="sectiontitle">Error Code</h4><p id="dds_api_0095__dds_api_0018_p20466124120334">For more information, see <a href="dds_error_code.html">Error Code</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dds_api_0092.html">Log Information Queries</a></div>
|
|
</div>
|
|
</div>
|
|
|