Files
doc-exports/docs/cfw/api-ref/ListLogConfig.html
qiaoli 2ced5c725f CFW API 20250123 version
Reviewed-by: Gladkov, Maksim <mgladkov@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: qiaoli <qiaoli@huawei.com>
Co-committed-by: qiaoli <qiaoli@huawei.com>
2025-02-18 12:17:50 +00:00

233 lines
18 KiB
HTML

<a name="ListLogConfig"></a><a name="ListLogConfig"></a>
<h1 class="topictitle1">Obtaining Log Configurations</h1>
<div id="body1708331107508"><div class="section" id="ListLogConfig__section311565991516"><h4 class="sectiontitle">Function</h4><p id="ListLogConfig__p111585911511">This API is used to obtain log configurations.</p>
</div>
<div class="section" id="ListLogConfig__section51159595155"><h4 class="sectiontitle">URI</h4><p id="ListLogConfig__p9116105961510">GET /v1/{project_id}/cfw/logs/configuration</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListLogConfig__table19116205917153" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="ListLogConfig__row171161459131514"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="ListLogConfig__p1711620593154">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="ListLogConfig__p1116459181516">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="ListLogConfig__p10116259191520">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="ListLogConfig__p2116155912152">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListLogConfig__row18116859111515"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="ListLogConfig__p17117259181511">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="ListLogConfig__p1611735911518">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="ListLogConfig__p2117115910155">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="ListLogConfig__p191172592151">Project ID, which can be obtained by calling an API or from the console. For details, see <a href="cfw_02_0015.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListLogConfig__table11171859151511" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Query Parameters</caption><thead align="left"><tr id="ListLogConfig__row91178590152"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.1"><p id="ListLogConfig__p1611710597156">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.2"><p id="ListLogConfig__p11117659121512">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.3"><p id="ListLogConfig__p7118459151512">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.4.2.5.1.4"><p id="ListLogConfig__p4118459121514">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListLogConfig__row1117059121519"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ListLogConfig__p1118115910156">fw_instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ListLogConfig__p61181599154">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ListLogConfig__p61181259131514">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ListLogConfig__p1118259131515">Firewall ID, which can be obtained by referring to <a href="cfw_02_0028.html">Obtaining a Firewall ID</a>.</p>
</td>
</tr>
<tr id="ListLogConfig__row1711795916154"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ListLogConfig__p5118165913153">enterprise_project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ListLogConfig__p10118155901510">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ListLogConfig__p2118459161514">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ListLogConfig__p19118135901512">Enterprise project ID, which is the ID of a project planned based on organizations. You can obtain the enterprise project ID by referring to <a href="cfw_02_0027.html">Obtaining an Enterprise Project ID</a>. If the enterprise project function is not enabled, the value is <strong id="ListLogConfig__b1811885911516">0</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListLogConfig__section51181459161513"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListLogConfig__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request header parameters</caption><thead align="left"><tr id="ListLogConfig__row111188597151"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="ListLogConfig__p91191859101515">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="ListLogConfig__p611955918157">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="ListLogConfig__p11119115911156">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="ListLogConfig__p911925941516">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListLogConfig__row201181259131514"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="ListLogConfig__p1111935931516">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="ListLogConfig__p6119459171514">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="ListLogConfig__p4119145971510">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="ListLogConfig__p411955941517">User token. You can obtain the token by referring to <a href="cfw_02_0029.html">Obtaining a User Token</a>.</p>
</td>
</tr>
<tr id="ListLogConfig__row1811845910150"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="ListLogConfig__p1811913591154">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="ListLogConfig__p71199597154">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="ListLogConfig__p5119459191515">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="ListLogConfig__p141198597157">Content type. It can only be set to application/json.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListLogConfig__section9119155910154"><h4 class="sectiontitle">Response Parameters</h4><p id="ListLogConfig__p1212085951518"><strong id="ListLogConfig__b1612015931510">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListLogConfig__response_ListLogConfigResponseBody" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response body parameters</caption><thead align="left"><tr id="ListLogConfig__row712095971517"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.1"><p id="ListLogConfig__p812065911151">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.2"><p id="ListLogConfig__p91201559151516">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.4.1.3"><p id="ListLogConfig__p17120115911156">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListLogConfig__row1812025951518"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ListLogConfig__p1012085981519">data</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ListLogConfig__p7120259151516"><a href="#ListLogConfig__response_LogConfigDto">LogConfigDto</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ListLogConfig__p1912017599156">Log configurations.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="ListLogConfig__response_LogConfigDto"></a><a name="response_LogConfigDto"></a><table cellpadding="4" cellspacing="0" summary="" id="ListLogConfig__response_LogConfigDto" frame="border" border="1" rules="all"><caption><b>Table 5 </b>LogConfigDto</caption><thead align="left"><tr id="ListLogConfig__row181211059161517"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.4.2.4.1.1"><p id="ListLogConfig__p112117594151">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.4.2.4.1.2"><p id="ListLogConfig__p1012145914152">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.4.2.4.1.3"><p id="ListLogConfig__p612113591153">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListLogConfig__row912111595157"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListLogConfig__p15121195913158">fw_instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListLogConfig__p11211859101516">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListLogConfig__p19121115961513">Firewall ID, which can be obtained by referring to <a href="cfw_02_0028.html">Obtaining a Firewall ID</a>.</p>
</td>
</tr>
<tr id="ListLogConfig__row141213595156"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListLogConfig__p3121125981516">lts_enable</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListLogConfig__p112213596154">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListLogConfig__p5122159191514">Whether to enable LTS: 1 (yes), 0 (no). If the parameter is set to 1 then parameters lts_attack_log_stream_enable, lts_access_log_stream_enable, lts_flow_log_stream_enable must be mandatory.</p>
</td>
</tr>
<tr id="ListLogConfig__row141211159111513"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListLogConfig__p1112216594157">lts_log_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListLogConfig__p31221059131520">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListLogConfig__p412245918156">Log Tank Service (LTS) log group ID, which can be obtained by calling the API for querying all the log groups of an account in LTS. Find the value in <strong id="ListLogConfig__b4122135981516">log_groups.log_group_id</strong> (The period [.] is used to separate different levels of objects).</p>
</td>
</tr>
<tr id="ListLogConfig__row131212597157"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListLogConfig__p912235912157">lts_attack_log_stream_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListLogConfig__p31221359161513">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListLogConfig__p91229598157">Attack log stream ID, which can be obtained by calling the API for querying all the log streams in a specified log group in LTS. Find the value in <strong id="ListLogConfig__b12122059141512">log_streams.log_stream_id</strong> (The period [.] is used to separate different levels of objects).</p>
</td>
</tr>
<tr id="ListLogConfig__row101211559201510"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListLogConfig__p112215931513">lts_attack_log_stream_enable</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListLogConfig__p612235921513">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListLogConfig__p1312213595156">Whether to enable the attack log stream: <strong id="ListLogConfig__b5122259151518">1</strong> (yes), <strong id="ListLogConfig__b12122105911518">0</strong> (no).</p>
</td>
</tr>
<tr id="ListLogConfig__row1012175915151"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListLogConfig__p16123659181512">lts_access_log_stream_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListLogConfig__p1512385961511">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListLogConfig__p212311596151">Access control log stream ID, which can be obtained by calling the API for querying all the log streams in a specified log group in LTS. Find the value in <strong id="ListLogConfig__b1612315595150">log_streams.log_stream_id</strong> (The period [.] is used to separate different levels of objects).</p>
</td>
</tr>
<tr id="ListLogConfig__row1612155914153"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListLogConfig__p71232059161516">lts_access_log_stream_enable</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListLogConfig__p1212385911512">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListLogConfig__p1123195915151">Whether to enable the access control stream: <strong id="ListLogConfig__b12123165919156">1</strong> (yes), <strong id="ListLogConfig__b71230591157">0</strong> (no).</p>
</td>
</tr>
<tr id="ListLogConfig__row16121135991514"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListLogConfig__p61232592151">lts_flow_log_stream_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListLogConfig__p31232595158">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListLogConfig__p2012375991517">Traffic log ID, which can be obtained by calling the API for querying all the log streams in a specified log group in LTS. Find the value in <strong id="ListLogConfig__b412335961512">log_streams.log_stream_id</strong> (The period [.] is used to separate different levels of objects).</p>
</td>
</tr>
<tr id="ListLogConfig__row1012114596150"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ListLogConfig__p171231259161510">lts_flow_log_stream_enable</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ListLogConfig__p1512375919159">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ListLogConfig__p7123185911512">Whether to enable the traffic log function: <strong id="ListLogConfig__b012395911511">1</strong> (yes), <strong id="ListLogConfig__b11123135961516">0</strong> (no).</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListLogConfig__section17123155991513"><h4 class="sectiontitle">Example Requests</h4><p id="ListLogConfig__p8124165912159">Query the log configuration of the firewall 4e113415-7811-4bb3-bf5e-eb835953f7d4 in project 408972e72dcd4c1a9b033e955802a36b.</p>
<pre class="screen" id="ListLogConfig__screen712425919158">https://{Endpoint}/v1/408972e72dcd4c1a9b033e955802a36b/cfw/logs/configuration?fw_instance_id=4e113415-7811-4bb3-bf5e-eb835953f7d4&amp;enterprise_project_id=default</pre>
</div>
<div class="section" id="ListLogConfig__section1512413597150"><h4 class="sectiontitle">Example Responses</h4><p id="ListLogConfig__p121241859101513"><strong id="ListLogConfig__b6124135918158">Status code: 200</strong></p>
<p id="ListLogConfig__p0124059101510">Return value for querying log configurations.</p>
<pre class="screen" id="ListLogConfig__screen181241259101518">{
"data" : {
"fw_instance_id" : "4df2bcd1-6299-4fba-8e71-8d50ea807090",
"lts_access_log_stream_enable" : 0,
"lts_attack_log_stream_enable" : 0,
"lts_enable" : 0,
"lts_flow_log_stream_enable" : 0,
"lts_log_group_id" : "d783ce42-7f56-4c2d-9a96-b1043d016f5a"
}
}</pre>
</div>
<div class="section" id="ListLogConfig__section630835971519"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ListLogConfig__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="ListLogConfig__row11133115918159"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="ListLogConfig__p1530845991519">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="ListLogConfig__p1830835921517">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ListLogConfig__row1913312591156"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ListLogConfig__p10308259141515">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ListLogConfig__p1230817598159">Return value for querying log configurations.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ListLogConfig__section3308759131516"><h4 class="sectiontitle">Error Codes</h4><p id="ListLogConfig__p93087595154">See <a href="ErrorCode.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="topic_300000008.html">Log Management</a></div>
</div>
</div>