doc-exports/docs/csbs/api-ref/en-us_topic_0098635096.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_0098635096"></a><a name="EN-US_TOPIC_0098635096"></a>
<h1 class="topictitle1">Querying Tags of a Backup Policy</h1>
<div id="body1519724141413"><div class="section" id="EN-US_TOPIC_0098635096__section50368838"><h4 class="sectiontitle">Function</h4><p class="msonormal" id="EN-US_TOPIC_0098635096__p34691245">This API is used to query tags of a specific resource.</p>
<p class="msonormal" id="EN-US_TOPIC_0098635096__p43785757">TMS uses this API to query all tags of a specific resource.</p>
</div>
<div class="section" id="EN-US_TOPIC_0098635096__section50666366"><h4 class="sectiontitle">URI</h4><ul id="EN-US_TOPIC_0098635096__ul56985425"><li id="EN-US_TOPIC_0098635096__li43106784">URI format<p id="EN-US_TOPIC_0098635096__p52416742"><a name="EN-US_TOPIC_0098635096__li43106784"></a><a name="li43106784"></a>GET https://{endpoint}/v1/{project_id}/csbs_backup_policy/{resource_id}/tags</p>
</li><li id="EN-US_TOPIC_0098635096__li1988636">Request header
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0098635096__table17897732" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request header</caption><thead align="left"><tr id="EN-US_TOPIC_0098635096__row29912730"><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_0098635096__p209623317216">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="EN-US_TOPIC_0098635096__p15962193221">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="EN-US_TOPIC_0098635096__p99783315213">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="34%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="EN-US_TOPIC_0098635096__p6978835213">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0098635096__row42564588"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="EN-US_TOPIC_0098635096__p25179629">Content-type</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="EN-US_TOPIC_0098635096__p16198190187">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="EN-US_TOPIC_0098635096__p26284107">MIME type of the body in the request</p>
</td>
<td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="EN-US_TOPIC_0098635096__p47358524">application/json</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635096__row23573535"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="EN-US_TOPIC_0098635096__p30408220">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="EN-US_TOPIC_0098635096__p181961807811">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="EN-US_TOPIC_0098635096__p47146745">User token</p>
</td>
<td class="cellrowborder" valign="top" width="34%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="EN-US_TOPIC_0098635096__p25041524">-</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="EN-US_TOPIC_0098635096__ul1660410"><li id="EN-US_TOPIC_0098635096__li14943697">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0098635096__table275553" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0098635096__row10635570"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.3.1.1.2.5.1.1"><p id="EN-US_TOPIC_0098635096__p1011541116264">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.3.1.1.2.5.1.2"><p id="EN-US_TOPIC_0098635096__p101311711112614">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.3.1.1.2.5.1.3"><p id="EN-US_TOPIC_0098635096__p9131181117262">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.3.1.1.2.5.1.4"><p id="EN-US_TOPIC_0098635096__p313120110264">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0098635096__row16018178"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.2.5.1.1 "><p id="EN-US_TOPIC_0098635096__p22404047">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.2.5.1.2 "><p id="EN-US_TOPIC_0098635096__p2788537">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.2.5.1.3 "><p id="EN-US_TOPIC_0098635096__p24544935">String</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.2.5.1.4 "><p id="EN-US_TOPIC_0098635096__p65779720">Project ID</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635096__row37269850"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.2.5.1.1 "><p id="EN-US_TOPIC_0098635096__p66067912">resource_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.2.5.1.2 "><p id="EN-US_TOPIC_0098635096__p49900666">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.2.5.1.3 "><p id="EN-US_TOPIC_0098635096__p15422169">String</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.2.5.1.4 "><p id="EN-US_TOPIC_0098635096__p41236172">Resource ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0098635096__section53344112"><h4 class="sectiontitle">Request</h4><ul id="EN-US_TOPIC_0098635096__ul51795644"><li id="EN-US_TOPIC_0098635096__li63507614">Parameter description<p class="msonormal" id="EN-US_TOPIC_0098635096__p48243716247"><a name="EN-US_TOPIC_0098635096__li63507614"></a><a name="li63507614"></a>None</p>
</li></ul>
<ul id="EN-US_TOPIC_0098635096__ul59043505"><li id="EN-US_TOPIC_0098635096__li61629497">Example request<pre class="screen" id="EN-US_TOPIC_0098635096__screen152121217332">GET https://{endpoint}/v1/{project_id}/csbs_backup_policy/{resource_id}/tags</pre>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0098635096__section10334967"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0098635096__ul32073719"><li id="EN-US_TOPIC_0098635096__li20228022">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0098635096__table38104721" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0098635096__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_0098635096__p56621914152613">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_0098635096__p1366220148267">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_0098635096__p1366281418264">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0098635096__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_0098635096__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_0098635096__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_0098635096__p19182539">Tag list</p>
<p id="EN-US_TOPIC_0098635096__p13733391056">Keys in the tag list must be unique.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0098635096__li4220283">Parameter description of field <strong id="EN-US_TOPIC_0098635096__b84235270695528">resource_tag</strong>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0098635096__table61443009" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Parameter description of field <strong id="EN-US_TOPIC_0098635096__b423205116218">resource_tag</strong></caption><thead align="left"><tr id="EN-US_TOPIC_0098635096__row39972798"><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_0098635096__p8569102142610">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.470000000000002%" id="mcps1.3.4.2.2.2.2.4.1.2"><p id="EN-US_TOPIC_0098635096__p456952122610">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54.120000000000005%" id="mcps1.3.4.2.2.2.2.4.1.3"><p id="EN-US_TOPIC_0098635096__p14569112118269">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0098635096__row9701936"><td class="cellrowborder" valign="top" width="29.409999999999997%" headers="mcps1.3.4.2.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0098635096__p47659360">key</p>
</td>
<td class="cellrowborder" valign="top" width="16.470000000000002%" headers="mcps1.3.4.2.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0098635096__p35202932">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.120000000000005%" headers="mcps1.3.4.2.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0098635096__p13925135105714">Tag key</p>
<p id="EN-US_TOPIC_0098635096__p7327206587">It consists of up to 36 characters.</p>
<p id="EN-US_TOPIC_0098635096__p145821075819">It cannot be an empty string.</p>
<p id="EN-US_TOPIC_0098635096__p14766132412516">It can contain only letters, digits, hyphens (-), and underscores (_).</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635096__row27351677"><td class="cellrowborder" valign="top" width="29.409999999999997%" headers="mcps1.3.4.2.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0098635096__p893371">value</p>
</td>
<td class="cellrowborder" valign="top" width="16.470000000000002%" headers="mcps1.3.4.2.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0098635096__p5254266">List&lt;String&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="54.120000000000005%" headers="mcps1.3.4.2.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0098635096__p1966153512589">Tag value</p>
<p id="EN-US_TOPIC_0098635096__p8808725135910">It consists of up to 43 characters.</p>
<p id="EN-US_TOPIC_0098635096__p919321595">It can be an empty string.</p>
<p id="EN-US_TOPIC_0098635096__p14697173411355">It can contain only letters, digits, hyphens (-), and underscores (_).</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0098635096__li37978409">Example response<pre class="screen" id="EN-US_TOPIC_0098635096__screen8457152911335">{
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key2",
"value": "value3"
}
]
}</pre>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0098635096__section25905843"><h4 class="sectiontitle">Status Codes</h4><ul id="EN-US_TOPIC_0098635096__ul2911981"><li id="EN-US_TOPIC_0098635096__li26207835">Normal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0098635096__table34543924" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0098635096__row10296933"><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_0098635096__p28745279">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_0098635096__p46666290">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0098635096__row21873125"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.1.1.1.3.1.1 "><p id="EN-US_TOPIC_0098635096__p26892672">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_0098635096__p30822828">OK</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0098635096__li8970000">Abnormal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0098635096__table13621136" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0098635096__row14775484"><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_0098635096__p55963561">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_0098635096__p36754611">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0098635096__row24333505"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0098635096__p24856892">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_0098635096__p142347">Invalid parameters.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635096__row1281126"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0098635096__p36662351">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_0098635096__p16860416">Authentication failed.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635096__row17526019"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0098635096__p10321460">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_0098635096__p30731970">You do not have permission to perform this operation.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635096__row8152279"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0098635096__p56354875">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_0098635096__p1342126">The requested resource was not found.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0098635096__row12079142"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0098635096__p38886454">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_0098635096__p62795050">A system exception occurs.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0098635096__section61541938486"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0098635096__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>