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

180 lines
14 KiB
HTML

<a name="waf_02_0040"></a><a name="waf_02_0040"></a>
<h1 class="topictitle1">Updating a Blacklist or Whitelist Rule</h1>
<div id="body50196090"><div class="section" id="waf_02_0040__section53455492"><h4 class="sectiontitle">Function Description</h4><p class="msonormal" id="waf_02_0040__p39351451">This API is used to update a blacklist or whitelist rule.</p>
</div>
<div class="section" id="waf_02_0040__section11337384"><h4 class="sectiontitle">URI</h4><ul id="waf_02_0040__ul33350957"><li id="waf_02_0040__li31723159">URI format<p id="waf_02_0040__p17072983"><a name="waf_02_0040__li31723159"></a><a name="li31723159"></a>PUT /v1/{project_id}/waf/policy/{policy_id}/whiteblackip/{whiteblackip_rule_id}</p>
</li><li id="waf_02_0040__li19439125">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0040__table40734402" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path parameters</caption><thead align="left"><tr id="waf_02_0040__row58692937"><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_0040__p56507437"><strong id="waf_02_0040__b269068184420">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_0040__p13699678"><strong id="waf_02_0040__b12633393444">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_0040__p35932099"><strong id="waf_02_0040__b5580131011442">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_0040__p24818884"><strong id="waf_02_0040__b2052871144420">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0040__row64172619"><td class="cellrowborder" valign="top" width="30.930000000000003%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0040__p30599613">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_0040__p62649604">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_0040__p41453192">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_0040__p2265392">Specifies the project ID.</p>
</td>
</tr>
<tr id="waf_02_0040__row20388533"><td class="cellrowborder" valign="top" width="30.930000000000003%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0040__p40858511">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_0040__p21205122">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_0040__p39893301">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_0040__p10131920">Specifies the policy ID.</p>
</td>
</tr>
<tr id="waf_02_0040__row24078420"><td class="cellrowborder" valign="top" width="30.930000000000003%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0040__p4195040">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_0040__p4253927">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_0040__p9023827">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_0040__p59841420">Specifies the ID of a blacklist or whitelist rule.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="waf_02_0040__section34927599"><h4 class="sectiontitle">Request</h4><div class="p" id="waf_02_0040__p112821316472">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0040__table32705923" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="waf_02_0040__row51664566"><th align="left" class="cellrowborder" valign="top" width="25.507449255074494%" id="mcps1.3.3.2.1.2.5.1.1"><p id="waf_02_0040__p24080287"><strong id="waf_02_0040__b81585554415">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.3.2.1.2.5.1.2"><p id="waf_02_0040__p4346192"><strong id="waf_02_0040__b597325554416">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.3.2.1.2.5.1.3"><p id="waf_02_0040__p16497266"><strong id="waf_02_0040__b1185965664420">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.796020397960206%" id="mcps1.3.3.2.1.2.5.1.4"><p id="waf_02_0040__p61210156"><strong id="waf_02_0040__b168633572440">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0040__row59075623"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.3.2.1.2.5.1.1 "><p id="waf_02_0040__p20396171">addr</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.2.1.2.5.1.2 "><p id="waf_02_0040__p41477118">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.2.1.2.5.1.3 "><p id="waf_02_0040__p4203435">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.3.2.1.2.5.1.4 "><p id="waf_02_0040__p4933944">Specifies the public IP address or range (IP address and subnet mask). For example, <em id="waf_02_0040__i15610112217277">X.X.</em><strong id="waf_02_0040__b156251722172710">0.125</strong> or <em id="waf_02_0040__i4625822152714">X.X.</em><strong id="waf_02_0040__b12625182222714">6.0/24</strong>.</p>
</td>
</tr>
<tr id="waf_02_0040__row83631647193016"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.3.2.1.2.5.1.1 "><p id="waf_02_0040__p736354716300">white</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.2.1.2.5.1.2 "><p id="waf_02_0040__p1836317478309">No</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.2.1.2.5.1.3 "><p id="waf_02_0040__p44337548">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.3.2.1.2.5.1.4 "><p id="waf_02_0040__p131673177539">Specifies the IP address type.</p>
<ul id="waf_02_0040__ul3374102111535"><li id="waf_02_0040__li1039914614531"><strong id="waf_02_0040__b207811484455">1</strong>: <strong id="waf_02_0040__b117821348124517">Whitelist</strong></li><li id="waf_02_0040__li113741219533"><strong id="waf_02_0040__b020875084510">0</strong>: <strong id="waf_02_0040__b1421014506454">Blacklist</strong></li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="waf_02_0040__section45912936"><h4 class="sectiontitle">Response</h4><div class="p" id="waf_02_0040__p7570121817472">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0040__table8657213" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameter description</caption><thead align="left"><tr id="waf_02_0040__row15637064"><th align="left" class="cellrowborder" valign="top" width="42.85571442855714%" id="mcps1.3.4.2.1.2.4.1.1"><p id="waf_02_0040__p58642663"><strong id="waf_02_0040__b119301536134515">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_0040__p52435287"><strong id="waf_02_0040__b17392143884515">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_0040__p19399872"><strong id="waf_02_0040__b19489139114510">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0040__row40381121"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0040__p49645329">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_0040__p61848685">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_0040__p43687614">Specifies the ID of a blacklist or whitelist rule.</p>
</td>
</tr>
<tr id="waf_02_0040__row57644214"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0040__p38669777">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_0040__p45244245">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_0040__p40905192">Specifies the policy ID.</p>
</td>
</tr>
<tr id="waf_02_0040__row32602416"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0040__p23550048">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_0040__p28505716">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_0040__p27261653">Specifies the public IP address or range (IP address and subnet mask). For example, <em id="waf_02_0040__i76103441277">X.X.</em><strong id="waf_02_0040__b1061010448275">0.125</strong> or <em id="waf_02_0040__i162519443278">X.X.</em><strong id="waf_02_0040__b4625144152718">6.0/24</strong>.</p>
</td>
</tr>
<tr id="waf_02_0040__row44028285"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0040__p9521339">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_0040__p33031034">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_0040__p153321832551">Specifies the IP address type.</p>
<ul id="waf_02_0040__ul7332531553"><li id="waf_02_0040__li1133410325510"><strong id="waf_02_0040__b3194951174518">1</strong>: <strong id="waf_02_0040__b91951751134510">Whitelist</strong></li><li id="waf_02_0040__li1335143105515"><strong id="waf_02_0040__b618795217456">0</strong>: <strong id="waf_02_0040__b16187175210451">Blacklist</strong></li></ul>
<p id="waf_02_0040__p58268130">If you do not configure the <strong id="waf_02_0040__b4470573109">white</strong> parameter, the value is <strong id="waf_02_0040__b24765719108">Blacklist</strong> by default.</p>
</td>
</tr>
<tr id="waf_02_0040__row54651124"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0040__p64664939">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_0040__p3368735">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_0040__p56661280">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_0040__section12227624124710"><h4 class="sectiontitle">Examples</h4><p id="waf_02_0040__p1337119014"><em id="waf_02_0040__i1237812207285">X.X.</em><strong id="waf_02_0040__b53402413286">0.125</strong> is used as an example.</p>
<ul id="waf_02_0040__ul132411324144713"><li id="waf_02_0040__li19241524174715">Request example<pre class="screen" id="waf_02_0040__screen11241142414478">{
"addr": "X.X.0.125",
"white": 1
}</pre>
</li></ul>
<ul id="waf_02_0040__ul12241102484716"><li id="waf_02_0040__li124117241477">Response example<pre class="screen" id="waf_02_0040__screen1924172464713">{
"id": "44d887434169475794b2717438f7fa78",
"policy_id": "ertr45c0f96784ec8abd8ba61a98064ef",
"addr": "X.X.0.125",
"white": 1,
"timestamp": 1499817600
}</pre>
</li></ul>
</div>
<div class="section" id="waf_02_0040__section10563246"><h4 class="sectiontitle">Status Code</h4><div class="p" id="waf_02_0040__waf_02_0012_a652d4922b7df48fca0a65bc1a38ea5f2"><a href="#waf_02_0040__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0">Table 4</a> describes the normal status code returned by the API.
<div class="tablenoborder"><a name="waf_02_0040__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><a name="waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0040__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Status code</caption><thead align="left"><tr id="waf_02_0040__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_0040__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_0040__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_0040__waf_02_0012_ada185614bba24140995b8123b3e9faa8">Meaning</p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0040__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_0040__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_0040__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_0040__waf_02_0012_en-us_topic_0144911667_p369874114414">The request has succeeded.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="waf_02_0040__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>