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>
116 lines
9.0 KiB
HTML
116 lines
9.0 KiB
HTML
<a name="vpc_router_0006"></a><a name="vpc_router_0006"></a>
|
|
|
|
<h1 class="topictitle1">Adding an Interface to a Router</h1>
|
|
<div id="body1495543735581"><div class="section" id="vpc_router_0006__section57792052205835"><h4 class="sectiontitle">Function</h4><p id="vpc_router_0006__p50644605205835">This API is used to add an interface to a router.</p>
|
|
<p id="vpc_router_0006__p1338174016435">Restrictions</p>
|
|
<ul id="vpc_router_0006__ul18245144812431"><li id="vpc_router_0006__li42451548164316">When a port is used, the port can have only one IP address.</li><li id="vpc_router_0006__li7246448114315">When a subnet is used, the gateway IP address must be configured for the subnet.</li><li id="vpc_router_0006__li825144844318">A router cannot be added to networks whose <strong id="vpc_router_0006__b84235270615336">provider:network_type</strong> is <strong id="vpc_router_0006__b842352706153314">geneve</strong>.</li><li id="vpc_router_0006__li46664448711">Only one router can be added to a subnet.</li></ul>
|
|
</div>
|
|
<div class="section" id="vpc_router_0006__section53148261205835"><h4 class="sectiontitle">URI</h4><p id="vpc_router_0006__p635710819439">PUT /v2.0/routers/{router_id}/add_router_interface</p>
|
|
</div>
|
|
<div class="section" id="vpc_router_0006__section46335438205835"><h4 class="sectiontitle">Request Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_router_0006__table62182974205835" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameter</caption><thead align="left"><tr id="vpc_router_0006__row2403081205835"><th align="left" class="cellrowborder" valign="top" width="17.349999999999998%" id="mcps1.3.3.2.2.5.1.1"><p id="vpc_router_0006__p60431871205835">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="14.29%" id="mcps1.3.3.2.2.5.1.2"><p id="vpc_router_0006__p63143353205835">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="18.279999999999998%" id="mcps1.3.3.2.2.5.1.3"><p id="vpc_router_0006__p14337951205835">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50.080000000000005%" id="mcps1.3.3.2.2.5.1.4"><p id="vpc_router_0006__p20523419205835">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="vpc_router_0006__row51784210205835"><td class="cellrowborder" valign="top" width="17.349999999999998%" headers="mcps1.3.3.2.2.5.1.1 "><p id="vpc_router_0006__p33771502205835">subnet_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.29%" headers="mcps1.3.3.2.2.5.1.2 "><p id="vpc_router_0006__p51137175205835">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.279999999999998%" headers="mcps1.3.3.2.2.5.1.3 "><p id="vpc_router_0006__p48470516205835">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.080000000000005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="vpc_router_0006__p33797742205835">Specifies the subnet ID. Either <strong id="vpc_router_0006__b842352706191715">subnet_id</strong> or <strong id="vpc_router_0006__b842352706191719">port_id</strong> is used.</p>
|
|
<p id="vpc_router_0006__p35744225205835">Use the gateway IP address of the subnet to create a router interface.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_router_0006__row53262572205835"><td class="cellrowborder" valign="top" width="17.349999999999998%" headers="mcps1.3.3.2.2.5.1.1 "><p id="vpc_router_0006__p19301079205835">port_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.29%" headers="mcps1.3.3.2.2.5.1.2 "><p id="vpc_router_0006__p19883542205835">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.279999999999998%" headers="mcps1.3.3.2.2.5.1.3 "><p id="vpc_router_0006__p67063058205835">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.080000000000005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="vpc_router_0006__p63398578205835">Specifies the port ID. Either <strong id="vpc_router_0006__b1556928203191732">subnet_id</strong> or <strong id="vpc_router_0006__b2095602666191732">port_id</strong> is used. Use the port IP address to create a router interface.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="vpc_router_0006__section23560284524"><h4 class="sectiontitle">Example Request</h4><p id="vpc_router_0006__p139225469239">Add an interface to the router. The router ID is i5b8e885c-1347-4ac2-baf9-2249c8ed1270, and the subnet ID is ab78be2d-782f-42a5-aa72-35879f6890ff.</p>
|
|
<pre class="screen" id="vpc_router_0006__screen12897038135217">PUT https://{Endpoint}/v2.0/routers/5b8e885c-1347-4ac2-baf9-2249c8ed1270/add_router_interface
|
|
|
|
{"subnet_id": "ab78be2d-782f-42a5-aa72-35879f6890ff"}</pre>
|
|
</div>
|
|
<div class="section" id="vpc_router_0006__section33716291205835"><h4 class="sectiontitle">Response Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_router_0006__table46665045205835" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response parameter</caption><thead align="left"><tr id="vpc_router_0006__row27310894205835"><th align="left" class="cellrowborder" valign="top" width="19.32%" id="mcps1.3.5.2.2.4.1.1"><p id="vpc_router_0006__p64698801205835">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.909999999999998%" id="mcps1.3.5.2.2.4.1.2"><p id="vpc_router_0006__p6111537205835">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="64.77000000000001%" id="mcps1.3.5.2.2.4.1.3"><p id="vpc_router_0006__p33804102205835">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="vpc_router_0006__row53777707205835"><td class="cellrowborder" valign="top" width="19.32%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_router_0006__p61026988205835">subnet_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.909999999999998%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_router_0006__p44239027205835">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="64.77000000000001%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_router_0006__p6419564205835">Specifies the subnet ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_router_0006__row57776083205835"><td class="cellrowborder" valign="top" width="19.32%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_router_0006__p49351156205835">tenant_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.909999999999998%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_router_0006__p38020701205835">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="64.77000000000001%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_router_0006__p10487112">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_router_0006__row146016113483"><td class="cellrowborder" valign="top" width="19.32%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_router_0006__p3602101115481">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.909999999999998%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_router_0006__p19598203374820">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="64.77000000000001%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_router_0006__p165981433194815">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_router_0006__row24491644205835"><td class="cellrowborder" valign="top" width="19.32%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_router_0006__p37666118205835">port_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.909999999999998%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_router_0006__p31056700205835">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="64.77000000000001%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_router_0006__p20503759205835">Specifies the port ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="vpc_router_0006__row50316109205835"><td class="cellrowborder" valign="top" width="19.32%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_router_0006__p49073051205835">id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.909999999999998%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_router_0006__p15494169205835">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="64.77000000000001%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_router_0006__p54423238205835">Specifies the router ID.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="vpc_router_0006__section20047097205835"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="vpc_router_0006__screen171371946135216">{
|
|
"subnet_id": "ab78be2d-782f-42a5-aa72-35879f6890ff",
|
|
"tenant_id": "6fbe9263116a4b68818cf1edce16bc4f",
|
|
"project_id": "6fbe9263116a4b68818cf1edce16bc4f",
|
|
"port_id": "40e86635-b2a3-45de-a7c8-3cced5b7e755",
|
|
"id": "5b8e885c-1347-4ac2-baf9-2249c8ed1270"
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="vpc_router_0006__section10470352390"><h4 class="sectiontitle">Status Code</h4><p id="vpc_router_0006__p18112112662914">See <a href="vpc_api_0002.html">Status Codes</a>.</p>
|
|
</div>
|
|
<div class="section" id="vpc_router_0006__section85821649202813"><h4 class="sectiontitle">Error Code</h4><p id="vpc_router_0006__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_router_0000.html">Router</a></div>
|
|
</div>
|
|
</div>
|
|
|