doc-exports/docs/mrs/api-ref/mrs_02_0071.html
Yang, Tong bd2b57f749 MRS API 2.0.38.SP20 version
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Yang, Tong <yangtong2@huawei.com>
Co-committed-by: Yang, Tong <yangtong2@huawei.com>
2022-11-16 15:06:08 +00:00

107 lines
8.8 KiB
HTML

<a name="mrs_02_0071"></a><a name="mrs_02_0071"></a>
<h1 class="topictitle1">Adding a Tag to a Specified Cluster</h1>
<div id="body8662426"><div class="section" id="mrs_02_0071__sabc7dbff6adb45cd93f20e092357ae85"><h4 class="sectiontitle">Function</h4><p id="mrs_02_0071__a06359bc6966f4f50ba362bb583374f3d">This API is used to add a tag to a specified cluster.</p>
<p id="mrs_02_0071__en-us_topic_0110707061_p57418711018">A cluster has a maximum of 10 tags. This API is idempotent. If a tag to be created has the same key as an existing tag, the tag will overwrite the existing one.</p>
</div>
<div class="section" id="mrs_02_0071__s589e5ad723a343ea8224ae5acfacde33"><h4 class="sectiontitle">URI</h4><ul id="mrs_02_0071__ul3299804811311"><li id="mrs_02_0071__li3701617811311">Format<p id="mrs_02_0071__a349d21a2c1474be6bddab0889e9df0f0"><a name="mrs_02_0071__li3701617811311"></a><a name="li3701617811311"></a>POST /v1.1/{project_id}/clusters/{cluster_id}/tags</p>
</li><li id="mrs_02_0071__li29511803172648">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_02_0071__t242752ea56bf450f8b80444174e62d69" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameter description</caption><thead align="left"><tr id="mrs_02_0071__r65f89e1a178c4a47a56dd81220c532de"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.2.2.1.2.4.1.1"><p id="mrs_02_0071__aa3ca13de4d274217bd889b319cde8849"><strong id="mrs_02_0071__b11821152456">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.2.2.1.2.4.1.2"><p id="mrs_02_0071__en-us_topic_0110707061_p388412816227"><strong id="mrs_02_0071__b15596580510">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.2.2.1.2.4.1.3"><p id="mrs_02_0071__a0736051ee1a1415baeb2f55ed1c0d255"><strong id="mrs_02_0071__b144525127519">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_02_0071__r6f5ab9d702da4458b8f3904ca5532d44"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="mrs_02_0071__a8ac9ce258b8d4ab6a6c0b87a91a5077b">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="mrs_02_0071__aba45b9aac26445bda5f40178b6133773">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="mrs_02_0071__a295457bf2fb046afa866835c4b9113a2">Project ID. For details on how to obtain the project ID, see <a href="mrs_02_0011.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="mrs_02_0071__r03e757778a544a539934b26ce498f671"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="mrs_02_0071__en-us_topic_0110707061_p288462815221">cluster_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="mrs_02_0071__a476657609f5d4ca6b6df423e6c7579c2">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="mrs_02_0071__en-us_topic_0110707061_p78845285227">Cluster ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="mrs_02_0071__sa272ba477099400b8eaac43b02f930a6"><h4 class="sectiontitle">Request</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_02_0071__t5d6a85e09aa14d16986a8cf2f3e34375" frame="border" border="1" rules="all"><caption><b>Table 2 </b><strong id="mrs_02_0071__b15148191443118">tags</strong> parameter description</caption><thead align="left"><tr id="mrs_02_0071__r1e5c57d68620402c8bb798b3c5642170"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.2.5.1.1"><p id="mrs_02_0071__aa0ecbcc8ff644332b45740923b6b65cd"><strong id="mrs_02_0071__b98906428618">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.2.2.5.1.2"><p id="mrs_02_0071__en-us_topic_0110707061_p359718019240"><strong id="mrs_02_0071__b7655144515619">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.3.2.2.5.1.3"><p id="mrs_02_0071__en-us_topic_0110707061_p35978012418"><strong id="mrs_02_0071__b632122642111">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="45%" id="mcps1.3.3.2.2.5.1.4"><p id="mrs_02_0071__a2688727b75e34fe9bf2e6b7a76b15ffe"><strong id="mrs_02_0071__b7414174910617">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_02_0071__r920ccc483fe44ace8e1d8ad774de1583"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.2.5.1.1 "><p id="mrs_02_0071__en-us_topic_0110707061_p105973017245">key</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.2 "><p id="mrs_02_0071__en-us_topic_0110707061_p15982012410">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.3 "><p id="mrs_02_0071__a8f87a73d2a9046538f9e21249ae5b1ef">String</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.3.2.2.5.1.4 "><p id="mrs_02_0071__ad3d3b7688d0f4103884579ec59e1d4ad">Key. A tag key can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_).</p>
</td>
</tr>
<tr id="mrs_02_0071__r132299a936a04e58acc72ffd714cc879"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.2.5.1.1 "><p id="mrs_02_0071__ae0ae0dc1e3dc4cd58e23a7932f0065e3">value</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.2 "><p id="mrs_02_0071__en-us_topic_0110707061_p25981800247">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.3.2.2.5.1.3 "><p id="mrs_02_0071__en-us_topic_0110707061_p125981607243">String</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.3.2.2.5.1.4 "><p id="mrs_02_0071__en-us_topic_0110707061_p55984072416">Tag value. A tag value can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_).</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="mrs_02_0071__s77010e865e2a4004801f00406353c065"><h4 class="sectiontitle">Response</h4><p id="mrs_02_0071__aac14c61711e147f0820fe1d4d77b1d3d"><strong id="mrs_02_0071__a61dd0fc69ff4483b9fbb6e67e8c9db72">Response parameters</strong></p>
<p id="mrs_02_0071__a86adbe5511e84b8986cca1f0702e0121">None.</p>
</div>
<div class="section" id="mrs_02_0071__s5a73aa4f71334961ba7f8ccde0a863b7"><h4 class="sectiontitle">Example</h4><ul id="mrs_02_0071__u99414f8948b947fd961204a1785287c8"><li id="mrs_02_0071__l05e301a71bde4da3a6e0f4fc43b632c9">Example request</li></ul>
<pre class="screen" id="mrs_02_0071__s46170201300e4d2988c13e1ca980e930">{
"tag":
{
"key":"DEV",
"value":"DEV1"
}
} </pre>
<ul id="mrs_02_0071__u9952f182b3e64f4383a5962afc8091b5"><li id="mrs_02_0071__l5c8b987b853b441a88e8f82cf7d27116">Example response<p id="mrs_02_0071__a25cf552225a84ba68ad9fddd1ac6a2b2"><a name="mrs_02_0071__l5c8b987b853b441a88e8f82cf7d27116"></a><a name="l5c8b987b853b441a88e8f82cf7d27116"></a>None.</p>
</li></ul>
</div>
<div class="section" id="mrs_02_0071__s33965fe40ed14d9d958a455b548fcf23"><h4 class="sectiontitle">Status Code</h4><p id="mrs_02_0071__a38c5d2d441a048568a5f9f7cd86f8dac"><a href="#mrs_02_0071__t853eb843894541af90b6f0a45bbc833f">Table 3</a> describes the status code of this API.</p>
<div class="tablenoborder"><a name="mrs_02_0071__t853eb843894541af90b6f0a45bbc833f"></a><a name="t853eb843894541af90b6f0a45bbc833f"></a><table cellpadding="4" cellspacing="0" summary="" id="mrs_02_0071__t853eb843894541af90b6f0a45bbc833f" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Status code</caption><thead align="left"><tr id="mrs_02_0071__r28ded54d02d945a6a8381f42ecc6660a"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.6.3.2.3.1.1"><p id="mrs_02_0071__a71689c7f46044c97ad1008854138cf29"><strong id="mrs_02_0071__b139705541965">Status Code</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="70%" id="mcps1.3.6.3.2.3.1.2"><p id="mrs_02_0071__ab71bc72c98d446ff8cd1afb6ac2c83b3"><strong id="mrs_02_0071__b09741858563">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_02_0071__r00b9253346d847fa885b20cac7c83cc1"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.6.3.2.3.1.1 "><p id="mrs_02_0071__af5fbec93e9a5465580f513eb3541567b">204</p>
</td>
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.6.3.2.3.1.2 "><p id="mrs_02_0071__p1666511011814">The operation is successful.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_02_0070.html">Tag Management APIs</a></div>
</div>
</div>