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

428 lines
38 KiB
HTML

<a name="waf_02_0052"></a><a name="waf_02_0052"></a>
<h1 class="topictitle1">Updating a Precise Protection Rule</h1>
<div id="body53393874"><div class="section" id="waf_02_0052__section4351957"><h4 class="sectiontitle">Function Description</h4><p class="msonormal" id="waf_02_0052__p29936551">This API is used to update a precise protection rule.</p>
</div>
<div class="section" id="waf_02_0052__section39167615"><h4 class="sectiontitle">URI</h4><ul id="waf_02_0052__ul8941552"><li id="waf_02_0052__li13365108">URI format<p id="waf_02_0052__p53177110"><a name="waf_02_0052__li13365108"></a><a name="li13365108"></a>PUT /v1/{project_id}/waf/policy/{policy_id}/custom/{custom_rule_id}</p>
</li><li id="waf_02_0052__li8831943">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0052__table12378624" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path parameters</caption><thead align="left"><tr id="waf_02_0052__row49380663"><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_0052__p40410789"><strong id="waf_02_0052__b19891141317274">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_0052__p52048451"><strong id="waf_02_0052__b1691541492716">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_0052__p55174969"><strong id="waf_02_0052__b5378151612272">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_0052__p39987504"><strong id="waf_02_0052__b153272018152712">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0052__row17762383"><td class="cellrowborder" valign="top" width="30.930000000000003%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0052__p29466943">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_0052__p38012200">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_0052__p59089329">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_0052__p21506306">Specifies the project ID.</p>
</td>
</tr>
<tr id="waf_02_0052__row59339029"><td class="cellrowborder" valign="top" width="30.930000000000003%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0052__p41732070">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_0052__p24854548">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_0052__p67061382">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_0052__p63262885">Specifies the policy ID.</p>
</td>
</tr>
<tr id="waf_02_0052__row32495056"><td class="cellrowborder" valign="top" width="30.930000000000003%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0052__p14853917">custom_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_0052__p62316618">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_0052__p14481279">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_0052__p32132965">Specifies the ID of a precise protection rule.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="waf_02_0052__section16964221"><h4 class="sectiontitle">Request</h4><div class="p" id="waf_02_0052__p931071418566">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0052__table35445346" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="waf_02_0052__row26374855"><th align="left" class="cellrowborder" valign="top" width="25.507449255074494%" id="mcps1.3.3.2.1.2.5.1.1"><p id="waf_02_0052__p55988511"><strong id="waf_02_0052__b105970616286">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_0052__p38775556"><strong id="waf_02_0052__b1957617972815">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_0052__p53812317"><strong id="waf_02_0052__b20465161212820">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_0052__p63830419"><strong id="waf_02_0052__b18154101416282">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0052__row2881421"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.3.2.1.2.5.1.1 "><p id="waf_02_0052__p32068531">name</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.2.1.2.5.1.2 "><p id="waf_02_0052__p47414255">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_0052__p15349414">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_0052__p35343042">Specifies the rule name.</p>
</td>
</tr>
<tr id="waf_02_0052__row49651930"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.3.2.1.2.5.1.1 "><p id="waf_02_0052__p62383368">time</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.2.1.2.5.1.2 "><p id="waf_02_0052__p19888014">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_0052__p316437">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.3.2.1.2.5.1.4 "><p id="waf_02_0052__p126191914204">Specifies the effect time of the precise protection rule.</p>
<ul id="waf_02_0052__ul52563885311"><li id="waf_02_0052__li1525183805313"><span class="parmvalue" id="waf_02_0052__parmvalue119412044113720"><b>false</b></span>: The rule takes effect immediately.</li><li id="waf_02_0052__li179493215549"><span class="parmvalue" id="waf_02_0052__parmvalue9488850133711"><b>true</b></span>: The rule takes effect at the scheduled time.</li></ul>
</td>
</tr>
<tr id="waf_02_0052__row29356267"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.3.2.1.2.5.1.1 "><p id="waf_02_0052__p29047402">start</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.2.1.2.5.1.2 "><p id="waf_02_0052__p4029350">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_0052__p57941894">Long</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.3.2.1.2.5.1.4 "><p id="waf_02_0052__p62781810">Specifies the time when the precise protection rule takes effect. If <strong id="waf_02_0052__b1029093715229">time</strong> is set to <strong id="waf_02_0052__b829143719225">true</strong>, either the start time or the end time must be set.</p>
</td>
</tr>
<tr id="waf_02_0052__row28165385"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.3.2.1.2.5.1.1 "><p id="waf_02_0052__p66803699">end</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.2.1.2.5.1.2 "><p id="waf_02_0052__p42390558">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_0052__p11083186">Long</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.3.2.1.2.5.1.4 "><p id="waf_02_0052__p25322837">Specifies the time when the precise protection rule expires. If <strong id="waf_02_0052__b4434134718226">time</strong> is set to <strong id="waf_02_0052__b1643424702219">true</strong>, either the start time or the end time must be set.</p>
</td>
</tr>
<tr id="waf_02_0052__row1057314103473"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.3.2.1.2.5.1.1 "><p id="waf_02_0052__p5574810114714">conditions</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.2.1.2.5.1.2 "><p id="waf_02_0052__p1657491010475">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_0052__p105745103478"><a href="#waf_02_0052__table15795105212399">Table 3</a></p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.3.2.1.2.5.1.4 "><p id="waf_02_0052__p7574810154711">Specifies the condition parameters.</p>
</td>
</tr>
<tr id="waf_02_0052__row13873481"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.3.2.1.2.5.1.1 "><p id="waf_02_0052__p50010194">action</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.2.1.2.5.1.2 "><p id="waf_02_0052__p24293883">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_0052__p21647468"><a href="#waf_02_0052__table11869252183917">Table 4</a></p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.3.2.1.2.5.1.4 "><p id="waf_02_0052__p8614478">Specifies the protective action after the precise protection rule is matched.</p>
</td>
</tr>
<tr id="waf_02_0052__row1490572204917"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.3.2.1.2.5.1.1 "><p id="waf_02_0052__p41583556">priority</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.2.1.2.5.1.2 "><p id="waf_02_0052__p12824875">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_0052__p32181946">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_0052__p56600858">Specifies the rule priority. The value ranges from <strong id="waf_02_0052__b226115715010">0</strong> to <strong id="waf_02_0052__b72628573503">65535</strong>. The default value is <strong id="waf_02_0052__b4908123172315">50</strong>. Smaller values correspond to higher priorities.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="tablenoborder"><a name="waf_02_0052__table15795105212399"></a><a name="table15795105212399"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0052__table15795105212399" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="waf_02_0052__b198212816293">conditions</strong></caption><thead align="left"><tr id="waf_02_0052__row18801155273910"><th align="left" class="cellrowborder" valign="top" width="26.16%" id="mcps1.3.3.3.2.5.1.1"><p id="waf_02_0052__p680445263913"><strong id="waf_02_0052__b17376511182313">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.53%" id="mcps1.3.3.3.2.5.1.2"><p id="waf_02_0052__p982910912357"><strong id="waf_02_0052__b926170532">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.509999999999998%" id="mcps1.3.3.3.2.5.1.3"><p id="waf_02_0052__p8807552173910"><strong id="waf_02_0052__b64851838125713">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="36.8%" id="mcps1.3.3.3.2.5.1.4"><p id="waf_02_0052__p11809552173910"><strong id="waf_02_0052__b10828913142318">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0052__row1981275223913"><td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.3.3.2.5.1.1 "><p id="waf_02_0052__p1481416526399">category</p>
</td>
<td class="cellrowborder" valign="top" width="17.53%" headers="mcps1.3.3.3.2.5.1.2 "><p id="waf_02_0052__p8896173833419">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.509999999999998%" headers="mcps1.3.3.3.2.5.1.3 "><p id="waf_02_0052__p181717528397">String</p>
</td>
<td class="cellrowborder" valign="top" width="36.8%" headers="mcps1.3.3.3.2.5.1.4 "><p id="waf_02_0052__p78191552193916">Specifies the condition type. The value can be <strong id="waf_02_0052__b799045075111">path</strong>, <strong id="waf_02_0052__b8990135065110">user-agent</strong>, <strong id="waf_02_0052__b999115018512">ip</strong>, <strong id="waf_02_0052__b16991750175118">params</strong>, <strong id="waf_02_0052__b4991115015517">cookie</strong>, <strong id="waf_02_0052__b3992650105114">referer</strong>, or <strong id="waf_02_0052__b109921150125114">header</strong>.</p>
</td>
</tr>
<tr id="waf_02_0052__row198208522393"><td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.3.3.2.5.1.1 "><p id="waf_02_0052__p6823135213395">index</p>
</td>
<td class="cellrowborder" valign="top" width="17.53%" headers="mcps1.3.3.3.2.5.1.2 "><p id="waf_02_0052__p48971338133418">No</p>
</td>
<td class="cellrowborder" valign="top" width="19.509999999999998%" headers="mcps1.3.3.3.2.5.1.3 "><p id="waf_02_0052__p882745213392">String</p>
</td>
<td class="cellrowborder" valign="top" width="36.8%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="waf_02_0052__ul47389508420"><li id="waf_02_0052__li027963317">If <strong id="waf_02_0052__b799283912416">category</strong> is set to <strong id="waf_02_0052__b3992173914249">cookie</strong>, <strong id="waf_02_0052__b89929390243">index</strong> indicates cookie name.</li><li id="waf_02_0052__li5271461831">If <strong id="waf_02_0052__b16857144712417">category</strong> is set to <strong id="waf_02_0052__b3857134742411">params</strong>, <strong id="waf_02_0052__b28571947162418">index</strong> indicates param name.</li><li id="waf_02_0052__li427156731">If <strong id="waf_02_0052__b7658162010484">category </strong>is set to <strong id="waf_02_0052__b1658152074816">header</strong>, <strong id="waf_02_0052__b14658102094812">index</strong> indicates an option in the header.</li></ul>
</td>
</tr>
<tr id="waf_02_0052__row88321852153910"><td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.3.3.2.5.1.1 "><p id="waf_02_0052__p983495273920">logic</p>
</td>
<td class="cellrowborder" valign="top" width="17.53%" headers="mcps1.3.3.3.2.5.1.2 "><p id="waf_02_0052__p17897103873415">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.509999999999998%" headers="mcps1.3.3.3.2.5.1.3 "><p id="waf_02_0052__p128381352133914">String</p>
</td>
<td class="cellrowborder" valign="top" width="36.8%" headers="mcps1.3.3.3.2.5.1.4 "><p id="waf_02_0052__p17842105216390"><span class="parmvalue" id="waf_02_0052__parmvalue166187152233"><b>contain</b></span>, <span class="parmvalue" id="waf_02_0052__parmvalue16181015172316"><b>not_contain</b></span>, <span class="parmvalue" id="waf_02_0052__parmvalue16619615122318"><b>equal</b></span>, <span class="parmvalue" id="waf_02_0052__parmvalue146201515202319"><b>not_equal</b></span>, <span class="parmvalue" id="waf_02_0052__parmvalue3620131572313"><b>prefix</b></span>, <span class="parmvalue" id="waf_02_0052__parmvalue15621131516235"><b>not_prefix</b></span>, <span class="parmvalue" id="waf_02_0052__parmvalue36211159236"><b>suffix</b></span>, and <span class="parmvalue" id="waf_02_0052__parmvalue462261592315"><b>not_suffix</b></span> indicate <strong id="waf_02_0052__b462251512310">Include</strong>, <strong id="waf_02_0052__b176231615182319">Exclude</strong>, <strong id="waf_02_0052__b116239152239">Equal to</strong>, <strong id="waf_02_0052__b19624615172313">Not equal to</strong>, <strong id="waf_02_0052__b262441592311">Prefix is</strong>, <strong id="waf_02_0052__b9625181552318">Prefix is not</strong>, <strong id="waf_02_0052__b11626115172318">Suffix is</strong>, and <strong id="waf_02_0052__b14626111515235">Suffix is not</strong> respectively.</p>
<p id="waf_02_0052__p181434344213">If <span class="parmname" id="waf_02_0052__parmname1723205417519"><b>category</b></span> is set to <strong id="waf_02_0052__b572411547510">ip</strong>, <span class="parmname" id="waf_02_0052__parmname1972475419518"><b>logic</b></span> can only be <span class="parmvalue" id="waf_02_0052__parmvalue1672512543516"><b>equal</b></span> or <span class="parmvalue" id="waf_02_0052__parmvalue18725454155112"><b>not_equal</b></span>.</p>
</td>
</tr>
<tr id="waf_02_0052__row7844115211397"><td class="cellrowborder" valign="top" width="26.16%" headers="mcps1.3.3.3.2.5.1.1 "><p id="waf_02_0052__p198482052183915">contents</p>
</td>
<td class="cellrowborder" valign="top" width="17.53%" headers="mcps1.3.3.3.2.5.1.2 "><p id="waf_02_0052__p68976382348">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.509999999999998%" headers="mcps1.3.3.3.2.5.1.3 "><p id="waf_02_0052__p8852155293920">List</p>
</td>
<td class="cellrowborder" valign="top" width="36.8%" headers="mcps1.3.3.3.2.5.1.4 "><p id="waf_02_0052__p3856135214398">Specifies content matching the condition. Currently, only one value is accepted. </p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="waf_02_0052__table11869252183917"></a><a name="table11869252183917"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0052__table11869252183917" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="waf_02_0052__b67401118122915">action</strong></caption><thead align="left"><tr id="waf_02_0052__row108771152153912"><th align="left" class="cellrowborder" valign="top" width="26.88%" id="mcps1.3.3.4.2.5.1.1"><p id="waf_02_0052__p1088015522391"><strong id="waf_02_0052__b126469390235">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.06%" id="mcps1.3.3.4.2.5.1.2"><p id="waf_02_0052__p1061735942013"><strong id="waf_02_0052__b1406445785">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.259999999999998%" id="mcps1.3.3.4.2.5.1.3"><p id="waf_02_0052__p788305283914"><strong id="waf_02_0052__b1789775562">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="36.8%" id="mcps1.3.3.4.2.5.1.4"><p id="waf_02_0052__p888585219398"><strong id="waf_02_0052__b1395341192311">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0052__row208859523396"><td class="cellrowborder" valign="top" width="26.88%" headers="mcps1.3.3.4.2.5.1.1 "><p id="waf_02_0052__p888817523397">category</p>
</td>
<td class="cellrowborder" valign="top" width="17.06%" headers="mcps1.3.3.4.2.5.1.2 "><p id="waf_02_0052__p361725910206">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.259999999999998%" headers="mcps1.3.3.4.2.5.1.3 "><p id="waf_02_0052__p3890165216399">String</p>
</td>
<td class="cellrowborder" valign="top" width="36.8%" headers="mcps1.3.3.4.2.5.1.4 "><p id="waf_02_0052__p94858282213">Specifies the protective action.</p>
<ul id="waf_02_0052__ul1491712301523"><li id="waf_02_0052__li169619511124"><span class="parmvalue" id="waf_02_0052__parmvalue956117191172"><b>block</b></span>: block.</li><li id="waf_02_0052__li1091753013216"><span class="parmvalue" id="waf_02_0052__parmvalue974116227172"><b>pass</b></span>: allow.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="waf_02_0052__section18460262"><h4 class="sectiontitle">Response</h4><div class="p" id="waf_02_0052__p777613372567">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0052__table21827061" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Parameter description</caption><thead align="left"><tr id="waf_02_0052__row28265867"><th align="left" class="cellrowborder" valign="top" width="42.85571442855714%" id="mcps1.3.4.2.1.2.4.1.1"><p id="waf_02_0052__p7833851"><strong id="waf_02_0052__b44889334578">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_0052__p30562167"><strong id="waf_02_0052__b60923830">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_0052__p59616488"><strong id="waf_02_0052__b15645414578">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0052__row66786352"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0052__p40985451">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_0052__p31487247">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_0052__p330178">Specifies the ID of a precise protection rule.</p>
</td>
</tr>
<tr id="waf_02_0052__row2971610"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0052__p39373866">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_0052__p35166558">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_0052__p29918943">Specifies the policy ID.</p>
</td>
</tr>
<tr id="waf_02_0052__row835031"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0052__p528693">name</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0052__p42824212">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_0052__p46209180">Specifies the rule name.</p>
</td>
</tr>
<tr id="waf_02_0052__row13229438"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0052__p64951573">time</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0052__p26586089">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.4.2.1.2.4.1.3 "><p id="waf_02_0052__p1116816397587">Specifies the effect time of the precise protection rule.</p>
<ul id="waf_02_0052__ul71711939145810"><li id="waf_02_0052__li1117283965818"><span class="parmvalue" id="waf_02_0052__parmvalue20681103018384"><b>false</b></span>: The rule takes effect immediately.</li><li id="waf_02_0052__li61771393582"><span class="parmvalue" id="waf_02_0052__parmvalue1634133410383"><b>true</b></span>: The rule takes effect at the scheduled time.</li></ul>
</td>
</tr>
<tr id="waf_02_0052__row53906414"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0052__p4343448">start</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0052__p16275035">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_0052__p43209438">Specifies the time when the precise protection rule takes effect.</p>
</td>
</tr>
<tr id="waf_02_0052__row53340623"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0052__p25623189">end</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0052__p62212465">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_0052__p6044872">Specifies the time when the precise protection rule expires.</p>
</td>
</tr>
<tr id="waf_02_0052__row54403854"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0052__p44636076">conditions</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0052__p58752378"><a href="#waf_02_0052__table19870529184915">Table 6</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_0052__p61322144">Specifies the condition parameters.</p>
</td>
</tr>
<tr id="waf_02_0052__row5087387"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0052__p9425218">action</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0052__p25245222"><a href="#waf_02_0052__table19952132917491">Table 7</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_0052__p31597102">Specifies the protective action after the precise protection rule is matched.</p>
</td>
</tr>
<tr id="waf_02_0052__row11511132"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0052__p59986482">priority</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.4.2.1.2.4.1.2 "><p id="waf_02_0052__p27066910">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_0052__p5282171915206">Specifies the priority of a rule being executed. Smaller values correspond to higher priorities. If two rules are assigned with the same priority, the rule added earlier has higher priority. The value ranges from <strong id="waf_02_0052__b914418156">0</strong> to <strong id="waf_02_0052__b1144198855">65535</strong>.</p>
</td>
</tr>
<tr id="waf_02_0052__row1771443"><td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.4.2.1.2.4.1.1 "><p id="waf_02_0052__p9269217">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_0052__p12609087">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_0052__p1749462202016">Specifies the time when a precise protection rule is added.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="tablenoborder"><a name="waf_02_0052__table19870529184915"></a><a name="table19870529184915"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0052__table19870529184915" frame="border" border="1" rules="all"><caption><b>Table 6 </b><strong id="waf_02_0052__b22431135122920">conditions</strong></caption><thead align="left"><tr id="waf_02_0052__row158795297497"><th align="left" class="cellrowborder" valign="top" width="33.086691330866906%" id="mcps1.3.4.3.2.4.1.1"><p id="waf_02_0052__p2881122954910"><strong id="waf_02_0052__b6503184320247">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.117288271172878%" id="mcps1.3.4.3.2.4.1.2"><p id="waf_02_0052__p7884192994917"><strong id="waf_02_0052__b1566197401">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.7960203979602%" id="mcps1.3.4.3.2.4.1.3"><p id="waf_02_0052__p288715299496"><strong id="waf_02_0052__b4321447142420">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0052__row1989032916497"><td class="cellrowborder" valign="top" width="33.086691330866906%" headers="mcps1.3.4.3.2.4.1.1 "><p id="waf_02_0052__p1489316299496">category</p>
</td>
<td class="cellrowborder" valign="top" width="27.117288271172878%" headers="mcps1.3.4.3.2.4.1.2 "><p id="waf_02_0052__p16895142918491">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.7960203979602%" headers="mcps1.3.4.3.2.4.1.3 "><p id="waf_02_0052__p4901112934918">Specifies the condition type. The value can be <strong id="waf_02_0052__b12526165813510">path</strong>, <strong id="waf_02_0052__b752785814519">user-agent</strong>, <strong id="waf_02_0052__b2528185814517">ip</strong>, <strong id="waf_02_0052__b185281258155113">params</strong>, <strong id="waf_02_0052__b452914585519">cookie</strong>, <strong id="waf_02_0052__b18530185813518">referer</strong>, or <strong id="waf_02_0052__b16530558105112">header</strong>.</p>
</td>
</tr>
<tr id="waf_02_0052__row199031629184917"><td class="cellrowborder" valign="top" width="33.086691330866906%" headers="mcps1.3.4.3.2.4.1.1 "><p id="waf_02_0052__p99061529134916">index</p>
</td>
<td class="cellrowborder" valign="top" width="27.117288271172878%" headers="mcps1.3.4.3.2.4.1.2 "><p id="waf_02_0052__p1909112913497">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.7960203979602%" headers="mcps1.3.4.3.2.4.1.3 "><ul id="waf_02_0052__ul11271761838"><li id="waf_02_0052__li1539220710179">If <strong id="waf_02_0052__b15911309251">category</strong> is set to <strong id="waf_02_0052__b05981503259">cookie</strong>, <strong id="waf_02_0052__b459840112520">index</strong> indicates cookie name.</li><li id="waf_02_0052__li53979721710">If <strong id="waf_02_0052__b17716103142515">category</strong> is set to <strong id="waf_02_0052__b10716730254">params</strong>, <strong id="waf_02_0052__b157167342513">index</strong> indicates param name.</li><li id="waf_02_0052__li64073711176">If <strong id="waf_02_0052__b63372384814">category </strong>is set to <strong id="waf_02_0052__b1933223104817">header</strong>, <strong id="waf_02_0052__b933102319482">index</strong> indicates an option in the header.</li></ul>
</td>
</tr>
<tr id="waf_02_0052__row391312915495"><td class="cellrowborder" valign="top" width="33.086691330866906%" headers="mcps1.3.4.3.2.4.1.1 "><p id="waf_02_0052__p17917112934914">logic</p>
</td>
<td class="cellrowborder" valign="top" width="27.117288271172878%" headers="mcps1.3.4.3.2.4.1.2 "><p id="waf_02_0052__p1492013291493">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.7960203979602%" headers="mcps1.3.4.3.2.4.1.3 "><p id="waf_02_0052__p10922929194916"><span class="parmvalue" id="waf_02_0052__parmvalue17711111914237"><b>contain</b></span>, <span class="parmvalue" id="waf_02_0052__parmvalue571221982310"><b>not_contain</b></span>, <span class="parmvalue" id="waf_02_0052__parmvalue177121199236"><b>equal</b></span>, <span class="parmvalue" id="waf_02_0052__parmvalue8713719202319"><b>not_equal</b></span>, <span class="parmvalue" id="waf_02_0052__parmvalue17714161982314"><b>prefix</b></span>, <span class="parmvalue" id="waf_02_0052__parmvalue19714181942314"><b>not_prefix</b></span>, <span class="parmvalue" id="waf_02_0052__parmvalue17715181922313"><b>suffix</b></span>, and <span class="parmvalue" id="waf_02_0052__parmvalue6716919162312"><b>not_suffix</b></span> indicate <strong id="waf_02_0052__b18716171915231">Include</strong>, <strong id="waf_02_0052__b13717111922317">Exclude</strong>, <strong id="waf_02_0052__b571719195237">Equal to</strong>, <strong id="waf_02_0052__b1871721962314">Not equal to</strong>, <strong id="waf_02_0052__b5718141982314">Prefix is</strong>, <strong id="waf_02_0052__b147197193231">Prefix is not</strong>, <strong id="waf_02_0052__b1971991972310">Suffix is</strong>, and <strong id="waf_02_0052__b117207193230">Suffix is not</strong> respectively.</p>
<p id="waf_02_0052__p12211115324210">If <span class="parmname" id="waf_02_0052__parmname156514220527"><b>category</b></span> is set to <strong id="waf_02_0052__b656612214525">ip</strong>, <span class="parmname" id="waf_02_0052__parmname05678265214"><b>logic</b></span> can only be <span class="parmvalue" id="waf_02_0052__parmvalue165677215529"><b>equal</b></span> or <span class="parmvalue" id="waf_02_0052__parmvalue2056713225214"><b>not_equal</b></span>.</p>
</td>
</tr>
<tr id="waf_02_0052__row11927329174917"><td class="cellrowborder" valign="top" width="33.086691330866906%" headers="mcps1.3.4.3.2.4.1.1 "><p id="waf_02_0052__p1393018293495">contents</p>
</td>
<td class="cellrowborder" valign="top" width="27.117288271172878%" headers="mcps1.3.4.3.2.4.1.2 "><p id="waf_02_0052__p14933429134919">List</p>
</td>
<td class="cellrowborder" valign="top" width="39.7960203979602%" headers="mcps1.3.4.3.2.4.1.3 "><p id="waf_02_0052__p129361729164910">Specifies content matching the condition.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="waf_02_0052__table19952132917491"></a><a name="table19952132917491"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0052__table19952132917491" frame="border" border="1" rules="all"><caption><b>Table 7 </b><strong id="waf_02_0052__b1779164442920">action</strong></caption><thead align="left"><tr id="waf_02_0052__row796182924920"><th align="left" class="cellrowborder" valign="top" width="33.086691330866906%" id="mcps1.3.4.4.2.4.1.1"><p id="waf_02_0052__p11963162910493"><strong id="waf_02_0052__b01202922518">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.117288271172878%" id="mcps1.3.4.4.2.4.1.2"><p id="waf_02_0052__p12967182920493"><strong id="waf_02_0052__b84845752">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.7960203979602%" id="mcps1.3.4.4.2.4.1.3"><p id="waf_02_0052__p297116295496"><strong id="waf_02_0052__b149751100259">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0052__row16971829164910"><td class="cellrowborder" valign="top" width="33.086691330866906%" headers="mcps1.3.4.4.2.4.1.1 "><p id="waf_02_0052__p1597482912494">category</p>
</td>
<td class="cellrowborder" valign="top" width="27.117288271172878%" headers="mcps1.3.4.4.2.4.1.2 "><p id="waf_02_0052__p697714299496">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.7960203979602%" headers="mcps1.3.4.4.2.4.1.3 "><p id="waf_02_0052__p1222611101546">Specifies the protective action.</p>
<ul id="waf_02_0052__ul1522911106417"><li id="waf_02_0052__li1723191017415"><span class="parmvalue" id="waf_02_0052__parmvalue1202136201714"><b>block</b></span>: block.</li><li id="waf_02_0052__li223416104418"><span class="parmvalue" id="waf_02_0052__parmvalue1480204017175"><b>pass</b></span>: allow.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="waf_02_0052__section498844755617"><h4 class="sectiontitle">Examples</h4><p id="waf_02_0052__p1239718218529">A rule named <strong id="waf_02_0052__b1519471420515">rule1</strong> is used as an example.</p>
<ul id="waf_02_0052__ul10109124845617"><li id="waf_02_0052__li171091485566">Request example<pre class="screen" id="waf_02_0052__screen18110748195610">{
"name": "rule1",
"time": true,
"start": 1499817600,
"end": 1567817600,
"conditions": [{
"category": "path",
"contents": ["/login"],
"logic": "contain"
},{
"category": "ip",
"logic": "equal",
"contents": ["X.X.1.1"]
}
],
"action": {
"category": "block"
},
"priority": 10
}</pre>
</li></ul>
<ul id="waf_02_0052__ul2111134813566"><li id="waf_02_0052__li511117483568">Response example<pre class="screen" id="waf_02_0052__screen11111348165610">{
"id": "7374ad99c6c448e9a9ca35cb46660a39",
"policy_id": "9tre832yf96784ec8abd8ba61a98064ef",
"name": "rule1",
"time": true,
"start": 1499817600,
"end": 1567817600,
"conditions": [{
"category": "path",
"contents": ["/login"],
"logic": "contain"
},{
"category": "ip",
"logic": "equal",
"contents": ["X.X.1.1"]
}
],
"action": {
"category": "block"
},
"priority": 10,
"timestamp": 1499817600
}</pre>
</li></ul>
</div>
<div class="section" id="waf_02_0052__section31924637"><h4 class="sectiontitle">Status Code</h4><div class="p" id="waf_02_0052__waf_02_0012_a652d4922b7df48fca0a65bc1a38ea5f2"><a href="#waf_02_0052__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0">Table 8</a> describes the normal status code returned by the API.
<div class="tablenoborder"><a name="waf_02_0052__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><a name="waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0052__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0" frame="border" border="1" rules="all"><caption><b>Table 8 </b>Status code</caption><thead align="left"><tr id="waf_02_0052__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_0052__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_0052__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_0052__waf_02_0012_ada185614bba24140995b8123b3e9faa8">Meaning</p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0052__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_0052__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_0052__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_0052__waf_02_0012_en-us_topic_0144911667_p369874114414">The request has succeeded.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="waf_02_0052__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_0047.html">Precise Protection Rules</a></div>
</div>
</div>