forked from docs/doc-exports
Reviewed-by: Bobkova, Natalia <natalia.bobkova@t-systems.com> Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com> Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
139 lines
11 KiB
HTML
139 lines
11 KiB
HTML
<a name="smn_api_56005"></a><a name="smn_api_56005"></a>
|
|
|
|
<h1 class="topictitle1">Querying Tags of a Topic</h1>
|
|
<div id="body1523350913840"><div class="section" id="smn_api_56005__section199791258152011"><h4 class="sectiontitle">Description</h4><ul id="smn_api_56005__ul33304380203733"><li id="smn_api_56005__li51147505203733">API name<p id="smn_api_56005__p38624841203741"><a name="smn_api_56005__li51147505203733"></a><a name="li51147505203733"></a>ListResourceTags</p>
|
|
</li></ul>
|
|
<ul id="smn_api_56005__ul20998054203745"><li id="smn_api_56005__li46884910203750">Function<p id="smn_api_56005__p11151185911205"><a name="smn_api_56005__li46884910203750"></a><a name="li46884910203750"></a>Query tags of a topic.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="smn_api_56005__section49791258162015"><h4 class="sectiontitle">URI</h4><ul id="smn_api_56005__ul2151185952010"><li id="smn_api_56005__li111511759172012">URI format<p id="smn_api_56005__p16151259192015"><a name="smn_api_56005__li111511759172012"></a><a name="li111511759172012"></a>GET /v2/{project_id}/{resource_type}/{resource_id}/tags</p>
|
|
</li><li id="smn_api_56005__li61517598208">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="smn_api_56005__table29791058162012" frame="border" border="1" rules="all"><thead align="left"><tr id="smn_api_56005__row17151155952013"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.2.2.1.1.5.1.1"><p id="smn_api_56005__p1915195972018"><strong id="smn_api_56005__b112541522174019">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.2.2.1.1.5.1.2"><p id="smn_api_56005__p3151105916206"><strong id="smn_api_56005__b6302182419405">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="23.61%" id="mcps1.3.2.2.2.1.1.5.1.3"><p id="smn_api_56005__p191517591201"><strong id="smn_api_56005__b030115252401">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="26.39%" id="mcps1.3.2.2.2.1.1.5.1.4"><p id="smn_api_56005__p1715185918204"><strong id="smn_api_56005__b16220192634014">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="smn_api_56005__row51511159172015"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.1.5.1.1 "><p id="smn_api_56005__p201511599202">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.1.5.1.2 "><p id="smn_api_56005__p21513598202">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.61%" headers="mcps1.3.2.2.2.1.1.5.1.3 "><p id="smn_api_56005__p215118592200">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="26.39%" headers="mcps1.3.2.2.2.1.1.5.1.4 "><p id="smn_api_56005__p5151115912205">Project ID</p>
|
|
<p id="smn_api_56005__p118812918506">See <a href="smn_api_66000.html">Obtaining a Project ID</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="smn_api_56005__row151511559172017"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.1.5.1.1 "><p id="smn_api_56005__p99531421797">resource_type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.1.5.1.2 "><p id="smn_api_56005__p1495310421799">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.61%" headers="mcps1.3.2.2.2.1.1.5.1.3 "><p id="smn_api_56005__p149531342296">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="26.39%" headers="mcps1.3.2.2.2.1.1.5.1.4 "><p id="smn_api_56005__p52661238184213">Resource type</p>
|
|
<p id="smn_api_56005__p1533013513535">Only <strong id="smn_api_56005__b747945183719">smn_topic</strong> (topic) is supported.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="smn_api_56005__row20151259132010"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.1.5.1.1 "><p id="smn_api_56005__p1363485413187">resource_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.1.5.1.2 "><p id="smn_api_56005__p463417547182">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.61%" headers="mcps1.3.2.2.2.1.1.5.1.3 "><p id="smn_api_56005__p7634195417180">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="26.39%" headers="mcps1.3.2.2.2.1.1.5.1.4 "><p id="smn_api_56005__p176341254201810">Resource ID</p>
|
|
<p id="smn_api_56005__p57491711103514">Obtain a resource ID:</p>
|
|
<ul id="smn_api_56005__ul111761720155610"><li id="smn_api_56005__smn_api_56002_li969342316131">Add <strong id="smn_api_56005__smn_api_56002_b1745003620">X-SMN-RESOURCEID-TYPE=name</strong> in the request header and set the resource ID to the topic name.</li><li id="smn_api_56005__smn_api_56002_li1669312233134">Call the <strong id="smn_api_56005__smn_api_56002_b84235270694340">GetResourceInstances</strong> API to obtain the resource ID.</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="smn_api_56005__section1799514588205"><h4 class="sectiontitle">Request</h4><ul id="smn_api_56005__ul151511859192015"><li id="smn_api_56005__li171518599206">Parameter description<p id="smn_api_56005__p61516597202"><a name="smn_api_56005__li171518599206"></a><a name="li171518599206"></a>None</p>
|
|
</li></ul>
|
|
<ul id="smn_api_56005__ul2151859162018"><li id="smn_api_56005__li1215105942017">Example request<pre class="screen" id="smn_api_56005__screen1415165916208">GET https://{SMN_Endpoint}/v2/{project_id}/{resource_type}/{resource_id}/tags</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="smn_api_56005__section799516585208"><h4 class="sectiontitle">Response</h4><ul id="smn_api_56005__ul6151145902018"><li id="smn_api_56005__li915117593203">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="smn_api_56005__table2010959142017" frame="border" border="1" rules="all"><thead align="left"><tr id="smn_api_56005__row141511359192017"><th align="left" class="cellrowborder" valign="top" width="20.51%" id="mcps1.3.4.2.1.1.1.4.1.1"><p id="smn_api_56005__p10151105918204"><strong id="smn_api_56005__b442811136417">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33%" id="mcps1.3.4.2.1.1.1.4.1.2"><p id="smn_api_56005__p515195922016"><strong id="smn_api_56005__b1161316157419">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="46.160000000000004%" id="mcps1.3.4.2.1.1.1.4.1.3"><p id="smn_api_56005__p201517594209"><strong id="smn_api_56005__b1899111674120">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="smn_api_56005__row17151559122015"><td class="cellrowborder" valign="top" width="20.51%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="smn_api_56005__p715119594207">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="smn_api_56005__p271610325517">Resource_tag structure array</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="46.160000000000004%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="smn_api_56005__p1815155919201">Tag list. For details, see <a href="#smn_api_56005__table1127111434346">Table 1</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="smn_api_56005__table1127111434346"></a><a name="table1127111434346"></a><table cellpadding="4" cellspacing="0" summary="" id="smn_api_56005__table1127111434346" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Resource_tag structure</caption><thead align="left"><tr id="smn_api_56005__smn_api_56001_row139311651171713"><th align="left" class="cellrowborder" valign="top" width="22.352235223522353%" id="mcps1.3.4.2.1.2.2.5.1.1"><p id="smn_api_56005__smn_api_56001_p993135161718">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="18.821882188218822%" id="mcps1.3.4.2.1.2.2.5.1.2"><p id="smn_api_56005__smn_api_56001_p13931451141710"><strong id="smn_api_56005__b2095064942">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15.291529152915292%" id="mcps1.3.4.2.1.2.2.5.1.3"><p id="smn_api_56005__smn_api_56001_p393125141712">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="43.53435343534354%" id="mcps1.3.4.2.1.2.2.5.1.4"><p id="smn_api_56005__smn_api_56001_p1715443212610">Constraint</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="smn_api_56005__smn_api_56001_row3931105113173"><td class="cellrowborder" valign="top" width="22.352235223522353%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="smn_api_56005__smn_api_56001_p17931145131711">key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.821882188218822%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="smn_api_56005__smn_api_56001_p16931751111714">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.291529152915292%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="smn_api_56005__smn_api_56001_p393175116171">Tag key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.53435343534354%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="smn_api_56005__smn_api_56001_p171314419267">A key can contain up to 36 Unicode characters, including only digits, letters, hyphens (-), and underscores (_). A key cannot be left blank, be an empty string, or start or end with a space.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="smn_api_56005__smn_api_56001_row39312515173"><td class="cellrowborder" valign="top" width="22.352235223522353%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="smn_api_56005__smn_api_56001_p09311651171711">value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.821882188218822%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="smn_api_56005__smn_api_56001_p14931751141720">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15.291529152915292%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="smn_api_56005__smn_api_56001_p159313515179">Tag value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="43.53435343534354%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="smn_api_56005__smn_api_56001_p344164632615">A value can contain up to 43 Unicode characters, including only digits, letters, hyphens (-), and underscores (_). A value can be an empty string, but it cannot start or end with a space.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="smn_api_56005__ul10151155932018"><li id="smn_api_56005__li11151195914208">Example response<pre class="screen" id="smn_api_56005__screen215115972018">{
|
|
"tags": [
|
|
{
|
|
"key": "key1",
|
|
"value": "value1"
|
|
},
|
|
{
|
|
"key": "key2",
|
|
"value": "value3"
|
|
}
|
|
]
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="smn_api_56005__section242171292113"><h4 class="sectiontitle">Returned Value</h4><p id="smn_api_56005__p13638112411919">See <a href="smn_api_63002.html">Returned Value</a>.</p>
|
|
</div>
|
|
<div class="section" id="smn_api_56005__section73211020122511"><h4 class="sectiontitle">Error Codes</h4><p id="smn_api_56005__p9759142919265">See <a href="smn_api_64000.html">Error Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="smn_api_56000.html">Resource Tag Operations</a></div>
|
|
</div>
|
|
</div>
|
|
|