forked from docs/doc-exports
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com> Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com> Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
143 lines
12 KiB
HTML
143 lines
12 KiB
HTML
<a name="deh_05_0901"></a><a name="deh_05_0901"></a>
|
|
|
|
<h1 class="topictitle1">Adding Tags to a DeH in Batches</h1>
|
|
<div id="body1539073522350"><div class="section" id="deh_05_0901__section54478915181842"><h4 class="sectiontitle">Function</h4><ul id="deh_05_0901__ul246771516486"><li id="deh_05_0901__li946771511489">This API is used to add tags to a specified DeH in batches.</li></ul>
|
|
<ul id="deh_05_0901__ul319691018485"><li id="deh_05_0901__li1519613108481">Tag Management Service (TMS) uses this API to batch add tags to a DeH.</li></ul>
|
|
</div>
|
|
<div class="section" id="deh_05_0901__section141154519480"><h4 class="sectiontitle"><strong id="deh_05_0901__b13841175311520">Constraint</strong></h4><ul id="deh_05_0901__ul11139051184816"><li id="deh_05_0901__li613905119486">A DeH allows a maximum of 10 tags.</li><li id="deh_05_0901__li9139145111488">This API is idempotent.<p id="deh_05_0901__p13139115112481"><a name="deh_05_0901__li9139145111488"></a><a name="li9139145111488"></a>During tag creation, if a tag exists (both the key and value are the same as those of an existing tag), the tag is successfully processed by default.</p>
|
|
</li><li id="deh_05_0901__li31391551134818">A new tag will overwrite the original one if their keys are the same and values are different.</li></ul>
|
|
</div>
|
|
<div class="section" id="deh_05_0901__en-us_topic_0057972838_section58912114"><h4 class="sectiontitle">URI</h4><p id="deh_05_0901__en-us_topic_0057972838_p17816132418199">POST /v1.0/{project_id}/dedicated-host-tags/{dedicated_host_id}/tags/action</p>
|
|
<p id="deh_05_0901__p7167536162813"><a href="#deh_05_0901__table1913014815289">Table 1</a> describes the parameters.</p>
|
|
|
|
<div class="tablenoborder"><a name="deh_05_0901__table1913014815289"></a><a name="table1913014815289"></a><table cellpadding="4" cellspacing="0" summary="" id="deh_05_0901__table1913014815289" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters description</caption><thead align="left"><tr id="deh_05_0901__row6132548192819"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.4.2.5.1.1"><p id="deh_05_0901__p1453395718282"><strong id="deh_05_0901__b023082265513">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.4.2.5.1.2"><p id="deh_05_0901__p12672121152914"><strong id="deh_05_0901__b5595123145520">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.4.2.5.1.3"><p id="deh_05_0901__p036416672910"><strong id="deh_05_0901__b1922112505512">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.4.2.5.1.4"><p id="deh_05_0901__p13607121012919"><strong id="deh_05_0901__b18468927105520">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="deh_05_0901__row1513224882810"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.4.2.5.1.1 "><p id="deh_05_0901__p7535157152814">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.4.2.5.1.2 "><p id="deh_05_0901__p106746132910">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.4.2.5.1.3 "><p id="deh_05_0901__p5368176122914">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.4.2.5.1.4 "><p id="deh_05_0901__p361114109293">Specifies the project ID.</p>
|
|
<p id="deh_05_0901__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_05_0901__row18132154822812"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.4.2.5.1.1 "><p id="deh_05_0901__p653716573284">dedicated_host_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.4.2.5.1.2 "><p id="deh_05_0901__p116765112916">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.4.2.5.1.3 "><p id="deh_05_0901__p18369106112920">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.4.2.5.1.4 "><p id="deh_05_0901__p3612201014297">Specifies the DeH ID.</p>
|
|
<p id="deh_05_0901__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_05_0901__en-us_topic_0057972838_section60446980"><h4 class="sectiontitle">Request</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="deh_05_0901__table12204027174213" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="deh_05_0901__row020452715428"><th align="left" class="cellrowborder" valign="top" width="19.77%" id="mcps1.3.4.2.2.5.1.1"><p id="deh_05_0901__p2088117451427"><strong id="deh_05_0901__b4442144385513">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="19.68%" id="mcps1.3.4.2.2.5.1.2"><p id="deh_05_0901__p5881154564220"><strong id="deh_05_0901__b19868073">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="18.78%" id="mcps1.3.4.2.2.5.1.3"><p id="deh_05_0901__p14881124534214"><strong id="deh_05_0901__b1908984106">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="41.77%" id="mcps1.3.4.2.2.5.1.4"><p id="deh_05_0901__p1488144574215"><strong id="deh_05_0901__b18590496552">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="deh_05_0901__row10204112713429"><td class="cellrowborder" valign="top" width="19.77%" headers="mcps1.3.4.2.2.5.1.1 "><p id="deh_05_0901__p7881154511424">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.68%" headers="mcps1.3.4.2.2.5.1.2 "><p id="deh_05_0901__p288114452428">Array of objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.78%" headers="mcps1.3.4.2.2.5.1.3 "><p id="deh_05_0901__p68811245184211">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.77%" headers="mcps1.3.4.2.2.5.1.4 "><p id="deh_05_0901__p11881124512421">Specifies the tag list. For details, see <a href="#deh_05_0901__table119521422114317">Table 3</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="deh_05_0901__row82051827104211"><td class="cellrowborder" valign="top" width="19.77%" headers="mcps1.3.4.2.2.5.1.1 "><p id="deh_05_0901__p108811045194213">action</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.68%" headers="mcps1.3.4.2.2.5.1.2 "><p id="deh_05_0901__p188811845174218">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.78%" headers="mcps1.3.4.2.2.5.1.3 "><p id="deh_05_0901__p5881144544219">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.77%" headers="mcps1.3.4.2.2.5.1.4 "><p id="deh_05_0901__p5881945174211">Specifies the operation. Only lowercase letters are supported. For example, <strong id="deh_05_0901__b1718733772117">create</strong> indicates the creation operation.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="deh_05_0901__table119521422114317"></a><a name="table119521422114317"></a><table cellpadding="4" cellspacing="0" summary="" id="deh_05_0901__table119521422114317" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="deh_05_0901__deh_02_0019_b12695246712">tag</strong> field description</caption><thead align="left"><tr id="deh_05_0901__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_05_0901__deh_02_0019_p1718917231623"><strong id="deh_05_0901__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_05_0901__deh_02_0019_p2189132319217"><strong id="deh_05_0901__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_05_0901__deh_02_0019_p1818992317219"><strong id="deh_05_0901__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_05_0901__deh_02_0019_p118920231824"><strong id="deh_05_0901__deh_02_0019_b643313283410">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="deh_05_0901__deh_02_0019_row13211117210"><td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.4.3.2.5.1.1 "><p id="deh_05_0901__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_05_0901__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_05_0901__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_05_0901__deh_02_0019_p31899231420">Specifies the tag key.</p>
|
|
<ul id="deh_05_0901__deh_02_0019_ul111893231829"><li id="deh_05_0901__deh_02_0019_li121891423127">It contains a maximum of 36 Unicode characters.</li><li id="deh_05_0901__deh_02_0019_li1718962310216">The value cannot be empty.</li><li id="deh_05_0901__deh_02_0019_li5189623828">It cannot contain the following ASCII characters: =*<>\|/,</li><li id="deh_05_0901__deh_02_0019_li11189623223">It can contain letters, digits, hyphens (-), and underscores (_).</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="deh_05_0901__deh_02_0019_row82126117211"><td class="cellrowborder" valign="top" width="14.91%" headers="mcps1.3.4.3.2.5.1.1 "><p id="deh_05_0901__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_05_0901__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_05_0901__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_05_0901__deh_02_0019_p518920231221">Specifies the tag value.</p>
|
|
<ul id="deh_05_0901__deh_02_0019_ul91890232211"><li id="deh_05_0901__deh_02_0019_li6189823426">It contains a maximum of 43 Unicode characters.</li><li id="deh_05_0901__deh_02_0019_li201907231215">It cannot contain the following ASCII characters: =*<>\|/,</li><li id="deh_05_0901__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_05_0901__section40529449"><h4 class="sectiontitle">Response</h4><p id="deh_05_0901__p986612313214">N/A</p>
|
|
</div>
|
|
<div class="section" id="deh_05_0901__section4539132133315"><h4 class="sectiontitle">Example Request</h4><div class="p" id="deh_05_0901__p106459334459">Add two tags to a DeH in a batch. The keys and corresponding values for these two tags are as follows: <strong id="deh_05_0901__b5535001196">key1</strong> and <strong id="deh_05_0901__b82381931090">value1</strong>; <strong id="deh_05_0901__b1234201010917">key2</strong> and <strong id="deh_05_0901__b6389101218913">value2</strong>.<pre class="screen" id="deh_05_0901__screen12505101794015">POST https://{Endpoint}/v1.0/9c53a566cb3443ab910cf0daebca90c4/dedicated-host-tags/74259164-e63a-4ad9-9c77-a1bd2c9aa187/tags/action
|
|
{
|
|
"action": "create",
|
|
"tags": [
|
|
{
|
|
"key": "key1",
|
|
"value": "value1"
|
|
},
|
|
{
|
|
"key": "key2",
|
|
"value": "value2"
|
|
}
|
|
]
|
|
}</pre>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="deh_05_0901__section16360154516337"><h4 class="sectiontitle">Example Response</h4><p id="deh_05_0901__p1096533153615">N/A</p>
|
|
</div>
|
|
<div class="section" id="deh_05_0901__section12666143310316"><h4 class="sectiontitle">Status Code</h4><p id="deh_05_0901__p14878191345">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_05_0900.html">DeH Tag Management</a></div>
|
|
</div>
|
|
</div>
|
|
|