doc-exports/docs/smn/api-ref/smn_api_56006.html
Zaoxu, Li 152a7d9381 SMN API DOC
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>
2024-06-20 15:01:38 +00:00

134 lines
9.8 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.64%" id="mcps1.3.4.2.1.2.2.5.1.1"><p id="smn_api_56006__smn_api_56001_p1252612428129">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.11%" id="mcps1.3.4.2.1.2.2.5.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="21.2%" id="mcps1.3.4.2.1.2.2.5.1.3"><p id="smn_api_56006__smn_api_56001_p17526124281215">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.050000000000004%" id="mcps1.3.4.2.1.2.2.5.1.4"><p id="smn_api_56006__smn_api_56001_p12294162622414">Constraint</p>
</th>
</tr>
</thead>
<tbody><tr id="smn_api_56006__smn_api_56001_row1526194218129"><td class="cellrowborder" valign="top" width="20.64%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="smn_api_56006__smn_api_56001_p65262427126">key</p>
</td>
<td class="cellrowborder" valign="top" width="19.11%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="smn_api_56006__smn_api_56001_p35261242171216">String</p>
</td>
<td class="cellrowborder" valign="top" width="21.2%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="smn_api_56006__smn_api_56001_p552604213129">Tag key</p>
</td>
<td class="cellrowborder" valign="top" width="39.050000000000004%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="smn_api_56006__smn_api_56001_p6294172612244">A key can contain up to 36 Unicode characters. A key cannot be left blank.</p>
</td>
</tr>
<tr id="smn_api_56006__smn_api_56001_row55261142141216"><td class="cellrowborder" valign="top" width="20.64%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="smn_api_56006__smn_api_56001_p1852614219127">values</p>
</td>
<td class="cellrowborder" valign="top" width="19.11%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="smn_api_56006__smn_api_56001_p45262426129">String list</p>
</td>
<td class="cellrowborder" valign="top" width="21.2%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="smn_api_56006__smn_api_56001_p152694220126">Value list</p>
</td>
<td class="cellrowborder" valign="top" width="39.050000000000004%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="smn_api_56006__smn_api_56001_p18294152612244">Each value can contain up to 43 Unicode characters. If a value starts with an asterisk (*), the string following the asterisk is fuzzy-matched. The <strong id="smn_api_56006__b05806201767">values</strong> field cannot be missing, but can be an empty list. If it is empty, any value will be matched. Values are in the OR relationship.</p>
</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>