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>
166 lines
14 KiB
HTML
166 lines
14 KiB
HTML
<a name="EN-US_TOPIC_0067360381"></a><a name="EN-US_TOPIC_0067360381"></a>
|
|
|
|
<h1 class="topictitle1">Adding or Modifying a Tag</h1>
|
|
<div id="body1500543329970"><div class="section" id="EN-US_TOPIC_0067360381__section30340876173741"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0067360381__p28324099173951">This API is used to add a tag to an image or modify a tag of an image. With tags, you can manage easily the images.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0067360381__section1046471173754"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0067360381__p34007837142933">PUT /v1/cloudimages/tags</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0067360381__section8520341173813"><h4 class="sectiontitle">Request</h4><ul id="EN-US_TOPIC_0067360381__ul1654615503111"><li id="EN-US_TOPIC_0067360381__li17546115017115">Request parameters
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0067360381__table6337411917425" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0067360381__row2485160717425"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="EN-US_TOPIC_0067360381__p6453764617425">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="EN-US_TOPIC_0067360381__p6016684317425">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="EN-US_TOPIC_0067360381__p4167613317425">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="EN-US_TOPIC_0067360381__p2032360317425">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0067360381__row4869470317425"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0067360381__p11027285174310">image_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0067360381__p20794863174310">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0067360381__p6662325174310">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0067360381__p6489949174317">Specifies the image ID.</p>
|
|
<p id="EN-US_TOPIC_0067360381__p127065072116">For details about how to obtain the image ID, see <a href="en-us_topic_0020091565.html">Querying Images</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0067360381__row446091717425"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0067360381__p21105754174331">tag</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0067360381__p31844545174331">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0067360381__p29271315174331">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0067360381__p4639858113657">Specifies the tag.</p>
|
|
<p id="EN-US_TOPIC_0067360381__p20992085173243">Use either <strong id="EN-US_TOPIC_0067360381__b84235270693042">tag</strong> or <strong id="EN-US_TOPIC_0067360381__b84235270693044">image_tag</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0067360381__row323937184633"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0067360381__p51830302113147">image_tag</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0067360381__p6802785113147">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0067360381__p19173032113147">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0067360381__p5661683113147">Lists the image tags. For detailed description, see <a href="en-us_topic_0020092110.html">Image Tag Data Formats</a>. This parameter is left blank by default.</p>
|
|
<p id="EN-US_TOPIC_0067360381__p15340342977">Use either <strong id="EN-US_TOPIC_0067360381__b1646526147">tag</strong> or <strong id="EN-US_TOPIC_0067360381__b28214523">image_tag</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0067360381__table1394012426522" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Data structure description of the image_tag field</caption><thead align="left"><tr id="EN-US_TOPIC_0067360381__row594094225214"><th align="left" class="cellrowborder" valign="top" width="20.44%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="EN-US_TOPIC_0067360381__p863017285311">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.86%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="EN-US_TOPIC_0067360381__p116306213535">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.849999999999998%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="EN-US_TOPIC_0067360381__p16630182205318">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="43.85%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="EN-US_TOPIC_0067360381__p3630225536">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0067360381__row29401742195215"><td class="cellrowborder" valign="top" width="20.44%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="EN-US_TOPIC_0067360381__p1594064215521">key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.86%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="EN-US_TOPIC_0067360381__p4940194205214">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.849999999999998%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="EN-US_TOPIC_0067360381__p19940194275217">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.85%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="EN-US_TOPIC_0067360381__p15940942115214">Specifies the tag key.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0067360381__row199401642195213"><td class="cellrowborder" valign="top" width="20.44%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="EN-US_TOPIC_0067360381__p79401542205214">value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.86%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="EN-US_TOPIC_0067360381__p1794044215216">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.849999999999998%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="EN-US_TOPIC_0067360381__p17940124216526">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.85%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="EN-US_TOPIC_0067360381__p4940942205210">Specifies the tag value.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0067360381__section15947192835118"><h4 class="sectiontitle">Example Request</h4><ul id="EN-US_TOPIC_0067360381__ul139094912220"><li id="EN-US_TOPIC_0067360381__li217416031278">Adding or modifying a tag (parameter: <strong id="EN-US_TOPIC_0067360381__b39185131392">tags</strong>)<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0067360381__screen2288784017451"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">PUT</span><span class="w"> </span><span class="n">https</span><span class="p">:</span><span class="c1">//{Endpoint}/v1/cloudimages/tags</span>
|
|
<span class="p">{</span>
|
|
<span class="w"> </span><span class="s">"image_id"</span><span class="p">:</span><span class="w"> </span><span class="s">"62a15f6c-9197-44d2-89c7-708981c1bec1"</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s">"tag"</span><span class="p">:</span><span class="w"> </span><span class="s">"aaaa.1111"</span>
|
|
<span class="p">}</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0067360381__li241742774618">Adding or modifying a tag (parameter: <strong id="EN-US_TOPIC_0067360381__b066261618394">image_tag</strong>)<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0067360381__screen3898857912558"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">PUT</span><span class="w"> </span><span class="n">https</span><span class="p">:</span><span class="c1">//{Endpoint}/v1/cloudimages/tags</span>
|
|
<span class="p">{</span>
|
|
<span class="w"> </span><span class="s">"image_id"</span><span class="p">:</span><span class="w"> </span><span class="s">"67437ebd-2563-46e0-887e-ad1923977fa1"</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s">"image_tag"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="s">"key"</span><span class="p">:</span><span class="s">"key1"</span><span class="p">,</span><span class="s">"value"</span><span class="p">:</span><span class="s">"value1"</span><span class="p">}</span>
|
|
<span class="p">}</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0067360381__section39788910173834"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0067360381__ul1784832371"><li id="EN-US_TOPIC_0067360381__li1578510323716">Response parameters<p id="EN-US_TOPIC_0067360381__p131516511175"><a name="EN-US_TOPIC_0067360381__li1578510323716"></a><a name="li1578510323716"></a>None</p>
|
|
</li><li id="EN-US_TOPIC_0067360381__li133341737077">Example response<pre class="codeblock" id="EN-US_TOPIC_0067360381__codeblock11389613162656">STATUS CODE 204</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0067360381__section44583302173851"><h4 class="sectiontitle">Returned Values</h4><ul id="EN-US_TOPIC_0067360381__ul3448649175051"><li id="EN-US_TOPIC_0067360381__li27186685175051">Normal<p id="EN-US_TOPIC_0067360381__p54643513175135"><a name="EN-US_TOPIC_0067360381__li27186685175051"></a><a name="li27186685175051"></a>204</p>
|
|
</li><li id="EN-US_TOPIC_0067360381__li21038684175140">Abnormal
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0067360381__table14374540175339" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0067360381__row16614073175339"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.6.2.2.1.1.3.1.1"><p id="EN-US_TOPIC_0067360381__p32064062175339">Returned Value</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.6.2.2.1.1.3.1.2"><p id="EN-US_TOPIC_0067360381__p47052264175339">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0067360381__row20817199175339"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0067360381__p32333240175448">400 Bad Request</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0067360381__p1746788175448">Request error.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0067360381__row1749657175339"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0067360381__p65449231175448">401 Unauthorized</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0067360381__p66896379175448">Authentication failed.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0067360381__row34986904175339"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0067360381__p46425689175448">403 Forbidden</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0067360381__p2384431175448">You do not have the rights to perform the operation.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0067360381__row62469322175339"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0067360381__p60528953175448">404 Not Found</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0067360381__p3898164175448">The requested resource was not found.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0067360381__row45180882175339"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0067360381__p23189406175448">500 Internal Server Error</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0067360381__p66402567175448">Internal service error.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0067360381__row40153247175339"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0067360381__p21980411175448">503 Service Unavailable</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0067360381__p35582892175448">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_0135481402.html">Image Tagging</a></div>
|
|
</div>
|
|
</div>
|
|
|