doc-exports/docs/csbs/api-ref/en-us_topic_0098635090.html
Wei, Hongmin 8ce662c4dc CSBS API initial version
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Wei, Hongmin <weihongmin1@huawei.com>
Co-committed-by: Wei, Hongmin <weihongmin1@huawei.com>
2022-10-24 21:06:50 +00:00

207 lines
15 KiB
HTML

<a name="EN-US_TOPIC_0098635090"></a><a name="EN-US_TOPIC_0098635090"></a>
<h1 class="topictitle1">Querying Tags of a Backup Resource</h1>
<div id="body1519724141390"><div class="section" id="EN-US_TOPIC_0098635090__section27585226"><h4 class="sectiontitle">Function</h4><p class="msonormal" id="EN-US_TOPIC_0098635090__p34076028">This API is used to query tags of a specific resource.</p>
<p class="msonormal" id="EN-US_TOPIC_0098635090__p38248803">TMS uses this API to query all tags of a specific resource.</p>
</div>
<div class="section" id="EN-US_TOPIC_0098635090__section46940446"><h4 class="sectiontitle">URI</h4><ul id="EN-US_TOPIC_0098635090__ul11145359"><li id="EN-US_TOPIC_0098635090__li33199375">URI format<p id="EN-US_TOPIC_0098635090__p30358920"><a name="EN-US_TOPIC_0098635090__li33199375"></a><a name="li33199375"></a>GET https://{endpoint}/v1/{project_id}/csbs_backup/{resource_id}/tags</p>
</li><li id="EN-US_TOPIC_0098635090__li4794829">Request header
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0098635090__table43153461" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request header</caption><thead align="left"><tr id="EN-US_TOPIC_0098635090__row36921673"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="EN-US_TOPIC_0098635090__p209623317216">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="EN-US_TOPIC_0098635090__p15962193221">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="EN-US_TOPIC_0098635090__p99783315213">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="46%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="EN-US_TOPIC_0098635090__p6978835213">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0098635090__row5888712"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="EN-US_TOPIC_0098635090__p7223683">Content-type</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="EN-US_TOPIC_0098635090__p11602195813417">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="EN-US_TOPIC_0098635090__p48247463">MIME type of the body in the request</p>
</td>
<td class="cellrowborder" valign="top" width="46%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="EN-US_TOPIC_0098635090__p66202439">application/json</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635090__row58951042"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="EN-US_TOPIC_0098635090__p10305078">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="EN-US_TOPIC_0098635090__p176017582416">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="13%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="EN-US_TOPIC_0098635090__p29404983">User token</p>
</td>
<td class="cellrowborder" valign="top" width="46%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="EN-US_TOPIC_0098635090__p55218749">-</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="EN-US_TOPIC_0098635090__ul56259124"><li id="EN-US_TOPIC_0098635090__li36570070">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0098635090__table60695180" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0098635090__row17600446"><th align="left" class="cellrowborder" valign="top" width="26%" id="mcps1.3.2.3.1.1.2.5.1.1"><p id="EN-US_TOPIC_0098635090__p1182916596221">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.000000000000002%" id="mcps1.3.2.3.1.1.2.5.1.2"><p id="EN-US_TOPIC_0098635090__p1282965922217">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.000000000000002%" id="mcps1.3.2.3.1.1.2.5.1.3"><p id="EN-US_TOPIC_0098635090__p4829165962220">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="46%" id="mcps1.3.2.3.1.1.2.5.1.4"><p id="EN-US_TOPIC_0098635090__p1382965916225">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0098635090__row23907896"><td class="cellrowborder" valign="top" width="26%" headers="mcps1.3.2.3.1.1.2.5.1.1 "><p id="EN-US_TOPIC_0098635090__p57491423">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.2.3.1.1.2.5.1.2 "><p id="EN-US_TOPIC_0098635090__p26293678">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.2.3.1.1.2.5.1.3 "><p id="EN-US_TOPIC_0098635090__p49413198">String</p>
</td>
<td class="cellrowborder" valign="top" width="46%" headers="mcps1.3.2.3.1.1.2.5.1.4 "><p id="EN-US_TOPIC_0098635090__p65779720">Project ID</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635090__row32248040"><td class="cellrowborder" valign="top" width="26%" headers="mcps1.3.2.3.1.1.2.5.1.1 "><p id="EN-US_TOPIC_0098635090__p61954460">resource_id</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.2.3.1.1.2.5.1.2 "><p id="EN-US_TOPIC_0098635090__p52255327">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.2.3.1.1.2.5.1.3 "><p id="EN-US_TOPIC_0098635090__p4823132">String</p>
</td>
<td class="cellrowborder" valign="top" width="46%" headers="mcps1.3.2.3.1.1.2.5.1.4 "><p id="EN-US_TOPIC_0098635090__p55129401">Resource ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0098635090__section19810832"><h4 class="sectiontitle">Request</h4><ul id="EN-US_TOPIC_0098635090__ul36296478"><li id="EN-US_TOPIC_0098635090__li58232852">Parameter description<p class="msonormal" id="EN-US_TOPIC_0098635090__p1882623901017"><a name="EN-US_TOPIC_0098635090__li58232852"></a><a name="li58232852"></a>None</p>
</li></ul>
<ul id="EN-US_TOPIC_0098635090__ul38947106"><li id="EN-US_TOPIC_0098635090__li14979642">Example request<pre class="screen" id="EN-US_TOPIC_0098635090__screen1712123216303">GET https://{endpoint}/v1/{project_id}/csbs_backup/{resource_id}/tags</pre>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0098635090__section44079761"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0098635090__ul48523689"><li id="EN-US_TOPIC_0098635090__li34060019">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0098635090__table38104721" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0098635090__row42994491"><th align="left" class="cellrowborder" valign="top" width="30.23%" id="mcps1.3.4.2.1.1.2.4.1.1"><p id="EN-US_TOPIC_0098635090__p1065802122318">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.44%" id="mcps1.3.4.2.1.1.2.4.1.2"><p id="EN-US_TOPIC_0098635090__p1867313282314">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52.33%" id="mcps1.3.4.2.1.1.2.4.1.3"><p id="EN-US_TOPIC_0098635090__p186733215238">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0098635090__row26228182"><td class="cellrowborder" valign="top" width="30.23%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="EN-US_TOPIC_0098635090__p44108002">tags</p>
</td>
<td class="cellrowborder" valign="top" width="17.44%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="EN-US_TOPIC_0098635090__p15978406">List&lt;resource_tag&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="52.33%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="EN-US_TOPIC_0098635090__p19182539">Tag list</p>
<p id="EN-US_TOPIC_0098635090__p8594239348">Keys in the tag list must be unique.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0098635090__li38425129">Parameter description of field <strong id="EN-US_TOPIC_0098635090__b84235270695528">resource_tag</strong>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0098635090__table10281849" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Parameter description of field <strong id="EN-US_TOPIC_0098635090__b16755884208">resource_tag</strong></caption><thead align="left"><tr id="EN-US_TOPIC_0098635090__row58282180"><th align="left" class="cellrowborder" valign="top" width="29.409999999999997%" id="mcps1.3.4.2.2.2.2.4.1.1"><p id="EN-US_TOPIC_0098635090__p1447011814232">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.65%" id="mcps1.3.4.2.2.2.2.4.1.2"><p id="EN-US_TOPIC_0098635090__p64701185231">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52.94%" id="mcps1.3.4.2.2.2.2.4.1.3"><p id="EN-US_TOPIC_0098635090__p17470138152311">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0098635090__row65272389"><td class="cellrowborder" valign="top" width="29.409999999999997%" headers="mcps1.3.4.2.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0098635090__p52572118">key</p>
</td>
<td class="cellrowborder" valign="top" width="17.65%" headers="mcps1.3.4.2.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0098635090__p30483160">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.94%" headers="mcps1.3.4.2.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0098635090__p13925135105714">Tag key</p>
<p id="EN-US_TOPIC_0098635090__p7327206587">It consists of up to 36 characters.</p>
<p id="EN-US_TOPIC_0098635090__p145821075819">It cannot be an empty string.</p>
<p id="EN-US_TOPIC_0098635090__p14766132412516">It can contain only letters, digits, hyphens (-), and underscores (_).</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635090__row9189896"><td class="cellrowborder" valign="top" width="29.409999999999997%" headers="mcps1.3.4.2.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0098635090__p6184122">value</p>
</td>
<td class="cellrowborder" valign="top" width="17.65%" headers="mcps1.3.4.2.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0098635090__p31151897">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.94%" headers="mcps1.3.4.2.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0098635090__p1966153512589">Tag value</p>
<p id="EN-US_TOPIC_0098635090__p8808725135910">It consists of up to 43 characters.</p>
<p id="EN-US_TOPIC_0098635090__p919321595">It can be an empty string.</p>
<p id="EN-US_TOPIC_0098635090__p151956616313">It can contain only letters, digits, hyphens (-), and underscores (_).</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0098635090__li41108220">Example response<pre class="screen" id="EN-US_TOPIC_0098635090__screen74351940203010">{
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key2",
"value": "value3"
}
]
}</pre>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0098635090__section61173530"><h4 class="sectiontitle">Status Codes</h4><ul id="EN-US_TOPIC_0098635090__ul22940550"><li id="EN-US_TOPIC_0098635090__li5138363">Normal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0098635090__table46245271" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0098635090__row10252817"><th align="left" class="cellrowborder" valign="top" width="42.42%" id="mcps1.3.5.2.1.1.1.3.1.1"><p id="EN-US_TOPIC_0098635090__p25171847">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="57.58%" id="mcps1.3.5.2.1.1.1.3.1.2"><p id="EN-US_TOPIC_0098635090__p25653697">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0098635090__row64683559"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.1.1.1.3.1.1 "><p id="EN-US_TOPIC_0098635090__p4876963">200</p>
</td>
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.2.1.1.1.3.1.2 "><p id="EN-US_TOPIC_0098635090__p59489690">OK</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0098635090__li65645168">Abnormal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0098635090__table53935606" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0098635090__row58293474"><th align="left" class="cellrowborder" valign="top" width="42.42%" id="mcps1.3.5.2.2.1.1.3.1.1"><p id="EN-US_TOPIC_0098635090__p24150953">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="57.58%" id="mcps1.3.5.2.2.1.1.3.1.2"><p id="EN-US_TOPIC_0098635090__p10070168">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0098635090__row10377304"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0098635090__p35255313">400</p>
</td>
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0098635090__p37108074">Invalid parameters.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635090__row65537210"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0098635090__p6913766">401</p>
</td>
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0098635090__p23144199">Authentication failed.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635090__row6971207"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0098635090__p27796914">403</p>
</td>
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0098635090__p36957574">You do not have permission to perform this operation.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635090__row64182710"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0098635090__p31417017">404</p>
</td>
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0098635090__p61750457">The requested resource was not found.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635090__row18883203"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0098635090__p53144456">500</p>
</td>
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0098635090__p9733694">A system exception occurs.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0098635090__section61541938486"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0098635090__p999593594811">For details, see <a href="en-us_topic_0071888297.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0098466174.html">Tag Management</a></div>
</div>
</div>