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

190 lines
16 KiB
HTML

<a name="EN-US_TOPIC_0161097718"></a><a name="EN-US_TOPIC_0161097718"></a>
<h1 class="topictitle1">Creating an ECS Group</h1>
<div id="body1552986093022"><div class="section" id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_section31887518"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0161097718__p17280141481210">This API is used to create an ECS group.</p>
</div>
<div class="section" id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_section32752180"><h4 class="sectiontitle">Constraints</h4><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p15728249">Only anti-affinity policies are supported.</p>
</div>
<div class="section" id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_section18552212"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p9424619165013">POST /v1/{project_id}/cloudservers/os-server-groups</p>
<div class="p" id="EN-US_TOPIC_0161097718__p1154921125113"><a href="#EN-US_TOPIC_0161097718__table11729101619308">Table 1</a> describes the parameters in the URI.
<div class="tablenoborder"><a name="EN-US_TOPIC_0161097718__table11729101619308"></a><a name="table11729101619308"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0161097718__table11729101619308" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0161097718__row5730191683014"><th align="left" class="cellrowborder" valign="top" width="21.772177217721772%" id="mcps1.3.3.3.2.2.4.1.1"><p id="EN-US_TOPIC_0161097718__p1565162413016">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.752175217521753%" id="mcps1.3.3.3.2.2.4.1.2"><p id="EN-US_TOPIC_0161097718__p1365122443018">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="56.47564756475647%" id="mcps1.3.3.3.2.2.4.1.3"><p id="EN-US_TOPIC_0161097718__p76542423019">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0161097718__row137308168304"><td class="cellrowborder" valign="top" width="21.772177217721772%" headers="mcps1.3.3.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0161097718__p17659242302">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="21.752175217521753%" headers="mcps1.3.3.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0161097718__p19651224183012">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="56.47564756475647%" headers="mcps1.3.3.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0161097718__p365142413012">Specifies the project ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_section35680930"><h4 class="sectiontitle">Request</h4><p id="EN-US_TOPIC_0161097718__p191672480517"><a href="#EN-US_TOPIC_0161097718__table146581144163019">Table 2</a> describes the request parameters.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0161097718__table146581144163019"></a><a name="table146581144163019"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0161097718__table146581144163019" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0161097718__row116581744133015"><th align="left" class="cellrowborder" valign="top" width="19.34%" id="mcps1.3.4.3.2.5.1.1"><p id="EN-US_TOPIC_0161097718__p414920477304">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.630000000000003%" id="mcps1.3.4.3.2.5.1.2"><p id="EN-US_TOPIC_0161097718__p91492047173011">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.220000000000002%" id="mcps1.3.4.3.2.5.1.3"><p id="EN-US_TOPIC_0161097718__p16149647123011">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.81%" id="mcps1.3.4.3.2.5.1.4"><p id="EN-US_TOPIC_0161097718__p20150547123015">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0161097718__row4658144483012"><td class="cellrowborder" valign="top" width="19.34%" headers="mcps1.3.4.3.2.5.1.1 "><p id="EN-US_TOPIC_0161097718__p51501047133016">server_group</p>
</td>
<td class="cellrowborder" valign="top" width="17.630000000000003%" headers="mcps1.3.4.3.2.5.1.2 "><p id="EN-US_TOPIC_0161097718__p1215044719301">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.220000000000002%" headers="mcps1.3.4.3.2.5.1.3 "><p id="EN-US_TOPIC_0161097718__p151502479305">Object</p>
</td>
<td class="cellrowborder" valign="top" width="43.81%" headers="mcps1.3.4.3.2.5.1.4 "><p id="EN-US_TOPIC_0161097718__p101502047113016">Specifies the ECS group information. For details, see <a href="#EN-US_TOPIC_0161097718__en-us_topic_0057973153_table19917766">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0161097718__en-us_topic_0057973153_table19917766"></a><a name="en-us_topic_0057973153_table19917766"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_table19917766" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="EN-US_TOPIC_0161097718__b842352706162245">server_group</strong> parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_row59878934"><th align="left" class="cellrowborder" valign="top" width="19.518048195180484%" id="mcps1.3.4.4.2.5.1.1"><p id="EN-US_TOPIC_0161097718__p115851920182615">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.578242175782425%" id="mcps1.3.4.4.2.5.1.2"><p id="EN-US_TOPIC_0161097718__p184120288567">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.178382161783823%" id="mcps1.3.4.4.2.5.1.3"><p id="EN-US_TOPIC_0161097718__p1560210202260">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="46.72532746725327%" id="mcps1.3.4.4.2.5.1.4"><p id="EN-US_TOPIC_0161097718__p10602192016264">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_row28765213"><td class="cellrowborder" valign="top" width="19.518048195180484%" headers="mcps1.3.4.4.2.5.1.1 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p48280896">name</p>
</td>
<td class="cellrowborder" valign="top" width="17.578242175782425%" headers="mcps1.3.4.4.2.5.1.2 "><p id="EN-US_TOPIC_0161097718__p13412228125618">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.178382161783823%" headers="mcps1.3.4.4.2.5.1.3 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p18438475">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.72532746725327%" headers="mcps1.3.4.4.2.5.1.4 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p44665147">Specifies the ECS group name. The value contains 1 to 255 characters.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_row66442010"><td class="cellrowborder" valign="top" width="19.518048195180484%" headers="mcps1.3.4.4.2.5.1.1 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p13093750">policies</p>
</td>
<td class="cellrowborder" valign="top" width="17.578242175782425%" headers="mcps1.3.4.4.2.5.1.2 "><p id="EN-US_TOPIC_0161097718__p4412122855620">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.178382161783823%" headers="mcps1.3.4.4.2.5.1.3 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p53960863">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="46.72532746725327%" headers="mcps1.3.4.4.2.5.1.4 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p173471532155519">Specifies the policies associated with the ECS group. Options:</p>
<ul id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_ul1237514118527"><li id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_li1374711155217"><strong id="EN-US_TOPIC_0161097718__b76011237203011">anti-affinity</strong>: ECSs in this group must be deployed on different hosts.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_section52692922"><h4 class="sectiontitle">Response</h4><p id="EN-US_TOPIC_0161097718__p2625114213525"><a href="#EN-US_TOPIC_0161097718__table776421293115">Table 4</a> describes the response parameters.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0161097718__table776421293115"></a><a name="table776421293115"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0161097718__table776421293115" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0161097718__row97641012183116"><th align="left" class="cellrowborder" valign="top" width="28.582858285828582%" id="mcps1.3.5.3.2.4.1.1"><p id="EN-US_TOPIC_0161097718__p15446119183116">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.992799279927993%" id="mcps1.3.5.3.2.4.1.2"><p id="EN-US_TOPIC_0161097718__p124468198315">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.42434243424342%" id="mcps1.3.5.3.2.4.1.3"><p id="EN-US_TOPIC_0161097718__p44461019163116">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0161097718__row176481273118"><td class="cellrowborder" valign="top" width="28.582858285828582%" headers="mcps1.3.5.3.2.4.1.1 "><p id="EN-US_TOPIC_0161097718__p114461719163116">server_group</p>
</td>
<td class="cellrowborder" valign="top" width="27.992799279927993%" headers="mcps1.3.5.3.2.4.1.2 "><p id="EN-US_TOPIC_0161097718__p7446171917312">Object</p>
</td>
<td class="cellrowborder" valign="top" width="43.42434243424342%" headers="mcps1.3.5.3.2.4.1.3 "><p id="EN-US_TOPIC_0161097718__p164462196319">Specifies the ECS group information. For details, see <a href="#EN-US_TOPIC_0161097718__en-us_topic_0057973153_table7944126">Table 5</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0161097718__en-us_topic_0057973153_table7944126"></a><a name="en-us_topic_0057973153_table7944126"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_table7944126" frame="border" border="1" rules="all"><caption><b>Table 5 </b><strong id="EN-US_TOPIC_0161097718__b195841923359">server_group</strong> parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_row9238701"><th align="left" class="cellrowborder" valign="top" width="26.657334266573347%" id="mcps1.3.6.2.4.1.1"><p id="EN-US_TOPIC_0161097718__p177470268263">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.08809119088091%" id="mcps1.3.6.2.4.1.2"><p id="EN-US_TOPIC_0161097718__p167471026112613">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54.25457454254574%" id="mcps1.3.6.2.4.1.3"><p id="EN-US_TOPIC_0161097718__p67471426112617">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_row60872190"><td class="cellrowborder" valign="top" width="26.657334266573347%" headers="mcps1.3.6.2.4.1.1 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p31700356">id</p>
</td>
<td class="cellrowborder" valign="top" width="19.08809119088091%" headers="mcps1.3.6.2.4.1.2 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p17592014">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.25457454254574%" headers="mcps1.3.6.2.4.1.3 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p61068496">Specifies the ECS group UUID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_row12745552"><td class="cellrowborder" valign="top" width="26.657334266573347%" headers="mcps1.3.6.2.4.1.1 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p25756821">name</p>
</td>
<td class="cellrowborder" valign="top" width="19.08809119088091%" headers="mcps1.3.6.2.4.1.2 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p5927779">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.25457454254574%" headers="mcps1.3.6.2.4.1.3 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p36126903">Specifies the ECS group name.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_row56706675"><td class="cellrowborder" valign="top" width="26.657334266573347%" headers="mcps1.3.6.2.4.1.1 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p29837953">policies</p>
</td>
<td class="cellrowborder" valign="top" width="19.08809119088091%" headers="mcps1.3.6.2.4.1.2 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p955132">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="54.25457454254574%" headers="mcps1.3.6.2.4.1.3 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p18801115810585">Specifies the policies associated with the ECS group. Options:</p>
<ul id="EN-US_TOPIC_0161097718__ul546717262079"><li id="EN-US_TOPIC_0161097718__li74678261873"><strong id="EN-US_TOPIC_0161097718__b842352706161537">anti-affinity</strong>: ECSs in this group must be deployed on different hosts.</li></ul>
</td>
</tr>
<tr id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_row28154895"><td class="cellrowborder" valign="top" width="26.657334266573347%" headers="mcps1.3.6.2.4.1.1 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p65953984">members</p>
</td>
<td class="cellrowborder" valign="top" width="19.08809119088091%" headers="mcps1.3.6.2.4.1.2 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p40672482">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="54.25457454254574%" headers="mcps1.3.6.2.4.1.3 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p27313303">Specifies the IDs of the ECSs in an ECS group.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_row44493140"><td class="cellrowborder" valign="top" width="26.657334266573347%" headers="mcps1.3.6.2.4.1.1 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p47174611">metadata</p>
</td>
<td class="cellrowborder" valign="top" width="19.08809119088091%" headers="mcps1.3.6.2.4.1.2 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p63047142">Object</p>
</td>
<td class="cellrowborder" valign="top" width="54.25457454254574%" headers="mcps1.3.6.2.4.1.3 "><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p60373738">Specifies the ECS group metadata.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_section4474257"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0161097718__p5422121012125">Create an ECS group.</p>
<pre class="screen" id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_screen54316823165914">POST https://{endpoint}/v1/{project_id}/cloudservers/os-server-groups
{
"server_group": {
"name": "test",
"policies": ["anti-affinity"]
}
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0161097718__section1090114347313"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="EN-US_TOPIC_0161097718__screen1191412345316">{
"server_group": {
"id": "5bbcc3c4-1da2-4437-a48a-66f15b1b13f9",
"name": "test",
"policies": [
"anti-affinity"
],
"members": [],
"metadata": {}
}
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_section17661930132114"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0161097718__en-us_topic_0057973153_p11699192195015">See <a href="en-us_topic_0022067716.html">Returned Values for General Requests</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0161097718__section85821649202813"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0161097718__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_0161097717.html">ECS Group Management</a></div>
</div>
</div>