Files
doc-exports/docs/wafd/api-ref/CreateGeoipRule.html
qinweiwei 14cbe51752 wafd API 20260210 version
Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com>
Co-authored-by: qinweiwei <qinweiwei@huawei.com>
Co-committed-by: qinweiwei <qinweiwei@huawei.com>
2026-04-21 11:31:19 +00:00

401 lines
33 KiB
HTML

<a name="CreateGeoipRule"></a><a name="CreateGeoipRule"></a>
<h1 class="topictitle1">Creating a Geolocation Access Control Rule</h1>
<div id="body1708331107508"><div class="section" id="CreateGeoipRule__topic1641000000"><h4 class="sectiontitle">Function</h4><p id="CreateGeoipRule__topic1641000002">This API is used to create a geolocation access control rule.</p>
</div>
<div class="section" id="CreateGeoipRule__atuogenerate_1"><h4 class="sectiontitle">URI</h4><p id="CreateGeoipRule__topic1641000004">POST /v1/{project_id}/waf/policy/{policy_id}/geoip</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateGeoipRule__topic1641000005" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="CreateGeoipRule__topic1641000013"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="CreateGeoipRule__topic1641000015">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="CreateGeoipRule__topic1641000017">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="CreateGeoipRule__topic1641000019">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="CreateGeoipRule__topic1641000021">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateGeoipRule__topic1641000023"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="CreateGeoipRule__topic1641000025">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="CreateGeoipRule__topic1641000027">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="CreateGeoipRule__topic1641000029">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="CreateGeoipRule__topic1641000031">Project ID</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000032"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="CreateGeoipRule__topic1641000034">policy_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="CreateGeoipRule__topic1641000036">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="CreateGeoipRule__topic1641000038">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="CreateGeoipRule__topic1641000040">Policy ID. It can be obtained by calling the <strong id="CreateGeoipRule__topic1641000041">ListPolicy</strong> API.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateGeoipRule__topic1641000042"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateGeoipRule__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="CreateGeoipRule__topic1641000051"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="CreateGeoipRule__topic1641000053">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="CreateGeoipRule__topic1641000055">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="CreateGeoipRule__topic1641000057">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="CreateGeoipRule__topic1641000059">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateGeoipRule__topic1641000061"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="CreateGeoipRule__topic1641000063">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="CreateGeoipRule__topic1641000065">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="CreateGeoipRule__topic1641000067">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="CreateGeoipRule__topic1641000069">User token</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000070"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="CreateGeoipRule__topic1641000072">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="CreateGeoipRule__topic1641000074">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="CreateGeoipRule__topic1641000076">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="CreateGeoipRule__topic1641000078">Content type</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateGeoipRule__request_CreateGeoIpRuleRequestBody" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameters</caption><thead align="left"><tr id="CreateGeoipRule__topic1641000086"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="CreateGeoipRule__topic1641000088">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="CreateGeoipRule__topic1641000090">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="CreateGeoipRule__topic1641000092">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="CreateGeoipRule__topic1641000094">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateGeoipRule__topic1641000096"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateGeoipRule__topic1641000098">geoip</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateGeoipRule__topic1641000100">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateGeoipRule__topic1641000102">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateGeoipRule__topic1641000104">Applicable regions. The value can be the region code.</p>
<ul id="CreateGeoipRule__topic1641000105"><li id="CreateGeoipRule__topic1641000106"><p id="CreateGeoipRule__topic1641000107"><a name="CreateGeoipRule__topic1641000106"></a><a name="topic1641000106"></a>CA: Canada</p>
</li><li id="CreateGeoipRule__topic1641000108"><p id="CreateGeoipRule__topic1641000109"><a name="CreateGeoipRule__topic1641000108"></a><a name="topic1641000108"></a>US: USA</p>
</li><li id="CreateGeoipRule__topic1641000110"><p id="CreateGeoipRule__topic1641000111"><a name="CreateGeoipRule__topic1641000110"></a><a name="topic1641000110"></a>AU: Australia</p>
</li><li id="CreateGeoipRule__topic1641000112"><p id="CreateGeoipRule__topic1641000113"><a name="CreateGeoipRule__topic1641000112"></a><a name="topic1641000112"></a>IN: India</p>
</li><li id="CreateGeoipRule__topic1641000114"><p id="CreateGeoipRule__topic1641000115"><a name="CreateGeoipRule__topic1641000114"></a><a name="topic1641000114"></a>JP: Japan</p>
</li><li id="CreateGeoipRule__topic1641000116"><p id="CreateGeoipRule__topic1641000117"><a name="CreateGeoipRule__topic1641000116"></a><a name="topic1641000116"></a>UK: United Kingdom</p>
</li><li id="CreateGeoipRule__topic1641000118"><p id="CreateGeoipRule__topic1641000119"><a name="CreateGeoipRule__topic1641000118"></a><a name="topic1641000118"></a>FR: France</p>
</li><li id="CreateGeoipRule__topic1641000120"><p id="CreateGeoipRule__topic1641000121"><a name="CreateGeoipRule__topic1641000120"></a><a name="topic1641000120"></a>DE: Germany</p>
</li><li id="CreateGeoipRule__topic1641000122"><p id="CreateGeoipRule__topic1641000123"><a name="CreateGeoipRule__topic1641000122"></a><a name="topic1641000122"></a>BR: Brazil</p>
</li><li id="CreateGeoipRule__topic1641000124"><p id="CreateGeoipRule__topic1641000125"><a name="CreateGeoipRule__topic1641000124"></a><a name="topic1641000124"></a>Ukraine: Ukraine</p>
</li><li id="CreateGeoipRule__topic1641000126"><p id="CreateGeoipRule__topic1641000127"><a name="CreateGeoipRule__topic1641000126"></a><a name="topic1641000126"></a>Pakistan: Pakistan</p>
</li><li id="CreateGeoipRule__topic1641000128"><p id="CreateGeoipRule__topic1641000129"><a name="CreateGeoipRule__topic1641000128"></a><a name="topic1641000128"></a>Palestine: Palestine</p>
</li><li id="CreateGeoipRule__topic1641000130"><p id="CreateGeoipRule__topic1641000131"><a name="CreateGeoipRule__topic1641000130"></a><a name="topic1641000130"></a>Israel: Israel</p>
</li><li id="CreateGeoipRule__topic1641000132"><p id="CreateGeoipRule__topic1641000133"><a name="CreateGeoipRule__topic1641000132"></a><a name="topic1641000132"></a>Iraq: Iraq</p>
</li><li id="CreateGeoipRule__topic1641000134"><p id="CreateGeoipRule__topic1641000135"><a name="CreateGeoipRule__topic1641000134"></a><a name="topic1641000134"></a>Afghanistan: Afghanistan</p>
</li><li id="CreateGeoipRule__topic1641000136"><p id="CreateGeoipRule__topic1641000137"><a name="CreateGeoipRule__topic1641000136"></a><a name="topic1641000136"></a>Libya: Libya</p>
</li><li id="CreateGeoipRule__topic1641000138"><p id="CreateGeoipRule__topic1641000139"><a name="CreateGeoipRule__topic1641000138"></a><a name="topic1641000138"></a>Turkey: Turkey</p>
</li><li id="CreateGeoipRule__topic1641000140"><p id="CreateGeoipRule__topic1641000141"><a name="CreateGeoipRule__topic1641000140"></a><a name="topic1641000140"></a>Thailand: Thailand</p>
</li><li id="CreateGeoipRule__topic1641000142"><p id="CreateGeoipRule__topic1641000143"><a name="CreateGeoipRule__topic1641000142"></a><a name="topic1641000142"></a>Singapore: Singapore</p>
</li><li id="CreateGeoipRule__topic1641000144"><p id="CreateGeoipRule__topic1641000145"><a name="CreateGeoipRule__topic1641000144"></a><a name="topic1641000144"></a>South Africa: South Africa</p>
</li><li id="CreateGeoipRule__topic1641000146"><p id="CreateGeoipRule__topic1641000147"><a name="CreateGeoipRule__topic1641000146"></a><a name="topic1641000146"></a>Mexico: Mexico</p>
</li><li id="CreateGeoipRule__topic1641000148"><p id="CreateGeoipRule__topic1641000149"><a name="CreateGeoipRule__topic1641000148"></a><a name="topic1641000148"></a>Peru: Peru</p>
</li><li id="CreateGeoipRule__topic1641000150"><p id="CreateGeoipRule__topic1641000151"><a name="CreateGeoipRule__topic1641000150"></a><a name="topic1641000150"></a>For more geographical location codes, see "Appendix - Geographic Location Codes."</p>
</li></ul>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000152"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateGeoipRule__topic1641000154">white</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateGeoipRule__topic1641000156">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateGeoipRule__topic1641000158">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateGeoipRule__topic1641000160">Protective action. The value can be:</p>
<ul id="CreateGeoipRule__topic1641000161"><li id="CreateGeoipRule__topic1641000162"><p id="CreateGeoipRule__topic1641000163"><a name="CreateGeoipRule__topic1641000162"></a><a name="topic1641000162"></a>0: WAF blocks the requests that hit the rule.</p>
</li><li id="CreateGeoipRule__topic1641000164"><p id="CreateGeoipRule__topic1641000165"><a name="CreateGeoipRule__topic1641000164"></a><a name="topic1641000164"></a>1: WAF allows the requests that hit the rule.</p>
</li><li id="CreateGeoipRule__topic1641000166"><p id="CreateGeoipRule__topic1641000167"><a name="CreateGeoipRule__topic1641000166"></a><a name="topic1641000166"></a>2: WAF only logs the requests that hit the rule.</p>
</li></ul>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000168"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateGeoipRule__topic1641000170">name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateGeoipRule__topic1641000172">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateGeoipRule__topic1641000174">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateGeoipRule__topic1641000176">Rule name. Currently, the console does not support configuring names for geolocation access control rule. Ignore this parameter.</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000177"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateGeoipRule__topic1641000179">description</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateGeoipRule__topic1641000181">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateGeoipRule__topic1641000183">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateGeoipRule__topic1641000185">Rule description</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateGeoipRule__topic1641000186"><h4 class="sectiontitle">Response Parameters</h4><p id="CreateGeoipRule__topic1641000188"><strong id="CreateGeoipRule__topic1641000189">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateGeoipRule__response_CreateGeoIpRuleResponseBody" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response body parameters</caption><thead align="left"><tr id="CreateGeoipRule__topic1641000196"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.1"><p id="CreateGeoipRule__topic1641000198">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.2"><p id="CreateGeoipRule__topic1641000200">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.4.1.3"><p id="CreateGeoipRule__topic1641000202">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateGeoipRule__topic1641000204"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateGeoipRule__topic1641000206">id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateGeoipRule__topic1641000208">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateGeoipRule__topic1641000210">Rule ID.</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000211"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateGeoipRule__topic1641000213">policyid</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateGeoipRule__topic1641000215">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateGeoipRule__topic1641000217">Policy ID</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000218"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateGeoipRule__topic1641000220">name</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateGeoipRule__topic1641000222">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateGeoipRule__topic1641000224">Rule name. Currently, the console does not support configuring names for geolocation access control rule. Ignore this parameter.</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000225"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateGeoipRule__topic1641000227">geoTagList</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateGeoipRule__topic1641000229">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateGeoipRule__topic1641000231">List of geographical locations hit the geolocation access control rule.</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000232"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateGeoipRule__topic1641000234">geoip</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateGeoipRule__topic1641000236">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateGeoipRule__topic1641000238">Applicable regions. The value can be the region code.</p>
<ul id="CreateGeoipRule__topic1641000239"><li id="CreateGeoipRule__topic1641000240"><p id="CreateGeoipRule__topic1641000241"><a name="CreateGeoipRule__topic1641000240"></a><a name="topic1641000240"></a>CA: Canada</p>
</li><li id="CreateGeoipRule__topic1641000242"><p id="CreateGeoipRule__topic1641000243"><a name="CreateGeoipRule__topic1641000242"></a><a name="topic1641000242"></a>US: USA</p>
</li><li id="CreateGeoipRule__topic1641000244"><p id="CreateGeoipRule__topic1641000245"><a name="CreateGeoipRule__topic1641000244"></a><a name="topic1641000244"></a>AU: Australia</p>
</li><li id="CreateGeoipRule__topic1641000246"><p id="CreateGeoipRule__topic1641000247"><a name="CreateGeoipRule__topic1641000246"></a><a name="topic1641000246"></a>IN: India</p>
</li><li id="CreateGeoipRule__topic1641000248"><p id="CreateGeoipRule__topic1641000249"><a name="CreateGeoipRule__topic1641000248"></a><a name="topic1641000248"></a>JP: Japan</p>
</li><li id="CreateGeoipRule__topic1641000250"><p id="CreateGeoipRule__topic1641000251"><a name="CreateGeoipRule__topic1641000250"></a><a name="topic1641000250"></a>UK: United Kingdom</p>
</li><li id="CreateGeoipRule__topic1641000252"><p id="CreateGeoipRule__topic1641000253"><a name="CreateGeoipRule__topic1641000252"></a><a name="topic1641000252"></a>FR: France</p>
</li><li id="CreateGeoipRule__topic1641000254"><p id="CreateGeoipRule__topic1641000255"><a name="CreateGeoipRule__topic1641000254"></a><a name="topic1641000254"></a>DE: Germany</p>
</li><li id="CreateGeoipRule__topic1641000256"><p id="CreateGeoipRule__topic1641000257"><a name="CreateGeoipRule__topic1641000256"></a><a name="topic1641000256"></a>BR: Brazil</p>
</li><li id="CreateGeoipRule__topic1641000258"><p id="CreateGeoipRule__topic1641000259"><a name="CreateGeoipRule__topic1641000258"></a><a name="topic1641000258"></a>Ukraine: Ukraine</p>
</li><li id="CreateGeoipRule__topic1641000260"><p id="CreateGeoipRule__topic1641000261"><a name="CreateGeoipRule__topic1641000260"></a><a name="topic1641000260"></a>Pakistan: Pakistan</p>
</li><li id="CreateGeoipRule__topic1641000262"><p id="CreateGeoipRule__topic1641000263"><a name="CreateGeoipRule__topic1641000262"></a><a name="topic1641000262"></a>Palestine: Palestine</p>
</li><li id="CreateGeoipRule__topic1641000264"><p id="CreateGeoipRule__topic1641000265"><a name="CreateGeoipRule__topic1641000264"></a><a name="topic1641000264"></a>Israel: Israel</p>
</li><li id="CreateGeoipRule__topic1641000266"><p id="CreateGeoipRule__topic1641000267"><a name="CreateGeoipRule__topic1641000266"></a><a name="topic1641000266"></a>Iraq: Iraq</p>
</li><li id="CreateGeoipRule__topic1641000268"><p id="CreateGeoipRule__topic1641000269"><a name="CreateGeoipRule__topic1641000268"></a><a name="topic1641000268"></a>Afghanistan: Afghanistan</p>
</li><li id="CreateGeoipRule__topic1641000270"><p id="CreateGeoipRule__topic1641000271"><a name="CreateGeoipRule__topic1641000270"></a><a name="topic1641000270"></a>Libya: Libya</p>
</li><li id="CreateGeoipRule__topic1641000272"><p id="CreateGeoipRule__topic1641000273"><a name="CreateGeoipRule__topic1641000272"></a><a name="topic1641000272"></a>Turkey: Turkey</p>
</li><li id="CreateGeoipRule__topic1641000274"><p id="CreateGeoipRule__topic1641000275"><a name="CreateGeoipRule__topic1641000274"></a><a name="topic1641000274"></a>Thailand: Thailand</p>
</li><li id="CreateGeoipRule__topic1641000276"><p id="CreateGeoipRule__topic1641000277"><a name="CreateGeoipRule__topic1641000276"></a><a name="topic1641000276"></a>Singapore: Singapore</p>
</li><li id="CreateGeoipRule__topic1641000278"><p id="CreateGeoipRule__topic1641000279"><a name="CreateGeoipRule__topic1641000278"></a><a name="topic1641000278"></a>South Africa: South Africa</p>
</li><li id="CreateGeoipRule__topic1641000280"><p id="CreateGeoipRule__topic1641000281"><a name="CreateGeoipRule__topic1641000280"></a><a name="topic1641000280"></a>Mexico: Mexico</p>
</li><li id="CreateGeoipRule__topic1641000282"><p id="CreateGeoipRule__topic1641000283"><a name="CreateGeoipRule__topic1641000282"></a><a name="topic1641000282"></a>Peru: Peru</p>
</li><li id="CreateGeoipRule__topic1641000284"><p id="CreateGeoipRule__topic1641000285"><a name="CreateGeoipRule__topic1641000284"></a><a name="topic1641000284"></a>For more geographical location codes, see "Appendix - Geographic Location Codes."</p>
</li></ul>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000286"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateGeoipRule__topic1641000288">white</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateGeoipRule__topic1641000290">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateGeoipRule__topic1641000292">Protective action. The value can be:</p>
<ul id="CreateGeoipRule__topic1641000293"><li id="CreateGeoipRule__topic1641000294"><p id="CreateGeoipRule__topic1641000295"><a name="CreateGeoipRule__topic1641000294"></a><a name="topic1641000294"></a>0: WAF blocks the requests that hit the rule.</p>
</li><li id="CreateGeoipRule__topic1641000296"><p id="CreateGeoipRule__topic1641000297"><a name="CreateGeoipRule__topic1641000296"></a><a name="topic1641000296"></a>1: WAF allows the requests that hit the rule.</p>
</li><li id="CreateGeoipRule__topic1641000298"><p id="CreateGeoipRule__topic1641000299"><a name="CreateGeoipRule__topic1641000298"></a><a name="topic1641000298"></a>2: WAF only logs the requests that hit the rule.</p>
</li></ul>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000300"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateGeoipRule__topic1641000302">status</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateGeoipRule__topic1641000304">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateGeoipRule__topic1641000306">Rule status. The value can be:</p>
<ul id="CreateGeoipRule__topic1641000307"><li id="CreateGeoipRule__topic1641000308"><p id="CreateGeoipRule__topic1641000309"><a name="CreateGeoipRule__topic1641000308"></a><a name="topic1641000308"></a>0: The rule is disabled.</p>
</li><li id="CreateGeoipRule__topic1641000310"><p id="CreateGeoipRule__topic1641000311"><a name="CreateGeoipRule__topic1641000310"></a><a name="topic1641000310"></a>1: The rule is enabled.</p>
</li></ul>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000312"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateGeoipRule__topic1641000314">timestamp</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateGeoipRule__topic1641000316">Long</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateGeoipRule__topic1641000318">Time the rule is created. The value is a 13-digit timestamp in ms.</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000319"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateGeoipRule__topic1641000321">description</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateGeoipRule__topic1641000323">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateGeoipRule__topic1641000325">Rule description</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateGeoipRule__topic1641000326"><strong id="CreateGeoipRule__topic1641000327">Status code: 400</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateGeoipRule__response_RestErrorResponse" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response body parameters</caption><thead align="left"><tr id="CreateGeoipRule__topic1641000334"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.1"><p id="CreateGeoipRule__topic1641000336">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.2"><p id="CreateGeoipRule__topic1641000338">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.5.2.4.1.3"><p id="CreateGeoipRule__topic1641000340">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateGeoipRule__topic1641000342"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreateGeoipRule__topic1641000344">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreateGeoipRule__topic1641000346">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreateGeoipRule__topic1641000348">Error code</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000349"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreateGeoipRule__topic1641000351">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreateGeoipRule__topic1641000353">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreateGeoipRule__topic1641000355">Error message</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateGeoipRule__topic1641000356"><strong id="CreateGeoipRule__topic1641000357">Status code: 401</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateGeoipRule__response_RestErrorResponse_1" frame="border" border="1" rules="all"><caption><b>Table 6 </b>Response body parameters</caption><thead align="left"><tr id="CreateGeoipRule__topic1641000364"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.1"><p id="CreateGeoipRule__topic1641000366">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.2"><p id="CreateGeoipRule__topic1641000368">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.7.2.4.1.3"><p id="CreateGeoipRule__topic1641000370">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateGeoipRule__topic1641000372"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="CreateGeoipRule__topic1641000374">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="CreateGeoipRule__topic1641000376">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="CreateGeoipRule__topic1641000378">Error code</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000379"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="CreateGeoipRule__topic1641000381">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="CreateGeoipRule__topic1641000383">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="CreateGeoipRule__topic1641000385">Error message</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateGeoipRule__topic1641000386"><strong id="CreateGeoipRule__topic1641000387">Status code: 500</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateGeoipRule__response_RestErrorResponse_2" frame="border" border="1" rules="all"><caption><b>Table 7 </b>Response body parameters</caption><thead align="left"><tr id="CreateGeoipRule__topic1641000394"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.9.2.4.1.1"><p id="CreateGeoipRule__topic1641000396">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.9.2.4.1.2"><p id="CreateGeoipRule__topic1641000398">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.9.2.4.1.3"><p id="CreateGeoipRule__topic1641000400">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateGeoipRule__topic1641000402"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.1 "><p id="CreateGeoipRule__topic1641000404">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.2 "><p id="CreateGeoipRule__topic1641000406">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.9.2.4.1.3 "><p id="CreateGeoipRule__topic1641000408">Error code</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000409"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.1 "><p id="CreateGeoipRule__topic1641000411">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.2 "><p id="CreateGeoipRule__topic1641000413">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.9.2.4.1.3 "><p id="CreateGeoipRule__topic1641000415">Error message</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateGeoipRule__topic1641000416"><h4 class="sectiontitle">Example Requests</h4><pre class="screen" id="CreateGeoipRule__topic1641000418">POST https://{Endpoint}/v1/{project_id}/waf/policy/{policy_id}/geoip?
{
"white" : 0,
"description" : "demo",
"geoip" : "BR"
}</pre>
</div>
<div class="section" id="CreateGeoipRule__topic1641000419"><h4 class="sectiontitle">Example Responses</h4><p id="CreateGeoipRule__topic1641000421"><strong id="CreateGeoipRule__topic1641000422">Status code: 200</strong></p>
<p id="CreateGeoipRule__topic1641000423">Request succeeded.</p>
<pre class="screen" id="CreateGeoipRule__topic1641000424">{
"id" : "02dafa406c4941368a1037b020f15a53",
"policyid" : "38ff0cb9a10e4d5293c642bc0350fa6d",
"timestamp" : 1650534513775,
"description" : "demo",
"status" : 1,
"geoTagList" : [ "BR" ],
"geoip" : "BR",
"white" : 0
}</pre>
</div>
<div class="section" id="CreateGeoipRule__topic1641000425"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateGeoipRule__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="CreateGeoipRule__topic1641000431"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="CreateGeoipRule__topic1641000433">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="CreateGeoipRule__topic1641000435">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateGeoipRule__topic1641000437"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateGeoipRule__topic1641000439">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateGeoipRule__topic1641000441">Request succeeded.</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000442"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateGeoipRule__topic1641000444">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateGeoipRule__topic1641000446">Request failed.</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000447"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateGeoipRule__topic1641000449">401</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateGeoipRule__topic1641000451">The token does not have required permissions.</p>
</td>
</tr>
<tr id="CreateGeoipRule__topic1641000452"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateGeoipRule__topic1641000454">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateGeoipRule__topic1641000456">Internal server error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateGeoipRule__topic1641000457"><h4 class="sectiontitle">Error Codes</h4><p id="CreateGeoipRule__topic1641000459">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>