forked from docs/doc-exports
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com> Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com> Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
113 lines
9.6 KiB
HTML
113 lines
9.6 KiB
HTML
<a name="EN-US_TOPIC_0167811966"></a><a name="EN-US_TOPIC_0167811966"></a>
|
|
|
|
<h1 class="topictitle1">Querying Project Tags</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_section192222559445"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_en-us_topic_0070518924_p16454058112126">Projects are used to group and isolate OpenStack resources, which include computing, storage, and network resources. A project can be a department or a team. Multiple projects can be created for the same account.</p>
|
|
<p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p174297413217">This API is used to query all tags used by a user in a specified project.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_section222245513448"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p67221155165016">GET /v1/{project_id}/cloudservers/tags</p>
|
|
<div class="p" id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p862375810505"><a href="#EN-US_TOPIC_0167811966__table1169019216279">Table 1</a> describes the parameters in the URI.
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0167811966__table1169019216279"></a><a name="table1169019216279"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0167811966__table1169019216279" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0167811966__row5690112102720"><th align="left" class="cellrowborder" valign="top" width="25.302530253025303%" id="mcps1.3.2.3.2.2.4.1.1"><p id="EN-US_TOPIC_0167811966__p19318191414273">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="21.732173217321733%" id="mcps1.3.2.3.2.2.4.1.2"><p id="EN-US_TOPIC_0167811966__p13185140278">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="52.96529652965296%" id="mcps1.3.2.3.2.2.4.1.3"><p id="EN-US_TOPIC_0167811966__p5318121411273">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0167811966__row1769010217277"><td class="cellrowborder" valign="top" width="25.302530253025303%" headers="mcps1.3.2.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0167811966__p5318131452713">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.732173217321733%" headers="mcps1.3.2.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0167811966__p17318814142720">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="52.96529652965296%" headers="mcps1.3.2.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0167811966__p1031811142271">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_section625475584419"><h4 class="sectiontitle">Request</h4><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p332814266515">None</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_section1825415515447"><h4 class="sectiontitle">Response</h4><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p13879133385113"><a href="#EN-US_TOPIC_0167811966__table14618153352714">Table 2</a> describes the response parameters.</p>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0167811966__table14618153352714"></a><a name="table14618153352714"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0167811966__table14618153352714" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0167811966__row2618133332719"><th align="left" class="cellrowborder" valign="top" width="22.422242224222423%" id="mcps1.3.4.3.2.4.1.1"><p id="EN-US_TOPIC_0167811966__p150940182718">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="31.48314831483148%" id="mcps1.3.4.3.2.4.1.2"><p id="EN-US_TOPIC_0167811966__p350840122718">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="46.09460946094609%" id="mcps1.3.4.3.2.4.1.3"><p id="EN-US_TOPIC_0167811966__p10508403271">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0167811966__row136181633202712"><td class="cellrowborder" valign="top" width="22.422242224222423%" headers="mcps1.3.4.3.2.4.1.1 "><p id="EN-US_TOPIC_0167811966__p1501040202719">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.48314831483148%" headers="mcps1.3.4.3.2.4.1.2 "><p id="EN-US_TOPIC_0167811966__p550124018279">Array of objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="46.09460946094609%" headers="mcps1.3.4.3.2.4.1.3 "><p id="EN-US_TOPIC_0167811966__p17509403273">Specifies the tag list. For details, see <a href="#EN-US_TOPIC_0167811966__en-us_topic_0102606094_table207611141174713">Table 3</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0167811966__en-us_topic_0102606094_table207611141174713"></a><a name="en-us_topic_0102606094_table207611141174713"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_table207611141174713" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="EN-US_TOPIC_0167811966__b512414216138">tag</strong> field description</caption><thead align="left"><tr id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_row157616415478"><th align="left" class="cellrowborder" valign="top" width="27%" id="mcps1.3.4.4.2.4.1.1"><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p1990563433715">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="28.999999999999996%" id="mcps1.3.4.4.2.4.1.2"><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p11905734183715">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="44%" id="mcps1.3.4.4.2.4.1.3"><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p169051234153715">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_row1476124114474"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.4.4.2.4.1.1 "><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p1048131744810">key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.999999999999996%" headers="mcps1.3.4.4.2.4.1.2 "><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p5481171719487">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44%" headers="mcps1.3.4.4.2.4.1.3 "><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p6894311152216">Specifies the tag key.</p>
|
|
<ul id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_ul16669204222215"><li id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_li466814217224">Contains a maximum of 36 Unicode characters.</li><li id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_li46681425221">Can only consist of digits, letters, hyphens (-), and underscores (_).</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_row4761184174717"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.4.4.2.4.1.1 "><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p048151716488">values</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.999999999999996%" headers="mcps1.3.4.4.2.4.1.2 "><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p1156632102520">Array of strings</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="44%" headers="mcps1.3.4.4.2.4.1.3 "><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p1662531514220">Specifies the tag value.</p>
|
|
<ul id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_ul18894121619234"><li id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_li389441602319">Contains a maximum of 43 Unicode characters.</li><li id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_li289441620239">Can be left blank.</li><li id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_li5894316162318">Can only consist of digits, letters, hyphens (-), and underscores (_).</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_section73711311115217"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0167811966__p8914253535">Query all tags used in a specified project.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_screen1336311553442">GET https://<em id="EN-US_TOPIC_0167811966__i5452131772714">{endpoint}</em>/v1/{project_id}/cloudservers/tags</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0167811966__section1828712235221"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="EN-US_TOPIC_0167811966__screen1430072392213">{
|
|
"tags": [
|
|
{
|
|
"key": "key1",
|
|
"values": [
|
|
"value1",
|
|
"value2"
|
|
]
|
|
},
|
|
{
|
|
"key": "key2",
|
|
"values": [
|
|
"value1",
|
|
"value2"
|
|
]
|
|
}
|
|
]
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_en-us_topic_0092803065_en-us_topic_0020212692_section22960139"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_en-us_topic_0092803065_en-us_topic_0020212692_p23670760">See <a href="en-us_topic_0022067716.html">Returned Values for General Requests</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_en-us_topic_0092803065_en-us_topic_0067161469_en-us_topic_0057973179_section23611955"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0167811966__en-us_topic_0102606094_p63654318524">See <a href="en-us_topic_0022067717.html">Error Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0108433461.html">Tag Management</a></div>
|
|
</div>
|
|
</div>
|
|
|