Files
doc-exports/docs/smn/api-ref/smn_api_56006.html
2025-12-11 08:04:34 +00:00

137 lines
11 KiB
HTML

<a name="smn_api_56006"></a><a name="smn_api_56006"></a>
<h1 class="topictitle1">Querying Tags in a Specified Project</h1>
<div id="body1523350913840"><div class="section" id="smn_api_56006__section4995141120217"><h4 class="sectiontitle">Description</h4><ul id="smn_api_56006__ul33304380203733"><li id="smn_api_56006__li51147505203733">API name<p id="smn_api_56006__p38624841203741"><a name="smn_api_56006__li51147505203733"></a><a name="li51147505203733"></a>GetProjectTags</p>
</li></ul>
<ul id="smn_api_56006__ul20998054203745"><li id="smn_api_56006__li46884910203750">Function<p id="smn_api_56006__p1316781217215"><a name="smn_api_56006__li46884910203750"></a><a name="li46884910203750"></a>Query all tags of a resource type in a specified project.</p>
</li></ul>
</div>
<div class="section" id="smn_api_56006__section1999581115219"><h4 class="sectiontitle">URI</h4><ul id="smn_api_56006__ul1316731216217"><li id="smn_api_56006__li016721216210">URI format<p id="smn_api_56006__p7167191215212"><a name="smn_api_56006__li016721216210"></a><a name="li016721216210"></a>GET /v2/{project_id}/{resource_type}/tags</p>
</li><li id="smn_api_56006__li1116710126211">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="smn_api_56006__table1710612152111" frame="border" border="1" rules="all"><thead align="left"><tr id="smn_api_56006__row5167161218218"><th align="left" class="cellrowborder" valign="top" width="21.84%" id="mcps1.3.2.2.2.1.1.5.1.1"><p id="smn_api_56006__p216712123213"><strong id="smn_api_56006__b1499417358">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.14%" id="mcps1.3.2.2.2.1.1.5.1.2"><p id="smn_api_56006__p616715121219"><strong id="smn_api_56006__b399418720517">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.54%" id="mcps1.3.2.2.2.1.1.5.1.3"><p id="smn_api_56006__p191671312162117"><strong id="smn_api_56006__b1599417710515">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="34.48%" id="mcps1.3.2.2.2.1.1.5.1.4"><p id="smn_api_56006__p11167171282115"><strong id="smn_api_56006__b6995772512">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="smn_api_56006__row61671612152120"><td class="cellrowborder" valign="top" width="21.84%" headers="mcps1.3.2.2.2.1.1.5.1.1 "><p id="smn_api_56006__p15167712142119">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="24.14%" headers="mcps1.3.2.2.2.1.1.5.1.2 "><p id="smn_api_56006__p816781216216">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.54%" headers="mcps1.3.2.2.2.1.1.5.1.3 "><p id="smn_api_56006__p716731217212">String</p>
</td>
<td class="cellrowborder" valign="top" width="34.48%" headers="mcps1.3.2.2.2.1.1.5.1.4 "><p id="smn_api_56006__p12167412162111">Project ID</p>
<p id="smn_api_56006__p118812918506">See <a href="smn_api_66000.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="smn_api_56006__row416718122211"><td class="cellrowborder" valign="top" width="21.84%" headers="mcps1.3.2.2.2.1.1.5.1.1 "><p id="smn_api_56006__p99531421797">resource_type</p>
</td>
<td class="cellrowborder" valign="top" width="24.14%" headers="mcps1.3.2.2.2.1.1.5.1.2 "><p id="smn_api_56006__p1495310421799">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.54%" headers="mcps1.3.2.2.2.1.1.5.1.3 "><p id="smn_api_56006__p149531342296">String</p>
</td>
<td class="cellrowborder" valign="top" width="34.48%" headers="mcps1.3.2.2.2.1.1.5.1.4 "><p id="smn_api_56006__p52661238184213">Resource type</p>
<p id="smn_api_56006__p1034904075316">Only <strong id="smn_api_56006__b337394918380">smn_topic</strong> (topic) is supported.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="smn_api_56006__section142631216210"><h4 class="sectiontitle">Request</h4><ul id="smn_api_56006__ul6167712122114"><li id="smn_api_56006__li7167412102115">Parameter description<p id="smn_api_56006__p6167131218212"><a name="smn_api_56006__li7167412102115"></a><a name="li7167412102115"></a>None</p>
</li></ul>
<ul id="smn_api_56006__ul71671712162118"><li id="smn_api_56006__li716751220214">Example request<pre class="screen" id="smn_api_56006__screen716771232110">GET https://{SMN_Endpoint}/v2/{project_id}/{resource_type}/tags</pre>
</li></ul>
</div>
<div class="section" id="smn_api_56006__section172616120211"><h4 class="sectiontitle">Response</h4><ul id="smn_api_56006__ul416719120217"><li id="smn_api_56006__li1216731216219">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="smn_api_56006__table1226141212116" frame="border" border="1" rules="all"><thead align="left"><tr id="smn_api_56006__row1167171216218"><th align="left" class="cellrowborder" valign="top" width="18.63%" id="mcps1.3.4.2.1.1.1.4.1.1"><p id="smn_api_56006__p016731216215"><strong id="smn_api_56006__b1599611714512">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.73%" id="mcps1.3.4.2.1.1.1.4.1.2"><p id="smn_api_56006__p131679120217"><strong id="smn_api_56006__b699617713512">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="53.64%" id="mcps1.3.4.2.1.1.1.4.1.3"><p id="smn_api_56006__p19167212182113"><strong id="smn_api_56006__b59961371853">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="smn_api_56006__row3167151282112"><td class="cellrowborder" valign="top" width="18.63%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="smn_api_56006__p8167151292115">tags</p>
</td>
<td class="cellrowborder" valign="top" width="27.73%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="smn_api_56006__p016751262114">Tags structure array</p>
</td>
<td class="cellrowborder" valign="top" width="53.64%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="smn_api_56006__p616718127213">Tag list. For details, see <a href="#smn_api_56006__table7893236124418">Table 1</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="smn_api_56006__table7893236124418"></a><a name="table7893236124418"></a><table cellpadding="4" cellspacing="0" summary="" id="smn_api_56006__table7893236124418" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Tags structure</caption><thead align="left"><tr id="smn_api_56006__smn_api_56001_row12526442141213"><th align="left" class="cellrowborder" valign="top" width="20.642064206420642%" id="mcps1.3.4.2.1.2.2.4.1.1"><p id="smn_api_56006__smn_api_56001_p1252612428129">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.48274827482748%" id="mcps1.3.4.2.1.2.2.4.1.2"><p id="smn_api_56006__smn_api_56001_p14526542121214"><strong id="smn_api_56006__b129977711512">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.87518751875187%" id="mcps1.3.4.2.1.2.2.4.1.3"><p id="smn_api_56006__smn_api_56001_p17526124281215">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="smn_api_56006__smn_api_56001_row1526194218129"><td class="cellrowborder" valign="top" width="20.642064206420642%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="smn_api_56006__smn_api_56001_p65262427126">key</p>
</td>
<td class="cellrowborder" valign="top" width="27.48274827482748%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="smn_api_56006__smn_api_56001_p35261242171216">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.87518751875187%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="smn_api_56006__p1220963865017">The tag key.</p>
<ul id="smn_api_56006__ul172097385507"><li id="smn_api_56006__li120943815508"><p id="smn_api_56006__p1220923810504"><a name="smn_api_56006__li120943815508"></a><a name="li120943815508"></a>A tag key can contain a maximum of 127 Unicode characters.</p>
</li><li id="smn_api_56006__li15209638125018"><p id="smn_api_56006__p12209103814505"><a name="smn_api_56006__li15209638125018"></a><a name="li15209638125018"></a><strong id="smn_api_56006__b85016410513">key</strong> cannot be left blank.</p>
</li></ul>
</td>
</tr>
<tr id="smn_api_56006__smn_api_56001_row55261142141216"><td class="cellrowborder" valign="top" width="20.642064206420642%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="smn_api_56006__smn_api_56001_p1852614219127">values</p>
</td>
<td class="cellrowborder" valign="top" width="27.48274827482748%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="smn_api_56006__smn_api_56001_p45262426129">String list</p>
</td>
<td class="cellrowborder" valign="top" width="51.87518751875187%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="smn_api_56006__p9209173813500">The list of tag values.</p>
<ul id="smn_api_56006__ul10209838125011"><li id="smn_api_56006__li162091538205013"><p id="smn_api_56006__p320973815014"><a name="smn_api_56006__li162091538205013"></a><a name="li162091538205013"></a>Each tag contains a maximum of 10 values.</p>
</li><li id="smn_api_56006__li1620943816504"><p id="smn_api_56006__p820903810506"><a name="smn_api_56006__li1620943816504"></a><a name="li1620943816504"></a>Each value must be unique.</p>
</li><li id="smn_api_56006__li1621012384502"><p id="smn_api_56006__p16210838155016"><a name="smn_api_56006__li1621012384502"></a><a name="li1621012384502"></a>Each value contains a maximum of 255 Unicode characters.</p>
</li><li id="smn_api_56006__li152105386506"><p id="smn_api_56006__p172107384508"><a name="smn_api_56006__li152105386506"></a><a name="li152105386506"></a>If <strong id="smn_api_56006__b045016542451">values</strong> is left blank, it defaults to <strong id="smn_api_56006__b19916175115449">any_value</strong>.</p>
</li><li id="smn_api_56006__li12109388508"><p id="smn_api_56006__p4210173817507"><a name="smn_api_56006__li12109388508"></a><a name="li12109388508"></a>Multiple values are linked by an OR operator, meaning only one needs to match.</p>
</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="smn_api_56006__ul1416771219217"><li id="smn_api_56006__li21671012162119">Example response<pre class="screen" id="smn_api_56006__screen13167812152110">{
"tags": [
{
"key": "key1",
"values": [
"value1",
"value2"
]
},
{
"key": "key2",
"values": [
"value1",
"value2"
]
}
]
}</pre>
</li></ul>
</div>
<div class="section" id="smn_api_56006__section242171292113"><h4 class="sectiontitle">Returned Value</h4><p id="smn_api_56006__p13638112411919">See <a href="smn_api_63002.html">Returned Value</a>.</p>
</div>
<div class="section" id="smn_api_56006__section73211020122511"><h4 class="sectiontitle">Error Codes</h4><p id="smn_api_56006__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>