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

132 lines
10 KiB
HTML

<a name="EN-US_TOPIC_0065817728"></a><a name="EN-US_TOPIC_0065817728"></a>
<h1 class="topictitle1">Querying AZs</h1>
<div id="body1499652824863"><div class="section" id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_section60955817"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p11257869">This API is used to query AZs.</p>
</div>
<div class="section" id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_section11731442"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p742294318453">GET /v2.1/{project_id}/os-availability-zone</p>
<p id="EN-US_TOPIC_0065817728__p6214132052519">GET /v2/{project_id}/os-availability-zone</p>
<div class="p" id="EN-US_TOPIC_0065817728__p183684661713"><a href="#EN-US_TOPIC_0065817728__en-us_topic_0057973206_table2814978410562">Table 1</a> describes the parameters in the URI.
<div class="tablenoborder"><a name="EN-US_TOPIC_0065817728__en-us_topic_0057973206_table2814978410562"></a><a name="en-us_topic_0057973206_table2814978410562"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_table2814978410562" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_row4149654710562"><th align="left" class="cellrowborder" valign="top" width="33%" id="mcps1.3.2.4.2.2.4.1.1"><p id="EN-US_TOPIC_0065817728__p5187119">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23%" id="mcps1.3.2.4.2.2.4.1.2"><p id="EN-US_TOPIC_0065817728__p17503500">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44%" id="mcps1.3.2.4.2.2.4.1.3"><p id="EN-US_TOPIC_0065817728__p8497414">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_row3491217610562"><td class="cellrowborder" valign="top" width="33%" headers="mcps1.3.2.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p931403110562">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.2.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p1623904210562">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="44%" headers="mcps1.3.2.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0065817728__p37593705">Specifies the project ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_section63234676"><h4 class="sectiontitle">Response</h4><p id="EN-US_TOPIC_0065817728__p13701110151813"><a href="#EN-US_TOPIC_0065817728__en-us_topic_0057973206_table34970028">Table 2</a> describes the response parameters.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0065817728__en-us_topic_0057973206_table34970028"></a><a name="en-us_topic_0057973206_table34970028"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_table34970028" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_row39112085"><th align="left" class="cellrowborder" valign="top" width="32.186781321867805%" id="mcps1.3.3.3.2.4.1.1"><p id="EN-US_TOPIC_0065817728__en-us_topic_0057972670_p57733603">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.997200279972002%" id="mcps1.3.3.3.2.4.1.2"><p id="EN-US_TOPIC_0065817728__en-us_topic_0057972670_p45910260">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.816018398160175%" id="mcps1.3.3.3.2.4.1.3"><p id="EN-US_TOPIC_0065817728__en-us_topic_0057972670_p32634650">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_row37957477"><td class="cellrowborder" valign="top" width="32.186781321867805%" headers="mcps1.3.3.3.2.4.1.1 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p54656798">availabilityZoneInfo</p>
</td>
<td class="cellrowborder" valign="top" width="27.997200279972002%" headers="mcps1.3.3.3.2.4.1.2 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p65124552">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="39.816018398160175%" headers="mcps1.3.3.3.2.4.1.3 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p54030">Specifies the AZ information. For details, see <a href="#EN-US_TOPIC_0065817728__en-us_topic_0057973206_table4376441">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0065817728__en-us_topic_0057973206_table4376441"></a><a name="en-us_topic_0057973206_table4376441"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_table4376441" frame="border" border="1" rules="all"><caption><b>Table 3 </b>AvailabilityZoneInfo parameter information</caption><thead align="left"><tr id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_row55834932"><th align="left" class="cellrowborder" valign="top" width="32.12678732126787%" id="mcps1.3.3.4.2.4.1.1"><p id="EN-US_TOPIC_0065817728__p044879102811">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.057194280571945%" id="mcps1.3.3.4.2.4.1.2"><p id="EN-US_TOPIC_0065817728__p74488912281">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.81601839816019%" id="mcps1.3.3.4.2.4.1.3"><p id="EN-US_TOPIC_0065817728__p846317913288">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_row62745414"><td class="cellrowborder" valign="top" width="32.12678732126787%" headers="mcps1.3.3.4.2.4.1.1 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p49213798">zoneState</p>
</td>
<td class="cellrowborder" valign="top" width="28.057194280571945%" headers="mcps1.3.3.4.2.4.1.2 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p26894719">Object</p>
</td>
<td class="cellrowborder" valign="top" width="39.81601839816019%" headers="mcps1.3.3.4.2.4.1.3 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p27048633">Specifies the AZ status. For details, see <a href="#EN-US_TOPIC_0065817728__en-us_topic_0057973206_table37797818">Table 4</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_row42111108"><td class="cellrowborder" valign="top" width="32.12678732126787%" headers="mcps1.3.3.4.2.4.1.1 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p55556613">hosts</p>
</td>
<td class="cellrowborder" valign="top" width="28.057194280571945%" headers="mcps1.3.3.4.2.4.1.2 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p3791843">List</p>
</td>
<td class="cellrowborder" valign="top" width="39.81601839816019%" headers="mcps1.3.3.4.2.4.1.3 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p48006356">The parameter is set to <strong id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_b54095206">null</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_row29404023"><td class="cellrowborder" valign="top" width="32.12678732126787%" headers="mcps1.3.3.4.2.4.1.1 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p32915700">zoneName</p>
</td>
<td class="cellrowborder" valign="top" width="28.057194280571945%" headers="mcps1.3.3.4.2.4.1.2 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p48926033">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.81601839816019%" headers="mcps1.3.3.4.2.4.1.3 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p22007756">Specifies the AZ name.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0065817728__en-us_topic_0057973206_table37797818"></a><a name="en-us_topic_0057973206_table37797818"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_table37797818" frame="border" border="1" rules="all"><caption><b>Table 4 </b>zoneState parameter information</caption><thead align="left"><tr id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_row19790066"><th align="left" class="cellrowborder" valign="top" width="30.09%" id="mcps1.3.3.5.2.4.1.1"><p id="EN-US_TOPIC_0065817728__p19223713172814">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="30.09%" id="mcps1.3.3.5.2.4.1.2"><p id="EN-US_TOPIC_0065817728__p7223213122812">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.82%" id="mcps1.3.3.5.2.4.1.3"><p id="EN-US_TOPIC_0065817728__p17223111314282">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_row56786272"><td class="cellrowborder" valign="top" width="30.09%" headers="mcps1.3.3.5.2.4.1.1 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p36285299">available</p>
</td>
<td class="cellrowborder" valign="top" width="30.09%" headers="mcps1.3.3.5.2.4.1.2 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p53428078">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="39.82%" headers="mcps1.3.3.5.2.4.1.3 "><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_p32026686">Specifies the AZ status.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_section32241172"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0065817728__p42596203134">Query a list of AZs.</p>
<pre class="screen" id="EN-US_TOPIC_0065817728__screen13323049151810">GET https://{endpoint}/v2/9c53a566cb3443ab910cf0daebca90c4/os-availability-zone
GET https://{endpoint}/v2.1/9c53a566cb3443ab910cf0daebca90c4/os-availability-zone</pre>
</div>
<div class="section" id="EN-US_TOPIC_0065817728__section19399181019572"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="EN-US_TOPIC_0065817728__screen10420151045716">{
"availabilityZoneInfo": [{
"zoneState": {
"available": true
},
"hosts": null,
"zoneName": "az1" //Replace the value with the actual AZ name.
},
{
"zoneState": {
"available": true
},
"hosts": null,
"zoneName": "az2" //Replace the value with the actual AZ name.
}]
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_en-us_topic_0020212692_section22960139"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0065817728__en-us_topic_0057973206_en-us_topic_0020212692_p23670760">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_0065817684.html">AZ</a></div>
</div>
</div>