doc-exports/docs/tms/api-ref/en-us_topic_0056765935.html
Wei, Hongmin b37b65e78f TMS API 0528 Version
Reviewed-by: Ziuzko, Alevtina <alevtina.ziuzko@t-systems.com>
Co-authored-by: Wei, Hongmin <weihongmin1@huawei.com>
Co-committed-by: Wei, Hongmin <weihongmin1@huawei.com>
2024-05-28 11:21:07 +00:00

132 lines
12 KiB
HTML

<a name="en-us_topic_0056765935"></a><a name="en-us_topic_0056765935"></a>
<h1 class="topictitle1">Creating or Deleting Predefined Tags</h1>
<div id="body8662426"><div class="section" id="en-us_topic_0056765935__s3ca7a6682f2f40adb92fc2535fc27c71"><h4 class="sectiontitle">Function</h4><p id="en-us_topic_0056765935__en-us_topic_0056765542_p65561530">This API is used to create or delete predefined tags. You can add tags to resources using the predefined tags.</p>
<p id="en-us_topic_0056765935__p6443610620445">This API supports idempotency and batch processing.</p>
<div class="note" id="en-us_topic_0056765935__note167171751682"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="en-us_topic_0056765935__p8717451587">Idempotent operations refer to invoking the same API for multiple times by using the same parameters, which have the same impact on the system.</p>
</div></div>
</div>
<div class="section" id="en-us_topic_0056765935__sd093810dcf9f49f9a9ac3f0addd993aa"><h4 class="sectiontitle">URI</h4><p id="en-us_topic_0056765935__en-us_topic_0056765542_p48490504">POST /v1.0/predefine_tags/action</p>
</div>
<div class="section" id="en-us_topic_0056765935__s0080d9bf95db45a999db8ca7195660ca"><h4 class="sectiontitle">Request</h4><ul id="en-us_topic_0056765935__en-us_topic_0056765542_ul49011679"><li id="en-us_topic_0056765935__en-us_topic_0056765542_li38451933">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0056765935__table121659556191" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request header parameters</caption><thead align="left"><tr id="en-us_topic_0056765935__en-us_topic_0133313257_row627664919518"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="en-us_topic_0056765935__en-us_topic_0133313257_p3349526181715">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="en-us_topic_0056765935__en-us_topic_0133313257_p2349182681715">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="en-us_topic_0056765935__en-us_topic_0133313257_p183491226101712">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="en-us_topic_0056765935__en-us_topic_0133313257_p1734915261172">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0056765935__en-us_topic_0133313257_row8281649753"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="en-us_topic_0056765935__en-us_topic_0133313257_p17280349556">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="en-us_topic_0056765935__en-us_topic_0133313257_p122819492055">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="en-us_topic_0056765935__en-us_topic_0133313257_p1028110492510">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="en-us_topic_0056765935__en-us_topic_0133313257_p172819491858">Specifies the user token. TMS is a global service. When calling the IAM API to obtain a user token, set <strong id="en-us_topic_0056765935__en-us_topic_0133313257_b1896416521191">scope</strong> to <strong id="en-us_topic_0056765935__en-us_topic_0133313257_b14965652697">domain</strong>. The value of <strong id="en-us_topic_0056765935__en-us_topic_0133313257_b179651521297">X-Subject-Token</strong> in the response header is the user token.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0056765935__en-us_topic_0056765542_table10523083" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameters</caption><thead align="left"><tr id="en-us_topic_0056765935__en-us_topic_0056765542_row3226198"><th align="left" class="cellrowborder" valign="top" width="17.4%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="en-us_topic_0056765935__en-us_topic_0056765542_p59995477"><strong id="en-us_topic_0056765935__b410197072043">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.689999999999998%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="en-us_topic_0056765935__en-us_topic_0056765542_p27795493"><strong id="en-us_topic_0056765935__b342619932043">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="30.85%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="en-us_topic_0056765935__en-us_topic_0056765542_p36842478"><strong id="en-us_topic_0056765935__b237580232043">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="35.06%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="en-us_topic_0056765935__en-us_topic_0056765542_p31450711"><strong id="en-us_topic_0056765935__b453516772043">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0056765935__en-us_topic_0056765542_row5166299"><td class="cellrowborder" valign="top" width="17.4%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="en-us_topic_0056765935__en-us_topic_0056765542_p15817070">action</p>
</td>
<td class="cellrowborder" valign="top" width="16.689999999999998%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="en-us_topic_0056765935__en-us_topic_0056765542_p6114302">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="30.85%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="en-us_topic_0056765935__en-us_topic_0056765542_p25496434">String</p>
</td>
<td class="cellrowborder" valign="top" width="35.06%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="en-us_topic_0056765935__p22800527164128">Specifies the action identifier.</p>
<p id="en-us_topic_0056765935__en-us_topic_0056765542_p51945267">The value is case sensitive and can be <strong id="en-us_topic_0056765935__b842352706163653">create</strong> or <strong id="en-us_topic_0056765935__b842352706163656">delete</strong>.</p>
</td>
</tr>
<tr id="en-us_topic_0056765935__row3768776719376"><td class="cellrowborder" valign="top" width="17.4%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="en-us_topic_0056765935__p3295480193712">tags</p>
</td>
<td class="cellrowborder" valign="top" width="16.689999999999998%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="en-us_topic_0056765935__p65607343193712">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="30.85%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="en-us_topic_0056765935__p4388405218398">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="35.06%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="en-us_topic_0056765935__p13529275193712">Specifies the tags. One to fifty tags are specified.</p>
<p id="en-us_topic_0056765935__p6301124715121">For details, see <a href="#en-us_topic_0056765935__en-us_topic_0056765542_table46817064">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="en-us_topic_0056765935__en-us_topic_0056765542_li64854219"><strong id="en-us_topic_0056765935__b842352706143357">tags</strong> field description
<div class="tablenoborder"><a name="en-us_topic_0056765935__en-us_topic_0056765542_table46817064"></a><a name="en-us_topic_0056765542_table46817064"></a><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0056765935__en-us_topic_0056765542_table46817064" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Fields</caption><thead align="left"><tr id="en-us_topic_0056765935__en-us_topic_0056765542_row4410728"><th align="left" class="cellrowborder" valign="top" width="19.01980198019802%" id="mcps1.3.3.2.2.2.2.5.1.1"><p id="en-us_topic_0056765935__en-us_topic_0056765542_p21724664"><strong id="en-us_topic_0056765935__b3685747820628">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.752475247524753%" id="mcps1.3.3.2.2.2.2.5.1.2"><p id="en-us_topic_0056765935__en-us_topic_0056765542_p14867369"><strong id="en-us_topic_0056765935__b3266572720628">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.871287128712872%" id="mcps1.3.3.2.2.2.2.5.1.3"><p id="en-us_topic_0056765935__en-us_topic_0056765542_p63406242"><strong id="en-us_topic_0056765935__b2867822920628">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40.35643564356436%" id="mcps1.3.3.2.2.2.2.5.1.4"><p id="en-us_topic_0056765935__en-us_topic_0056765542_p35632012"><strong id="en-us_topic_0056765935__b4123518320628">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0056765935__en-us_topic_0056765542_row511887"><td class="cellrowborder" valign="top" width="19.01980198019802%" headers="mcps1.3.3.2.2.2.2.5.1.1 "><p id="en-us_topic_0056765935__en-us_topic_0056765542_p41462866">key</p>
</td>
<td class="cellrowborder" valign="top" width="18.752475247524753%" headers="mcps1.3.3.2.2.2.2.5.1.2 "><p id="en-us_topic_0056765935__en-us_topic_0056765542_p3048957">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="21.871287128712872%" headers="mcps1.3.3.2.2.2.2.5.1.3 "><p id="en-us_topic_0056765935__en-us_topic_0056765542_p45638969">String</p>
</td>
<td class="cellrowborder" valign="top" width="40.35643564356436%" headers="mcps1.3.3.2.2.2.2.5.1.4 "><p id="en-us_topic_0056765935__p108587120631">Specifies the key.</p>
<p id="en-us_topic_0056765935__p16424462153146">It can contain up to 36 characters. The key cannot be empty. Only digits, letters, hyphens (-), at signs (@), and underscores (_) are allowed.</p>
</td>
</tr>
<tr id="en-us_topic_0056765935__en-us_topic_0056765542_row51921052"><td class="cellrowborder" valign="top" width="19.01980198019802%" headers="mcps1.3.3.2.2.2.2.5.1.1 "><p id="en-us_topic_0056765935__en-us_topic_0056765542_p44855704">value</p>
</td>
<td class="cellrowborder" valign="top" width="18.752475247524753%" headers="mcps1.3.3.2.2.2.2.5.1.2 "><p id="en-us_topic_0056765935__en-us_topic_0056765542_p9433441">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="21.871287128712872%" headers="mcps1.3.3.2.2.2.2.5.1.3 "><p id="en-us_topic_0056765935__en-us_topic_0056765542_p25911262">String</p>
</td>
<td class="cellrowborder" valign="top" width="40.35643564356436%" headers="mcps1.3.3.2.2.2.2.5.1.4 "><p id="en-us_topic_0056765935__p2486891184110">Specifies the value.</p>
<p id="en-us_topic_0056765935__p10159585153243">Each value contains a maximum of 43 Unicode characters and can be an empty string. Only digits, letters, hyphens (-), at signs (@), and underscores (_) are allowed.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0056765935__en-us_topic_0056765542_ul17042198"><li id="en-us_topic_0056765935__en-us_topic_0056765542_li19162058">Example request<pre class="codeblock" id="en-us_topic_0056765935__codeblock15520154616343">POST https://{<em id="en-us_topic_0056765935__i1641494403">TMS endpoint</em>}/v1.0/predefine_tags/action</pre>
<pre class="screen" id="en-us_topic_0056765935__screen6928154612914">{
"action": "create",
"tags": [
{
"key": "ENV1",
"value": "DEV1"
},
{
"key": "ENV2",
"value": "DEV2"
}
]
}</pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0056765935__s8f10435686924c5ca93a27ff7fbeacb2"><h4 class="sectiontitle">Example Response</h4><p id="en-us_topic_0056765935__p148073472218"><strong id="en-us_topic_0056765935__b17153067484511">Status code: 204</strong></p>
</div>
<div class="section" id="en-us_topic_0056765935__section17789101582315"><h4 class="sectiontitle">Status Codes</h4><p id="en-us_topic_0056765935__p145228330242">See <a href="en-us_topic_0130578970.html">Status Codes</a>.</p>
</div>
<div class="section" id="en-us_topic_0056765935__section18604165622519"><h4 class="sectiontitle">Error Codes</h4><p id="en-us_topic_0056765935__p177044331253">See <a href="en-us_topic_0057939857.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0133313258.html">Predefined Tag Operations</a></div>
</div>
</div>