doc-exports/docs/deh/api-ref/deh_02_0023.html
Zaoxu, Li bcdc2ecfaa DEH API update1026
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-01-12 14:27:11 +00:00

128 lines
10 KiB
HTML

<a name="deh_02_0023"></a><a name="deh_02_0023"></a>
<h1 class="topictitle1">Modifying DeH Attributes</h1>
<div id="body1512563929533"><div class="section" id="deh_02_0023__section2129750"><h4 class="sectiontitle">Function</h4><p id="deh_02_0023__p52084342">This API is used to modify the <strong id="deh_02_0023__b1455613817193">auto_placement</strong> and <strong id="deh_02_0023__b44812015141914">name</strong> attributes of a DeH.</p>
</div>
<div class="section" id="deh_02_0023__section19167756"><h4 class="sectiontitle">URI</h4><p id="deh_02_0023__p1459863120307">PUT /v1.0/{project_id}/dedicated-hosts/{dedicated_host_id}</p>
<p id="deh_02_0023__p1256624114553"><a href="#deh_02_0023__table572214121015">Table 1</a> describes the parameters.</p>
<div class="tablenoborder"><a name="deh_02_0023__table572214121015"></a><a name="table572214121015"></a><table cellpadding="4" cellspacing="0" summary="" id="deh_02_0023__table572214121015" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters description</caption><thead align="left"><tr id="deh_02_0023__row572516410109"><th align="left" class="cellrowborder" valign="top" width="21.23787621237876%" id="mcps1.3.2.4.2.5.1.1"><p id="deh_02_0023__p107252049107"><strong id="deh_02_0023__b212574719219">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.44765523447655%" id="mcps1.3.2.4.2.5.1.2"><p id="deh_02_0023__p726975522919"><strong id="deh_02_0023__b105121348202117">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.48755124487551%" id="mcps1.3.2.4.2.5.1.3"><p id="deh_02_0023__p072564201017"><strong id="deh_02_0023__b549624952117">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="30.826917308269174%" id="mcps1.3.2.4.2.5.1.4"><p id="deh_02_0023__p47253421017"><strong id="deh_02_0023__b1834714506210">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="deh_02_0023__row107256481017"><td class="cellrowborder" valign="top" width="21.23787621237876%" headers="mcps1.3.2.4.2.5.1.1 "><p id="deh_02_0023__p1872514451016">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="23.44765523447655%" headers="mcps1.3.2.4.2.5.1.2 "><p id="deh_02_0023__p12269175511291">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.48755124487551%" headers="mcps1.3.2.4.2.5.1.3 "><p id="deh_02_0023__p147251646108">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="30.826917308269174%" headers="mcps1.3.2.4.2.5.1.4 "><p id="deh_02_0023__p6725747104">Specifies the project ID.</p>
<p id="deh_02_0023__p7376194915119">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>
<tr id="deh_02_0023__row184436404555"><td class="cellrowborder" valign="top" width="21.23787621237876%" headers="mcps1.3.2.4.2.5.1.1 "><p id="deh_02_0023__p164455404556">dedicated_host_id</p>
</td>
<td class="cellrowborder" valign="top" width="23.44765523447655%" headers="mcps1.3.2.4.2.5.1.2 "><p id="deh_02_0023__p29241051175512">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.48755124487551%" headers="mcps1.3.2.4.2.5.1.3 "><p id="deh_02_0023__p1592535185519">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="30.826917308269174%" headers="mcps1.3.2.4.2.5.1.4 "><p id="deh_02_0023__p1544524011550">Specifies the DeH ID.</p>
<p id="deh_02_0023__p858154817367">You can obtain the value from the DeH console or using the API in <a href="deh_02_0020.html">Querying DeHs</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="deh_02_0023__section14650458"><h4 class="sectiontitle">Request</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="deh_02_0023__table12861174187" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="deh_02_0023__row1187101717185"><th align="left" class="cellrowborder" valign="top" width="25.000000000000007%" id="mcps1.3.3.2.2.5.1.1"><p id="deh_02_0023__p6478230141818"><strong id="deh_02_0023__b647462423914">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.290000000000003%" id="mcps1.3.3.2.2.5.1.2"><p id="deh_02_0023__p204785303184"><strong id="deh_02_0023__b1179603273915">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25.360000000000007%" id="mcps1.3.3.2.2.5.1.3"><p id="deh_02_0023__p15479173061815"><strong id="deh_02_0023__b1615711369396">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="30.350000000000005%" id="mcps1.3.3.2.2.5.1.4"><p id="deh_02_0023__p1747953017182"><strong id="deh_02_0023__b10467113743918">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="deh_02_0023__row387111721816"><td class="cellrowborder" valign="top" width="25.000000000000007%" headers="mcps1.3.3.2.2.5.1.1 "><p id="deh_02_0023__p168915995911">dedicated_host</p>
</td>
<td class="cellrowborder" valign="top" width="19.290000000000003%" headers="mcps1.3.3.2.2.5.1.2 "><p id="deh_02_0023__p34792305182">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="25.360000000000007%" headers="mcps1.3.3.2.2.5.1.3 "><p id="deh_02_0023__p947953015182">Object</p>
</td>
<td class="cellrowborder" valign="top" width="30.350000000000005%" headers="mcps1.3.3.2.2.5.1.4 "><p id="deh_02_0023__p1247953011815">Specifies the dedicated host. For details, see <a href="#deh_02_0023__table88521854161717">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="deh_02_0023__table88521854161717"></a><a name="table88521854161717"></a><table cellpadding="4" cellspacing="0" summary="" id="deh_02_0023__table88521854161717" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="deh_02_0023__b199673515409">dedicated_host</strong> field data structure description</caption><thead align="left"><tr id="deh_02_0023__row14851254161719"><th align="left" class="cellrowborder" valign="top" width="19.139999999999997%" id="mcps1.3.3.3.2.6.1.1"><p id="deh_02_0023__p1185015412177"><strong id="deh_02_0023__b15031456184018">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="11.1%" id="mcps1.3.3.3.2.6.1.2"><p id="deh_02_0023__p085085421712"><strong id="deh_02_0023__b437563318412">Location</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.78%" id="mcps1.3.3.3.2.6.1.3"><p id="deh_02_0023__p1485012544172"><strong id="deh_02_0023__b13462118112211">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.16%" id="mcps1.3.3.3.2.6.1.4"><p id="deh_02_0023__p198501554151719"><strong id="deh_02_0023__b1615270565">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="42.82%" id="mcps1.3.3.3.2.6.1.5"><p id="deh_02_0023__p9850205431713"><strong id="deh_02_0023__b19400141010221">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="deh_02_0023__row5851165410173"><td class="cellrowborder" valign="top" width="19.139999999999997%" headers="mcps1.3.3.3.2.6.1.1 "><p id="deh_02_0023__p2085115411173">auto_placement</p>
</td>
<td class="cellrowborder" valign="top" width="11.1%" headers="mcps1.3.3.3.2.6.1.2 "><p id="deh_02_0023__p1185118543171">in</p>
</td>
<td class="cellrowborder" valign="top" width="14.78%" headers="mcps1.3.3.3.2.6.1.3 "><p id="deh_02_0023__p13851105419179">String</p>
</td>
<td class="cellrowborder" valign="top" width="12.16%" headers="mcps1.3.3.3.2.6.1.4 "><p id="deh_02_0023__p285185411714">No</p>
</td>
<td class="cellrowborder" valign="top" width="42.82%" headers="mcps1.3.3.3.2.6.1.5 "><p id="deh_02_0023__p4851554121719">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_0023__p19851654101711">The value can be <strong id="deh_02_0023__b1588844916239">on</strong> or <strong id="deh_02_0023__b1889074982311">off</strong>.</p>
</td>
</tr>
<tr id="deh_02_0023__row885219544177"><td class="cellrowborder" valign="top" width="19.139999999999997%" headers="mcps1.3.3.3.2.6.1.1 "><p id="deh_02_0023__p108511254171713">name</p>
</td>
<td class="cellrowborder" valign="top" width="11.1%" headers="mcps1.3.3.3.2.6.1.2 "><p id="deh_02_0023__p14851105441714">in</p>
</td>
<td class="cellrowborder" valign="top" width="14.78%" headers="mcps1.3.3.3.2.6.1.3 "><p id="deh_02_0023__p1385145481719">String</p>
</td>
<td class="cellrowborder" valign="top" width="12.16%" headers="mcps1.3.3.3.2.6.1.4 "><p id="deh_02_0023__p3851195481711">No</p>
</td>
<td class="cellrowborder" valign="top" width="42.82%" headers="mcps1.3.3.3.2.6.1.5 "><p id="deh_02_0023__p58511954141710">Specifies the DeH name.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="deh_02_0023__section64745266"><h4 class="sectiontitle">Response</h4><p id="deh_02_0023__p6106195917560">None</p>
</div>
<div class="section" id="deh_02_0023__section4539132133315"><h4 class="sectiontitle">Example Request</h4><div class="p" id="deh_02_0023__p5722134419425">Set <strong id="deh_02_0023__b122842054815">auto_placement</strong> to <strong id="deh_02_0023__b5909135015610">off</strong> to not allow an ECS to be placed on any available DeH. Change the name of the DeH to <strong id="deh_02_0023__b15670120315">DeH_vm3</strong>.<pre class="screen" id="deh_02_0023__screen53401596154145">PUT https://{Endpoint}/v1.0/9c53a566cb3443ab910cf0daebca90c4/dedicated-hosts/74259164-e63a-4ad9-9c77-a1bd2c9aa187
{
"dedicated_host": {
"auto_placement": "off",
"name": "DeH_vm3"
}
}</pre>
</div>
</div>
<div class="section" id="deh_02_0023__section16360154516337"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="deh_02_0023__screen915652432816">Http Response Code: 204</pre>
</div>
<div class="section" id="deh_02_0023__section21768161"><h4 class="sectiontitle">Status Code</h4><p id="deh_02_0023__p33132859">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>