forked from docs/doc-exports
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>
228 lines
17 KiB
HTML
228 lines
17 KiB
HTML
<a name="deh_02_0019"></a><a name="deh_02_0019"></a>
|
|
|
|
<h1 class="topictitle1">Allocating DeHs</h1>
|
|
<div id="body1512563929533"><div class="section" id="deh_02_0019__section48259009"><h4 class="sectiontitle">Function</h4><p id="deh_02_0019__p4687385">This API is used to allocate one or more DeHs and set required parameters, such as the flavor, AZ, and quantity.</p>
|
|
</div>
|
|
<div class="section" id="deh_02_0019__section16665627"><h4 class="sectiontitle">Constraints</h4><p id="deh_02_0019__p34767408">The number of allocatable DeHs depends on the DeH quota owned by the tenant.</p>
|
|
</div>
|
|
<div class="section" id="deh_02_0019__section31677898"><h4 class="sectiontitle">URI</h4><p id="deh_02_0019__p86546226917">POST /v1.0/{project_id}/dedicated-hosts</p>
|
|
<p id="deh_02_0019__p194128351495"><a href="#deh_02_0019__table572214121015">Table 1</a> describes the parameters.</p>
|
|
|
|
<div class="tablenoborder"><a name="deh_02_0019__table572214121015"></a><a name="table572214121015"></a><table cellpadding="4" cellspacing="0" summary="" id="deh_02_0019__table572214121015" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters description</caption><thead align="left"><tr id="deh_02_0019__row572516410109"><th align="left" class="cellrowborder" valign="top" width="21.23787621237876%" id="mcps1.3.3.4.2.5.1.1"><p id="deh_02_0019__p107252049107"><strong id="deh_02_0019__b1679518201213">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="23.44765523447655%" id="mcps1.3.3.4.2.5.1.2"><p id="deh_02_0019__p726975522919"><strong id="deh_02_0019__b161650227212">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="24.48755124487551%" id="mcps1.3.3.4.2.5.1.3"><p id="deh_02_0019__p072564201017"><strong id="deh_02_0019__b252042320216">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="30.826917308269174%" id="mcps1.3.3.4.2.5.1.4"><p id="deh_02_0019__p47253421017"><strong id="deh_02_0019__b208241224223">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="deh_02_0019__row107256481017"><td class="cellrowborder" valign="top" width="21.23787621237876%" headers="mcps1.3.3.4.2.5.1.1 "><p id="deh_02_0019__p1872514451016">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.44765523447655%" headers="mcps1.3.3.4.2.5.1.2 "><p id="deh_02_0019__p12269175511291">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="24.48755124487551%" headers="mcps1.3.3.4.2.5.1.3 "><p id="deh_02_0019__p147251646108">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="30.826917308269174%" headers="mcps1.3.3.4.2.5.1.4 "><p id="deh_02_0019__p6725747104">Specifies the project ID.</p>
|
|
<p id="deh_02_0019__p13397185821014">For details about how to obtain the project ID, see <a href="https://docs.otc.t-systems.com/en-us/api/apiug/apig-en-api-180328009.html" target="_blank" rel="noopener noreferrer">Obtaining Required Information</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="deh_02_0019__section15772917"><h4 class="sectiontitle">Request</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="deh_02_0019__table59821252115712" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="deh_02_0019__row13983205218575"><th align="left" class="cellrowborder" valign="top" width="16.39%" id="mcps1.3.4.2.2.6.1.1"><p id="deh_02_0019__p13235141510585"><strong id="deh_02_0019__b162766431724">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13.25%" id="mcps1.3.4.2.2.6.1.2"><p id="deh_02_0019__p16235101595818"><strong id="deh_02_0019__b56202615314">In</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="14.649999999999999%" id="mcps1.3.4.2.2.6.1.3"><p id="deh_02_0019__p102355155587"><strong id="deh_02_0019__b1782741637">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.220000000000002%" id="mcps1.3.4.2.2.6.1.4"><p id="deh_02_0019__p2023518153582"><strong id="deh_02_0019__b1752437247">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="39.489999999999995%" id="mcps1.3.4.2.2.6.1.5"><p id="deh_02_0019__p182351715195814"><strong id="deh_02_0019__b16898711036">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="deh_02_0019__row69837528576"><td class="cellrowborder" valign="top" width="16.39%" headers="mcps1.3.4.2.2.6.1.1 "><p id="deh_02_0019__p172368156585">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.25%" headers="mcps1.3.4.2.2.6.1.2 "><p id="deh_02_0019__p11236131520589">body</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.649999999999999%" headers="mcps1.3.4.2.2.6.1.3 "><p id="deh_02_0019__p15236915115819">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.220000000000002%" headers="mcps1.3.4.2.2.6.1.4 "><p id="deh_02_0019__p11236111510582">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.489999999999995%" headers="mcps1.3.4.2.2.6.1.5 "><p id="deh_02_0019__p19236131595819">Specifies the DeH name.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="deh_02_0019__row1498395205712"><td class="cellrowborder" valign="top" width="16.39%" headers="mcps1.3.4.2.2.6.1.1 "><p id="deh_02_0019__p52361015125817">auto_placement</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.25%" headers="mcps1.3.4.2.2.6.1.2 "><p id="deh_02_0019__p5236615175817">body</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.649999999999999%" headers="mcps1.3.4.2.2.6.1.3 "><p id="deh_02_0019__p12236161565812">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.220000000000002%" headers="mcps1.3.4.2.2.6.1.4 "><p id="deh_02_0019__p15236515155817">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.489999999999995%" headers="mcps1.3.4.2.2.6.1.5 "><p id="deh_02_0019__p192361115175815">Specifies whether to allow an ECS to be placed on any available DeH if its DeH ID is not specified during its creation.</p>
|
|
<p id="deh_02_0019__p3236191575811">The value can be <strong id="deh_02_0019__b1472295311720">on</strong> or <strong id="deh_02_0019__b11733175681720">off</strong>.</p>
|
|
<p id="deh_02_0019__p10236815185816">The default value is <strong id="deh_02_0019__b188181091818">on</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="deh_02_0019__row149841852185715"><td class="cellrowborder" valign="top" width="16.39%" headers="mcps1.3.4.2.2.6.1.1 "><p id="deh_02_0019__p1723681535815">availability_zone</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.25%" headers="mcps1.3.4.2.2.6.1.2 "><p id="deh_02_0019__p11236171585810">body</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.649999999999999%" headers="mcps1.3.4.2.2.6.1.3 "><p id="deh_02_0019__p1623610153583">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.220000000000002%" headers="mcps1.3.4.2.2.6.1.4 "><p id="deh_02_0019__p162363152580">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.489999999999995%" headers="mcps1.3.4.2.2.6.1.5 "><p id="deh_02_0019__p14236111518585">Specifies the AZ to which the DeH belongs.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="deh_02_0019__row498475218571"><td class="cellrowborder" valign="top" width="16.39%" headers="mcps1.3.4.2.2.6.1.1 "><p id="deh_02_0019__p7236615205820">host_type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.25%" headers="mcps1.3.4.2.2.6.1.2 "><p id="deh_02_0019__p172362015185816">body</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.649999999999999%" headers="mcps1.3.4.2.2.6.1.3 "><p id="deh_02_0019__p16236151575813">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.220000000000002%" headers="mcps1.3.4.2.2.6.1.4 "><p id="deh_02_0019__p123631515581">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.489999999999995%" headers="mcps1.3.4.2.2.6.1.5 "><p id="deh_02_0019__p723621517586">Specifies the DeH type.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="deh_02_0019__row16984752175719"><td class="cellrowborder" valign="top" width="16.39%" headers="mcps1.3.4.2.2.6.1.1 "><p id="deh_02_0019__p623614158586">quantity</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.25%" headers="mcps1.3.4.2.2.6.1.2 "><p id="deh_02_0019__p8236141515584">body</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.649999999999999%" headers="mcps1.3.4.2.2.6.1.3 "><p id="deh_02_0019__p7236121555810">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.220000000000002%" headers="mcps1.3.4.2.2.6.1.4 "><p id="deh_02_0019__p182371815185817">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.489999999999995%" headers="mcps1.3.4.2.2.6.1.5 "><p id="deh_02_0019__p10237191535813">Specifies the number of allocatable DeHs.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="deh_02_0019__row14984252195712"><td class="cellrowborder" valign="top" width="16.39%" headers="mcps1.3.4.2.2.6.1.1 "><p id="deh_02_0019__p102374157580">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.25%" headers="mcps1.3.4.2.2.6.1.2 "><p id="deh_02_0019__p1323712154588">body</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.649999999999999%" headers="mcps1.3.4.2.2.6.1.3 "><p id="deh_02_0019__p16237415115815">Array of objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.220000000000002%" headers="mcps1.3.4.2.2.6.1.4 "><p id="deh_02_0019__p2237161510585">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="39.489999999999995%" headers="mcps1.3.4.2.2.6.1.5 "><p id="deh_02_0019__p62377152585">Specifies the DeH tags.</p>
|
|
<p id="deh_02_0019__p141042131319">For details, see <a href="#deh_02_0019__table17210121526">Table 3</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="deh_02_0019__table17210121526"></a><a name="table17210121526"></a><table cellpadding="4" cellspacing="0" summary="" id="deh_02_0019__table17210121526" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="deh_02_0019__b12695246712">tag</strong> field description</caption><thead align="left"><tr id="deh_02_0019__row9210161824"><th align="left" class="cellrowborder" valign="top" width="14.91%" id="mcps1.3.4.3.2.5.1.1"><p id="deh_02_0019__p1718917231623"><strong id="deh_02_0019__b299218237717">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="14.91%" id="mcps1.3.4.3.2.5.1.2"><p id="deh_02_0019__p2189132319217"><strong id="deh_02_0019__b139285923">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.9%" id="mcps1.3.4.3.2.5.1.3"><p id="deh_02_0019__p1818992317219"><strong id="deh_02_0019__b992788968">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="54.279999999999994%" id="mcps1.3.4.3.2.5.1.4"><p id="deh_02_0019__p118920231824"><strong id="deh_02_0019__b643313283410">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="deh_02_0019__row13211117210"><td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.4.3.2.5.1.1 "><p id="deh_02_0019__p201894231827">key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.4.3.2.5.1.2 "><p id="deh_02_0019__p101899231024">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.9%" headers="mcps1.3.4.3.2.5.1.3 "><p id="deh_02_0019__p518912310213">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.279999999999994%" headers="mcps1.3.4.3.2.5.1.4 "><p id="deh_02_0019__p31899231420">Specifies the tag key.</p>
|
|
<ul id="deh_02_0019__ul111893231829"><li id="deh_02_0019__li121891423127">It contains a maximum of 36 Unicode characters.</li><li id="deh_02_0019__li1718962310216">The value cannot be empty.</li><li id="deh_02_0019__li5189623828">It cannot contain the following ASCII characters: =*<>\|/,</li><li id="deh_02_0019__li11189623223">It can contain letters, digits, hyphens (-), and underscores (_).</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="deh_02_0019__row82126117211"><td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.4.3.2.5.1.1 "><p id="deh_02_0019__p1218920231727">value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.4.3.2.5.1.2 "><p id="deh_02_0019__p81891323526">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.9%" headers="mcps1.3.4.3.2.5.1.3 "><p id="deh_02_0019__p518902310212">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.279999999999994%" headers="mcps1.3.4.3.2.5.1.4 "><p id="deh_02_0019__p518920231221">Specifies the tag value.</p>
|
|
<ul id="deh_02_0019__ul91890232211"><li id="deh_02_0019__li6189823426">It contains a maximum of 43 Unicode characters.</li><li id="deh_02_0019__li201907231215">It cannot contain the following ASCII characters: =*<>\|/,</li><li id="deh_02_0019__li101909231129">It can contain letters, digits, hyphens (-), and underscores (_).</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="deh_02_0019__section7738529"><h4 class="sectiontitle">Response</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="deh_02_0019__table4659504415" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response parameters</caption><thead align="left"><tr id="deh_02_0019__row866000947"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.5.2.2.5.1.1"><p id="deh_02_0019__p119318221244"><strong id="deh_02_0019__b1320112413441">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.5.2.2.5.1.2"><p id="deh_02_0019__p89314227414"><strong id="deh_02_0019__b1984271543">In</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.5.2.2.5.1.3"><p id="deh_02_0019__p493112211418"><strong id="deh_02_0019__b96422724414">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.5.2.2.5.1.4"><p id="deh_02_0019__p29392212417"><strong id="deh_02_0019__b811310913440">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="deh_02_0019__row116604010418"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.2.2.5.1.1 "><p id="deh_02_0019__p39322211418">dedicated_host_ids</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.2.2.5.1.2 "><p id="deh_02_0019__p15931222544">body</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.2.2.5.1.3 "><p id="deh_02_0019__p19312210417">Array of strings</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.2.2.5.1.4 "><p id="deh_02_0019__p2946221246">Specifies a group of IDs of allocated DeHs. The tenant can create ECSs on these DeHs.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="deh_02_0019__section3344133016223"><h4 class="sectiontitle">Example Request</h4><div class="p" id="deh_02_0019__p124331343883">Two s3 DeHs are allocated in <strong id="deh_02_0019__b288016538488">az1</strong>, and the DeH name is <strong id="deh_02_0019__b77403314489">General Computing server1</strong>.<pre class="screen" id="deh_02_0019__screen52827613153754">POST https://{Endpoint}/v1.0/9c53a566cb3443ab910cf0daebca90c4/dedicated-hosts
|
|
{
|
|
"availability_zone": "dc1.az1",
|
|
"name": "General-Purpose server1",
|
|
"auto_placement": "off",
|
|
"host_type":"s2",
|
|
"quantity": 2,
|
|
"tags": [
|
|
{
|
|
"key": "key1",
|
|
"value": "value1"
|
|
}
|
|
]
|
|
}</pre>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="deh_02_0019__section115395148237"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="deh_02_0019__screen1867508015383">{
|
|
"dedicated_host_ids": ["xxxxxxx1","xxxxxxx2"]
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="deh_02_0019__section4243749"><h4 class="sectiontitle">Status Code</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="deh_02_0019__table82251050440" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Returned error codes</caption><thead align="left"><tr id="deh_02_0019__row162255501446"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.2.2.3.1.1"><p id="deh_02_0019__p17241161117511">Error Code</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.2.2.3.1.2"><p id="deh_02_0019__p624115111151">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="deh_02_0019__row822618501845"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.2.2.3.1.1 "><p id="deh_02_0019__p1924117112059">403 Forbidden</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.2.2.3.1.2 "><ol id="deh_02_0019__ol1124111111516"><li id="deh_02_0019__li52421111353">Insufficient quota.</li><li id="deh_02_0019__li1124217111752">The flavor is not supported.</li></ol>
|
|
</td>
|
|
</tr>
|
|
<tr id="deh_02_0019__row52263501541"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.2.2.3.1.1 "><p id="deh_02_0019__p1524241120512">404 FlavorNotFound</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.2.2.3.1.2 "><p id="deh_02_0019__p72425111151">Invalid flavor.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="deh_02_0019__p3241099">For more status codes, see <a href="deh_02_0016.html">Status Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="deh_02_0017.html">API</a></div>
|
|
</div>
|
|
</div>
|
|
|