doc-exports/docs/natgw/api-ref/nat_api_0008.html
Qin Ying, Fan 388d58fc5d NATGW API 20230922 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-01-16 14:31:30 +00:00

190 lines
15 KiB
HTML

<a name="nat_api_0008"></a><a name="nat_api_0008"></a>
<h1 class="topictitle1">Querying Details of an SNAT Rule</h1>
<div id="body7731053"><div class="section" id="nat_api_0008__section59567946"><h4 class="sectiontitle">Function</h4><p id="nat_api_0008__p22235579">This API is used to query details of an SNAT rule.</p>
</div>
<div class="section" id="nat_api_0008__section66349468"><h4 class="sectiontitle">URI</h4><p id="nat_api_0008__p14616161815153">GET /v2.0/snat_rules/{snat_rule_id}</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0008__table1910716134591" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="nat_api_0008__row3169413135915"><th align="left" class="cellrowborder" valign="top" width="21.272127212721273%" id="mcps1.3.2.3.2.5.1.1"><p id="nat_api_0008__p16169131375910">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.842084208420843%" id="mcps1.3.2.3.2.5.1.2"><p id="nat_api_0008__p151699135593">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.781578157815781%" id="mcps1.3.2.3.2.5.1.3"><p id="nat_api_0008__p1716915133591">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="42.104210421042104%" id="mcps1.3.2.3.2.5.1.4"><p id="nat_api_0008__p016991320594">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="nat_api_0008__row131691913145916"><td class="cellrowborder" valign="top" width="21.272127212721273%" headers="mcps1.3.2.3.2.5.1.1 "><p id="nat_api_0008__p116919133595">snat_rule_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.842084208420843%" headers="mcps1.3.2.3.2.5.1.2 "><p id="nat_api_0008__p6169171310597">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15.781578157815781%" headers="mcps1.3.2.3.2.5.1.3 "><p id="nat_api_0008__p101695138597">String</p>
</td>
<td class="cellrowborder" valign="top" width="42.104210421042104%" headers="mcps1.3.2.3.2.5.1.4 "><p id="nat_api_0008__p31691313145913">Specifies the SNAT rule ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="nat_api_0008__section5597798"><h4 class="sectiontitle">Request</h4><p id="nat_api_0008__p33119814">None</p>
</div>
<div class="section" id="nat_api_0008__section50380184"><h4 class="sectiontitle">Response</h4><p id="nat_api_0008__p125693518151"><a href="#nat_api_0008__table65459315">Table 2</a> lists response parameter.</p>
<div class="tablenoborder"><a name="nat_api_0008__table65459315"></a><a name="table65459315"></a><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0008__table65459315" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response parameter</caption><thead align="left"><tr id="nat_api_0008__row47811128"><th align="left" class="cellrowborder" valign="top" width="20.73%" id="mcps1.3.4.3.2.4.1.1"><p id="nat_api_0008__p47496137">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.050000000000004%" id="mcps1.3.4.3.2.4.1.2"><p id="nat_api_0008__p21981920">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.22%" id="mcps1.3.4.3.2.4.1.3"><p id="nat_api_0008__p6428601">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="nat_api_0008__row50954701"><td class="cellrowborder" valign="top" width="20.73%" headers="mcps1.3.4.3.2.4.1.1 "><p id="nat_api_0008__p33690117">snat_rule</p>
</td>
<td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.4.3.2.4.1.2 "><p id="nat_api_0008__p44544970">Object</p>
</td>
<td class="cellrowborder" valign="top" width="51.22%" headers="mcps1.3.4.3.2.4.1.3 "><p id="nat_api_0008__p447513">Specifies the SNAT rule object. For details, see <a href="#nat_api_0008__table113261845122312">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="nat_api_0008__table113261845122312"></a><a name="table113261845122312"></a><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0008__table113261845122312" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Description of the <strong id="nat_api_0008__b4752184101511">snat_rule</strong> field</caption><thead align="left"><tr id="nat_api_0008__row3326164512310"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.4.2.4.1.1"><p id="nat_api_0008__p144282010346">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.4.2.4.1.2"><p id="nat_api_0008__p1742881017412">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.4.4.2.4.1.3"><p id="nat_api_0008__p1442813106416">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="nat_api_0008__row73267459231"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0008__p4180209175512">id</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0008__p318018955517">String</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0008__p418017905520">Specifies the SNAT rule ID.</p>
</td>
</tr>
<tr id="nat_api_0008__row11326845102317"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0008__p2180189185519">tenant_id</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0008__p11801797556">String</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0008__p6180499553">Specifies the project ID.</p>
</td>
</tr>
<tr id="nat_api_0008__row13261445132318"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0008__p1718019914553">nat_gateway_id</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0008__p318009145510">String</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0008__p21801692559">Specifies the NAT gateway ID.</p>
</td>
</tr>
<tr id="nat_api_0008__row2032617455238"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0008__p1518016915520">network_id</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0008__p181803945519">String</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0008__p13180179195519">Specifies the network ID used by the SNAT rule.</p>
</td>
</tr>
<tr id="nat_api_0008__row1632610451230"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0008__p201802919559">cidr</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0008__p7180592555">String</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0008__p16180139205514">Specifies a subset of the VPC subnet CIDR block or a CIDR block of a Direct Connect connection.</p>
</td>
</tr>
<tr id="nat_api_0008__row11326645162317"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0008__p0180129105513">source_type</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0008__p1118089165512">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0008__p1118010920557"><strong id="nat_api_0008__b667415014212">0</strong>: Either <strong id="nat_api_0008__b116749506215">network_id</strong> or <strong id="nat_api_0008__b1767575012212">cidr</strong> can be specified in a VPC.</p>
<p id="nat_api_0008__p61801291556"><strong id="nat_api_0008__b1717016385527">1</strong>: Only <strong id="nat_api_0008__b18170438165213">cidr</strong> can be specified over a Direct Connect connection.</p>
<p id="nat_api_0008__p131806910557">If no value is entered, the default value <strong id="nat_api_0008__b14717415339">0</strong> (VPC) is used.</p>
</td>
</tr>
<tr id="nat_api_0008__row4326104512234"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0008__p891724055516">floating_ip_id</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0008__p39177408550">String(4096)</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><ul id="nat_api_0008__ul391714011555"><li id="nat_api_0008__li149171240155516">Specifies the <span id="nat_api_0008__text585611983116"></span><span id="nat_api_0008__text1692841915315">EIP</span> ID. Use commas (,) to separate IDs.</li><li id="nat_api_0008__li19179400557">The maximum length of the ID is 4,096 bytes.</li><li id="nat_api_0008__li1917114075515">Constraints: The number of <span id="nat_api_0008__text18124171314353"></span><span id="nat_api_0008__text101241213143516">EIP</span> IDs cannot exceed 20.</li></ul>
</td>
</tr>
<tr id="nat_api_0008__row2785103161819"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0008__p1791083317183">floating_ip_address</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0008__p491023317185">String(1024)</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><ul id="nat_api_0008__ul39101233161818"><li id="nat_api_0008__li189101033121812">Specifies the <span id="nat_api_0008__text10625151823512"></span><span id="nat_api_0008__text3625161810352">EIP</span>. Use commas (,) to separate <span id="nat_api_0008__text1372511223352"></span><span id="nat_api_0008__text20725022203519">EIP</span>s.</li><li id="nat_api_0008__li1491017331187">The maximum length is 1,024 bytes.</li></ul>
</td>
</tr>
<tr id="nat_api_0008__row62381927111816"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0008__p18910133311184">freezed_ip_address</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0008__p17910533111816">String(1024)</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><ul id="nat_api_0008__ul8910133191812"><li id="nat_api_0008__li09101933201816">Specifies the frozen EIP. Use commas (,) to separate frozen EIPs.</li><li id="nat_api_0008__li3910113331818">The maximum length is 1,024 bytes.</li></ul>
</td>
</tr>
<tr id="nat_api_0008__row11326184562315"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0008__p1391784011551">description</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0008__p29171740185513">String(255)</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0008__p1791754012553">Provides supplementary information about the SNAT rule.</p>
</td>
</tr>
<tr id="nat_api_0008__row932614518236"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0008__p9917640115517">status</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0008__p1917204015553">String</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><ul id="nat_api_0008__ul191724018551"><li id="nat_api_0008__li1917114005514">Specifies the status of the SNAT rule.</li><li id="nat_api_0008__li49171540105514">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_0008__row3326134518239"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0008__p1491714408557">admin_state_up</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0008__p1764614265487">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><ul id="nat_api_0008__ul71858556358"><li id="nat_api_0008__li132051838164415">Specifies whether the SNAT rule is enabled or disabled.</li><li id="nat_api_0008__li12205203804411">The value can be:<ul id="nat_api_0008__ul16205638124410"><li id="nat_api_0008__li16206163884415"><strong id="nat_api_0008__b15680145614597">true</strong>: The SNAT rule is enabled.</li><li id="nat_api_0008__li102063382449"><strong id="nat_api_0008__b142981259105917">false</strong>: The SNAT rule is disabled.</li></ul>
</li></ul>
</td>
</tr>
<tr id="nat_api_0008__row1932664512234"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0008__p09171040115511">created_at</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0008__p1291734045514">String</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0008__p1356911211605">Specifies when the SNAT rule was 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_0008__section50768476"><h4 class="sectiontitle">Examples</h4><ul id="nat_api_0008__ul1696695581615"><li id="nat_api_0008__li9966755171610">Example request<pre class="screen" id="nat_api_0008__screen51514164103135">GET https://{Endpoint}/v2.0/snat_rules/5b95c675-69c2-4656-ba06-58ff72e1d338</pre>
</li></ul>
</div>
<ul id="nat_api_0008__ul13591377175"><li id="nat_api_0008__li459671176">Example response<pre class="screen" id="nat_api_0008__screen15411102031710">{
"snat_rule": {
"floating_ip_id": "bdc10a4c-d81a-41ec-adf7-de857f7c812a",
"status": "ACTIVE",
"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></ul>
<div class="section" id="nat_api_0008__section1941962013172"><h4 class="sectiontitle">Status Codes</h4><p id="nat_api_0008__p1941952020172">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>