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

144 lines
12 KiB
HTML

<a name="EN-US_TOPIC_0065817721"></a><a name="EN-US_TOPIC_0065817721"></a>
<h1 class="topictitle1">Querying <span id="text1819113165413">ECS</span> Groups</h1>
<div id="body1499652824863"><div class="section" id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_section14574577"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p47391365">This API is used to query <span id="EN-US_TOPIC_0065817721__text204133571821">ECS</span> groups.</p>
</div>
<div class="section" id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_section64062336"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0065817721__p6620225131711">GET /v2.1/{project_id}/os-server-groups</p>
<p id="EN-US_TOPIC_0065817721__p253333202119">GET /v2/{project_id}/os-server-groups</p>
<div class="p" id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p17835728145012"><a href="#EN-US_TOPIC_0065817721__table12344152719154">Table 1</a> describes the parameters in the URI.
<div class="tablenoborder"><a name="EN-US_TOPIC_0065817721__table12344152719154"></a><a name="table12344152719154"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065817721__table12344152719154" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0065817721__row8345627191518"><th align="left" class="cellrowborder" valign="top" width="22.422242224222423%" id="mcps1.3.2.4.2.2.4.1.1"><p id="EN-US_TOPIC_0065817721__p86851935171514">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.301930193019302%" id="mcps1.3.2.4.2.2.4.1.2"><p id="EN-US_TOPIC_0065817721__p13685193551513">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="58.275827582758275%" id="mcps1.3.2.4.2.2.4.1.3"><p id="EN-US_TOPIC_0065817721__p5685163571516">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0065817721__row1434592713158"><td class="cellrowborder" valign="top" width="22.422242224222423%" headers="mcps1.3.2.4.2.2.4.1.1 "><p id="EN-US_TOPIC_0065817721__p26851935151517">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.301930193019302%" headers="mcps1.3.2.4.2.2.4.1.2 "><p id="EN-US_TOPIC_0065817721__p10685183518157">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="58.275827582758275%" headers="mcps1.3.2.4.2.2.4.1.3 "><p id="EN-US_TOPIC_0065817721__p166851235111514">Specifies the project ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p42580898202948">Parameters in the following table can be used as URI parameters to filter query results.</p>
<p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p8337527">Usage: /v2/{project_id}/os-server-groups?</p>
<div class="section" id="EN-US_TOPIC_0065817721__section3227155991615"><h4 class="sectiontitle">Request</h4><p id="EN-US_TOPIC_0065817721__p1012718156552">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_section10175274"><h4 class="sectiontitle">Response</h4><p id="EN-US_TOPIC_0065817721__p9185206175612"><a href="#EN-US_TOPIC_0065817721__table151218547156">Table 2</a> describes the response parameters.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0065817721__table151218547156"></a><a name="table151218547156"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065817721__table151218547156" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0065817721__row18513175441514"><th align="left" class="cellrowborder" valign="top" width="22.650000000000002%" id="mcps1.3.6.3.2.4.1.1"><p id="EN-US_TOPIC_0065817721__p56771746163">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="26.340000000000003%" id="mcps1.3.6.3.2.4.1.2"><p id="EN-US_TOPIC_0065817721__p13677440167">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.01%" id="mcps1.3.6.3.2.4.1.3"><p id="EN-US_TOPIC_0065817721__p176771346162">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0065817721__row4513354141513"><td class="cellrowborder" valign="top" width="22.650000000000002%" headers="mcps1.3.6.3.2.4.1.1 "><p id="EN-US_TOPIC_0065817721__p9677247166">server_groups</p>
</td>
<td class="cellrowborder" valign="top" width="26.340000000000003%" headers="mcps1.3.6.3.2.4.1.2 "><p id="EN-US_TOPIC_0065817721__p66773471614">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="51.01%" headers="mcps1.3.6.3.2.4.1.3 "><p id="EN-US_TOPIC_0065817721__p116779419169">Specifies the <span id="EN-US_TOPIC_0065817721__text1167724191615">ECS</span> group information. For details, see <a href="#EN-US_TOPIC_0065817721__en-us_topic_0057973158_table47937085">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0065817721__en-us_topic_0057973158_table47937085"></a><a name="en-us_topic_0057973158_table47937085"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_table47937085" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_b842352706165936">server_groups</strong> parameter information</caption><thead align="left"><tr id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_row65811616"><th align="left" class="cellrowborder" valign="top" width="21.39%" id="mcps1.3.6.4.2.4.1.1"><p id="EN-US_TOPIC_0065817721__p6654124612269">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.91%" id="mcps1.3.6.4.2.4.1.2"><p id="EN-US_TOPIC_0065817721__p1865454611261">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="55.7%" id="mcps1.3.6.4.2.4.1.3"><p id="EN-US_TOPIC_0065817721__p6654446102616">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_row33147825"><td class="cellrowborder" valign="top" width="21.39%" headers="mcps1.3.6.4.2.4.1.1 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p619317">id</p>
</td>
<td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.3.6.4.2.4.1.2 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p50164680">String</p>
</td>
<td class="cellrowborder" valign="top" width="55.7%" headers="mcps1.3.6.4.2.4.1.3 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p28602690">Specifies the <span id="EN-US_TOPIC_0065817721__text28471914233">ECS</span> group UUID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_row56097620"><td class="cellrowborder" valign="top" width="21.39%" headers="mcps1.3.6.4.2.4.1.1 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p47613365">name</p>
</td>
<td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.3.6.4.2.4.1.2 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p31477322">String</p>
</td>
<td class="cellrowborder" valign="top" width="55.7%" headers="mcps1.3.6.4.2.4.1.3 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p28736562">Specifies the <span id="EN-US_TOPIC_0065817721__text41766171531">ECS</span> group name.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_row29632828"><td class="cellrowborder" valign="top" width="21.39%" headers="mcps1.3.6.4.2.4.1.1 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p51448853">members</p>
</td>
<td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.3.6.4.2.4.1.2 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p6607563">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="55.7%" headers="mcps1.3.6.4.2.4.1.3 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p67004395">Specifies the <span id="EN-US_TOPIC_0065817721__text3988193715542">ECS</span>s in an <span id="EN-US_TOPIC_0065817721__text9331326655">ECS</span> group.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_row66168651"><td class="cellrowborder" valign="top" width="21.39%" headers="mcps1.3.6.4.2.4.1.1 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p58060511">metadata</p>
</td>
<td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.3.6.4.2.4.1.2 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p5280980">Object</p>
</td>
<td class="cellrowborder" valign="top" width="55.7%" headers="mcps1.3.6.4.2.4.1.3 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p20340992">Specifies the <span id="EN-US_TOPIC_0065817721__text856813219520">ECS</span> group metadata.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_row32671040185312"><td class="cellrowborder" valign="top" width="21.39%" headers="mcps1.3.6.4.2.4.1.1 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p64633146">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.3.6.4.2.4.1.2 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p793464">String</p>
</td>
<td class="cellrowborder" valign="top" width="55.7%" headers="mcps1.3.6.4.2.4.1.3 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p38538274">Specifies the tenant ID in UUID format for the <span id="EN-US_TOPIC_0065817721__text164069404549">ECS</span> group.</p>
<p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p457295075618">This parameter is supported in microversion 2.13 and later.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_row146121548185317"><td class="cellrowborder" valign="top" width="21.39%" headers="mcps1.3.6.4.2.4.1.1 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p11612848145317">policies</p>
</td>
<td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.3.6.4.2.4.1.2 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p961210488537">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="55.7%" headers="mcps1.3.6.4.2.4.1.3 "><div class="p" id="EN-US_TOPIC_0065817721__p11241458144516">Specifies the policies associated with the <span id="EN-US_TOPIC_0065817721__text18159591354">ECS</span> group. Options:<ul id="EN-US_TOPIC_0065817721__en-us_topic_0057973153_ul1237514118527"><li id="EN-US_TOPIC_0065817721__en-us_topic_0057973153_li1374711155217"><strong id="EN-US_TOPIC_0065817721__b13641316463">anti-affinity</strong>: <span id="EN-US_TOPIC_0065817721__text1069111613616">ECS</span>s in this group must be deployed on different hosts.</li></ul>
</div>
</td>
</tr>
<tr id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_row1110365011537"><td class="cellrowborder" valign="top" width="21.39%" headers="mcps1.3.6.4.2.4.1.1 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p110325019536">user_id</p>
</td>
<td class="cellrowborder" valign="top" width="22.91%" headers="mcps1.3.6.4.2.4.1.2 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p1310325019539">String</p>
</td>
<td class="cellrowborder" valign="top" width="55.7%" headers="mcps1.3.6.4.2.4.1.3 "><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p16833172165712">Specifies the user ID in UUID format for the <span id="EN-US_TOPIC_0065817721__text14924044115417">ECS</span> group.</p>
<p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p1783472155719">This parameter is supported in microversion 2.13 and later.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_section24468610"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0065817721__p1078614525216">Query a list of ECS groups.</p>
<pre class="screen" id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_screen38355038203359">GET https://{endpoint}/v2/9c53a566cb3443ab910cf0daebca90c4/os-server-groups
GET https://{endpoint}/v2.1/9c53a566cb3443ab910cf0daebca90c4/os-server-groups</pre>
</div>
<div class="section" id="EN-US_TOPIC_0065817721__section451882185114"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="EN-US_TOPIC_0065817721__screen652552117511">{
"server_groups": [
{
"id": "616fb98f-46ca-475e-917e-2563e5a8cd19",
"name": "test",
"policies": ["anti-affinity"],
"members": [],
"metadata": {},
"project_id": "9c53a566cb3443ab910cf0daebca90c4"
}
]
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_section1220312142315"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0065817721__en-us_topic_0057973158_p1219552234817">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_0065817683.html">ECS Group Management</a></div>
</div>
</div>