doc-exports/docs/waf/api-ref/waf_02_0073.html
Li, Qiao 914011d51b waf_api_1109
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Li, Qiao <qiaoli@huawei.com>
Co-committed-by: Li, Qiao <qiaoli@huawei.com>
2022-11-16 15:31:27 +00:00

198 lines
15 KiB
HTML

<a name="waf_02_0073"></a><a name="waf_02_0073"></a>
<h1 class="topictitle1">Querying Request Statistics and Attack Statistics in a Specified Time Range</h1>
<div id="body51587453"><div class="section" id="waf_02_0073__section272892"><h4 class="sectiontitle">Function Description</h4><p class="msonormal" id="waf_02_0073__p17834126">This API is used to query request statistics and attack statistics in a specified time range.</p>
</div>
<div class="section" id="waf_02_0073__section22104283"><h4 class="sectiontitle">URI</h4><ul id="waf_02_0073__ul38953514"><li id="waf_02_0073__li15037312">URI format<p id="waf_02_0073__p1118085"><a name="waf_02_0073__li15037312"></a><a name="li15037312"></a>GET /v1/{project_id}/waf/event/timeline?from={from}&amp;to={to}&amp;timezone={timezone}&amp;hosts={hostids}</p>
<div class="note" id="waf_02_0073__note63241148751"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="waf_02_0073__p23244481054">An example of a URI is as follows:</p>
<p id="waf_02_0073__p774833712618">GET /v1/3ac26c59e15a4a11bb680a103a29ddb6/waf/event/attack/type?from=1543976973635&amp;to=1563976973635&amp;hosts=3211757cafa3437aae24d760022e79ba&amp;hosts=93029844064b43739b51ca63036fbc4b&amp;hosts=34fe5f5c60ef4e43a9975296765d1217</p>
</div></div>
</li><li id="waf_02_0073__li10062770">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0073__table23456073" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path parameters</caption><thead align="left"><tr id="waf_02_0073__row24209096"><th align="left" class="cellrowborder" valign="top" width="25.507449255074494%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="waf_02_0073__p14779753"><strong id="waf_02_0073__b181631731111111">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="waf_02_0073__p56309310"><strong id="waf_02_0073__b9628338114">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.33826617338266%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="waf_02_0073__p64760239"><strong id="waf_02_0073__b170120342111">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.806019398060194%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="waf_02_0073__p11088038"><strong id="waf_02_0073__b1731413610112">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0073__row25715848"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0073__p2608959">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0073__p9999155">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.33826617338266%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0073__p4625227">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.806019398060194%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0073__p39099120">Specifies the project ID.</p>
</td>
</tr>
<tr id="waf_02_0073__row16347762"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0073__p49100373">from</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0073__p17707256">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.33826617338266%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0073__p25001603">Long</p>
</td>
<td class="cellrowborder" valign="top" width="39.806019398060194%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0073__p18857034">Specifies the start time (UTC) in milliseconds. For example, <strong id="waf_02_0073__b102003575485">1548172800000</strong>.</p>
</td>
</tr>
<tr id="waf_02_0073__row3762181511574"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0073__p1076241518579">to</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0073__p11762171595720">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.33826617338266%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0073__p18762131575715">Long</p>
</td>
<td class="cellrowborder" valign="top" width="39.806019398060194%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0073__p676211156578">Specifies the end time (UTC) in milliseconds. For example, <strong id="waf_02_0073__b10419170144910">1548431999000</strong>.</p>
</td>
</tr>
<tr id="waf_02_0073__row15254518105719"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0073__p192549185578">timezone</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0073__p8254151819574">No</p>
</td>
<td class="cellrowborder" valign="top" width="17.33826617338266%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0073__p1525415181578">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.806019398060194%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0073__p162541618145710">Time zone. For example, the time zone for London is +00:00. The default value is <strong id="waf_02_0073__b224718353496">+00:00</strong>.</p>
</td>
</tr>
<tr id="waf_02_0073__row39666843"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0073__p58897682">hosts</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0073__p5982958">No</p>
</td>
<td class="cellrowborder" valign="top" width="17.33826617338266%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0073__p14857623">Array</p>
</td>
<td class="cellrowborder" valign="top" width="39.806019398060194%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0073__p62616820">Specifies the domain IDs.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="waf_02_0073__section64720826"><h4 class="sectiontitle">Request</h4><p id="waf_02_0073__p162261522111216">Request parameters</p>
<p class="msonormal" id="waf_02_0073__p38797678">None</p>
</div>
<div class="section" id="waf_02_0073__section45616523"><h4 class="sectiontitle">Response</h4><div class="p" id="waf_02_0073__p19968193019129">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0073__table7646679" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="waf_02_0073__row48684466"><th align="left" class="cellrowborder" valign="top" width="32.46675332466753%" id="mcps1.3.4.2.1.2.4.1.1"><p id="waf_02_0073__p51127646"><strong id="waf_02_0073__b15679918171220">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.73722627737226%" id="mcps1.3.4.2.1.2.4.1.2"><p id="waf_02_0073__p47698687"><strong id="waf_02_0073__b1444121181310">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.796020397960206%" id="mcps1.3.4.2.1.2.4.1.3"><p id="waf_02_0073__p38388477"><strong id="waf_02_0073__b149423223136">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0073__row9951978"><td class="cellrowborder" valign="top" width="32.46675332466753%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0073__p803902">requests</p>
</td>
<td class="cellrowborder" valign="top" width="27.73722627737226%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0073__p65116065"><a href="#waf_02_0073__table1864743120361">Table 3</a></p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.2.1.2.4.1.3 "><p id="waf_02_0073__p39909950">Specifies request statistics.</p>
</td>
</tr>
<tr id="waf_02_0073__row59543404"><td class="cellrowborder" valign="top" width="32.46675332466753%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0073__p58286448">attacks</p>
</td>
<td class="cellrowborder" valign="top" width="27.73722627737226%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0073__p23581848"><a href="#waf_02_0073__table1441245463618">Table 4</a></p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.2.1.2.4.1.3 "><p id="waf_02_0073__p31081549">Specifies attack statistics.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="tablenoborder"><a name="waf_02_0073__table1864743120361"></a><a name="table1864743120361"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0073__table1864743120361" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="waf_02_0073__b881394313300">requests</strong></caption><thead align="left"><tr id="waf_02_0073__row11651123193616"><th align="left" class="cellrowborder" valign="top" width="32.46675332466753%" id="mcps1.3.4.3.2.4.1.1"><p id="waf_02_0073__p8652331123610"><strong id="waf_02_0073__b19344135922013">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.73722627737226%" id="mcps1.3.4.3.2.4.1.2"><p id="waf_02_0073__p16653173163614"><strong id="waf_02_0073__b1252281602">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.796020397960206%" id="mcps1.3.4.3.2.4.1.3"><p id="waf_02_0073__p1765414316365"><strong id="waf_02_0073__b1273133172116">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0073__row14369133920360"><td class="cellrowborder" valign="top" width="32.46675332466753%" headers="mcps1.3.4.3.2.4.1.1 "><p id="waf_02_0073__p586543743614">time</p>
</td>
<td class="cellrowborder" valign="top" width="27.73722627737226%" headers="mcps1.3.4.3.2.4.1.2 "><p id="waf_02_0073__p4865133733611">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.3.2.4.1.3 "><p id="waf_02_0073__p58661537163619">Specifies the end time since Unix Epoch in milliseconds.</p>
</td>
</tr>
<tr id="waf_02_0073__row33681839143618"><td class="cellrowborder" valign="top" width="32.46675332466753%" headers="mcps1.3.4.3.2.4.1.1 "><p id="waf_02_0073__p586810376369">num</p>
</td>
<td class="cellrowborder" valign="top" width="27.73722627737226%" headers="mcps1.3.4.3.2.4.1.2 "><p id="waf_02_0073__p1086973783615">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.3.2.4.1.3 "><p id="waf_02_0073__p4871143716361">Specifies the number of requests.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="waf_02_0073__table1441245463618"></a><a name="table1441245463618"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0073__table1441245463618" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="waf_02_0073__b48625917308">attacks</strong></caption><thead align="left"><tr id="waf_02_0073__row1241695410366"><th align="left" class="cellrowborder" valign="top" width="32.46675332466753%" id="mcps1.3.4.4.2.4.1.1"><p id="waf_02_0073__p641715493612"><strong id="waf_02_0073__b1893713242">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.73722627737226%" id="mcps1.3.4.4.2.4.1.2"><p id="waf_02_0073__p14419115433618"><strong id="waf_02_0073__b1841831354">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.796020397960206%" id="mcps1.3.4.4.2.4.1.3"><p id="waf_02_0073__p942015493613"><strong id="waf_02_0073__b818085625">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0073__row742115443618"><td class="cellrowborder" valign="top" width="32.46675332466753%" headers="mcps1.3.4.4.2.4.1.1 "><p id="waf_02_0073__p0422254153613">time</p>
</td>
<td class="cellrowborder" valign="top" width="27.73722627737226%" headers="mcps1.3.4.4.2.4.1.2 "><p id="waf_02_0073__p0423115443611">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.4.2.4.1.3 "><p id="waf_02_0073__p542415544363">Specifies the end time since Unix Epoch in milliseconds.</p>
</td>
</tr>
<tr id="waf_02_0073__row1342565413362"><td class="cellrowborder" valign="top" width="32.46675332466753%" headers="mcps1.3.4.4.2.4.1.1 "><p id="waf_02_0073__p10426754133613">num</p>
</td>
<td class="cellrowborder" valign="top" width="27.73722627737226%" headers="mcps1.3.4.4.2.4.1.2 "><p id="waf_02_0073__p642775493614">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.4.2.4.1.3 "><p id="waf_02_0073__p1342810548364">Specifies the number of attacks.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="waf_02_0073__section6158236101217"><h4 class="sectiontitle">Example</h4><p id="waf_02_0073__p856415904315"></p>
<div class="p" id="waf_02_0073__p16296144171218">Response example<pre class="screen" id="waf_02_0073__screen10174183621215">{
"requests": [
{"time": 1499817600, "num": 123400},
{"time": 1499817601, "num": 123401},
{"time": 1499817602, "num": 123402}
],
"attacks": [
{"time": 1499817600, "num": 1234},
{"time": 1499817601, "num": 1235},
{"time": 1499817602, "num": 1236}
]
}</pre>
</div>
</div>
<div class="section" id="waf_02_0073__section7895529"><h4 class="sectiontitle">Status Code</h4><div class="p" id="waf_02_0073__waf_02_0012_a652d4922b7df48fca0a65bc1a38ea5f2"><a href="#waf_02_0073__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0">Table 5</a> describes the normal status code returned by the API.
<div class="tablenoborder"><a name="waf_02_0073__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><a name="waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0073__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Status code</caption><thead align="left"><tr id="waf_02_0073__waf_02_0012_r3d6e2f205c444705bdbb9daaac74e575"><th align="left" class="cellrowborder" valign="top" width="22%" id="mcps1.3.6.2.2.2.4.1.1"><p id="waf_02_0073__waf_02_0012_af3c4073076f24eca88d94e3fa1effdc6">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.41%" id="mcps1.3.6.2.2.2.4.1.2"><p id="waf_02_0073__waf_02_0012_en-us_topic_0144911667_p4531342288">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="58.589999999999996%" id="mcps1.3.6.2.2.2.4.1.3"><p id="waf_02_0073__waf_02_0012_ada185614bba24140995b8123b3e9faa8">Meaning</p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0073__waf_02_0012_rc7b2adc390904a1ba79e303017797786"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.6.2.2.2.4.1.1 "><p id="waf_02_0073__waf_02_0012_a93f3895d44bb4226934cc626ac50e37b">200</p>
</td>
<td class="cellrowborder" valign="top" width="19.41%" headers="mcps1.3.6.2.2.2.4.1.2 "><p id="waf_02_0073__waf_02_0012_en-us_topic_0144911667_p7538425819">OK</p>
</td>
<td class="cellrowborder" valign="top" width="58.589999999999996%" headers="mcps1.3.6.2.2.2.4.1.3 "><p id="waf_02_0073__waf_02_0012_en-us_topic_0144911667_p369874114414">The request has succeeded.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="waf_02_0073__waf_02_0012_en-us_topic_0144911667_p482819399522">For details about error status codes, see <a href="waf_02_0085.html">Status Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="waf_02_0069.html">Event Logs</a></div>
</div>
</div>