Files
doc-exports/docs/sfs/api-ref/sfs_03_0004.html
lizaoxu 3bac3b88e8 sfs_api_251009
Reviewed-by: Muller, Martin <martin.muller@t-systems.com>
Co-authored-by: lizaoxu <lizaoxu@huawei.com>
Co-committed-by: lizaoxu <lizaoxu@huawei.com>
2025-12-03 13:51:09 +00:00

188 lines
17 KiB
HTML

<a name="sfs_03_0004"></a><a name="sfs_03_0004"></a>
<h1 class="topictitle1">Querying Tags of a Resource</h1>
<div id="body8662426"><div class="section" id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_section45644251387"><h4 class="sectiontitle">Function</h4><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p456422517384">This API is used to query tags of a specified resource.</p>
</div>
<div class="section" id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_section25643251387"><h4 class="sectiontitle">URI</h4><ul id="sfs_03_0004__en-us_topic_0000001840032718_ul14450165512518"><li id="sfs_03_0004__en-us_topic_0000001840032718_l0b44fa9cf5ac4d5ebf049e4fffe1a9ea">GET /v3/sfs/tms/{project_id}/file-systems/{resource_id}/tags</li></ul>
<ul id="sfs_03_0004__en-us_topic_0000001840032718_ub4aa0077165a4a2aaa86e70b7267710a"><li id="sfs_03_0004__en-us_topic_0000001840032718_l46cf58ab60f44ee1aa0706ecc81ea921">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="sfs_03_0004__en-us_topic_0000001840032718_t5f48f75db9b14c6cbfd2879dd1e7c8d1" frame="border" border="1" rules="all"><thead align="left"><tr id="sfs_03_0004__en-us_topic_0000001840032718_ree8732a49c9f4cbfa3cbd26bda2eb442"><th align="left" class="cellrowborder" valign="top" width="14.29%" id="mcps1.3.2.3.1.1.1.5.1.1"><p id="sfs_03_0004__en-us_topic_0000001840032718_p17124101410431">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.85%" id="mcps1.3.2.3.1.1.1.5.1.2"><p id="sfs_03_0004__en-us_topic_0000001840032718_p1612415146430">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.55%" id="mcps1.3.2.3.1.1.1.5.1.3"><p id="sfs_03_0004__en-us_topic_0000001840032718_p312416148432">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.31%" id="mcps1.3.2.3.1.1.1.5.1.4"><p id="sfs_03_0004__en-us_topic_0000001840032718_p3124181464318">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="sfs_03_0004__en-us_topic_0000001840032718_r7dc74f4a31004f8eb4e868a93369c8a0"><td class="cellrowborder" valign="top" width="14.29%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="sfs_03_0004__en-us_topic_0000001840032718_adf798e5d942b4301b652796bdf092f4a">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="sfs_03_0004__en-us_topic_0000001840032718_a2326f73739854b4fa1892e0648821849">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.55%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="sfs_03_0004__en-us_topic_0000001840032718_ac77b318c2668498189dbee0fbb5fdb09">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.31%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="sfs_03_0004__en-us_topic_0000001840032718_a7f191d8fed27458ba04d994b7c934b80">The project ID.</p>
</td>
</tr>
<tr id="sfs_03_0004__en-us_topic_0000001840032718_row2725171315228"><td class="cellrowborder" valign="top" width="14.29%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p1343202116229">resource_id</p>
</td>
<td class="cellrowborder" valign="top" width="14.85%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p1634419216229">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.55%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p23441821182211">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.31%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p183442215228">The resource ID, which is the name of a general purpose file system.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_section15569122523811"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request header parameters</caption><thead align="left"><tr id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_row1256922515381"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p18570025113819">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p5570202573816">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p1357014252386">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p75711025133813">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_row256972512383"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p65711252389">Content-type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p12571325143810">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p157122513816">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p19571172519388">The MIME type of the request body.</p>
<p id="sfs_03_0004__en-us_topic_0000001840032718_p288693716167">Example: application/json</p>
</td>
</tr>
<tr id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_row256918253384"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p20571112510387">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p1571172510389">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p1557262573812">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p17572112515388">The user token.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_section1957532520382"><h4 class="sectiontitle">Response Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="sfs_03_0004__en-us_topic_0000001840032718_table1876133702013" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response body parameters</caption><thead align="left"><tr id="sfs_03_0004__en-us_topic_0000001840032718_row1576133712015"><th align="left" class="cellrowborder" valign="top" width="20.19%" id="mcps1.3.4.2.2.5.1.1"><p id="sfs_03_0004__en-us_topic_0000001840032718_p1250719494204">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.869999999999997%" id="mcps1.3.4.2.2.5.1.2"><p id="sfs_03_0004__en-us_topic_0000001840032718_p175072497201">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.29%" id="mcps1.3.4.2.2.5.1.3"><p id="sfs_03_0004__en-us_topic_0000001840032718_p1650724916208">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.65%" id="mcps1.3.4.2.2.5.1.4"><p id="sfs_03_0004__en-us_topic_0000001840032718_p4507184914201">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="sfs_03_0004__en-us_topic_0000001840032718_row876183715209"><td class="cellrowborder" valign="top" width="20.19%" headers="mcps1.3.4.2.2.5.1.1 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p18507134962014">tags</p>
</td>
<td class="cellrowborder" valign="top" width="19.869999999999997%" headers="mcps1.3.4.2.2.5.1.2 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p450784919203">No</p>
</td>
<td class="cellrowborder" valign="top" width="20.29%" headers="mcps1.3.4.2.2.5.1.3 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p1950720493207">List&lt;<a href="sfs_03_0002.html#sfs_03_0002__en-us_topic_0000001886392461_table667613216170">resource_tag</a>&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="39.65%" headers="mcps1.3.4.2.2.5.1.4 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p14507104914209">The tag list. For details, see <a href="sfs_03_0002.html#sfs_03_0002__en-us_topic_0000001886392461_table667613216170">Table 3</a>.</p>
</td>
</tr>
<tr id="sfs_03_0004__en-us_topic_0000001840032718_row37633742017"><td class="cellrowborder" valign="top" width="20.19%" headers="mcps1.3.4.2.2.5.1.1 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p950704919204">sys_tags</p>
</td>
<td class="cellrowborder" valign="top" width="19.869999999999997%" headers="mcps1.3.4.2.2.5.1.2 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p145071249172014">No</p>
</td>
<td class="cellrowborder" valign="top" width="20.29%" headers="mcps1.3.4.2.2.5.1.3 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p550794952013">List&lt;<a href="sfs_03_0002.html#sfs_03_0002__en-us_topic_0000001886392461_table667613216170">resource_tag</a>&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="39.65%" headers="mcps1.3.4.2.2.5.1.4 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p11507184916204">The system tag list. This parameter is only available to users with the <strong id="sfs_03_0004__en-us_topic_0000001840032718_b12941413145911">op_service</strong> permission.</p>
<p id="sfs_03_0004__en-us_topic_0000001840032718_p15072497207">This field contains only one <strong id="sfs_03_0004__en-us_topic_0000001840032718_b1744193517017">resource_tag</strong> structure currently.</p>
<p id="sfs_03_0004__en-us_topic_0000001840032718_p145074492204">The key is fixed at <strong id="sfs_03_0004__en-us_topic_0000001840032718_b2010119451305">_sys_enterprise_project_id</strong>.</p>
<p id="sfs_03_0004__en-us_topic_0000001840032718_p350774919204">The value is the ID of an enterprise project. Value <strong id="sfs_03_0004__en-us_topic_0000001840032718_b16683194292011">0</strong> indicates the default enterprise project.</p>
<p id="sfs_03_0004__en-us_topic_0000001840032718_p184873392615">For details, see <a href="sfs_03_0002.html#sfs_03_0002__en-us_topic_0000001886392461_table667613216170">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_section45751825203817"><h4 class="sectiontitle">Example Request</h4><p id="sfs_03_0004__en-us_topic_0000001840032718_p1371916133458">Querying tags of a general purpose file system whose name is <strong id="sfs_03_0004__en-us_topic_0000001840032718_b54698216110">bucketName</strong> with the project ID <strong id="sfs_03_0004__en-us_topic_0000001840032718_b946918211211">c80a2157ba1d46c0825265947342077c</strong>:</p>
<pre class="screen" id="sfs_03_0004__en-us_topic_0000001840032718_screen1181631412359">GET https://{endpoint}/v3/sfs/tms/c80a2157ba1d46c0825265947342077c/file-systems/bucketName/tags</pre>
</div>
<div class="section" id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_section1057692523814"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="sfs_03_0004__en-us_topic_0000001840032718_screen14291683515">{
"tags":[
{
"key":"key1",
"value":"value1"
},
{
"key":"key2",
"value":"value2"
}
]
}</pre>
</div>
<div class="section" id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_section9576122583811"><h4 class="sectiontitle">Status Codes</h4><ul id="sfs_03_0004__en-us_topic_0000001840032718_ul3162613183218"><li id="sfs_03_0004__en-us_topic_0000001840032718_li17162131319327">Normal</li></ul>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="sfs_03_0004__en-us_topic_0000001840032718_table368724141513" frame="border" border="1" rules="all"><thead align="left"><tr id="sfs_03_0004__en-us_topic_0000001840032718_row8682024181510"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.3.1.3.1.1"><p id="sfs_03_0004__en-us_topic_0000001840032718_p12688246153">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.3.1.3.1.2"><p id="sfs_03_0004__en-us_topic_0000001840032718_p26822418151">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="sfs_03_0004__en-us_topic_0000001840032718_row168024161516"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.3.1.3.1.1 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p1168424141515">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.3.1.3.1.2 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p16817240155">Resource tags queried.</p>
</td>
</tr>
</tbody>
</table>
</div>
<ul id="sfs_03_0004__en-us_topic_0000001840032718_ul0640161683218"><li id="sfs_03_0004__en-us_topic_0000001840032718_li17640141673214">Abnormal</li></ul>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_row45761425133810"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.5.1.3.1.1"><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p105761225173813">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.5.1.3.1.2"><p id="sfs_03_0004__en-us_topic_0000001840032718_en-us_topic_0000001311071305_en-us_topic_0000001263239606_p12576112573812">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="sfs_03_0004__en-us_topic_0000001840032718_row20215812131416"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.5.1.3.1.1 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p141019302141">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.5.1.3.1.2 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p410630191412">Invalid tag parameter.</p>
</td>
</tr>
<tr id="sfs_03_0004__en-us_topic_0000001840032718_row1922211518149"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.5.1.3.1.1 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p610133041416">401</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.5.1.3.1.2 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p1510113071415">Certification failed.</p>
</td>
</tr>
<tr id="sfs_03_0004__en-us_topic_0000001840032718_row17969131741415"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.5.1.3.1.1 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p10102309145">403</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.5.1.3.1.2 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p710103010141">Authentication failed.</p>
</td>
</tr>
<tr id="sfs_03_0004__en-us_topic_0000001840032718_row7978112011418"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.5.1.3.1.1 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p1410183031417">404</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.5.1.3.1.2 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p910133017145">Resource not found.</p>
</td>
</tr>
<tr id="sfs_03_0004__en-us_topic_0000001840032718_row9668162716146"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.5.1.3.1.1 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p1610430181412">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.5.1.3.1.2 "><p id="sfs_03_0004__en-us_topic_0000001840032718_p41033016149">System error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="sfs_03_0001.html">Tags</a></div>
</div>
</div>