doc-exports/docs/waf/api-ref/waf_02_0039.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

142 lines
11 KiB
HTML

<a name="waf_02_0039"></a><a name="waf_02_0039"></a>
<h1 class="topictitle1">Querying a Blacklist or Whitelist Rule</h1>
<div id="body30847266"><div class="section" id="waf_02_0039__section51375086"><h4 class="sectiontitle">Function Description</h4><p class="msonormal" id="waf_02_0039__p15600612">This API is used to query a blacklist or whitelist rule.</p>
</div>
<div class="section" id="waf_02_0039__section59722591"><h4 class="sectiontitle">URI</h4><ul id="waf_02_0039__ul55690046"><li id="waf_02_0039__li31448372">URI format<p id="waf_02_0039__p14599897"><a name="waf_02_0039__li31448372"></a><a name="li31448372"></a>GET /v1/{project_id}/waf/policy/{policy_id}/whiteblackip/{whiteblackip_rule_id}</p>
</li><li id="waf_02_0039__li64290214">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0039__table41741021" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path parameters</caption><thead align="left"><tr id="waf_02_0039__row24986044"><th align="left" class="cellrowborder" valign="top" width="30.930000000000003%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="waf_02_0039__p10603677"><strong id="waf_02_0039__b1123458103719">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.62%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="waf_02_0039__p53591474"><strong id="waf_02_0039__b16457185920372">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.430000000000001%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="waf_02_0039__p45942115"><strong id="waf_02_0039__b1160130163816">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="34.02%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="waf_02_0039__p30323866"><strong id="waf_02_0039__b1439641153811">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0039__row40314044"><td class="cellrowborder" valign="top" width="30.930000000000003%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0039__p44212147">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.62%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0039__p24414183">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.430000000000001%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0039__p31391807">String</p>
</td>
<td class="cellrowborder" valign="top" width="34.02%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0039__p59708452">Specifies the project ID.</p>
</td>
</tr>
<tr id="waf_02_0039__row505158"><td class="cellrowborder" valign="top" width="30.930000000000003%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0039__p40917865">policy_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.62%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0039__p26012748">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.430000000000001%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0039__p26657815">String</p>
</td>
<td class="cellrowborder" valign="top" width="34.02%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0039__p11799411">Specifies the policy ID.</p>
</td>
</tr>
<tr id="waf_02_0039__row39085839"><td class="cellrowborder" valign="top" width="30.930000000000003%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0039__p11836358">whiteblackip_rule_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.62%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0039__p19220962">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.430000000000001%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0039__p13394123">String</p>
</td>
<td class="cellrowborder" valign="top" width="34.02%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0039__p11182184">Specifies the ID of a blacklist or whitelist rule.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="waf_02_0039__section632413"><h4 class="sectiontitle">Request</h4><p id="waf_02_0039__p210012565458">Request parameters</p>
<p class="msonormal" id="waf_02_0039__p33341730">None</p>
</div>
<div class="section" id="waf_02_0039__section5691720"><h4 class="sectiontitle">Response</h4><div class="p" id="waf_02_0039__p16266114144610">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0039__table47305227" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="waf_02_0039__row17264294"><th align="left" class="cellrowborder" valign="top" width="42.85571442855714%" id="mcps1.3.4.2.1.2.4.1.1"><p id="waf_02_0039__p56230546"><strong id="waf_02_0039__b1191313719381">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.4.2.1.2.4.1.2"><p id="waf_02_0039__p58380403"><strong id="waf_02_0039__b4198163919383">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_0039__p31192241"><strong id="waf_02_0039__b81314402385">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0039__row12294718"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0039__p56348114">id</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0039__p794485">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.2.1.2.4.1.3 "><p id="waf_02_0039__p64353362">Specifies the ID of a blacklist or whitelist rule.</p>
</td>
</tr>
<tr id="waf_02_0039__row42309349"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0039__p4505225">policy_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0039__p29378938">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.2.1.2.4.1.3 "><p id="waf_02_0039__p30883743">Specifies the policy ID.</p>
</td>
</tr>
<tr id="waf_02_0039__row9518232"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0039__p32779367">addr</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0039__p37883103">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.2.1.2.4.1.3 "><p id="waf_02_0039__p48632487">Specifies the public IP address or range (IP address and subnet mask). For example, <em id="waf_02_0039__i20748919102619">X.X.</em><strong id="waf_02_0039__b1074819197262">0.125</strong> or <em id="waf_02_0039__i8764131962612">X.X.</em><strong id="waf_02_0039__b1076416198267">6.0/24</strong>.</p>
</td>
</tr>
<tr id="waf_02_0039__row35039200"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0039__p19602980">white</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0039__p44337548">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.2.1.2.4.1.3 "><p id="waf_02_0039__p131673177539">Specifies the IP address type.</p>
<ul id="waf_02_0039__ul3374102111535"><li id="waf_02_0039__li1039914614531"><strong id="waf_02_0039__b8654163317459">1</strong>: <strong id="waf_02_0039__b2655103318450">Whitelist</strong></li><li id="waf_02_0039__li113741219533"><strong id="waf_02_0039__b221293910458">0</strong>: <strong id="waf_02_0039__b0213113904518">Blacklist</strong></li></ul>
</td>
</tr>
<tr id="waf_02_0039__row42709387"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0039__p36908350">timestamp</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0039__p36786353">Long</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.2.1.2.4.1.3 "><p id="waf_02_0039__p26904588">Specifies the time when a blacklist or whitelist rule is added.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="waf_02_0039__section1151111284618"><h4 class="sectiontitle">Example</h4><p id="waf_02_0039__p75176523582"><em id="waf_02_0039__i1453125652612">X.X.</em><strong id="waf_02_0039__b4186155313260">0.125</strong> is used as an example.</p>
<div class="p" id="waf_02_0039__p1850192118464">Response example<pre class="screen" id="waf_02_0039__screen16521171244614">{
"id": "44d887434169475794b2717438f7fa78",
"policy_id": "ertr45c0f96784ec8abd8ba61a98064ef",
"addr": "X.X.0.125",
"white": 0,
"timestamp": 1499817600
}</pre>
</div>
</div>
<div class="section" id="waf_02_0039__section51225481"><h4 class="sectiontitle">Status Code</h4><div class="p" id="waf_02_0039__waf_02_0012_a652d4922b7df48fca0a65bc1a38ea5f2"><a href="#waf_02_0039__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0">Table 3</a> describes the normal status code returned by the API.
<div class="tablenoborder"><a name="waf_02_0039__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><a name="waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0039__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Status code</caption><thead align="left"><tr id="waf_02_0039__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_0039__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_0039__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_0039__waf_02_0012_ada185614bba24140995b8123b3e9faa8">Meaning</p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0039__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_0039__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_0039__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_0039__waf_02_0012_en-us_topic_0144911667_p369874114414">The request has succeeded.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="waf_02_0039__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_0035.html">Blacklist and Whitelist Rules</a></div>
</div>
</div>