doc-exports/docs/ims/api-ref/en-us_topic_0000001360879672.html
Hasko, Vladimir 0c7b91f4bd Initial import of IMS API
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
2022-10-05 08:51:25 +00:00

102 lines
9.1 KiB
HTML

<a name="EN-US_TOPIC_0000001360879672"></a><a name="EN-US_TOPIC_0000001360879672"></a>
<h1 class="topictitle1">Adding a Tag (Native OpenStack API)</h1>
<div id="body26973745"><div class="section" id="EN-US_TOPIC_0000001360879672__section43944024"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001360879672__p37389755">This API is used to add a custom tag to an image. With tags, you can manage easily the images.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001360879672__section59951903"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0000001360879672__p587088331724">PUT /v2/images/{image_id}/tags/{tag}</p>
<div class="p" id="EN-US_TOPIC_0000001360879672__p27519118313"><a href="#EN-US_TOPIC_0000001360879672__table58396974">Table 1</a> lists the parameters in the URI.
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001360879672__table58396974"></a><a name="table58396974"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001360879672__table58396974" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0000001360879672__row52161898"><th align="left" class="cellrowborder" valign="top" width="20.49%" id="mcps1.3.2.3.2.2.5.1.1"><p id="EN-US_TOPIC_0000001360879672__p64364196"><strong id="EN-US_TOPIC_0000001360879672__b29862858161838">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.68%" id="mcps1.3.2.3.2.2.5.1.2"><p id="EN-US_TOPIC_0000001360879672__p40455902205623"><strong id="EN-US_TOPIC_0000001360879672__b31324481161845">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.3.2.3.2.2.5.1.3"><p id="EN-US_TOPIC_0000001360879672__p46117407">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="35.709999999999994%" id="mcps1.3.2.3.2.2.5.1.4"><p id="EN-US_TOPIC_0000001360879672__p44522499">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001360879672__row49552630"><td class="cellrowborder" valign="top" width="20.49%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001360879672__p54340131">image_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.68%" headers="mcps1.3.2.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001360879672__p15622373205623">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.3.2.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001360879672__p39474480">String</p>
</td>
<td class="cellrowborder" valign="top" width="35.709999999999994%" headers="mcps1.3.2.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001360879672__p43316293">Specifies the image ID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001360879672__row54302323"><td class="cellrowborder" valign="top" width="20.49%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001360879672__p36412008">tag</p>
</td>
<td class="cellrowborder" valign="top" width="20.68%" headers="mcps1.3.2.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001360879672__p47312118205623">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.3.2.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001360879672__p63691513">String</p>
</td>
<td class="cellrowborder" valign="top" width="35.709999999999994%" headers="mcps1.3.2.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001360879672__p75636161112">Specifies the tag to be added.</p>
<p id="EN-US_TOPIC_0000001360879672__p15777461117">The tag can contain only digits, letters, underscores (_), and hyphens (-).</p>
<div class="note" id="EN-US_TOPIC_0000001360879672__note1350761815387"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="EN-US_TOPIC_0000001360879672__p550721883817">This API can only be used to add a tag key. To add a tag value, use the PUT /v1/cloudimages/tags API. For details, see <a href="en-us_topic_0000001411239269.html">Adding or Modifying a Tag</a>.</p>
</div></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001360879672__section2696221"><h4 class="sectiontitle">Request</h4><ul id="EN-US_TOPIC_0000001360879672__ul1340135113116"><li id="EN-US_TOPIC_0000001360879672__li975265253112">Request parameters<p id="EN-US_TOPIC_0000001360879672__p1898504328"><a name="EN-US_TOPIC_0000001360879672__li975265253112"></a><a name="li975265253112"></a>None</p>
</li><li id="EN-US_TOPIC_0000001360879672__li14340751153110">Example request<pre class="codeblock" id="EN-US_TOPIC_0000001360879672__codeblock60014861173621">PUT https://{Endpoint}/v2/images/4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba90/tags/aaaa</pre>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001360879672__section24265995"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0000001360879672__ul263811719324"><li id="EN-US_TOPIC_0000001360879672__li186381775327">Response parameters<p id="EN-US_TOPIC_0000001360879672__p166572319328"><a name="EN-US_TOPIC_0000001360879672__li186381775327"></a><a name="li186381775327"></a>None</p>
</li><li id="EN-US_TOPIC_0000001360879672__li8765181115321">Example response<pre class="codeblock" id="EN-US_TOPIC_0000001360879672__codeblock52928864162419">STATUS CODE 204</pre>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001360879672__section17067371"><h4 class="sectiontitle">Returned Values</h4><ul id="EN-US_TOPIC_0000001360879672__ul33868853"><li id="EN-US_TOPIC_0000001360879672__li36384226">Normal<p id="EN-US_TOPIC_0000001360879672__p59022586"><a name="EN-US_TOPIC_0000001360879672__li36384226"></a><a name="li36384226"></a>204</p>
</li><li id="EN-US_TOPIC_0000001360879672__li61441228">Abnormal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001360879672__table642803117411" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001360879672__row109645217411"><th align="left" class="cellrowborder" valign="top" width="38.080000000000005%" id="mcps1.3.5.2.2.1.1.3.1.1"><p id="EN-US_TOPIC_0000001360879672__p2170376317411"><strong id="EN-US_TOPIC_0000001360879672__b39973114161856">Returned Value</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="61.919999999999995%" id="mcps1.3.5.2.2.1.1.3.1.2"><p id="EN-US_TOPIC_0000001360879672__p1317436717411"><strong id="EN-US_TOPIC_0000001360879672__b5047798416190">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001360879672__row6049076717411"><td class="cellrowborder" valign="top" width="38.080000000000005%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000001360879672__p80506717411">400 Bad Request</p>
</td>
<td class="cellrowborder" valign="top" width="61.919999999999995%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000001360879672__p6521049217411">Request error.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001360879672__row5002352417411"><td class="cellrowborder" valign="top" width="38.080000000000005%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000001360879672__p2537366317411">401 Unauthorized</p>
</td>
<td class="cellrowborder" valign="top" width="61.919999999999995%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000001360879672__p4200083517411">Authentication failed.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001360879672__row4246319517411"><td class="cellrowborder" valign="top" width="38.080000000000005%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000001360879672__p1696676617411">403 Forbidden</p>
</td>
<td class="cellrowborder" valign="top" width="61.919999999999995%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000001360879672__p3213081417411">You do not have the rights to perform the operation.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001360879672__row22446538192234"><td class="cellrowborder" valign="top" width="38.080000000000005%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000001360879672__p2466565192236">404 Not Found</p>
</td>
<td class="cellrowborder" valign="top" width="61.919999999999995%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000001360879672__p65574046192236">The requested resource was not found.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001360879672__row2074187217411"><td class="cellrowborder" valign="top" width="38.080000000000005%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000001360879672__p237005317411">500 Internal Server Error</p>
</td>
<td class="cellrowborder" valign="top" width="61.919999999999995%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000001360879672__p5775661917411">Internal service error.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001360879672__row5004752817411"><td class="cellrowborder" valign="top" width="38.080000000000005%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0000001360879672__p2731794517411">503 Service Unavailable</p>
</td>
<td class="cellrowborder" valign="top" width="61.919999999999995%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0000001360879672__p6526996817411">The service is unavailable.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0000001360879704.html">Image Tagging (Native OpenStack APIs)</a></div>
</div>
</div>