doc-exports/docs/vpc/api-ref/vpc_firewall_0003.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

340 lines
28 KiB
HTML

<a name="vpc_firewall_0003"></a><a name="vpc_firewall_0003"></a>
<h1 class="topictitle1">Creating a <span id="text16243174543411">Firewall</span> Rule</h1>
<div id="body1495598977068"><div class="section" id="vpc_firewall_0003__section3826619212329"><h4 class="sectiontitle">Function</h4><p id="vpc_firewall_0003__p137444712329">This API is used to create a <span id="vpc_firewall_0003__text1349617018364"></span><span id="vpc_firewall_0003__text12496190173613">firewall</span> rule.</p>
</div>
<div class="section" id="vpc_firewall_0003__section2109482512329"><h4 class="sectiontitle">URI</h4><p id="vpc_firewall_0003__p1917641113720">POST /v2.0/fwaas/firewall_rules</p>
</div>
<div class="section" id="vpc_firewall_0003__section2533876012329"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_firewall_0003__table1879369612329" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameter</caption><thead align="left"><tr id="vpc_firewall_0003__row34303012329"><th align="left" class="cellrowborder" valign="top" width="12.988701129887009%" id="mcps1.3.3.2.2.5.1.1"><p id="vpc_firewall_0003__p1807949812329"><strong id="vpc_firewall_0003__b51341458173310">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.98830116988301%" id="mcps1.3.3.2.2.5.1.2"><p id="vpc_firewall_0003__p4218882212329"><strong id="vpc_firewall_0003__b725495023311">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.347665233476654%" id="mcps1.3.3.2.2.5.1.3"><p id="vpc_firewall_0003__p262059712329"><strong id="vpc_firewall_0003__b1116162103414">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="46.675332466753325%" id="mcps1.3.3.2.2.5.1.4"><p id="vpc_firewall_0003__p2622676712329"><strong id="vpc_firewall_0003__b763219414341">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_firewall_0003__row1636364712329"><td class="cellrowborder" valign="top" width="12.988701129887009%" headers="mcps1.3.3.2.2.5.1.1 "><p id="vpc_firewall_0003__p3751930212329">firewall_rule</p>
</td>
<td class="cellrowborder" valign="top" width="16.98830116988301%" headers="mcps1.3.3.2.2.5.1.2 "><p id="vpc_firewall_0003__p1109711212329">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="23.347665233476654%" headers="mcps1.3.3.2.2.5.1.3 "><p id="vpc_firewall_0003__p6089760312329"><a href="#vpc_firewall_0003__table38646929121127">firewall_rule</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="46.675332466753325%" headers="mcps1.3.3.2.2.5.1.4 "><p id="vpc_firewall_0003__p61314665122957">Specifies the firewall rule objects. For details, see <a href="#vpc_firewall_0003__table38646929121127">Table 2</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="vpc_firewall_0003__table38646929121127"></a><a name="table38646929121127"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_firewall_0003__table38646929121127" frame="border" border="1" rules="all"><caption><b>Table 2 </b><strong id="vpc_firewall_0003__b11162328133517">Firewall Rule</strong> objects</caption><thead align="left"><tr id="vpc_firewall_0003__row18263398121127"><th align="left" class="cellrowborder" valign="top" width="12.64%" id="mcps1.3.3.3.2.6.1.1"><p id="vpc_firewall_0003__p2027461121127"><strong id="vpc_firewall_0003__b3893165916359">Attribute</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.119999999999997%" id="mcps1.3.3.3.2.6.1.2"><p id="vpc_firewall_0003__p9927105296"><strong id="vpc_firewall_0003__b1173719013617">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.05%" id="mcps1.3.3.3.2.6.1.3"><p id="vpc_firewall_0003__p51747644121127"><strong id="vpc_firewall_0003__b986514173618">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.58%" id="mcps1.3.3.3.2.6.1.4"><p id="vpc_firewall_0003__p13528938121127"><strong id="vpc_firewall_0003__b44644268114611">Constraint</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="31.61%" id="mcps1.3.3.3.2.6.1.5"><p id="vpc_firewall_0003__p12805757121127"><strong id="vpc_firewall_0003__b2124186103620">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_firewall_0003__row3417421121127"><td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.3.3.3.2.6.1.1 "><p id="vpc_firewall_0003__p16296528121127">name</p>
</td>
<td class="cellrowborder" valign="top" width="17.119999999999997%" headers="mcps1.3.3.3.2.6.1.2 "><p id="vpc_firewall_0003__p892151018292">No</p>
</td>
<td class="cellrowborder" valign="top" width="14.05%" headers="mcps1.3.3.3.2.6.1.3 "><p id="vpc_firewall_0003__p52887833121127">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.58%" headers="mcps1.3.3.3.2.6.1.4 "><p id="vpc_firewall_0003__p12447583121127">The value can contain a maximum of 255 characters.</p>
</td>
<td class="cellrowborder" valign="top" width="31.61%" headers="mcps1.3.3.3.2.6.1.5 "><p id="vpc_firewall_0003__p29399172121127">Specifies the <span id="vpc_firewall_0003__text230515214714"></span><span id="vpc_firewall_0003__text03108234715">firewall</span> rule name.</p>
<p id="vpc_firewall_0003__p4331339102">The value can contain a maximum of 255 characters.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row33772147121127"><td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.3.3.3.2.6.1.1 "><p id="vpc_firewall_0003__p62102623121127">description</p>
</td>
<td class="cellrowborder" valign="top" width="17.119999999999997%" headers="mcps1.3.3.3.2.6.1.2 "><p id="vpc_firewall_0003__p718122992911">No</p>
</td>
<td class="cellrowborder" valign="top" width="14.05%" headers="mcps1.3.3.3.2.6.1.3 "><p id="vpc_firewall_0003__p30062050121127">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.58%" headers="mcps1.3.3.3.2.6.1.4 "><p id="vpc_firewall_0003__p32185140121127">The value can contain a maximum of 255 characters.</p>
</td>
<td class="cellrowborder" valign="top" width="31.61%" headers="mcps1.3.3.3.2.6.1.5 "><p id="vpc_firewall_0003__p64485971121127">Provides supplementary information about the <span id="vpc_firewall_0003__text17357175124712"></span><span id="vpc_firewall_0003__text3357125114711">firewall</span> rule.</p>
<p id="vpc_firewall_0003__p1224611561757">The value can contain a maximum of 255 characters.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row66347377121127"><td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.3.3.3.2.6.1.1 "><p id="vpc_firewall_0003__p7361769121127">protocol</p>
</td>
<td class="cellrowborder" valign="top" width="17.119999999999997%" headers="mcps1.3.3.3.2.6.1.2 "><p id="vpc_firewall_0003__p42411831172914">No</p>
</td>
<td class="cellrowborder" valign="top" width="14.05%" headers="mcps1.3.3.3.2.6.1.3 "><p id="vpc_firewall_0003__p50019959121127">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.58%" headers="mcps1.3.3.3.2.6.1.4 "><p id="vpc_firewall_0003__p49011438121127">The value can be <strong id="vpc_firewall_0003__b84235270620190">TCP</strong>, <strong id="vpc_firewall_0003__b84235270620198">UDP</strong>, or <strong id="vpc_firewall_0003__b842352706201915">ICMP</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="31.61%" headers="mcps1.3.3.3.2.6.1.5 "><p id="vpc_firewall_0003__p36897817121127">Specifies the IP protocol.</p>
<p id="vpc_firewall_0003__p1094663315110">The value can be <strong id="vpc_firewall_0003__b364462120396">TCP</strong>, <strong id="vpc_firewall_0003__b186441521133914">UDP</strong>, or <strong id="vpc_firewall_0003__b1464412116398">ICMP</strong>.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row8703753121127"><td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.3.3.3.2.6.1.1 "><p id="vpc_firewall_0003__p5943474121127">source_port</p>
</td>
<td class="cellrowborder" valign="top" width="17.119999999999997%" headers="mcps1.3.3.3.2.6.1.2 "><p id="vpc_firewall_0003__p268733211297">No</p>
</td>
<td class="cellrowborder" valign="top" width="14.05%" headers="mcps1.3.3.3.2.6.1.3 "><p id="vpc_firewall_0003__p59206978121127">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.58%" headers="mcps1.3.3.3.2.6.1.4 "><p id="vpc_firewall_0003__p8739741121127">The value can be an integer from 1 to 65535 or a port number range in the format of <strong id="vpc_firewall_0003__b842352706202051"><em id="vpc_firewall_0003__i842352697202059">a</em>:<em id="vpc_firewall_0003__i84235269720213">b</em></strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="31.61%" headers="mcps1.3.3.3.2.6.1.5 "><p id="vpc_firewall_0003__p62826249121127">Specifies the source port number or port number range.</p>
<p id="vpc_firewall_0003__p15371666511">The value can be an integer from 1 to 65535 or a port number range in the format of <strong id="vpc_firewall_0003__b8882115094111"><em id="vpc_firewall_0003__i88804505418">a</em>:<em id="vpc_firewall_0003__i28811350134119">b</em></strong>.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row52935496121127"><td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.3.3.3.2.6.1.1 "><p id="vpc_firewall_0003__p12876203121127">destination_port</p>
</td>
<td class="cellrowborder" valign="top" width="17.119999999999997%" headers="mcps1.3.3.3.2.6.1.2 "><p id="vpc_firewall_0003__p19241934142919">No</p>
</td>
<td class="cellrowborder" valign="top" width="14.05%" headers="mcps1.3.3.3.2.6.1.3 "><p id="vpc_firewall_0003__p66631365121127">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.58%" headers="mcps1.3.3.3.2.6.1.4 "><p id="vpc_firewall_0003__p34781596121127">The value can be an integer from 1 to 65535 or a port number range in the format of <strong id="vpc_firewall_0003__b18654632425"><em id="vpc_firewall_0003__i76531031428">a</em>:<em id="vpc_firewall_0003__i18654173134220">b</em></strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="31.61%" headers="mcps1.3.3.3.2.6.1.5 "><p id="vpc_firewall_0003__p66851026121127">Specifies the destination port number or port number range.</p>
<p id="vpc_firewall_0003__p193204108218">The value can be an integer from 1 to 65535 or a port number range in the format of <strong id="vpc_firewall_0003__b7419124574218"><em id="vpc_firewall_0003__i7417134519427">a</em>:<em id="vpc_firewall_0003__i16418174517427">b</em></strong>.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row37973187121127"><td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.3.3.3.2.6.1.1 "><p id="vpc_firewall_0003__p18090983121127">ip_version</p>
</td>
<td class="cellrowborder" valign="top" width="17.119999999999997%" headers="mcps1.3.3.3.2.6.1.2 "><p id="vpc_firewall_0003__p1733823692914">No</p>
</td>
<td class="cellrowborder" valign="top" width="14.05%" headers="mcps1.3.3.3.2.6.1.3 "><p id="vpc_firewall_0003__p15064211121127">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="24.58%" headers="mcps1.3.3.3.2.6.1.4 "><p id="vpc_firewall_0003__p49923839121127">4/6</p>
</td>
<td class="cellrowborder" valign="top" width="31.61%" headers="mcps1.3.3.3.2.6.1.5 "><p id="vpc_firewall_0003__p10402054121127">Specifies the IP protocol version.</p>
<p id="vpc_firewall_0003__p650618131322">The value can be <strong id="vpc_firewall_0003__b1257613151350">4</strong> and <strong id="vpc_firewall_0003__b657713156351">6</strong>, indicating IPv4 address and IPv6 address, respectively.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row34581454121127"><td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.3.3.3.2.6.1.1 "><p id="vpc_firewall_0003__p61377852121127">source_ip_address</p>
</td>
<td class="cellrowborder" valign="top" width="17.119999999999997%" headers="mcps1.3.3.3.2.6.1.2 "><p id="vpc_firewall_0003__p185623717291">No</p>
</td>
<td class="cellrowborder" valign="top" width="14.05%" headers="mcps1.3.3.3.2.6.1.3 "><p id="vpc_firewall_0003__p36483585121127">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.58%" headers="mcps1.3.3.3.2.6.1.4 "><p id="vpc_firewall_0003__p16531353121127">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="31.61%" headers="mcps1.3.3.3.2.6.1.5 "><p id="vpc_firewall_0003__p31475962121127">Specifies the source IP address or CIDR block.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row13949121127"><td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.3.3.3.2.6.1.1 "><p id="vpc_firewall_0003__p43901244121127">destination_ip_address</p>
</td>
<td class="cellrowborder" valign="top" width="17.119999999999997%" headers="mcps1.3.3.3.2.6.1.2 "><p id="vpc_firewall_0003__p15707396299">No</p>
</td>
<td class="cellrowborder" valign="top" width="14.05%" headers="mcps1.3.3.3.2.6.1.3 "><p id="vpc_firewall_0003__p14651426121127">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.58%" headers="mcps1.3.3.3.2.6.1.4 "><p id="vpc_firewall_0003__p8502527121127">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="31.61%" headers="mcps1.3.3.3.2.6.1.5 "><p id="vpc_firewall_0003__p53743554121127">Specifies the destination IP address or CIDR block.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row33223843121127"><td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.3.3.3.2.6.1.1 "><p id="vpc_firewall_0003__p40131900121127">action</p>
</td>
<td class="cellrowborder" valign="top" width="17.119999999999997%" headers="mcps1.3.3.3.2.6.1.2 "><p id="vpc_firewall_0003__p269614042916">No</p>
</td>
<td class="cellrowborder" valign="top" width="14.05%" headers="mcps1.3.3.3.2.6.1.3 "><p id="vpc_firewall_0003__p952780121127">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.58%" headers="mcps1.3.3.3.2.6.1.4 "><p id="vpc_firewall_0003__p13986437121127">deny/allow</p>
</td>
<td class="cellrowborder" valign="top" width="31.61%" headers="mcps1.3.3.3.2.6.1.5 "><p id="vpc_firewall_0003__p16135729121127">Specifies action performed on traffic passing through the <span id="vpc_firewall_0003__text18510110194713"></span><span id="vpc_firewall_0003__text55168103471">firewall</span>.</p>
<p id="vpc_firewall_0003__p053482914220">The value can be <strong id="vpc_firewall_0003__b1047618610532">deny</strong> or <strong id="vpc_firewall_0003__b1548219618531">allow</strong>. </p>
</td>
</tr>
<tr id="vpc_firewall_0003__row11398101121127"><td class="cellrowborder" valign="top" width="12.64%" headers="mcps1.3.3.3.2.6.1.1 "><p id="vpc_firewall_0003__p50347088121127">enabled</p>
</td>
<td class="cellrowborder" valign="top" width="17.119999999999997%" headers="mcps1.3.3.3.2.6.1.2 "><p id="vpc_firewall_0003__p14932441202918">No</p>
</td>
<td class="cellrowborder" valign="top" width="14.05%" headers="mcps1.3.3.3.2.6.1.3 "><p id="vpc_firewall_0003__p46161809121127">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="24.58%" headers="mcps1.3.3.3.2.6.1.4 "><p id="vpc_firewall_0003__p53180735121127">The value can be <strong id="vpc_firewall_0003__b3906124124820">true</strong> or <strong id="vpc_firewall_0003__b1190764134819">false</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="31.61%" headers="mcps1.3.3.3.2.6.1.5 "><p id="vpc_firewall_0003__p57324252121127">Specifies whether the <span id="vpc_firewall_0003__text1648011121479"></span><span id="vpc_firewall_0003__text648117129479">firewall</span> rule is enabled.</p>
<p id="vpc_firewall_0003__p117941758725">The value can be <strong id="vpc_firewall_0003__b1652344674713">true</strong> or <strong id="vpc_firewall_0003__b46490559473">false</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="vpc_firewall_0003__section8100515154315"><h4 class="sectiontitle">Example Request</h4><p id="vpc_firewall_0003__p8410103913245">Create an ACL rule with <strong id="vpc_firewall_0003__b8647173110127">action</strong> set to <strong id="vpc_firewall_0003__b199881633121212">allow</strong>, <strong id="vpc_firewall_0003__b185108409124">protocol</strong> set to <strong id="vpc_firewall_0003__b132594439128">tcp</strong>, and destination port set to 80.</p>
<pre class="screen" id="vpc_firewall_0003__screen144293245437">POST https://{Endpoint}/v2.0/fwaas/firewall_rules
{
"firewall_rule": {
"action": "allow",
"enabled": true,
"destination_port": "80",
"protocol": "tcp",
"name": "ALLOW_HTTP"
}
}</pre>
</div>
<div class="section" id="vpc_firewall_0003__section3990074312329"><h4 class="sectiontitle">Response Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_firewall_0003__table209507312329" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameter</caption><thead align="left"><tr id="vpc_firewall_0003__row5536995412329"><th align="left" class="cellrowborder" valign="top" width="23.169999999999998%" id="mcps1.3.5.2.2.4.1.1"><p id="vpc_firewall_0003__p2706537512329">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_0003__p5424121912329">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_0003__p1697811312329">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_firewall_0003__row3190076212329"><td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_firewall_0003__p5714453912329">firewall_rule</p>
</td>
<td class="cellrowborder" valign="top" width="25.61%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_firewall_0003__p394121812329"><a href="#vpc_firewall_0003__table96821221510">firewall_rule </a>object</p>
</td>
<td class="cellrowborder" valign="top" width="51.22%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_firewall_0003__p3044429312329">Specifies the firewall rule objects. For details, see <a href="#vpc_firewall_0003__table96821221510">Table 4</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="vpc_firewall_0003__table96821221510"></a><a name="table96821221510"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_firewall_0003__table96821221510" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="vpc_firewall_0003__b1186902634917">Firewall Rule</strong> objects</caption><thead align="left"><tr id="vpc_firewall_0003__row1568212181517"><th align="left" class="cellrowborder" valign="top" width="32.76%" id="mcps1.3.5.3.2.4.1.1"><p id="vpc_firewall_0003__p8681812161514"><strong id="vpc_firewall_0003__b4117730154919">Attribute</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.69%" id="mcps1.3.5.3.2.4.1.2"><p id="vpc_firewall_0003__p13681312131518"><strong id="vpc_firewall_0003__b1240143111494">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="46.550000000000004%" id="mcps1.3.5.3.2.4.1.3"><p id="vpc_firewall_0003__p116816121152"><strong id="vpc_firewall_0003__b453523214915">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_firewall_0003__row39528007121127"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p7362024121127">id</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p53278848121127">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p13095685121127">Specifies the UUID of the <span id="vpc_firewall_0003__text115441215134712"></span><span id="vpc_firewall_0003__text19544161554710">firewall</span> rule.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row1870712181518"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p2070121214156">name</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p570161218158">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p2070171271514">Specifies the <span id="vpc_firewall_0003__text1231510173471"></span><span id="vpc_firewall_0003__text143151617124714">firewall</span> rule name.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row47051241512"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p1970141281520">description</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p67031271510">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p1270412111511">Provides supplementary information about the <span id="vpc_firewall_0003__text14177151915475"></span><span id="vpc_firewall_0003__text15177619114719">firewall</span> rule.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row39157453121127"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p40485546121127">tenant_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p20366062121127">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p10487112">Specifies the project ID.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row13612334121127"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p3945861121127">public</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p53059091121127">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p46007536121127">Specifies whether the firewall rule can be shared by different tenants.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row2070312131513"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p1570141241512">protocol</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p0701312161512">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p17061201515">Specifies the IP protocol.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row1170181217153"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p12701112161517">source_port</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p127021218159">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p137011241510">Specifies the source port number or port number range.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row8701112181514"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p470312191512">destination_port</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p177081291516">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p1770121217158">Specifies the destination port number or port number range.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row07071212159"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p1370912131514">ip_version</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p770212111514">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p13701112161518">Specifies the IP protocol version.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row1070171261513"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p1970412151510">source_ip_address</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p14701812161510">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p19701412201516">Specifies the source IP address or CIDR block.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row167031212158"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p77061219153">destination_ip_address</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p1870712131519">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p1470712111516">Specifies the destination IP address or CIDR block.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row17051231516"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p13701512171516">action</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p871161221515">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p87131291511">Specifies action performed on traffic passing through the <span id="vpc_firewall_0003__text1113792311475"></span><span id="vpc_firewall_0003__text9142172312476">firewall</span>.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row571121210154"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p1571712101514">enabled</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p137131218159">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p167121271512">Specifies whether the <span id="vpc_firewall_0003__text198841224134714"></span><span id="vpc_firewall_0003__text788402419478">firewall</span> rule is enabled.</p>
</td>
</tr>
<tr id="vpc_firewall_0003__row1574912215580"><td class="cellrowborder" valign="top" width="32.76%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0003__p1312116475819">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.69%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0003__p5125543583">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.550000000000004%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0003__p1528123115287">Specifies the project ID. </p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="vpc_firewall_0003__section1765314912329"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="vpc_firewall_0003__screen58081448184317">{
"firewall_rule": {
"protocol": "tcp",
"description": "",
"source_ip_address": null,
"destination_ip_address": null,
"source_port": null,
"destination_port": "80",
"id": "b94acf06-efc2-485d-ba67-a61acf2a7e28",
"name": "ALLOW_HTTP",
"tenant_id": "23c8a121505047b6869edf39f3062712",
"enabled": true,
"action": "allow",
"ip_version": 4,
"public": false,
"project_id": "23c8a121505047b6869edf39f3062712"
}
}</pre>
</div>
<div class="section" id="vpc_firewall_0003__section10470352390"><h4 class="sectiontitle">Status Code</h4><p id="vpc_firewall_0003__p18112112662914">See <a href="vpc_api_0002.html">Status Codes</a>.</p>
</div>
<div class="section" id="vpc_firewall_0003__section85821649202813"><h4 class="sectiontitle">Error Code</h4><p id="vpc_firewall_0003__p7233105282813">See <a href="vpc_api_0003.html">Error Codes</a>.</p>
</div>
<p id="vpc_firewall_0003__p8060118"></p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="vpc_firewall_0000.html">Firewall</a></div>
</div>
</div>