doc-exports/docs/vpc/api-ref/vpc_router_0002.html
gtema 4cfecba474 VPC api from PR#278
Reviewed-by: Kucerak, Kristian <kristian.kucerak@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
2022-10-17 12:39:05 +00:00

208 lines
16 KiB
HTML

<a name="vpc_router_0002"></a><a name="vpc_router_0002"></a>
<h1 class="topictitle1">Querying a Router</h1>
<div id="body1495543735580"><div class="section" id="vpc_router_0002__section64937351205744"><h4 class="sectiontitle">Function</h4><p id="vpc_router_0002__p25434118205744">This API is used to query details about a router.</p>
</div>
<div class="section" id="vpc_router_0002__section27580478205744"><h4 class="sectiontitle">URI</h4><p id="vpc_router_0002__p1868564516341">GET /v2.0/routers/{router_id}</p>
</div>
<div class="section" id="vpc_router_0002__section60819119205744"><h4 class="sectiontitle">Request Message</h4><p id="vpc_router_0002__p27401612205744">None</p>
</div>
<div class="section" id="vpc_router_0002__section45287922205744"><h4 class="sectiontitle">Response Message</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_router_0002__table44443065205744" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Response parameter</caption><thead align="left"><tr id="vpc_router_0002__row61398570205744"><th align="left" class="cellrowborder" valign="top" width="23.169999999999998%" id="mcps1.3.4.2.2.4.1.1"><p id="vpc_router_0002__p7228234205744">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25.61%" id="mcps1.3.4.2.2.4.1.2"><p id="vpc_router_0002__p48616054205744">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.22%" id="mcps1.3.4.2.2.4.1.3"><p id="vpc_router_0002__p1505045205744">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_router_0002__row54799831205744"><td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.3.4.2.2.4.1.1 "><p id="vpc_router_0002__p9601350205744">router</p>
</td>
<td class="cellrowborder" valign="top" width="25.61%" headers="mcps1.3.4.2.2.4.1.2 "><p id="vpc_router_0002__p39511881205744"><a href="#vpc_router_0002__table24153696181443">router</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="51.22%" headers="mcps1.3.4.2.2.4.1.3 "><p id="vpc_router_0002__p63022381205744">Specifies the router. For details, see <a href="#vpc_router_0002__table24153696181443">Table 2</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="vpc_router_0002__table24153696181443"></a><a name="table24153696181443"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_router_0002__table24153696181443" frame="border" border="1" rules="all"><caption><b>Table 2 </b><strong id="vpc_router_0002__b112910131707">router</strong> objects</caption><thead align="left"><tr id="vpc_router_0002__row11861342181443"><th align="left" class="cellrowborder" valign="top" width="26.669999999999998%" id="mcps1.3.4.3.2.4.1.1"><p id="vpc_router_0002__p21244677181443"><strong id="vpc_router_0002__b5165727106">Attribute</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.330000000000002%" id="mcps1.3.4.3.2.4.1.2"><p id="vpc_router_0002__p43097239181443"><strong id="vpc_router_0002__b18186163017016">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.4.1.3"><p id="vpc_router_0002__p36728767181443"><strong id="vpc_router_0002__b126443115017">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_router_0002__row22240136181443"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.3.2.4.1.1 "><p id="vpc_router_0002__p56620590181443">id</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.4.3.2.4.1.2 "><p id="vpc_router_0002__p22865048181443">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="vpc_router_0002__p46905229181443">Specifies the router ID.</p>
<p id="vpc_router_0002__p121142486504">This parameter is not mandatory when you query routers.</p>
</td>
</tr>
<tr id="vpc_router_0002__row19493885181443"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.3.2.4.1.1 "><p id="vpc_router_0002__p35500827181443">name</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.4.3.2.4.1.2 "><p id="vpc_router_0002__p56994705181443">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="vpc_router_0002__p11978624181443">Specifies the router name.</p>
<p id="vpc_router_0002__p30744457181443">The name can contain only letters, digits, underscores (_), hyphens (-), and periods (.).</p>
</td>
</tr>
<tr id="vpc_router_0002__row8264657181443"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.3.2.4.1.1 "><p id="vpc_router_0002__p65457453181443">admin_state_up</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.4.3.2.4.1.2 "><p id="vpc_router_0002__p453502181443">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="vpc_router_0002__p48641520181443">Specifies the administrative status.</p>
<p id="vpc_router_0002__p35120501181443">The value can only be <strong id="vpc_router_0002__b171112050111">true</strong>.</p>
</td>
</tr>
<tr id="vpc_router_0002__row47649056181443"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.3.2.4.1.1 "><p id="vpc_router_0002__p34368308181443">status</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.4.3.2.4.1.2 "><p id="vpc_router_0002__p32369557181443">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="vpc_router_0002__p4016564181443">Specifies the router status. The value can be <strong id="vpc_router_0002__b192459531814">ACTIVE</strong>, <strong id="vpc_router_0002__b1324719531117">DOWN</strong>, or <strong id="vpc_router_0002__b1224915538110">ERROR</strong>.</p>
</td>
</tr>
<tr id="vpc_router_0002__row36149082181443"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.3.2.4.1.1 "><p id="vpc_router_0002__p42394506181443">tenant_id</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.4.3.2.4.1.2 "><p id="vpc_router_0002__p11402971181443">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="vpc_router_0002__p10487112">Specifies the project ID. </p>
</td>
</tr>
<tr id="vpc_router_0002__row26765861181443"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.3.2.4.1.1 "><p id="vpc_router_0002__p20551115181443">external_gateway_info</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.4.3.2.4.1.2 "><p id="vpc_router_0002__p54027655181443"><a href="vpc_router_0002.html">external_gateway_info</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="vpc_router_0002__p12911840181443">Specifies the external gateway. This is an extended attribute. For details, see the <strong id="vpc_router_0002__b19279951920">external_gateway_info</strong> objects.</p>
</td>
</tr>
<tr id="vpc_router_0002__row49097702181443"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.3.2.4.1.1 "><p id="vpc_router_0002__p17490925181443">routes</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.4.3.2.4.1.2 "><p id="vpc_router_0002__p7478812181443">Array of <a href="#vpc_router_0002__table18829650181443">route</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="vpc_router_0002__p5122123194853">Specifies a route list. This is an extended attribute. For details, see <a href="#vpc_router_0002__table18829650181443">Table 4</a>.</p>
</td>
</tr>
<tr id="vpc_router_0002__row7278189151614"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.3.2.4.1.1 "><p id="vpc_router_0002__p870051413911">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.4.3.2.4.1.2 "><p id="vpc_router_0002__p15700614790">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="vpc_router_0002__p1506171582614">Specifies the project ID. </p>
</td>
</tr>
<tr id="vpc_router_0002__row172292215166"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.3.2.4.1.1 "><p id="vpc_router_0002__p1953114119914">created_at</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.4.3.2.4.1.2 "><p id="vpc_router_0002__p595318416919">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="vpc_router_0002__p1395374115919">Specifies the time (UTC) when the router is created.</p>
<p id="vpc_router_0002__p65980291419">Format: <em id="vpc_router_0002__i16550616317">yyyy-MM-ddTHH:mm:ss</em></p>
</td>
</tr>
<tr id="vpc_router_0002__row106341917161611"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.3.2.4.1.1 "><p id="vpc_router_0002__p139719548912">updated_at</p>
</td>
<td class="cellrowborder" valign="top" width="23.330000000000002%" headers="mcps1.3.4.3.2.4.1.2 "><p id="vpc_router_0002__p53971154594">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="vpc_router_0002__p1339713549918">Specifies the time (UTC) when the router is updated.</p>
<p id="vpc_router_0002__p1475019214481">Format: <em id="vpc_router_0002__i72145282310">yyyy-MM-ddTHH:mm:ss</em></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_router_0002__table11448068181443" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="vpc_router_0002__b314718292316">external_gateway_info</strong> objects</caption><thead align="left"><tr id="vpc_router_0002__row58732356181443"><th align="left" class="cellrowborder" valign="top" width="26.669999999999998%" id="mcps1.3.4.4.2.4.1.1"><p id="vpc_router_0002__p59700400181443"><strong id="vpc_router_0002__b19991031036">Attribute</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.34%" id="mcps1.3.4.4.2.4.1.2"><p id="vpc_router_0002__p3894228181443"><strong id="vpc_router_0002__b719714335319">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="49.99%" id="mcps1.3.4.4.2.4.1.3"><p id="vpc_router_0002__p1781307181443"><strong id="vpc_router_0002__b1693341135">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_router_0002__row10068178181443"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.4.2.4.1.1 "><p id="vpc_router_0002__p10216081181443">network_id</p>
</td>
<td class="cellrowborder" valign="top" width="23.34%" headers="mcps1.3.4.4.2.4.1.2 "><p id="vpc_router_0002__p22196257181443">String</p>
</td>
<td class="cellrowborder" valign="top" width="49.99%" headers="mcps1.3.4.4.2.4.1.3 "><p id="vpc_router_0002__p38375206181443">Specifies the UUID of the external network.</p>
<p id="vpc_router_0002__p21383968181443">You can use <strong id="vpc_router_0002__b1686716381739">GET /v2.0/networks?router:external=True</strong> or run the <strong id="vpc_router_0002__b1486916381837">neutron net-external-list</strong> command to query information about the external network.</p>
</td>
</tr>
<tr id="vpc_router_0002__row58237990181443"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.4.2.4.1.1 "><p id="vpc_router_0002__p19656760181443">enable_snat</p>
</td>
<td class="cellrowborder" valign="top" width="23.34%" headers="mcps1.3.4.4.2.4.1.2 "><p id="vpc_router_0002__p48693751181443">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="49.99%" headers="mcps1.3.4.4.2.4.1.3 "><p id="vpc_router_0002__p22976335181443">Specifies whether the SNAT function is enabled.</p>
<p id="vpc_router_0002__p49143812181443">The default value is <strong id="vpc_router_0002__b2966153841">false</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="vpc_router_0002__table18829650181443"></a><a name="table18829650181443"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_router_0002__table18829650181443" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="vpc_router_0002__b10449920194115">route</strong> objects</caption><thead align="left"><tr id="vpc_router_0002__row60542282181443"><th align="left" class="cellrowborder" valign="top" width="26.669999999999998%" id="mcps1.3.4.5.2.4.1.1"><p id="vpc_router_0002__p4977811181443"><strong id="vpc_router_0002__b18596126349">Attribute</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.34%" id="mcps1.3.4.5.2.4.1.2"><p id="vpc_router_0002__p549581181443"><strong id="vpc_router_0002__b186141573417">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="49.99%" id="mcps1.3.4.5.2.4.1.3"><p id="vpc_router_0002__p9206714181443"><strong id="vpc_router_0002__b18402287420">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_router_0002__row7546366181443"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.5.2.4.1.1 "><p id="vpc_router_0002__p7275939181443">destination</p>
</td>
<td class="cellrowborder" valign="top" width="23.34%" headers="mcps1.3.4.5.2.4.1.2 "><p id="vpc_router_0002__p52480209181443">String</p>
</td>
<td class="cellrowborder" valign="top" width="49.99%" headers="mcps1.3.4.5.2.4.1.3 "><p id="vpc_router_0002__p66892155181443">Specifies the IP address range.</p>
</td>
</tr>
<tr id="vpc_router_0002__row65158490181443"><td class="cellrowborder" valign="top" width="26.669999999999998%" headers="mcps1.3.4.5.2.4.1.1 "><p id="vpc_router_0002__p43346313181443">nexthop</p>
</td>
<td class="cellrowborder" valign="top" width="23.34%" headers="mcps1.3.4.5.2.4.1.2 "><p id="vpc_router_0002__p21390453181443">String</p>
</td>
<td class="cellrowborder" valign="top" width="49.99%" headers="mcps1.3.4.5.2.4.1.3 "><p id="vpc_router_0002__p17763616181443">Specifies the next hop IP address. The IP address can only be one in the subnet associated with the router.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="vpc_router_0002__section4539230205744"><h4 class="sectiontitle">Example:</h4><p id="vpc_router_0002__p95591733133518">Example request</p>
<pre class="screen" id="vpc_router_0002__screen2916023632">GET https://{Endpoint}/v2.0/routers/01ab4be1-4447-45fb-94be-3ee787ed4ebe</pre>
</div>
<p id="vpc_router_0002__p1778509355">Example response</p>
<pre class="screen" id="vpc_router_0002__screen9188757182116">{
"router": {
"id": "01ab4be1-4447-45fb-94be-3ee787ed4ebe",
"name": "xiaoleizi-tag",
"status": "ACTIVE",
"tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
"project_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
"admin_state_up": true,
"external_gateway_info": {
"network_id": "0a2228f2-7f8a-45f1-8e09-9039e1d09975",
"enable_snat": false
},
"routes": [
{
"destination": "0.0.0.0/0",
"nexthop": "172.16.0.124"
}
],
"created_at": "2018-03-23T09:26:08",
"updated_at": "2018-08-24T08:49:53"
}
}</pre>
<div class="section" id="vpc_router_0002__section10470352390"><h4 class="sectiontitle">Status Code</h4><p id="vpc_router_0002__p18112112662914">See <a href="vpc_api_0002.html">Status Codes</a>.</p>
</div>
<div class="section" id="vpc_router_0002__section85821649202813"><h4 class="sectiontitle">Error Code</h4><p id="vpc_router_0002__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>