Files
doc-exports/docs/dws/api-ref/dws_02_0050.html
luhuayi fd5ee5dcd8 DWS API 20250722 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: luhuayi <luhuayi@huawei.com>
Co-committed-by: luhuayi <luhuayi@huawei.com>
2025-07-30 14:29:39 +00:00

160 lines
12 KiB
HTML

<a name="EN-US_TOPIC_0000002361650974"></a><a name="EN-US_TOPIC_0000002361650974"></a>
<h1 class="topictitle1">Querying Tags in a Project</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000002361650974__section967742317290"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000002361650974__p1677172311299">This API is used to query the tags of a project.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000002361650974__section10677123192911"><h4 class="sectiontitle">URI</h4><pre class="screen" id="EN-US_TOPIC_0000002361650974__screen1026194482910">GET /v1.0/{project_id}/tags</pre>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002361650974__table0678423182913" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002361650974__row5678172320292"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="EN-US_TOPIC_0000002361650974__p1567810239295">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="EN-US_TOPIC_0000002361650974__p15678923192912">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="EN-US_TOPIC_0000002361650974__p5678523192910">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="EN-US_TOPIC_0000002361650974__p136785236297">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002361650974__row7678623182911"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="EN-US_TOPIC_0000002361650974__p18678162312299">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="EN-US_TOPIC_0000002361650974__p17678162314299">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="EN-US_TOPIC_0000002361650974__p166781923132911">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="EN-US_TOPIC_0000002361650974__p467872312919"><strong id="EN-US_TOPIC_0000002361650974__b17731155517241">Definition</strong></p>
<p id="EN-US_TOPIC_0000002361650974__p126781523132918">Project ID. To obtain the value, see <a href="dws_02_0011.html">Obtaining a Project ID</a>.</p>
<p id="EN-US_TOPIC_0000002361650974__p136781123202913"><strong id="EN-US_TOPIC_0000002361650974__b1980651162519">Constraints</strong></p>
<p id="EN-US_TOPIC_0000002361650974__p467892317292">N/A</p>
<p id="EN-US_TOPIC_0000002361650974__p9678523142913"><strong id="EN-US_TOPIC_0000002361650974__b73371417132512">Range</strong></p>
<p id="EN-US_TOPIC_0000002361650974__p467972342914">N/A</p>
<p id="EN-US_TOPIC_0000002361650974__p3679182317297"><strong id="EN-US_TOPIC_0000002361650974__b389610212259">Default Value</strong></p>
<p id="EN-US_TOPIC_0000002361650974__p1167932392912">N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000002361650974__section12679202311291"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0000002361650974__p16798238294">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0000002361650974__section9679162342920"><h4 class="sectiontitle">Response Parameters</h4><p id="EN-US_TOPIC_0000002361650974__p16679142372915"><strong id="EN-US_TOPIC_0000002361650974__b1085392892519">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002361650974__en-us_topic_0000002375065777_en-us_topic_0000002340886604_response_ProjectTags" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response body parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002361650974__row3679523182915"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.1"><p id="EN-US_TOPIC_0000002361650974__p567992362918">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.2"><p id="EN-US_TOPIC_0000002361650974__p5679723162913">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.4.1.3"><p id="EN-US_TOPIC_0000002361650974__p1467913236292">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002361650974__row11679112315298"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="EN-US_TOPIC_0000002361650974__p4679123202911">tags</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="EN-US_TOPIC_0000002361650974__p16679102342917">Array of <a href="#EN-US_TOPIC_0000002361650974__en-us_topic_0000002375065777_en-us_topic_0000002340886604_response_ProjectTag">ProjectTag</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="EN-US_TOPIC_0000002361650974__p136791233296"><strong id="EN-US_TOPIC_0000002361650974__b42541318122513">Definition</strong></p>
<p id="EN-US_TOPIC_0000002361650974__p106801423102916">Tag object.</p>
<p id="EN-US_TOPIC_0000002361650974__p66801923142912"><strong id="EN-US_TOPIC_0000002361650974__b735972012515">Range</strong></p>
<p id="EN-US_TOPIC_0000002361650974__p156808237296">N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002361650974__en-us_topic_0000002375065777_en-us_topic_0000002340886604_response_ProjectTag"></a><a name="en-us_topic_0000002375065777_en-us_topic_0000002340886604_response_ProjectTag"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002361650974__en-us_topic_0000002375065777_en-us_topic_0000002340886604_response_ProjectTag" frame="border" border="1" rules="all"><caption><b>Table 3 </b>ProjectTag</caption><thead align="left"><tr id="EN-US_TOPIC_0000002361650974__row156801823102917"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.4.2.4.1.1"><p id="EN-US_TOPIC_0000002361650974__p1268092312917"><strong id="EN-US_TOPIC_0000002361650974__b491514475240">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.4.2.4.1.2"><p id="EN-US_TOPIC_0000002361650974__p16801823192915">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.4.2.4.1.3"><p id="EN-US_TOPIC_0000002361650974__p1768042317298">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002361650974__row4680523172910"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="EN-US_TOPIC_0000002361650974__p4680102392918">key</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="EN-US_TOPIC_0000002361650974__p86809231293">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="EN-US_TOPIC_0000002361650974__p1968013235299"><strong id="EN-US_TOPIC_0000002361650974__b14255131842513">Definition</strong></p>
<p id="EN-US_TOPIC_0000002361650974__p1468022302919">Key.</p>
<p id="EN-US_TOPIC_0000002361650974__p18680423172920"><strong id="EN-US_TOPIC_0000002361650974__b5360122062514">Range</strong></p>
<p id="EN-US_TOPIC_0000002361650974__p9680122372910">N/A</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002361650974__row15680112302919"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="EN-US_TOPIC_0000002361650974__p5680823172916">values</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="EN-US_TOPIC_0000002361650974__p468010236294">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="EN-US_TOPIC_0000002361650974__p18681142318294"><strong id="EN-US_TOPIC_0000002361650974__b16255151862515">Definition</strong></p>
<p id="EN-US_TOPIC_0000002361650974__p1868142319297">Value.</p>
<p id="EN-US_TOPIC_0000002361650974__p16681323182914"><strong id="EN-US_TOPIC_0000002361650974__b436014205253">Range</strong></p>
<p id="EN-US_TOPIC_0000002361650974__p11681112382911">N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000002361650974__section168117233298"><h4 class="sectiontitle">Example Request</h4><pre class="screen" id="EN-US_TOPIC_0000002361650974__screen1681122313293">GET https://{Endpoint}/v1.0/89cd04f168b84af6be287f71730fdb4b/tags</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000002361650974__section156812239296"><h4 class="sectiontitle">Example Responses</h4><p id="EN-US_TOPIC_0000002361650974__p16811423192919"><strong id="EN-US_TOPIC_0000002361650974__b2567122962518">Status code: 200</strong></p>
<p id="EN-US_TOPIC_0000002361650974__p146819230298">The project tags are queried successfully.</p>
<pre class="screen" id="EN-US_TOPIC_0000002361650974__screen968122392919">{
"tags" : [ {
"key" : "key",
"values" : [ "value-1", "value-2" ]
} ]
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000002361650974__section18686182302919"><h4 class="sectiontitle">Status Code</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002361650974__en-us_topic_0000002375065777_en-us_topic_0000002340886604_status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000002361650974__row1686142382911"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="EN-US_TOPIC_0000002361650974__p168682342919">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="EN-US_TOPIC_0000002361650974__p1568652318292">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002361650974__row10686112362920"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002361650974__p8686152392915">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002361650974__p186861823132910">The project tags are queried successfully.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002361650974__row1568652372914"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002361650974__p196871923152912">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002361650974__p16687323112919">Request error.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002361650974__row1268622310298"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002361650974__p56871323192915">401</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002361650974__p1668782310299">Authorization failed.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002361650974__row56861723192910"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002361650974__p10800182372919">403</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002361650974__p12800923122918">No operation permission.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002361650974__row166861223162919"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002361650974__p980082318291">404</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002361650974__p12800162362914">No resources found.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002361650974__row14686123112914"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002361650974__p380072362916">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002361650974__p580019235295">Internal service error.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002361650974__row16861723142918"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002361650974__p5801132310294">503</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002361650974__p98011423132916">Service unavailable.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_02_0045.html">Tag Management</a></div>
</div>
</div>