forked from docs/doc-exports
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>
212 lines
17 KiB
HTML
212 lines
17 KiB
HTML
<a name="vpc_firewall_0008"></a><a name="vpc_firewall_0008"></a>
|
|
|
|
<h1 class="topictitle1">Creating a <span id="text199225819377">Firewall</span> Policy</h1>
|
|
<div id="body1495598977068"><div class="section" id="vpc_firewall_0008__section1113556013250"><h4 class="sectiontitle">Function</h4><p id="vpc_firewall_0008__p5340186513250">This API is used to create a <span id="vpc_firewall_0008__text74610132429"></span><span id="vpc_firewall_0008__text1146191344220">firewall</span> policy. A <span id="vpc_firewall_0008__text84110387510"></span><span id="vpc_firewall_0008__text84113381454">firewall</span> policy must be associated with a <span id="vpc_firewall_0008__text1373543310199"></span><span id="vpc_firewall_0008__text1273683371916">firewall</span> group. You can learn more about the <a href="en-us_topic_0000001487936070.html">relationships among network ACL groups, policies, and rules</a>.</p>
|
|
</div>
|
|
<div class="section" id="vpc_firewall_0008__section6172185713250"><h4 class="sectiontitle">URI</h4><p id="vpc_firewall_0008__p429245320450">POST /v2.0/fwaas/firewall_policies</p>
|
|
</div>
|
|
<div class="section" id="vpc_firewall_0008__section1463374013250"><h4 class="sectiontitle">Request Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_firewall_0008__table2714868513250" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameter</caption><thead align="left"><tr id="vpc_firewall_0008__row1539465113250"><th align="left" class="cellrowborder" valign="top" width="19.388061193880613%" id="mcps1.3.3.2.2.5.1.1"><p id="vpc_firewall_0008__p1243776013250">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.858214178582145%" id="mcps1.3.3.2.2.5.1.2"><p id="vpc_firewall_0008__p3819060413250">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="19.898010198980103%" id="mcps1.3.3.2.2.5.1.3"><p id="vpc_firewall_0008__p4282563113250">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_0008__p3747093813250">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="vpc_firewall_0008__row4731925913250"><td class="cellrowborder" valign="top" width="19.388061193880613%" headers="mcps1.3.3.2.2.5.1.1 "><p id="vpc_firewall_0008__p3852256313250">firewall_policy</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.858214178582145%" headers="mcps1.3.3.2.2.5.1.2 "><p id="vpc_firewall_0008__p5375326713250"><a href="#vpc_firewall_0008__table17002720121127">firewall_policy </a>object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.898010198980103%" headers="mcps1.3.3.2.2.5.1.3 "><p id="vpc_firewall_0008__p5311559313250">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.85571442855714%" headers="mcps1.3.3.2.2.5.1.4 "><p id="vpc_firewall_0008__p3083242213250">Specifies the firewall policy. For details, see <a href="#vpc_firewall_0008__table17002720121127">Table 2</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="vpc_firewall_0008__table17002720121127"></a><a name="table17002720121127"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_firewall_0008__table17002720121127" frame="border" border="1" rules="all"><caption><b>Table 2 </b><strong id="vpc_firewall_0008__b181317112148">Firewall Policy</strong> objects</caption><thead align="left"><tr id="vpc_firewall_0008__row16929792121127"><th align="left" class="cellrowborder" valign="top" width="20.830000000000002%" id="mcps1.3.3.3.2.5.1.1"><p id="vpc_firewall_0008__p18873879121127"><strong id="vpc_firewall_0008__b2031192713146">Attribute</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.35%" id="mcps1.3.3.3.2.5.1.2"><p id="vpc_firewall_0008__p1558616214598"><strong id="vpc_firewall_0008__b1323982861413">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20.94%" id="mcps1.3.3.3.2.5.1.3"><p id="vpc_firewall_0008__p12638309121127"><strong id="vpc_firewall_0008__b17294829151410">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="41.88%" id="mcps1.3.3.3.2.5.1.4"><p id="vpc_firewall_0008__p61199938121127"><strong id="vpc_firewall_0008__b22231930101414">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="vpc_firewall_0008__row9858171121127"><td class="cellrowborder" valign="top" width="20.830000000000002%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_firewall_0008__p49865700121127">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.35%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_firewall_0008__p13586523597">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.94%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_firewall_0008__p6225460121127">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.88%" headers="mcps1.3.3.3.2.5.1.4 "><p id="vpc_firewall_0008__p40337147121127">Specifies the name of the <span id="vpc_firewall_0008__text17830202713401"></span><span id="vpc_firewall_0008__text19835627194018">firewall</span> policy.</p>
|
|
<p id="vpc_firewall_0008__p078324045715">The value can contain a maximum of 255 characters.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_firewall_0008__row61803802121127"><td class="cellrowborder" valign="top" width="20.830000000000002%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_firewall_0008__p39621949121127">description</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.35%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_firewall_0008__p9586132125919">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.94%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_firewall_0008__p66053143121127">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.88%" headers="mcps1.3.3.3.2.5.1.4 "><p id="vpc_firewall_0008__p15357220121127">Provides supplementary information about the <span id="vpc_firewall_0008__text143018306408"></span><span id="vpc_firewall_0008__text103021730174014">firewall</span> policy.</p>
|
|
<p id="vpc_firewall_0008__p9538853205712">The value can contain a maximum of 255 characters.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_firewall_0008__row33369184121127"><td class="cellrowborder" valign="top" width="20.830000000000002%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_firewall_0008__p16940942121127">firewall_rules</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.35%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_firewall_0008__p958617217599">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.94%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_firewall_0008__p27024915121127">Array of strings</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.88%" headers="mcps1.3.3.3.2.5.1.4 "><p id="vpc_firewall_0008__p53455884121127">Specifies the firewall rules referenced by the <span id="vpc_firewall_0008__text1091114325406"></span><span id="vpc_firewall_0008__text7911193294018">firewall</span> policy.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_firewall_0008__row717167121127"><td class="cellrowborder" valign="top" width="20.830000000000002%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_firewall_0008__p30704110121127">audited</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.35%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_firewall_0008__p1586172195914">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.94%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_firewall_0008__p10804884121127">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.88%" headers="mcps1.3.3.3.2.5.1.4 "><p id="vpc_firewall_0008__p3925300121127">Specifies the audit flag.</p>
|
|
<p id="vpc_firewall_0008__p04705516572">The value can be <strong id="vpc_firewall_0008__b148093917159">true</strong> or <strong id="vpc_firewall_0008__b148123919156">false</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="vpc_firewall_0008__section1445011319429"><h4 class="sectiontitle">Example Request</h4><p id="vpc_firewall_0008__p4465959142411">Create an ACL policy named <strong id="vpc_firewall_0008__b1255419246137">test-policy</strong> and associate it with the ACL rule whose ID is b8243448-cb3c-496e-851c-dadade4c161b.</p>
|
|
<pre class="screen" id="vpc_firewall_0008__screen479773964220">POST https://{Endpoint}/v2.0/fwaas/firewall_policies
|
|
|
|
{
|
|
"firewall_policy": {
|
|
"name": "test-policy",
|
|
"firewall_rules": [
|
|
"b8243448-cb3c-496e-851c-dadade4c161b"
|
|
]
|
|
}
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="vpc_firewall_0008__section3860887413250"><h4 class="sectiontitle">Response Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_firewall_0008__table1500933413250" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameter</caption><thead align="left"><tr id="vpc_firewall_0008__row4729303413250"><th align="left" class="cellrowborder" valign="top" width="23.169999999999998%" id="mcps1.3.5.2.2.4.1.1"><p id="vpc_firewall_0008__p3920364913250">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_0008__p2638548713250">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_0008__p3350107113250">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="vpc_firewall_0008__row2328883413250"><td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_firewall_0008__p1575454013250">firewall_policy</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25.61%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_firewall_0008__p4446263713250"><a href="#vpc_firewall_0008__table6763048152111">firewall_policy </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_0008__p4558033913250">Specifies the firewall policy. For details, see <a href="#vpc_firewall_0008__table6763048152111">Table 4</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="vpc_firewall_0008__table6763048152111"></a><a name="table6763048152111"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_firewall_0008__table6763048152111" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="vpc_firewall_0008__b44831154181513">Firewall Policy</strong> objects</caption><thead align="left"><tr id="vpc_firewall_0008__row18764194892115"><th align="left" class="cellrowborder" valign="top" width="32.083208320832085%" id="mcps1.3.5.3.2.4.1.1"><p id="vpc_firewall_0008__p3764194815213"><strong id="vpc_firewall_0008__b13294195612157">Attribute</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="22.632263226322635%" id="mcps1.3.5.3.2.4.1.2"><p id="vpc_firewall_0008__p876474817212"><strong id="vpc_firewall_0008__b227165816159">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="45.28452845284529%" id="mcps1.3.5.3.2.4.1.3"><p id="vpc_firewall_0008__p1876484815214"><strong id="vpc_firewall_0008__b1453161181616">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="vpc_firewall_0008__row46402691121127"><td class="cellrowborder" valign="top" width="32.083208320832085%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0008__p11805115121127">id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.632263226322635%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0008__p13006089121127">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.28452845284529%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0008__p13152683121127">Specifies the UUID of the <span id="vpc_firewall_0008__text19920113614011"></span><span id="vpc_firewall_0008__text09261136134018">firewall</span> policy.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_firewall_0008__row376464814211"><td class="cellrowborder" valign="top" width="32.083208320832085%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0008__p19764204872112">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.632263226322635%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0008__p2764154815210">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.28452845284529%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0008__p676474842118">Specifies the name of the <span id="vpc_firewall_0008__text1781143824013"></span><span id="vpc_firewall_0008__text1178213812409">firewall</span> policy.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_firewall_0008__row5764144892115"><td class="cellrowborder" valign="top" width="32.083208320832085%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0008__p476424842118">description</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.632263226322635%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0008__p147654481219">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.28452845284529%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0008__p18765204812117">Provides supplementary information about the <span id="vpc_firewall_0008__text72491417405"></span><span id="vpc_firewall_0008__text62498416405">firewall</span> policy.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_firewall_0008__row3765184815214"><td class="cellrowborder" valign="top" width="32.083208320832085%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0008__p11765848162113">tenant_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.632263226322635%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0008__p4765548162116">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.28452845284529%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0008__p10487112">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_firewall_0008__row7766248182119"><td class="cellrowborder" valign="top" width="32.083208320832085%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0008__p376624822116">firewall_rules</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.632263226322635%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0008__p127661248192113">Array of strings</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.28452845284529%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0008__p076694811218">Specifies the firewall rules referenced by the <span id="vpc_firewall_0008__text1320964316407"></span><span id="vpc_firewall_0008__text192101343144017">firewall</span> policy.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_firewall_0008__row376664817218"><td class="cellrowborder" valign="top" width="32.083208320832085%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0008__p1376624892119">audited</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.632263226322635%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0008__p197661748132118">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.28452845284529%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0008__p1676694811214">Specifies the audit flag.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_firewall_0008__row1976619489210"><td class="cellrowborder" valign="top" width="32.083208320832085%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0008__p1376694818214">public</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.632263226322635%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0008__p576634816213">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.28452845284529%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0008__p19766748192115">Specifies whether the firewall policy can be shared by different tenants.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_firewall_0008__row109594223354"><td class="cellrowborder" valign="top" width="32.083208320832085%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_firewall_0008__p870051413911">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.632263226322635%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_firewall_0008__p17700201411911">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45.28452845284529%" headers="mcps1.3.5.3.2.4.1.3 "><p id="vpc_firewall_0008__p1582585392819">Specifies the project ID. </p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="vpc_firewall_0008__section5030474113250"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="vpc_firewall_0008__screen1943194864210">{
|
|
"firewall_policy": {
|
|
"description": "",
|
|
"firewall_rules": [
|
|
"b8243448-cb3c-496e-851c-dadade4c161b"
|
|
],
|
|
"tenant_id": "23c8a121505047b6869edf39f3062712",
|
|
"public": false,
|
|
"id": "2fb0e81f-9f63-44b2-9894-c13a3284594a",
|
|
"audited": false,
|
|
"name": "test-policy",
|
|
"project_id": "23c8a121505047b6869edf39f3062712"
|
|
}
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="vpc_firewall_0008__section10470352390"><h4 class="sectiontitle">Status Code</h4><p id="vpc_firewall_0008__p18112112662914">See <a href="vpc_api_0002.html">Status Codes</a>.</p>
|
|
</div>
|
|
<div class="section" id="vpc_firewall_0008__section85821649202813"><h4 class="sectiontitle">Error Code</h4><p id="vpc_firewall_0008__p7233105282813">See <a href="vpc_api_0003.html">Error Codes</a>.</p>
|
|
</div>
|
|
<p id="vpc_firewall_0008__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>
|
|
|