doc-exports/docs/vpc/api-ref/vpc_firewall_0011.html
Qin Ying, Fan 310d2d9eb1 VPC API 20230106 version
Reviewed-by: Sarda, Priya <prsarda@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: Qin Ying, Fan <fanqinying@huawei.com>
Co-committed-by: Qin Ying, Fan <fanqinying@huawei.com>
2024-02-06 08:38:37 +00:00

179 lines
15 KiB
HTML

<a name="vpc_firewall_0011"></a><a name="vpc_firewall_0011"></a>
<h1 class="topictitle1">Inserting a <span id="text25581203917">Firewall</span> Rule</h1>
<div id="body1495598977068"><div class="section" id="vpc_firewall_0011__section29654898132610"><h4 class="sectiontitle">Function</h4><p id="vpc_firewall_0011__p35190654132610">This API is used to insert a <span id="vpc_firewall_0011__text1111065174819"></span><span id="vpc_firewall_0011__text91106564811">firewall</span> rule to a <span id="vpc_firewall_0011__text645573463016"></span><span id="vpc_firewall_0011__text3459193493016">firewall</span> policy.</p>
</div>
<div class="section" id="vpc_firewall_0011__section17120978132610"><h4 class="sectiontitle">URI</h4><p id="vpc_firewall_0011__p17418191635018">PUT /v2.0/fwaas/firewall_policies/{firewall_policy_id}/insert_rule</p>
<div class="p" id="vpc_firewall_0011__p16788151134220"><a href="#vpc_firewall_0011__table18880184689">Table 1</a> describes the parameters.
<div class="tablenoborder"><a name="vpc_firewall_0011__table18880184689"></a><a name="table18880184689"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_firewall_0011__table18880184689" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="vpc_firewall_0011__row13968641385"><th align="left" class="cellrowborder" valign="top" width="22.222222222222225%" id="mcps1.3.2.3.2.2.5.1.1"><p id="vpc_firewall_0011__p209684410817">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.14141414141414%" id="mcps1.3.2.3.2.2.5.1.2"><p id="vpc_firewall_0011__p69681441386">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.27272727272727%" id="mcps1.3.2.3.2.2.5.1.3"><p id="vpc_firewall_0011__p1096813412811">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="36.36363636363636%" id="mcps1.3.2.3.2.2.5.1.4"><p id="vpc_firewall_0011__p139686416813">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_firewall_0011__row19681041189"><td class="cellrowborder" valign="top" width="22.222222222222225%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="vpc_firewall_0011__p1682422682817">firewall_policy_id</p>
</td>
<td class="cellrowborder" valign="top" width="14.14141414141414%" headers="mcps1.3.2.3.2.2.5.1.2 "><p id="vpc_firewall_0011__p1797015416817">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="27.27272727272727%" headers="mcps1.3.2.3.2.2.5.1.3 "><p id="vpc_firewall_0011__p19701411813">String</p>
</td>
<td class="cellrowborder" valign="top" width="36.36363636363636%" headers="mcps1.3.2.3.2.2.5.1.4 "><p id="vpc_firewall_0011__p1888212430318">Specifies the <span id="vpc_firewall_0011__text16950194945014"></span><span id="vpc_firewall_0011__text6951204965014">firewall</span> policy ID, which uniquely identifies the <span id="vpc_firewall_0011__text1595220498500"></span><span id="vpc_firewall_0011__text1195316492508">firewall</span> policy.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="vpc_firewall_0011__section22829642132610"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_firewall_0011__table57910527132610" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameter</caption><thead align="left"><tr id="vpc_firewall_0011__row56750671132610"><th align="left" class="cellrowborder" valign="top" width="23.46765323467653%" id="mcps1.3.3.2.2.5.1.1"><p id="vpc_firewall_0011__p7811312132610">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.33856614338566%" id="mcps1.3.3.2.2.5.1.2"><p id="vpc_firewall_0011__p18875016132610">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.33806619338066%" id="mcps1.3.3.2.2.5.1.3"><p id="vpc_firewall_0011__p27149878132610">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="42.85571442855714%" id="mcps1.3.3.2.2.5.1.4"><p id="vpc_firewall_0011__p59520796132610">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_firewall_0011__row26604881132610"><td class="cellrowborder" valign="top" width="23.46765323467653%" headers="mcps1.3.3.2.2.5.1.1 "><p id="vpc_firewall_0011__p12663304132610">firewall_rule_id</p>
</td>
<td class="cellrowborder" valign="top" width="14.33856614338566%" headers="mcps1.3.3.2.2.5.1.2 "><p id="vpc_firewall_0011__p32486375132610">String</p>
</td>
<td class="cellrowborder" valign="top" width="19.33806619338066%" headers="mcps1.3.3.2.2.5.1.3 "><p id="vpc_firewall_0011__p18635788132610">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.3.2.2.5.1.4 "><p id="vpc_firewall_0011__p109701641488">Specifies the <span id="vpc_firewall_0011__text16468427183216"></span><span id="vpc_firewall_0011__text547312715322">firewall</span> rule ID, which uniquely identifies the <span id="vpc_firewall_0011__text1547422713324"></span><span id="vpc_firewall_0011__text647418273327">firewall</span> rule.</p>
</td>
</tr>
<tr id="vpc_firewall_0011__row8034919132610"><td class="cellrowborder" valign="top" width="23.46765323467653%" headers="mcps1.3.3.2.2.5.1.1 "><p id="vpc_firewall_0011__p55542506132610">insert_after</p>
</td>
<td class="cellrowborder" valign="top" width="14.33856614338566%" headers="mcps1.3.3.2.2.5.1.2 "><p id="vpc_firewall_0011__p15787556132610">String</p>
</td>
<td class="cellrowborder" valign="top" width="19.33806619338066%" headers="mcps1.3.3.2.2.5.1.3 "><p id="vpc_firewall_0011__p63384372132610">No</p>
</td>
<td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.3.2.2.5.1.4 "><p id="vpc_firewall_0011__p38128195114117">The <strong id="vpc_firewall_0011__b842352706105558_1">insert_after</strong> parameter indicates the firewall rule that has already been associated with the firewall policy. A new firewall rule will be inserted after the firewall rule associated with the firewall policy.</p>
<p id="vpc_firewall_0011__p25644931114113">If both the <strong id="vpc_firewall_0011__b842352706105645_1">insert_after</strong> and <strong id="vpc_firewall_0011__b842352706105656_1">insert_before</strong> parameters are specified, the <strong id="vpc_firewall_0011__b842352706105714_1">insert_after</strong> parameter will be ignored.</p>
</td>
</tr>
<tr id="vpc_firewall_0011__row20668351132610"><td class="cellrowborder" valign="top" width="23.46765323467653%" headers="mcps1.3.3.2.2.5.1.1 "><p id="vpc_firewall_0011__p42122069132610">insert_before</p>
</td>
<td class="cellrowborder" valign="top" width="14.33856614338566%" headers="mcps1.3.3.2.2.5.1.2 "><p id="vpc_firewall_0011__p46267954132610">String</p>
</td>
<td class="cellrowborder" valign="top" width="19.33806619338066%" headers="mcps1.3.3.2.2.5.1.3 "><p id="vpc_firewall_0011__p36183414132610">No</p>
</td>
<td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.3.2.2.5.1.4 "><p id="vpc_firewall_0011__p24247215114125">The <strong id="vpc_firewall_0011__b842352706105558_3">insert_before</strong> parameter indicates the firewall rule that has already been associated with the firewall policy. A new firewall rule will be inserted before the firewall rule associated with the firewall policy.</p>
<p id="vpc_firewall_0011__p48605762132610">If both the <strong id="vpc_firewall_0011__b842352706105645_3">insert_after</strong> and <strong id="vpc_firewall_0011__b842352706105656_3">insert_before</strong> parameters are specified, the <strong id="vpc_firewall_0011__b842352706105714_3">insert_after</strong> parameter will be ignored.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="vpc_firewall_0011__section27317291491"><h4 class="sectiontitle">Example Request</h4><p id="vpc_firewall_0011__p8105163114253">Insert rule 0f82b221-8cd6-44bd-9dfc-0e118fa7b6b1 below rule b8243448-cb3c-496e-851c-dadade4c161b in the ACL policy whose ID is afc52ce9-5305-4ec9-9feb-44feb8330341.</p>
<pre class="screen" id="vpc_firewall_0011__screen3849133914498">PUT https://{Endpoint}/v2.0/fwaas/firewall_policies/afc52ce9-5305-4ec9-9feb-44feb8330341/insert_rule
{
"insert_after": "b8243448-cb3c-496e-851c-dadade4c161b",
"firewall_rule_id": "0f82b221-8cd6-44bd-9dfc-0e118fa7b6b1",
"insert_before": ""
}</pre>
</div>
<div class="section" id="vpc_firewall_0011__section56633148132610"><h4 class="sectiontitle">Response Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_firewall_0011__table50663598132610" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameter</caption><thead align="left"><tr id="vpc_firewall_0011__row38032515132610"><th align="left" class="cellrowborder" valign="top" width="23.169999999999998%" id="mcps1.3.5.2.2.4.1.1"><p id="vpc_firewall_0011__p37452312132610">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25.61%" id="mcps1.3.5.2.2.4.1.2"><p id="vpc_firewall_0011__p10818837132610">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.22%" id="mcps1.3.5.2.2.4.1.3"><p id="vpc_firewall_0011__p58166210132610">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_firewall_0011__row30547380132610"><td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_firewall_0011__p22778252132610">description</p>
</td>
<td class="cellrowborder" valign="top" width="25.61%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_firewall_0011__p5687403132610">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.22%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_firewall_0011__p28250047132610">Provides supplementary information about the firewall policy.</p>
</td>
</tr>
<tr id="vpc_firewall_0011__row38138722132610"><td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_firewall_0011__p51429622132610">audited</p>
</td>
<td class="cellrowborder" valign="top" width="25.61%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_firewall_0011__p44611873132610">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="51.22%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_firewall_0011__p64467387132610">Each time the firewall policy or the associated firewall rules are changed, this attribute will be set to <strong id="vpc_firewall_0011__b8423527061137">False</strong>.</p>
</td>
</tr>
<tr id="vpc_firewall_0011__row37057482132610"><td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_firewall_0011__p2394977132610">firewall_rules</p>
</td>
<td class="cellrowborder" valign="top" width="25.61%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_firewall_0011__p46939168132610">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="51.22%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_firewall_0011__p41445777132610">Specifies the ID list of the firewall rules associated with the current firewall policy.</p>
</td>
</tr>
<tr id="vpc_firewall_0011__row52861264132610"><td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_firewall_0011__p4531891132610">id</p>
</td>
<td class="cellrowborder" valign="top" width="25.61%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_firewall_0011__p19878605132610">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.22%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_firewall_0011__p37584805132610">Specifies the firewall policy ID.</p>
</td>
</tr>
<tr id="vpc_firewall_0011__row19224600132610"><td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_firewall_0011__p61803150132610">name</p>
</td>
<td class="cellrowborder" valign="top" width="25.61%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_firewall_0011__p31295563132610">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.22%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_firewall_0011__p19158555132610">Specifies the firewall policy name.</p>
</td>
</tr>
<tr id="vpc_firewall_0011__row17433093132610"><td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_firewall_0011__p3069015132610">public</p>
</td>
<td class="cellrowborder" valign="top" width="25.61%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_firewall_0011__p63788416132610">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="51.22%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_firewall_0011__p17812694132610">If this attribute is set to <strong id="vpc_firewall_0011__b1233520252353">true</strong>, the <span id="vpc_firewall_0011__text17340625123510"></span><span id="vpc_firewall_0011__text73411725183519">firewall</span> policy is visible to tenants other than its owner. The <span id="vpc_firewall_0011__text113411255351"></span><span id="vpc_firewall_0011__text153412025163515">firewall</span> policy is not visible to other tenants by default.</p>
</td>
</tr>
<tr id="vpc_firewall_0011__row66677436132610"><td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_firewall_0011__p61139761132610">tenant_id</p>
</td>
<td class="cellrowborder" valign="top" width="25.61%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_firewall_0011__p16205070132610">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.22%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_firewall_0011__p10487112">Specifies the project ID.</p>
</td>
</tr>
<tr id="vpc_firewall_0011__row1242463910529"><td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_firewall_0011__p12424739135216">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="25.61%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_firewall_0011__p1433100105317">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.22%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_firewall_0011__p83360145317">Specifies the project ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="vpc_firewall_0011__section42126241132610"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="vpc_firewall_0011__screen199497277500">{
"description": "",
"firewall_rules": [
"b8243448-cb3c-496e-851c-dadade4c161b",
"0f82b221-8cd6-44bd-9dfc-0e118fa7b6b1"
],
"tenant_id": "23c8a121505047b6869edf39f3062712",
"public": false,
"id": "afc52ce9-5305-4ec9-9feb-44feb8330341",
"audited": false,
"name": "test-policy",
"project_id": "23c8a121505047b6869edf39f3062712"
}</pre>
</div>
<div class="section" id="vpc_firewall_0011__section10470352390"><h4 class="sectiontitle">Status Code</h4><p id="vpc_firewall_0011__p18112112662914">See <a href="vpc_api_0002.html">Status Codes</a>.</p>
</div>
<div class="section" id="vpc_firewall_0011__section85821649202813"><h4 class="sectiontitle">Error Code</h4><p id="vpc_firewall_0011__p7233105282813">See <a href="vpc_api_0003.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="vpc_firewall_0000.html">Firewall</a></div>
</div>
</div>