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>
126 lines
10 KiB
HTML
126 lines
10 KiB
HTML
<a name="EN-US_TOPIC_0065820823"></a><a name="EN-US_TOPIC_0065820823"></a>
|
|
|
|
<h1 class="topictitle1">Adding Tags to an <span id="text693805814551">ECS</span></h1>
|
|
<div id="body1499653398050"><p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_p66198114">This API is used to add tags to an <span id="EN-US_TOPIC_0065820823__text788575914551">ECS</span>.</p>
|
|
<p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_p1659311425911">You are required to use the HTTP header <strong id="EN-US_TOPIC_0065820823__b842352706165643">X-OpenStack-Nova-API-Version: 2.26</strong> to specify the microversion on the client.</p>
|
|
<div class="section" id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_section58912114"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_p17816132418199">PUT /v2.1/{project_id}/servers/{server_id}/tags</p>
|
|
<div class="p" id="EN-US_TOPIC_0065820823__p102462474254"><a href="#EN-US_TOPIC_0065820823__en-us_topic_0057972838_table32475667">Table 1</a> describes the parameters in the URI.
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0065820823__en-us_topic_0057972838_table32475667"></a><a name="en-us_topic_0057972838_table32475667"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_table32475667" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_row44937496"><th align="left" class="cellrowborder" valign="top" width="22.24%" id="mcps1.3.3.3.2.2.4.1.1"><p id="EN-US_TOPIC_0065820823__p5187119">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="21.87%" id="mcps1.3.3.3.2.2.4.1.2"><p id="EN-US_TOPIC_0065820823__p17503500">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="55.88999999999999%" id="mcps1.3.3.3.2.2.4.1.3"><p id="EN-US_TOPIC_0065820823__p8497414">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_row1664874"><td class="cellrowborder" valign="top" width="22.24%" headers="mcps1.3.3.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_p637140">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.87%" headers="mcps1.3.3.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_p51608407">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.88999999999999%" headers="mcps1.3.3.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0065820823__p37593705">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_row41565035"><td class="cellrowborder" valign="top" width="22.24%" headers="mcps1.3.3.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_p11324657">server_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.87%" headers="mcps1.3.3.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_p44882061">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.88999999999999%" headers="mcps1.3.3.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_p11568292">Specifies the <span id="EN-US_TOPIC_0065820823__text2699122273215">ECS</span> ID.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_section60446980"><h4 class="sectiontitle">Request</h4><p id="EN-US_TOPIC_0065820823__p6847181015266"><a href="#EN-US_TOPIC_0065820823__en-us_topic_0057972838_table28387752">Table 2</a> describes the request parameters.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0065820823__en-us_topic_0057972838_table28387752"></a><a name="en-us_topic_0057972838_table28387752"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_table28387752" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_row66802302"><th align="left" class="cellrowborder" valign="top" width="17.73%" id="mcps1.3.4.3.2.5.1.1"><p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_p42277343">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13.61%" id="mcps1.3.4.3.2.5.1.2"><p id="EN-US_TOPIC_0065820823__p1045515223348">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.64%" id="mcps1.3.4.3.2.5.1.3"><p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_p1912753">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="52.019999999999996%" id="mcps1.3.4.3.2.5.1.4"><p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_p217030">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_row17579482"><td class="cellrowborder" valign="top" width="17.73%" headers="mcps1.3.4.3.2.5.1.1 "><p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_p14651901">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.61%" headers="mcps1.3.4.3.2.5.1.2 "><p id="EN-US_TOPIC_0065820823__p54556226341">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.64%" headers="mcps1.3.4.3.2.5.1.3 "><p id="EN-US_TOPIC_0065820823__p136741937121318">Array of strings</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="52.019999999999996%" headers="mcps1.3.4.3.2.5.1.4 "><p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_p47045852">Specifies <span id="EN-US_TOPIC_0065820823__text4378132533210">ECS</span> tags.</p>
|
|
<p id="EN-US_TOPIC_0065820823__p61431611133610">A maximum of 50 tags can be configured, and each tag can contain up to 80 characters.</p>
|
|
<p id="EN-US_TOPIC_0065820823__p1036152112366">Can only consist of digits, letters, hyphens (-), and underscores (_).</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0065820823__section10456114218587"><h4 class="sectiontitle">Response</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065820823__table1481741123815" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0065820823__row1818614389"><th align="left" class="cellrowborder" valign="top" width="16.831683168316832%" id="mcps1.3.5.2.2.5.1.1"><p id="EN-US_TOPIC_0065820823__p281816120382">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.831683168316832%" id="mcps1.3.5.2.2.5.1.2"><p id="EN-US_TOPIC_0065820823__p108181610386">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.871287128712872%" id="mcps1.3.5.2.2.5.1.3"><p id="EN-US_TOPIC_0065820823__p4818161113816">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="53.46534653465347%" id="mcps1.3.5.2.2.5.1.4"><p id="EN-US_TOPIC_0065820823__p1281812119386">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0065820823__row08181516386"><td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.5.2.2.5.1.1 "><p id="EN-US_TOPIC_0065820823__p181818163815">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.831683168316832%" headers="mcps1.3.5.2.2.5.1.2 "><p id="EN-US_TOPIC_0065820823__p1818171133818">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.5.2.2.5.1.3 "><p id="EN-US_TOPIC_0065820823__p28181710388">Array of strings</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="53.46534653465347%" headers="mcps1.3.5.2.2.5.1.4 "><p id="EN-US_TOPIC_0065820823__p198186118384">Specifies <span id="EN-US_TOPIC_0065820823__text1966852819322">ECS</span> tags.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0065820823__table5668174110389" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Reserved tag parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0065820823__row96682418384"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.5.3.2.3.1.1"><p id="EN-US_TOPIC_0065820823__p13668541113820">Tag Name</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="83%" id="mcps1.3.5.3.2.3.1.2"><p id="EN-US_TOPIC_0065820823__p966844143815">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0065820823__row66689417387"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.5.3.2.3.1.1 "><p id="EN-US_TOPIC_0065820823__p26695418384">__type_baremetal</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="83%" headers="mcps1.3.5.3.2.3.1.2 "><p id="EN-US_TOPIC_0065820823__p1566917415389">Specifies that the server is a BMS.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0065820823__row7669541123815"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.5.3.2.3.1.1 "><p id="EN-US_TOPIC_0065820823__p466910416389">__type_virtual</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="83%" headers="mcps1.3.5.3.2.3.1.2 "><p id="EN-US_TOPIC_0065820823__p7669114113387">Specifies that the server is an <span id="EN-US_TOPIC_0065820823__text19235193125619">ECS</span>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0065820823__section114961544142619"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0065820823__p087116920105">Add tags to a specified ECS.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0065820823__screen45118443260">PUT https://{endpoint}/v2.1/{project_id}/servers/{server_id}/tags
|
|
|
|
{
|
|
"tags": ["baz", "foo", "qux"]
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0065820823__section1356113511582"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="EN-US_TOPIC_0065820823__screen1056555195814">{
|
|
"tags": ["baz", "foo", "qux"]
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_en-us_topic_0020212692_section22960139"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0065820823__en-us_topic_0057972838_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_0108433460.html">Tag Management</a></div>
|
|
</div>
|
|
</div>
|
|
|