forked from docs/doc-exports
Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com> Co-authored-by: qinweiwei <qinweiwei@huawei.com> Co-committed-by: qinweiwei <qinweiwei@huawei.com>
386 lines
31 KiB
HTML
386 lines
31 KiB
HTML
<a name="CreateAnticrawlerRule"></a><a name="CreateAnticrawlerRule"></a>
|
|
|
|
<h1 class="topictitle1">Creating a JavaScript Anti-Crawler Rule</h1>
|
|
<div id="body1708331107508"><div class="section" id="CreateAnticrawlerRule__topic1341000000"><h4 class="sectiontitle">Function</h4><p id="CreateAnticrawlerRule__topic1341000002">This API is used to create a JavaScript anti-crawler rule.</p>
|
|
</div>
|
|
<div class="section" id="CreateAnticrawlerRule__atuogenerate_1"><h4 class="sectiontitle">URI</h4><p id="CreateAnticrawlerRule__topic1341000004">POST /v1/{project_id}/waf/policy/{policy_id}/anticrawler</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAnticrawlerRule__topic1341000005" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="CreateAnticrawlerRule__topic1341000013"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="CreateAnticrawlerRule__topic1341000015">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="CreateAnticrawlerRule__topic1341000017">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="CreateAnticrawlerRule__topic1341000019">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="CreateAnticrawlerRule__topic1341000021">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="CreateAnticrawlerRule__topic1341000023"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="CreateAnticrawlerRule__topic1341000025">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="CreateAnticrawlerRule__topic1341000027">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="CreateAnticrawlerRule__topic1341000029">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="CreateAnticrawlerRule__topic1341000031">Project ID. To obtain it, go to Cloud management console and hover the cursor over your username. On the displayed window, choose <strong id="CreateAnticrawlerRule__topic1341000032">My Credentials</strong>. Then, in the <strong id="CreateAnticrawlerRule__topic1341000033">Projects</strong> area, view <strong id="CreateAnticrawlerRule__topic1341000034">Project ID</strong> of the corresponding project.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000035"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="CreateAnticrawlerRule__topic1341000037">policy_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="CreateAnticrawlerRule__topic1341000039">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="CreateAnticrawlerRule__topic1341000041">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="CreateAnticrawlerRule__topic1341000043">ID of a protection policy. You can specify a protection policy ID to query the rules used in the protection policy. You can obtain the policy ID by calling the <strong id="CreateAnticrawlerRule__topic1341000044">ListPolicy</strong> API.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAnticrawlerRule__topic1341000045" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Query Parameters</caption><thead align="left"><tr id="CreateAnticrawlerRule__topic1341000053"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.1"><p id="CreateAnticrawlerRule__topic1341000055">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.2"><p id="CreateAnticrawlerRule__topic1341000057">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.3"><p id="CreateAnticrawlerRule__topic1341000059">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.4.2.5.1.4"><p id="CreateAnticrawlerRule__topic1341000061">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="CreateAnticrawlerRule__topic1341000063"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="CreateAnticrawlerRule__topic1341000065">enterprise_project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="CreateAnticrawlerRule__topic1341000067">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="CreateAnticrawlerRule__topic1341000069">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="CreateAnticrawlerRule__topic1341000071">You can obtain the ID by calling the <strong id="CreateAnticrawlerRule__topic1341000072">ListEnterpriseProject</strong> API of EPS.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="CreateAnticrawlerRule__topic1341000073"><h4 class="sectiontitle">Request Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAnticrawlerRule__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request header parameters</caption><thead align="left"><tr id="CreateAnticrawlerRule__topic1341000082"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="CreateAnticrawlerRule__topic1341000084">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="CreateAnticrawlerRule__topic1341000086">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="CreateAnticrawlerRule__topic1341000088">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="CreateAnticrawlerRule__topic1341000090">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="CreateAnticrawlerRule__topic1341000092"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="CreateAnticrawlerRule__topic1341000094">X-Auth-Token</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="CreateAnticrawlerRule__topic1341000096">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="CreateAnticrawlerRule__topic1341000098">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="CreateAnticrawlerRule__topic1341000100">User token. It can be obtained by calling the IAM API (value of <strong id="CreateAnticrawlerRule__topic1341000101">X-Subject-Token</strong> in the response header).</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000102"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="CreateAnticrawlerRule__topic1341000104">Content-Type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="CreateAnticrawlerRule__topic1341000106">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="CreateAnticrawlerRule__topic1341000108">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="CreateAnticrawlerRule__topic1341000110">Content type.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAnticrawlerRule__request_CreateAnticrawlerRuleRequestbody" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Request body parameters</caption><thead align="left"><tr id="CreateAnticrawlerRule__topic1341000118"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="CreateAnticrawlerRule__topic1341000120">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="CreateAnticrawlerRule__topic1341000122">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="CreateAnticrawlerRule__topic1341000124">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="CreateAnticrawlerRule__topic1341000126">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="CreateAnticrawlerRule__topic1341000128"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateAnticrawlerRule__topic1341000130">url</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateAnticrawlerRule__topic1341000132">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateAnticrawlerRule__topic1341000134">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateAnticrawlerRule__topic1341000136">URL to which the rule applies.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000137"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateAnticrawlerRule__topic1341000139">logic</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateAnticrawlerRule__topic1341000141">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateAnticrawlerRule__topic1341000143">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateAnticrawlerRule__topic1341000145">Rule matching logic</p>
|
|
<ul id="CreateAnticrawlerRule__topic1341000146"><li id="CreateAnticrawlerRule__topic1341000147"><p id="CreateAnticrawlerRule__topic1341000148"><a name="CreateAnticrawlerRule__topic1341000147"></a><a name="topic1341000147"></a><strong id="CreateAnticrawlerRule__topic1341000149">1</strong>: Include</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000150"><p id="CreateAnticrawlerRule__topic1341000151"><a name="CreateAnticrawlerRule__topic1341000150"></a><a name="topic1341000150"></a><strong id="CreateAnticrawlerRule__topic1341000152">2</strong>: Not include</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000153"><p id="CreateAnticrawlerRule__topic1341000154"><a name="CreateAnticrawlerRule__topic1341000153"></a><a name="topic1341000153"></a><strong id="CreateAnticrawlerRule__topic1341000155">3</strong>: Equal</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000156"><p id="CreateAnticrawlerRule__topic1341000157"><a name="CreateAnticrawlerRule__topic1341000156"></a><a name="topic1341000156"></a><strong id="CreateAnticrawlerRule__topic1341000158">4</strong>: Not equal</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000159"><p id="CreateAnticrawlerRule__topic1341000160"><a name="CreateAnticrawlerRule__topic1341000159"></a><a name="topic1341000159"></a><strong id="CreateAnticrawlerRule__topic1341000161">5</strong>: Prefix is</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000162"><p id="CreateAnticrawlerRule__topic1341000163"><a name="CreateAnticrawlerRule__topic1341000162"></a><a name="topic1341000162"></a><strong id="CreateAnticrawlerRule__topic1341000164">6</strong>: Prefix is not</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000165"><p id="CreateAnticrawlerRule__topic1341000166"><a name="CreateAnticrawlerRule__topic1341000165"></a><a name="topic1341000165"></a><strong id="CreateAnticrawlerRule__topic1341000167">7</strong>: Suffix is</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000168"><p id="CreateAnticrawlerRule__topic1341000169"><a name="CreateAnticrawlerRule__topic1341000168"></a><a name="topic1341000168"></a><strong id="CreateAnticrawlerRule__topic1341000170">8</strong>: Suffix is not</p>
|
|
</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000171"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateAnticrawlerRule__topic1341000173">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateAnticrawlerRule__topic1341000175">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateAnticrawlerRule__topic1341000177">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateAnticrawlerRule__topic1341000179">Rule name.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000180"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateAnticrawlerRule__topic1341000182">type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateAnticrawlerRule__topic1341000184">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateAnticrawlerRule__topic1341000186">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateAnticrawlerRule__topic1341000188">JavaScript anti-crawler rule type.</p>
|
|
<ul id="CreateAnticrawlerRule__topic1341000189"><li id="CreateAnticrawlerRule__topic1341000190"><p id="CreateAnticrawlerRule__topic1341000191"><a name="CreateAnticrawlerRule__topic1341000190"></a><a name="topic1341000190"></a><strong id="CreateAnticrawlerRule__topic1341000192">anticrawler_specific_url</strong>: used to protect a specific path specified by the rule.</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000193"><p id="CreateAnticrawlerRule__topic1341000194"><a name="CreateAnticrawlerRule__topic1341000193"></a><a name="topic1341000193"></a><strong id="CreateAnticrawlerRule__topic1341000195">anticrawler_except_url</strong>: used to protect all paths except the one specified by the rule.</p>
|
|
</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="CreateAnticrawlerRule__topic1341000196"><h4 class="sectiontitle">Response Parameters</h4><p id="CreateAnticrawlerRule__topic1341000198"><strong id="CreateAnticrawlerRule__topic1341000199">Status code: 200</strong></p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAnticrawlerRule__response_CreateAnticrawlerRuleResponsebody" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response body parameters</caption><thead align="left"><tr id="CreateAnticrawlerRule__topic1341000206"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.1"><p id="CreateAnticrawlerRule__topic1341000208">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.2"><p id="CreateAnticrawlerRule__topic1341000210">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.4.1.3"><p id="CreateAnticrawlerRule__topic1341000212">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="CreateAnticrawlerRule__topic1341000214"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000216">policyid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000218">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000220">Policy ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000221"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000223">id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000225">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000227">Rule ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000228"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000230">url</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000232">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000234">URL to which the rule applies.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000235"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000237">logic</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000239">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000241">Rule matching logic</p>
|
|
<ul id="CreateAnticrawlerRule__topic1341000242"><li id="CreateAnticrawlerRule__topic1341000243"><p id="CreateAnticrawlerRule__topic1341000244"><a name="CreateAnticrawlerRule__topic1341000243"></a><a name="topic1341000243"></a><strong id="CreateAnticrawlerRule__topic1341000245">1</strong>: Include</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000246"><p id="CreateAnticrawlerRule__topic1341000247"><a name="CreateAnticrawlerRule__topic1341000246"></a><a name="topic1341000246"></a><strong id="CreateAnticrawlerRule__topic1341000248">2</strong>: Not include</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000249"><p id="CreateAnticrawlerRule__topic1341000250"><a name="CreateAnticrawlerRule__topic1341000249"></a><a name="topic1341000249"></a><strong id="CreateAnticrawlerRule__topic1341000251">3</strong>: Equal</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000252"><p id="CreateAnticrawlerRule__topic1341000253"><a name="CreateAnticrawlerRule__topic1341000252"></a><a name="topic1341000252"></a><strong id="CreateAnticrawlerRule__topic1341000254">4</strong>: Not equal</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000255"><p id="CreateAnticrawlerRule__topic1341000256"><a name="CreateAnticrawlerRule__topic1341000255"></a><a name="topic1341000255"></a><strong id="CreateAnticrawlerRule__topic1341000257">5</strong>: Prefix is</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000258"><p id="CreateAnticrawlerRule__topic1341000259"><a name="CreateAnticrawlerRule__topic1341000258"></a><a name="topic1341000258"></a><strong id="CreateAnticrawlerRule__topic1341000260">6</strong>: Prefix is not</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000261"><p id="CreateAnticrawlerRule__topic1341000262"><a name="CreateAnticrawlerRule__topic1341000261"></a><a name="topic1341000261"></a><strong id="CreateAnticrawlerRule__topic1341000263">7</strong>: Suffix is</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000264"><p id="CreateAnticrawlerRule__topic1341000265"><a name="CreateAnticrawlerRule__topic1341000264"></a><a name="topic1341000264"></a><strong id="CreateAnticrawlerRule__topic1341000266">8</strong>: Suffix is not</p>
|
|
</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000267"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000269">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000271">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000273">Rule name.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000274"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000276">type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000278">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000280">JavaScript anti-crawler rule type.</p>
|
|
<ul id="CreateAnticrawlerRule__topic1341000281"><li id="CreateAnticrawlerRule__topic1341000282"><p id="CreateAnticrawlerRule__topic1341000283"><a name="CreateAnticrawlerRule__topic1341000282"></a><a name="topic1341000282"></a><strong id="CreateAnticrawlerRule__topic1341000284">anticrawler_specific_url</strong>: used to protect a specific path specified by the rule.</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000285"><p id="CreateAnticrawlerRule__topic1341000286"><a name="CreateAnticrawlerRule__topic1341000285"></a><a name="topic1341000285"></a><strong id="CreateAnticrawlerRule__topic1341000287">anticrawler_except_url</strong>: used to protect all paths except the one specified by the rule.</p>
|
|
</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000288"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000290">timestamp</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000292">Long</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000294">Timestamp when the rule waf created.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000295"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000297">status</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000299">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000301">Rule status. The value can be <strong id="CreateAnticrawlerRule__topic1341000302">0</strong> or <strong id="CreateAnticrawlerRule__topic1341000303">1</strong>.</p>
|
|
<ul id="CreateAnticrawlerRule__topic1341000304"><li id="CreateAnticrawlerRule__topic1341000305"><p id="CreateAnticrawlerRule__topic1341000306"><a name="CreateAnticrawlerRule__topic1341000305"></a><a name="topic1341000305"></a><strong id="CreateAnticrawlerRule__topic1341000307">0</strong>: The rule is disabled.</p>
|
|
</li><li id="CreateAnticrawlerRule__topic1341000308"><p id="CreateAnticrawlerRule__topic1341000309"><a name="CreateAnticrawlerRule__topic1341000308"></a><a name="topic1341000308"></a><strong id="CreateAnticrawlerRule__topic1341000310">1</strong>: The rule is enabled.</p>
|
|
</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="CreateAnticrawlerRule__topic1341000311"><strong id="CreateAnticrawlerRule__topic1341000312">Status code: 400</strong></p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAnticrawlerRule__response_RestErrorResponse" frame="border" border="1" rules="all"><caption><b>Table 6 </b>Response body parameters</caption><thead align="left"><tr id="CreateAnticrawlerRule__topic1341000319"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.1"><p id="CreateAnticrawlerRule__topic1341000321">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.2"><p id="CreateAnticrawlerRule__topic1341000323">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.5.2.4.1.3"><p id="CreateAnticrawlerRule__topic1341000325">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="CreateAnticrawlerRule__topic1341000327"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000329">error_code</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000331">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000333">Error code</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000334"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000336">error_msg</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000338">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000340">Error message</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="CreateAnticrawlerRule__topic1341000341"><strong id="CreateAnticrawlerRule__topic1341000342">Status code: 401</strong></p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAnticrawlerRule__response_RestErrorResponse_1" frame="border" border="1" rules="all"><caption><b>Table 7 </b>Response body parameters</caption><thead align="left"><tr id="CreateAnticrawlerRule__topic1341000349"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.1"><p id="CreateAnticrawlerRule__topic1341000351">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.2"><p id="CreateAnticrawlerRule__topic1341000353">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.7.2.4.1.3"><p id="CreateAnticrawlerRule__topic1341000355">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="CreateAnticrawlerRule__topic1341000357"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000359">error_code</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000361">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000363">Error code</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000364"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000366">error_msg</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000368">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000370">Error message</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="CreateAnticrawlerRule__topic1341000371"><strong id="CreateAnticrawlerRule__topic1341000372">Status code: 500</strong></p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAnticrawlerRule__response_RestErrorResponse_2" frame="border" border="1" rules="all"><caption><b>Table 8 </b>Response body parameters</caption><thead align="left"><tr id="CreateAnticrawlerRule__topic1341000379"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.9.2.4.1.1"><p id="CreateAnticrawlerRule__topic1341000381">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.9.2.4.1.2"><p id="CreateAnticrawlerRule__topic1341000383">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.9.2.4.1.3"><p id="CreateAnticrawlerRule__topic1341000385">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="CreateAnticrawlerRule__topic1341000387"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000389">error_code</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000391">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.9.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000393">Error code</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000394"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.1 "><p id="CreateAnticrawlerRule__topic1341000396">error_msg</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.2 "><p id="CreateAnticrawlerRule__topic1341000398">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.9.2.4.1.3 "><p id="CreateAnticrawlerRule__topic1341000400">Error message</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="CreateAnticrawlerRule__topic1341000401"><h4 class="sectiontitle">Example Requests</h4><pre class="screen" id="CreateAnticrawlerRule__topic1341000403">POST https://{Endpoint}/v1/{project_id}/waf/policy/{policy_id}/anticrawler?
|
|
|
|
{
|
|
"url" : "/patent/id",
|
|
"logic" : 3,
|
|
"name" : "test2",
|
|
"type" : "anticrawler_except_url"
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="CreateAnticrawlerRule__topic1341000404"><h4 class="sectiontitle">Example Responses</h4><p id="CreateAnticrawlerRule__topic1341000406"><strong id="CreateAnticrawlerRule__topic1341000407">Status code: 200</strong></p>
|
|
<p id="CreateAnticrawlerRule__topic1341000408">ok</p>
|
|
<pre class="screen" id="CreateAnticrawlerRule__topic1341000409">{
|
|
"id" : "607d14b8153540c0af51a00fe2140d05",
|
|
"policyid" : "777716e0b7b84b5192b9d373f7c6d4f0",
|
|
"name" : "test2",
|
|
"timestamp" : 1675152776784,
|
|
"status" : 1,
|
|
"url" : "/patent/id",
|
|
"logic" : 1,
|
|
"type" : "anticrawler_except_url"
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="CreateAnticrawlerRule__topic1341000410"><h4 class="sectiontitle">Status Codes</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAnticrawlerRule__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="CreateAnticrawlerRule__topic1341000416"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="CreateAnticrawlerRule__topic1341000418">Status Code</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="CreateAnticrawlerRule__topic1341000420">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="CreateAnticrawlerRule__topic1341000422"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateAnticrawlerRule__topic1341000424">200</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateAnticrawlerRule__topic1341000426">ok</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000427"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateAnticrawlerRule__topic1341000429">400</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateAnticrawlerRule__topic1341000431">Request failed.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000432"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateAnticrawlerRule__topic1341000434">401</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateAnticrawlerRule__topic1341000436">The token does not have required permissions.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="CreateAnticrawlerRule__topic1341000437"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateAnticrawlerRule__topic1341000439">500</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateAnticrawlerRule__topic1341000441">Internal server error.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="CreateAnticrawlerRule__topic1341000442"><h4 class="sectiontitle">Error Codes</h4><p id="CreateAnticrawlerRule__topic1341000444">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_300000003.html">Rule Management</a></div>
|
|
</div>
|
|
</div>
|
|
|