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>
329 lines
25 KiB
HTML
329 lines
25 KiB
HTML
<a name="nat_api_0006"></a><a name="nat_api_0006"></a>
|
|
|
|
<h1 class="topictitle1">Creating an SNAT Rule</h1>
|
|
<div id="body58468852"><div class="section" id="nat_api_0006__section45647471"><h4 class="sectiontitle">Function</h4><p id="nat_api_0006__p8229815153013">This API is used to create an SNAT rule.</p>
|
|
<div class="note" id="nat_api_0006__note15721153933010"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="nat_api_0006__p38356572">You can create an SNAT rule only when <strong id="nat_api_0006__b842352706201054">status</strong> of the NAT gateway is set to <strong id="nat_api_0006__b84235270620118">ACTIVE</strong> and <strong id="nat_api_0006__b842352706201117">admin_state_up</strong> of the NAT gateway administrator to <strong id="nat_api_0006__b842352706201139">True</strong>.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="nat_api_0006__section8174056"><h4 class="sectiontitle">URI</h4><p id="nat_api_0006__p42841048152617">POST /v2.0/snat_rules</p>
|
|
</div>
|
|
<div class="section" id="nat_api_0006__section58118839"><h4 class="sectiontitle">Request</h4><p id="nat_api_0006__p47516610316"><a href="#nat_api_0006__table10267194320114">Table 1</a> describes the request parameter.</p>
|
|
|
|
<div class="tablenoborder"><a name="nat_api_0006__table10267194320114"></a><a name="table10267194320114"></a><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0006__table10267194320114" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameter</caption><thead align="left"><tr id="nat_api_0006__row6376174317113"><th align="left" class="cellrowborder" valign="top" width="23.72%" id="mcps1.3.3.3.2.5.1.1"><p id="nat_api_0006__p83761431417">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="8.219999999999999%" id="mcps1.3.3.3.2.5.1.2"><p id="nat_api_0006__p19376144311113">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="18.56%" id="mcps1.3.3.3.2.5.1.3"><p id="nat_api_0006__p1237644310118">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="49.5%" id="mcps1.3.3.3.2.5.1.4"><p id="nat_api_0006__p19376243814">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="nat_api_0006__row113769431511"><td class="cellrowborder" valign="top" width="23.72%" headers="mcps1.3.3.3.2.5.1.1 "><p id="nat_api_0006__p143761543316">snat_rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="8.219999999999999%" headers="mcps1.3.3.3.2.5.1.2 "><p id="nat_api_0006__p143761543914">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.56%" headers="mcps1.3.3.3.2.5.1.3 "><p id="nat_api_0006__p3376143212">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="49.5%" headers="mcps1.3.3.3.2.5.1.4 "><p id="nat_api_0006__p63766431210">Specifies the SNAT rule object. For details, see <a href="#nat_api_0006__table628219431019">Table 2</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="nat_api_0006__table628219431019"></a><a name="table628219431019"></a><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0006__table628219431019" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Description of the <strong id="nat_api_0006__b17841234145217">snat_rule</strong> field</caption><thead align="left"><tr id="nat_api_0006__row5376743718"><th align="left" class="cellrowborder" valign="top" width="22.57%" id="mcps1.3.3.4.2.5.1.1"><p id="nat_api_0006__p4376134314114">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="8.649999999999999%" id="mcps1.3.3.4.2.5.1.2"><p id="nat_api_0006__p43767431317">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.9%" id="mcps1.3.3.4.2.5.1.3"><p id="nat_api_0006__p3376643415">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="55.879999999999995%" id="mcps1.3.3.4.2.5.1.4"><p id="nat_api_0006__p5376154315117">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="nat_api_0006__row9376643318"><td class="cellrowborder" valign="top" width="22.57%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0006__p33764431917">nat_gateway_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="8.649999999999999%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0006__p143761343014">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.9%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0006__p143761143518">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.879999999999995%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0006__p15376243712">Specifies the NAT gateway ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row73761743512"><td class="cellrowborder" valign="top" width="22.57%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0006__p18522143016410">network_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="8.649999999999999%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0006__p115225301847">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.9%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0006__p9522830441">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.879999999999995%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0006__p115223302049">Specifies the network ID used by the SNAT rule. This parameter and <strong id="nat_api_0006__b1981911111551">cidr</strong> are alternative.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row237617432112"><td class="cellrowborder" valign="top" width="22.57%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0006__p56167320519">cidr</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="8.649999999999999%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0006__p11616163653">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.9%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0006__p7616132519">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.879999999999995%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0006__p96161631513">Specifies CIDR, which can be in the format of a network segment or a host IP address. This parameter and <strong id="nat_api_0006__b7582204212211">network_id</strong> are alternative.</p>
|
|
<p id="nat_api_0006__p1861612320514">If <strong id="nat_api_0006__b26831022102418">source_type</strong> is set to <strong id="nat_api_0006__b1378414485243">0</strong>, <strong id="nat_api_0006__b7427184472216">cidr</strong> must be a subset of the VPC subnet.</p>
|
|
<p id="nat_api_0006__p20616431753">If <strong id="nat_api_0006__b2037173642310">source_type</strong> is set to <strong id="nat_api_0006__b23816365236">1</strong>, <strong id="nat_api_0006__b12395363237">cidr</strong> must be a CIDR block of your on-premises network connected to the VPC through Direct Connect or Cloud Connect.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row1637684317119"><td class="cellrowborder" valign="top" width="22.57%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0006__p1437611434114">source_type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="8.649999999999999%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0006__p1537617431518">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.9%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0006__p537624314120">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.879999999999995%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0006__p037614433118"><strong id="nat_api_0006__b667415014212">0</strong>: Either <strong id="nat_api_0006__b116749506215">network_id</strong> or <strong id="nat_api_0006__b1767575012212">cidr</strong> can be specified in a VPC.</p>
|
|
<p id="nat_api_0006__p1937614436114"><strong id="nat_api_0006__b216113591626">1</strong>: Only <strong id="nat_api_0006__b141612591429">cidr</strong> can be specified over a Direct Connect connection.</p>
|
|
<p id="nat_api_0006__p1137616431711">If no value is entered, the default value <strong id="nat_api_0006__b14717415339">0</strong> (VPC) is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row19376114318117"><td class="cellrowborder" valign="top" width="22.57%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0006__p63761431119">floating_ip_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="8.649999999999999%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0006__p183763431012">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.9%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0006__p173763431417">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.879999999999995%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0006__p03765431213">Specifies the <span id="nat_api_0006__text418014393315"></span><span id="nat_api_0006__text131811639163120">EIP</span> ID. Use commas (,) to separate multiple IDs.</p>
|
|
<p id="nat_api_0006__p123761343915">The maximum length of the ID is 4,096 bytes.</p>
|
|
<p id="nat_api_0006__p103761343515">Constraints: The number of <span id="nat_api_0006__text585611983116"></span><span id="nat_api_0006__text1692841915315">EIP</span> IDs cannot exceed 20.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row537613431120"><td class="cellrowborder" valign="top" width="22.57%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0006__p83761431715">description</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="8.649999999999999%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0006__p637615431416">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.9%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0006__p1937604314114">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.879999999999995%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0006__p037619431019">Provides supplementary information about the SNAT rule.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="nat_api_0006__section53307511"><h4 class="sectiontitle">Response</h4><p id="nat_api_0006__p10491115173319"><a href="#nat_api_0006__table64245911">Table 3</a> lists response parameters.</p>
|
|
|
|
<div class="tablenoborder"><a name="nat_api_0006__table64245911"></a><a name="table64245911"></a><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0006__table64245911" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameter</caption><thead align="left"><tr id="nat_api_0006__row15388566"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.1"><p id="nat_api_0006__p38514356">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="26%" id="mcps1.3.4.3.2.4.1.2"><p id="nat_api_0006__p32655106">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="54%" id="mcps1.3.4.3.2.4.1.3"><p id="nat_api_0006__p38657103">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="nat_api_0006__row44217630"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="nat_api_0006__p24858302">snat_rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="26%" headers="mcps1.3.4.3.2.4.1.2 "><p id="nat_api_0006__p256599">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.4.3.2.4.1.3 "><p id="nat_api_0006__p5825169">Specifies the SNAT rule object. For details, see <a href="#nat_api_0006__table161525103">Table 4</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="nat_api_0006__table161525103"></a><a name="table161525103"></a><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0006__table161525103" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Description of the <strong id="nat_api_0006__b894193495210">snat_rule</strong> field</caption><thead align="left"><tr id="nat_api_0006__row1725172181011"><th align="left" class="cellrowborder" valign="top" width="23.23%" id="mcps1.3.4.4.2.4.1.1"><p id="nat_api_0006__p1725119218105">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="19.189999999999998%" id="mcps1.3.4.4.2.4.1.2"><p id="nat_api_0006__p162517218107">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="57.58%" id="mcps1.3.4.4.2.4.1.3"><p id="nat_api_0006__p525182161010">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="nat_api_0006__row112519221010"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0006__p42513251017">id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0006__p1225113212107">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0006__p102511291019">Specifies the SNAT rule ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row125152161012"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0006__p625113241017">tenant_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0006__p152512024103">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0006__p152510211012">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row13251172191013"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0006__p172667221018">nat_gateway_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0006__p82666214109">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0006__p1726611251011">Specifies the NAT gateway ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row226622101019"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0006__p162661929108">network_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0006__p02661226100">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0006__p42669211108">Specifies the network ID used by the SNAT rule.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row1266724105"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0006__p1266132131018">cidr</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0006__p5266122121017">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0006__p10266122191010">Specifies a subset of the VPC subnet CIDR block or a CIDR block of Direct Connect connection.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row16266192191014"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0006__p182661326103">source_type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0006__p62661213102">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0006__p172664291014"><strong id="nat_api_0006__b1041307709">0</strong>: Either <strong id="nat_api_0006__b820464479">network_id</strong> or <strong id="nat_api_0006__b277453382">cidr</strong> can be specified in a VPC.</p>
|
|
<p id="nat_api_0006__p192667291014"><strong id="nat_api_0006__b1329169283">1</strong>: Only <strong id="nat_api_0006__b622048601">cidr</strong> can be specified over a Direct Connect connection.</p>
|
|
<p id="nat_api_0006__p1026615271011">If no value is entered, the default value <strong id="nat_api_0006__b2070433458">0</strong> (VPC) is used.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row1526617211109"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0006__p82661421103">floating_ip_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0006__p8266142121011">String(4096)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.4.4.2.4.1.3 "><ul id="nat_api_0006__ul1926613271020"><li id="nat_api_0006__li626620261015">Specifies the <span id="nat_api_0006__text05261626131216"></span><span id="nat_api_0006__text152613268128">EIP</span> ID. Use commas (,) to separate multiple IDs.</li><li id="nat_api_0006__li226614213105">The maximum length of the ID is 4,096 bytes.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row1326617261012"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0006__p5266123104">floating_ip_address</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0006__p19266427107">String(1024)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.4.4.2.4.1.3 "><ul id="nat_api_0006__ul026610212101"><li id="nat_api_0006__li926613210106">Specifies the <span id="nat_api_0006__text1372613141213"></span><span id="nat_api_0006__text117261731171214">EIP</span>. Use commas (,) to separate multiple <span id="nat_api_0006__text1218793316327"></span><span id="nat_api_0006__text121874334324">EIP</span>s.</li><li id="nat_api_0006__li1926632131014">The maximum length is 1,024 bytes.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row9151125520311"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0006__p389019177125">freezed_ip_address</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0006__p4890141751210">String(1024)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.4.4.2.4.1.3 "><ul id="nat_api_0006__ul0890917131214"><li id="nat_api_0006__li1189061781210">Specifies the frozen EIP. Use commas (,) to separate frozen EIPs.</li><li id="nat_api_0006__li18900175121">The maximum length is 1,024 bytes.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row102666231019"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0006__p102665215106">description</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0006__p12668231014">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0006__p11403165455912">Provides supplementary information about the SNAT rule.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row20266627104"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0006__p1426682131019">status</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0006__p7266202101010">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.4.4.2.4.1.3 "><ul id="nat_api_0006__ul132663212108"><li id="nat_api_0006__li122661211103">Specifies the status of the SNAT rule.</li><li id="nat_api_0006__li10266152161012">For details about all its values, see <a href="nat_api_0042.html#nat_api_0042__table1390614366107">Table 1</a>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row826616212109"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0006__p226611211104">admin_state_up</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0006__p1764614265487">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.4.4.2.4.1.3 "><ul id="nat_api_0006__ul71858556358"><li id="nat_api_0006__li131592284447">Specifies the unfrozen or frozen state.</li><li id="nat_api_0006__li132051838164415">Specifies whether the SNAT rule is enabled or disabled.</li><li id="nat_api_0006__li12205203804411">The state can be:<ul id="nat_api_0006__ul16205638124410"><li id="nat_api_0006__li16206163884415"><strong id="nat_api_0006__b76592042145713">true</strong>: The SNAT rule is enabled.</li><li id="nat_api_0006__li102063382449"><strong id="nat_api_0006__b42002045125519">false</strong>: The SNAT rule is disabled.</li></ul>
|
|
</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0006__row626642101011"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0006__p18266122141014">created_at</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0006__p32669214104">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0006__p776395025914">Specifies when the SNAT rule is created (UTC time). Its value rounds to 6 decimal places for seconds. The format is yyyy-mm-dd hh:mm:ss.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="nat_api_0006__section10005551"><h4 class="sectiontitle">Examples</h4><ul id="nat_api_0006__ul1546013461341"><li id="nat_api_0006__li11459144614343">Example request<ol id="nat_api_0006__ol1192410484018"><li id="nat_api_0006__li1092419418403">Configure parameter <strong id="nat_api_0006__b8751018145418">network_id</strong> in a VPC.<pre class="screen" id="nat_api_0006__screen0931173963917">POST https://{Endpoint}/v2.0/snat_rules
|
|
{
|
|
"snat_rule": {
|
|
"nat_gateway_id": "a78fb3eb-1654-4710-8742-3fc49d5f04f8",
|
|
"description": "description",
|
|
"network_id": "eaad9cd6-2372-4be1-9535-9bd37210ae7b",
|
|
"source_type":0,
|
|
"floating_ip_id": "bdc10a4c-d81a-41ec-adf7-de857f7c812a"
|
|
}
|
|
}</pre>
|
|
</li></ol><ol start="2" id="nat_api_0006__ol34161224134018"><li id="nat_api_0006__li144161124144015">Configure parameter <strong id="nat_api_0006__b938918455">cidr</strong> in a VPC.<pre class="screen" id="nat_api_0006__screen1659512525397">POST https://{Endpoint}/v2.0/snat_rules
|
|
{
|
|
"snat_rule": {
|
|
"nat_gateway_id": "a78fb3eb-1654-4710-8742-3fc49d5f04f8",
|
|
"cidr": "192.168.1.10/32",
|
|
"description": "description",
|
|
"source_type":0,
|
|
"floating_ip_id": "bdc10a4c-d81a-41ec-adf7-de857f7c812a"
|
|
}
|
|
}</pre>
|
|
</li></ol><ol start="3" id="nat_api_0006__ol16589138114012"><li id="nat_api_0006__li558923818403">Configure parameter <strong id="nat_api_0006__b109758241454">cidr</strong> over a Direct Connect connection.<pre class="screen" id="nat_api_0006__screen10183205016401">POST https://{Endpoint}/v2.0/snat_rules
|
|
{
|
|
"snat_rule": {
|
|
"nat_gateway_id": "a78fb3eb-1654-4710-8742-3fc49d5f04f8",
|
|
"cidr": "172.30.0.0/24",
|
|
"description": "description",
|
|
"source_type":1,
|
|
"floating_ip_id": "bdc10a4c-d81a-41ec-adf7-de857f7c812a"
|
|
}
|
|
}</pre>
|
|
</li></ol>
|
|
</li></ul>
|
|
<ul id="nat_api_0006__ul16604102518355"><li id="nat_api_0006__li260462573512">Example response<ol id="nat_api_0006__ol1347392182816"><li id="nat_api_0006__li124738214284">Response to the request for specifying the <strong id="nat_api_0006__b895813551462">network_id</strong> for a VPC<pre class="screen" id="nat_api_0006__screen1960520477293">{
|
|
"snat_rule": {
|
|
"floating_ip_id": "bdc10a4c-d81a-41ec-adf7-de857f7c812a",
|
|
"status": "PENDING_CREATE",
|
|
"nat_gateway_id": "a78fb3eb-1654-4710-8742-3fc49d5f04f8",
|
|
"admin_state_up": true,
|
|
"network_id": "eaad9cd6-2372-4be1-9535-9bd37210ae7b",
|
|
"cidr": null,
|
|
"source_type":0,
|
|
"tenant_id": "27e25061336f4af590faeabeb7fcd9a3",
|
|
"created_at": "2017-11-18 07:54:21.665430",
|
|
"id": "5b95c675-69c2-4656-ba06-58ff72e1d338",
|
|
"floating_ip_address": "5.21.11.226",
|
|
"freezed_ip_address": "",
|
|
"description": "description"
|
|
}
|
|
}</pre>
|
|
</li><li id="nat_api_0006__li647419216288">Response to the request for specifying the CIDR block in a VPC<pre class="screen" id="nat_api_0006__screen676255810296">{
|
|
"snat_rule": {
|
|
"floating_ip_id": "bdc10a4c-d81a-41ec-adf7-de857f7c812a",
|
|
"status": "PENDING_CREATE",
|
|
"nat_gateway_id": "a78fb3eb-1654-4710-8742-3fc49d5f04f8",
|
|
"admin_state_up": true,
|
|
"cidr": "192.168.1.10/32",
|
|
"source_type":0,
|
|
"tenant_id": "27e25061336f4af590faeabeb7fcd9a3",
|
|
"created_at": "2017-11-18 07:54:21.665430",
|
|
"id": "5b95c675-69c2-4656-ba06-58ff72e1d338",
|
|
"floating_ip_address": "5.21.11.226",
|
|
"freezed_ip_address": "",
|
|
"description": "description"
|
|
}
|
|
}</pre>
|
|
</li><li id="nat_api_0006__li247715213283">Response to the request for specifying the CIDR block in a VPC<pre class="screen" id="nat_api_0006__screen11259161020302">{
|
|
"snat_rule": {
|
|
"floating_ip_id": "bdc10a4c-d81a-41ec-adf7-de857f7c812a",
|
|
"status": "PENDING_CREATE",
|
|
"nat_gateway_id": "a78fb3eb-1654-4710-8742-3fc49d5f04f8",
|
|
"admin_state_up": true,
|
|
"cidr": "172.30.0.0/24",
|
|
"source_type":1,
|
|
"tenant_id": "27e25061336f4af590faeabeb7fcd9a3",
|
|
"created_at": "2017-11-18 07:54:21.665430",
|
|
"id": "5b95c675-69c2-4656-ba06-58ff72e1d338",
|
|
"floating_ip_address": "5.21.11.226",
|
|
"freezed_ip_address": "",
|
|
"description": "description"
|
|
}
|
|
}</pre>
|
|
</li></ol>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="nat_api_0006__section5143287"><h4 class="sectiontitle">Status Codes</h4><p id="nat_api_0006__p35718957195632">See <a href="nat_api_0038.html">Status Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="nat_api_0005.html">SNAT Rules</a></div>
|
|
</div>
|
|
</div>
|
|
|