doc-exports/docs/ecs/api-ref/en-us_topic_0122107473.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

213 lines
16 KiB
HTML

<a name="EN-US_TOPIC_0122107473"></a><a name="EN-US_TOPIC_0122107473"></a>
<h1 class="topictitle1">Querying Information About Disks Attached to an ECS</h1>
<div id="body1531815447283"><div class="section" id="EN-US_TOPIC_0122107473__section61843920"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0122107473__p2362032">This API is used to query information about disks attached to an ECS.</p>
</div>
<div class="section" id="EN-US_TOPIC_0122107473__section19724370"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0122107473__p248418710335">GET /v1/{project_id}/cloudservers/{server_id}/block_device</p>
<div class="p" id="EN-US_TOPIC_0122107473__p01949418199"><a href="#EN-US_TOPIC_0122107473__table35893824">Table 1</a> describes the parameters in the URI.
<div class="tablenoborder"><a name="EN-US_TOPIC_0122107473__table35893824"></a><a name="table35893824"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0122107473__table35893824" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0122107473__row23656219"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.2.3.2.2.4.1.1"><p id="EN-US_TOPIC_0122107473__p37105578">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.2.3.2.2.4.1.2"><p id="EN-US_TOPIC_0122107473__p52761866">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="67%" id="mcps1.3.2.3.2.2.4.1.3"><p id="EN-US_TOPIC_0122107473__p45852771">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0122107473__row1865525015"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.2.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p3164713">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.2.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p55015173">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.2.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p37593705">Specifies the project ID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0122107473__row39466727"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.2.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p42688329">server_id</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.2.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p35202648">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="67%" headers="mcps1.3.2.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p32842235">Specifies the ECS ID in UUID format.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0122107473__section43301605"><h4 class="sectiontitle">Request</h4><p id="EN-US_TOPIC_0122107473__p51234165">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0122107473__section54170131"><h4 class="sectiontitle">Response</h4><div class="p" id="EN-US_TOPIC_0122107473__p977920197200"><a href="#EN-US_TOPIC_0122107473__table57959838">Table 2</a> describes the response parameters.
<div class="tablenoborder"><a name="EN-US_TOPIC_0122107473__table57959838"></a><a name="table57959838"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0122107473__table57959838" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0122107473__row39710134"><th align="left" class="cellrowborder" valign="top" width="18%" id="mcps1.3.4.2.2.2.4.1.1"><p id="EN-US_TOPIC_0122107473__p62404314">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13%" id="mcps1.3.4.2.2.2.4.1.2"><p id="EN-US_TOPIC_0122107473__p3528183">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="69%" id="mcps1.3.4.2.2.2.4.1.3"><p id="EN-US_TOPIC_0122107473__p17347392">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0122107473__row62961510"><td class="cellrowborder" valign="top" width="18%" headers="mcps1.3.4.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p66717520">volumeAttachments</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p49639570">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="69%" headers="mcps1.3.4.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p15568903">Specifies the disks attached to an ECS. For details, see <a href="#EN-US_TOPIC_0122107473__table7886611">Table 3</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0122107473__row187211929123119"><td class="cellrowborder" valign="top" width="18%" headers="mcps1.3.4.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__en-us_topic_0101860613_p292212560356">attachableQuantity</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__en-us_topic_0101860613_p1448919233356">Object</p>
</td>
<td class="cellrowborder" valign="top" width="69%" headers="mcps1.3.4.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__en-us_topic_0101860613_p1549432393517">Specifies the number of disks that can be attached to an <span id="EN-US_TOPIC_0122107473__text1950154563618">ECS</span>. For details, see <a href="#EN-US_TOPIC_0122107473__table17531254101519">Table 4</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0122107473__table7886611"></a><a name="table7886611"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0122107473__table7886611" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="EN-US_TOPIC_0122107473__b842352706181740">volumeAttachments</strong> parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0122107473__row60727582"><th align="left" class="cellrowborder" valign="top" width="18%" id="mcps1.3.4.2.3.2.4.1.1"><p id="EN-US_TOPIC_0122107473__p15956132518165">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13%" id="mcps1.3.4.2.3.2.4.1.2"><p id="EN-US_TOPIC_0122107473__p19956122517162">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="69%" id="mcps1.3.4.2.3.2.4.1.3"><p id="EN-US_TOPIC_0122107473__p129567252161">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0122107473__row34544438"><td class="cellrowborder" valign="top" width="18%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p46636132">serverId</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p30355189">String</p>
</td>
<td class="cellrowborder" valign="top" width="69%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p50116845">Specifies the ECS ID in UUID format.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0122107473__row48398424"><td class="cellrowborder" valign="top" width="18%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p16791461647">volumeId</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p10861332121715">String</p>
</td>
<td class="cellrowborder" valign="top" width="69%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p50454834">Specifies the EVS disk ID in UUID format.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0122107473__row51440330"><td class="cellrowborder" valign="top" width="18%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p1980225720418">id</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p1836163411178">String</p>
</td>
<td class="cellrowborder" valign="top" width="69%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p62498284">Specifies the mount ID, which is the same as the EVS disk ID.</p>
<p id="EN-US_TOPIC_0122107473__p9571123395014">The value is in UUID format.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0122107473__row9400111250"><td class="cellrowborder" valign="top" width="18%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p44001611759">size</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p1040020111156">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="69%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p1440012113518">Specifies the EVS disk size in GB.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0122107473__row25613652"><td class="cellrowborder" valign="top" width="18%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p5917164">device</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p51461341">String</p>
</td>
<td class="cellrowborder" valign="top" width="69%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p1462819">Specifies the drive letter of the EVS disk, which is the device name of the EVS disk.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0122107473__row138081017757"><td class="cellrowborder" valign="top" width="18%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p181061717510">pciAddress</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p128101117559">String</p>
</td>
<td class="cellrowborder" valign="top" width="69%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p28102176515">Specifies the PCI address.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0122107473__row3107744183313"><td class="cellrowborder" valign="top" width="18%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p11108124414332">bootIndex</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p1410818444336">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="69%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p11270135612595">Specifies the EVS disk boot sequence.</p>
<ul id="EN-US_TOPIC_0122107473__ul651412221208"><li id="EN-US_TOPIC_0122107473__li45141221206"><strong id="EN-US_TOPIC_0122107473__b842352706181942">0</strong> indicates the system disk.</li><li id="EN-US_TOPIC_0122107473__li11514192215014">Non-0 indicates a data disk.</li></ul>
</td>
</tr>
<tr id="EN-US_TOPIC_0122107473__row7510166142916"><td class="cellrowborder" valign="top" width="18%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p1485515145717">bus</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p185525155718">String</p>
</td>
<td class="cellrowborder" valign="top" width="69%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p18874019155217">Specifies the disk bus type.</p>
<p id="EN-US_TOPIC_0122107473__p1485511511573">Options: <strong id="EN-US_TOPIC_0122107473__b842352706114826">virtio</strong> and <strong id="EN-US_TOPIC_0122107473__b842352706114831">scsi</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0122107473__table17531254101519"></a><a name="table17531254101519"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0122107473__table17531254101519" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="EN-US_TOPIC_0122107473__b842352706145425">attachableQuantity</strong> parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0122107473__row25311554161513"><th align="left" class="cellrowborder" valign="top" width="25.302530253025303%" id="mcps1.3.4.3.2.4.1.1"><p id="EN-US_TOPIC_0122107473__p152879411176">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.08210821082108%" id="mcps1.3.4.3.2.4.1.2"><p id="EN-US_TOPIC_0122107473__p182875461715">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="53.615361536153614%" id="mcps1.3.4.3.2.4.1.3"><p id="EN-US_TOPIC_0122107473__p128718401719">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0122107473__row1653219541157"><td class="cellrowborder" valign="top" width="25.302530253025303%" headers="mcps1.3.4.3.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p52873419178">free_scsi</p>
</td>
<td class="cellrowborder" valign="top" width="21.08210821082108%" headers="mcps1.3.4.3.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p122871410173">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="53.615361536153614%" headers="mcps1.3.4.3.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p6287749174">Specifies the number of SCSI disks that can be attached to an <span id="EN-US_TOPIC_0122107473__text5341114683613">ECS</span>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0122107473__row55329548156"><td class="cellrowborder" valign="top" width="25.302530253025303%" headers="mcps1.3.4.3.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p1288154191714">free_blk</p>
</td>
<td class="cellrowborder" valign="top" width="21.08210821082108%" headers="mcps1.3.4.3.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p828812471716">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="53.615361536153614%" headers="mcps1.3.4.3.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p02886415175">Specifies the number of virtio_blk disks that can be attached to an <span id="EN-US_TOPIC_0122107473__text863226305">ECS</span>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0122107473__row3532145491512"><td class="cellrowborder" valign="top" width="25.302530253025303%" headers="mcps1.3.4.3.2.4.1.1 "><p id="EN-US_TOPIC_0122107473__p328814413172">free_disk</p>
</td>
<td class="cellrowborder" valign="top" width="21.08210821082108%" headers="mcps1.3.4.3.2.4.1.2 "><p id="EN-US_TOPIC_0122107473__p92887416176">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="53.615361536153614%" headers="mcps1.3.4.3.2.4.1.3 "><p id="EN-US_TOPIC_0122107473__p92882417176">Specifies the total number of disks that can be attached to an <span id="EN-US_TOPIC_0122107473__text8629747133617">ECS</span>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0122107473__section1828405010213"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0122107473__p3462121516547">Query information about disks attached to an ECS.</p>
<pre class="screen" id="EN-US_TOPIC_0122107473__screen30281189171813">GET https://<em id="EN-US_TOPIC_0122107473__i5452131772714">{endpoint}</em>/v1/{project_id}/cloudservers/{server_id}/block_device</pre>
</div>
<div class="section" id="EN-US_TOPIC_0122107473__section951205211125"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="EN-US_TOPIC_0122107473__screen18700523126">{
"attachableQuantity": {
"free_scsi": 23,
"free_blk": 15,
"free_disk": 23
},
"volumeAttachments": [
{
"pciAddress": "0000:02:01.0",
"volumeId": "a26887c6-c47b-4654-abb5-dfadf7d3f803",
"device": "/dev/vda",
"serverId": "4d8c3732-a248-40ed-bebc-539a6ffd25c0",
"id": "a26887c6-c47b-4654-abb5-dfadf7d3f803",
"size": "40",
"bootIndex": 0,
"bus":"virtio"
},
{
"pciAddress": "0000:02:02.0",
"volumeId": "a26887c6-c47b-4654-abb5-asdf234r234r",
"device": "/dev/vdb",
"serverId": "4d8c3732-a248-40ed-bebc-539a6ffd25c0",
"id": "a26887c6-c47b-4654-abb5-asdf234r234r",
"size": "10",
"bootIndex": 1,
"bus":"virtio"
}
]
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0122107473__en-us_topic_0092803065_en-us_topic_0020212692_section22960139"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0122107473__en-us_topic_0092803065_en-us_topic_0020212692_p23670760">See <a href="en-us_topic_0022067716.html">Returned Values for General Requests</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0122107473__en-us_topic_0092803065_en-us_topic_0067161469_en-us_topic_0057973179_section23611955"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0122107473__p7233105282813">See <a href="en-us_topic_0022067717.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0111860831.html">Disk Management</a></div>
</div>
</div>