doc-exports/docs/ecs/api-ref/en-us_topic_0121978383.html
Zaoxu, Li 4edaa4a4cc ECS API 20231016 version
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com>
Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
2024-04-29 11:04:13 +00:00

241 lines
19 KiB
HTML

<a name="EN-US_TOPIC_0121978383"></a><a name="EN-US_TOPIC_0121978383"></a>
<h1 class="topictitle1">Querying NICs of an ECS</h1>
<div id="body1531790006676"><div class="section" id="EN-US_TOPIC_0121978383__section36073588"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0121978383__p30936422">This API is used to query NICs of an ECS.</p>
</div>
<div class="section" id="EN-US_TOPIC_0121978383__section56226836"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0121978383__p1090449916610">GET /v1/{project_id}/cloudservers/{server_id}/os-interface</p>
<div class="p" id="EN-US_TOPIC_0121978383__p787234316103"><a href="#EN-US_TOPIC_0121978383__table38523909">Table 1</a> describes the parameters in the URI.
<div class="tablenoborder"><a name="EN-US_TOPIC_0121978383__table38523909"></a><a name="table38523909"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0121978383__table38523909" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0121978383__row15247616"><th align="left" class="cellrowborder" valign="top" width="16.42%" id="mcps1.3.2.3.2.2.4.1.1"><p id="EN-US_TOPIC_0121978383__p27097356">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.54%" id="mcps1.3.2.3.2.2.4.1.2"><p id="EN-US_TOPIC_0121978383__p47402253">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="66.03999999999999%" id="mcps1.3.2.3.2.2.4.1.3"><p id="EN-US_TOPIC_0121978383__p14377323">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0121978383__row23712525"><td class="cellrowborder" valign="top" width="16.42%" headers="mcps1.3.2.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p41666396">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.3.2.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p19534911">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="66.03999999999999%" headers="mcps1.3.2.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p37593705">Specifies the project ID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0121978383__row45459464114812"><td class="cellrowborder" valign="top" width="16.42%" headers="mcps1.3.2.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p6481999114812">server_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.3.2.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p55279920114812">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="66.03999999999999%" headers="mcps1.3.2.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p48488537114812">Specifies the <span id="EN-US_TOPIC_0121978383__text96666618197">ECS</span> ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0121978383__section36279478"><h4 class="sectiontitle">Request</h4><p id="EN-US_TOPIC_0121978383__p49840382">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0121978383__section58079852"><h4 class="sectiontitle">Response</h4><div class="p" id="EN-US_TOPIC_0121978383__p16361581111"><a href="#EN-US_TOPIC_0121978383__table25276401">Table 2</a> describes the response parameters.
<div class="tablenoborder"><a name="EN-US_TOPIC_0121978383__table25276401"></a><a name="table25276401"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0121978383__table25276401" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0121978383__row30840926"><th align="left" class="cellrowborder" valign="top" width="16.38%" id="mcps1.3.4.2.2.2.4.1.1"><p id="EN-US_TOPIC_0121978383__p21494305">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.05%" id="mcps1.3.4.2.2.2.4.1.2"><p id="EN-US_TOPIC_0121978383__p673716201611">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="70.57%" id="mcps1.3.4.2.2.2.4.1.3"><p id="EN-US_TOPIC_0121978383__p28416672">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0121978383__row13119252"><td class="cellrowborder" valign="top" width="16.38%" headers="mcps1.3.4.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p56026474">interfaceAttachments</p>
</td>
<td class="cellrowborder" valign="top" width="13.05%" headers="mcps1.3.4.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p34453949">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="70.57%" headers="mcps1.3.4.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p18214233">Specifies ECS NICs. For details, see <a href="#EN-US_TOPIC_0121978383__table49805933">Table 3</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0121978383__row1290043141314"><td class="cellrowborder" valign="top" width="16.38%" headers="mcps1.3.4.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p18900183116137">attachableQuantity</p>
</td>
<td class="cellrowborder" valign="top" width="13.05%" headers="mcps1.3.4.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p990093151313">Object</p>
</td>
<td class="cellrowborder" valign="top" width="70.57%" headers="mcps1.3.4.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p1790003112134">Specifies the number of NICs that can be attached to an ECS. For details, see <a href="#EN-US_TOPIC_0121978383__table19750463">Table 4</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0121978383__table49805933"></a><a name="table49805933"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0121978383__table49805933" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="EN-US_TOPIC_0121978383__b12918429171214">interfaceAttachments</strong> field description</caption><thead align="left"><tr id="EN-US_TOPIC_0121978383__row9026257"><th align="left" class="cellrowborder" valign="top" width="16.41164116411641%" id="mcps1.3.4.2.3.2.4.1.1"><p id="EN-US_TOPIC_0121978383__p0434174414615">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.221322132213222%" id="mcps1.3.4.2.3.2.4.1.2"><p id="EN-US_TOPIC_0121978383__p8434144415614">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="70.36703670367037%" id="mcps1.3.4.2.3.2.4.1.3"><p id="EN-US_TOPIC_0121978383__p143414418610">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0121978383__row10727144"><td class="cellrowborder" valign="top" width="16.41164116411641%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p63592346">port_state</p>
</td>
<td class="cellrowborder" valign="top" width="13.221322132213222%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p13579756">String</p>
</td>
<td class="cellrowborder" valign="top" width="70.36703670367037%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p34639550">Specifies the NIC port status.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0121978383__row43320496"><td class="cellrowborder" valign="top" width="16.41164116411641%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p19299281">fixed_ips</p>
</td>
<td class="cellrowborder" valign="top" width="13.221322132213222%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p55265559">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="70.36703670367037%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p23274750">Specifies private IP addresses for NICs. For details, see <a href="#EN-US_TOPIC_0121978383__table15567163961815">Table 5</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0121978383__row8146160"><td class="cellrowborder" valign="top" width="16.41164116411641%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p55859239">net_id</p>
</td>
<td class="cellrowborder" valign="top" width="13.221322132213222%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p10966323">String</p>
</td>
<td class="cellrowborder" valign="top" width="70.36703670367037%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p8495130">Specifies the network ID to which the NIC port belongs.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0121978383__row9347313"><td class="cellrowborder" valign="top" width="16.41164116411641%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p18934887">port_id</p>
</td>
<td class="cellrowborder" valign="top" width="13.221322132213222%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p13287175">String</p>
</td>
<td class="cellrowborder" valign="top" width="70.36703670367037%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p22674843">Specifies the NIC port ID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0121978383__row2747002"><td class="cellrowborder" valign="top" width="16.41164116411641%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p21180630">mac_addr</p>
</td>
<td class="cellrowborder" valign="top" width="13.221322132213222%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p50770908">String</p>
</td>
<td class="cellrowborder" valign="top" width="70.36703670367037%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p35008393">Specifies the MAC address of the NIC.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0121978383__row43566916314"><td class="cellrowborder" valign="top" width="16.41164116411641%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p13573915317">delete_on_termination</p>
</td>
<td class="cellrowborder" valign="top" width="13.221322132213222%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p153571391431">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="70.36703670367037%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p93571891439">Specifies whether to delete a NIC when detaching it.</p>
<p id="EN-US_TOPIC_0121978383__p02588249414"><strong id="EN-US_TOPIC_0121978383__b13816155764718">true</strong>: The NIC will be deleted. <strong id="EN-US_TOPIC_0121978383__b26676914481">false</strong>: The NIC will not be deleted.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0121978383__row91281116638"><td class="cellrowborder" valign="top" width="16.41164116411641%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p191286165313">driver_mode</p>
</td>
<td class="cellrowborder" valign="top" width="13.221322132213222%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p144141841132418">String</p>
</td>
<td class="cellrowborder" valign="top" width="70.36703670367037%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p96011887545">Specifies the NIC driver type, which is <strong id="EN-US_TOPIC_0121978383__b1696011423213">virtio</strong> by default. This parameter is a reserved field.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0121978383__row188911719936"><td class="cellrowborder" valign="top" width="16.41164116411641%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p1089112191314">min_rate</p>
</td>
<td class="cellrowborder" valign="top" width="13.221322132213222%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p1180475512248">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="70.36703670367037%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p1558065092212">Specifies the minimum NIC bandwidth.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0121978383__row89221528339"><td class="cellrowborder" valign="top" width="16.41164116411641%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p14922028439">multiqueue_num</p>
</td>
<td class="cellrowborder" valign="top" width="13.221322132213222%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p1922132816310">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="70.36703670367037%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p757714918225">Specifies the number of queues.</p>
<p id="EN-US_TOPIC_0121978383__p1092218284312">The value can be <strong id="EN-US_TOPIC_0121978383__b148210286497">1</strong>, <strong id="EN-US_TOPIC_0121978383__b131061031134910">2</strong>, <strong id="EN-US_TOPIC_0121978383__b10138163414491">4</strong>, <strong id="EN-US_TOPIC_0121978383__b39555364499">8</strong>, <strong id="EN-US_TOPIC_0121978383__b88101240164914">16</strong>, or <strong id="EN-US_TOPIC_0121978383__b203225430496">28</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0121978383__row10352135752711"><td class="cellrowborder" valign="top" width="16.41164116411641%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p135205732713">pci_address</p>
</td>
<td class="cellrowborder" valign="top" width="13.221322132213222%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p435219572270">String</p>
</td>
<td class="cellrowborder" valign="top" width="70.36703670367037%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p16352057192711">Specifies the BDF number of the NIC in Linux GuestOS.</p>
<div class="note" id="EN-US_TOPIC_0121978383__note98237381486"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="EN-US_TOPIC_0121978383__p18358422464">If the NIC is not supported, no information will be returned.</p>
</div></div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0121978383__table19750463"></a><a name="table19750463"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0121978383__table19750463" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="EN-US_TOPIC_0121978383__b24091659174613">attachableQuantity</strong> field description</caption><thead align="left"><tr id="EN-US_TOPIC_0121978383__row60761195"><th align="left" class="cellrowborder" valign="top" width="16.351635163516352%" id="mcps1.3.4.2.4.2.4.1.1"><p id="EN-US_TOPIC_0121978383__p2757204717619">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.34133413341334%" id="mcps1.3.4.2.4.2.4.1.2"><p id="EN-US_TOPIC_0121978383__p1775713471961">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="70.30703070307031%" id="mcps1.3.4.2.4.2.4.1.3"><p id="EN-US_TOPIC_0121978383__p1075710471363">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0121978383__row61624137"><td class="cellrowborder" valign="top" width="16.351635163516352%" headers="mcps1.3.4.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p25499238">free_nic</p>
</td>
<td class="cellrowborder" valign="top" width="13.34133413341334%" headers="mcps1.3.4.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p65213800">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="70.30703070307031%" headers="mcps1.3.4.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p4181553121915">Specifies the remaining number of NICs that can be attached to an ECS.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0121978383__row1452833672712"><td class="cellrowborder" valign="top" width="16.351635163516352%" headers="mcps1.3.4.2.4.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p8528173615275">free_efi_nic</p>
</td>
<td class="cellrowborder" valign="top" width="13.34133413341334%" headers="mcps1.3.4.2.4.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p185281636132717">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="70.30703070307031%" headers="mcps1.3.4.2.4.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p1452914365274">Specifies the remaining number of EFIs that can be attached to an ECS.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0121978383__table15567163961815"></a><a name="table15567163961815"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0121978383__table15567163961815" frame="border" border="1" rules="all"><caption><b>Table 5 </b><strong id="EN-US_TOPIC_0121978383__b97596111505">fixed_ips</strong> field description</caption><thead align="left"><tr id="EN-US_TOPIC_0121978383__row65671839141814"><th align="left" class="cellrowborder" valign="top" width="16.161616161616163%" id="mcps1.3.4.3.2.4.1.1"><p id="EN-US_TOPIC_0121978383__p1956873911183">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.131313131313133%" id="mcps1.3.4.3.2.4.1.2"><p id="EN-US_TOPIC_0121978383__p1356814391186">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="70.70707070707071%" id="mcps1.3.4.3.2.4.1.3"><p id="EN-US_TOPIC_0121978383__p5568153911181">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0121978383__row11568143921816"><td class="cellrowborder" valign="top" width="16.161616161616163%" headers="mcps1.3.4.3.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p11568339101812">subnet_id</p>
</td>
<td class="cellrowborder" valign="top" width="13.131313131313133%" headers="mcps1.3.4.3.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p656815398188">String</p>
</td>
<td class="cellrowborder" valign="top" width="70.70707070707071%" headers="mcps1.3.4.3.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p856823901816">Specifies the subnet of the NIC private IP address.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0121978383__row19568739111813"><td class="cellrowborder" valign="top" width="16.161616161616163%" headers="mcps1.3.4.3.2.4.1.1 "><p id="EN-US_TOPIC_0121978383__p17568163951812">ip_address</p>
</td>
<td class="cellrowborder" valign="top" width="13.131313131313133%" headers="mcps1.3.4.3.2.4.1.2 "><p id="EN-US_TOPIC_0121978383__p205681039201818">String</p>
</td>
<td class="cellrowborder" valign="top" width="70.70707070707071%" headers="mcps1.3.4.3.2.4.1.3 "><p id="EN-US_TOPIC_0121978383__p0568539121819">Specifies the NIC private IP address.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0121978383__section99031450181116"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0121978383__p158235195016">Query NICs of an ECS.</p>
<pre class="screen" id="EN-US_TOPIC_0121978383__en-us_topic_0057973153_screen54316823165914">GET https://<em id="EN-US_TOPIC_0121978383__i13406194416139">{endpoint}</em>/v1/{project_id}/cloudservers/{server_id}/os-interface</pre>
</div>
<div class="section" id="EN-US_TOPIC_0121978383__section1093717612910"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="EN-US_TOPIC_0121978383__screen119461361398">{
"attachableQuantity": {
"free_nic": 1,
"free_efi_nic": 0
},
"interfaceAttachments": [
{
"port_state": "ACTIVE",
"fixed_ips": [
{
"subnet_id": "ba31e1f5-fa76-4530-862c-5176fad033cf",
"ip_address": "192.168.0.33"
}
],
"net_id": "610a4af2-1d90-4d2b-8057-dc238b26febf",
"port_id": "04819c0a-6a07-44b6-945e-fb932071888e",
"mac_addr": "fa:16:3e:45:65:c4",
"delete_on_termination": false,
"driver_mode": null,
"min_rate": null,
"multiqueue_num": null,
"pci_address": null
}
]
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0121978383__section52956621"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0121978383__p44718725">See <a href="en-us_topic_0022067716.html">Returned Values for General Requests</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0124385012.html">NIC Management</a></div>
</div>
</div>