doc-exports/docs/as/api-ref/as_06_1002.html
guoyanyan 31704f0318 as_api_0325
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Co-authored-by: guoyanyan <guoyanyan3@huawei.com>
Co-committed-by: guoyanyan <guoyanyan3@huawei.com>
2023-04-13 08:59:32 +00:00

219 lines
16 KiB
HTML

<a name="as_06_1002"></a><a name="as_06_1002"></a>
<h1 class="topictitle1">Querying Tags of a Resource</h1>
<div id="body1500262816659"><div class="section" id="as_06_1002__section29924782114441"><h4 class="sectiontitle">Function</h4><p id="as_06_1002__p7988290114441">This interface is used to query tags of a specified resource in a project.</p>
</div>
<div class="section" id="as_06_1002__section4785746114441"><h4 class="sectiontitle">URI</h4><p id="as_06_1002__p59442901114441">GET /autoscaling-api/v1/{project_id}/{resource_type}/{resource_id}/tags</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_1002__table50145657114441" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="as_06_1002__row58197975114441"><th align="left" class="cellrowborder" valign="top" width="19.191919191919194%" id="mcps1.3.2.3.2.5.1.1"><p id="as_06_1002__p16415567114441"><strong id="as_06_1002__b16639103319446">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.191919191919194%" id="mcps1.3.2.3.2.5.1.2"><p id="as_06_1002__p54592535114441">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.141414141414144%" id="mcps1.3.2.3.2.5.1.3"><p id="as_06_1002__p59919191114441">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="47.474747474747474%" id="mcps1.3.2.3.2.5.1.4"><p id="as_06_1002__p21616312114441"><strong id="as_06_1002__b116023414446">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_1002__row6090849114441"><td class="cellrowborder" valign="top" width="19.191919191919194%" headers="mcps1.3.2.3.2.5.1.1 "><p id="as_06_1002__p23596795114441">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.191919191919194%" headers="mcps1.3.2.3.2.5.1.2 "><p id="as_06_1002__p32292270114441">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.141414141414144%" headers="mcps1.3.2.3.2.5.1.3 "><p id="as_06_1002__p65537057114441">String</p>
</td>
<td class="cellrowborder" valign="top" width="47.474747474747474%" headers="mcps1.3.2.3.2.5.1.4 "><p id="as_06_1002__p36520930">Specifies the project ID.</p>
</td>
</tr>
<tr id="as_06_1002__row62112352114441"><td class="cellrowborder" valign="top" width="19.191919191919194%" headers="mcps1.3.2.3.2.5.1.1 "><p id="as_06_1002__p65044652114441">resource_type</p>
</td>
<td class="cellrowborder" valign="top" width="19.191919191919194%" headers="mcps1.3.2.3.2.5.1.2 "><p id="as_06_1002__p34125427114441">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.141414141414144%" headers="mcps1.3.2.3.2.5.1.3 "><p id="as_06_1002__p12696223114441">String</p>
</td>
<td class="cellrowborder" valign="top" width="47.474747474747474%" headers="mcps1.3.2.3.2.5.1.4 "><p id="as_06_1002__p8757171112548">Specifies the resource type. The option is as follows:</p>
<p id="as_06_1002__p92021825131918"><strong id="as_06_1002__b128127271409">scaling_group_tag</strong>: indicates that the resource type is AS groups.</p>
</td>
</tr>
<tr id="as_06_1002__row61632861114441"><td class="cellrowborder" valign="top" width="19.191919191919194%" headers="mcps1.3.2.3.2.5.1.1 "><p id="as_06_1002__p26205811114441">resource_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.191919191919194%" headers="mcps1.3.2.3.2.5.1.2 "><p id="as_06_1002__p42295946114441">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.141414141414144%" headers="mcps1.3.2.3.2.5.1.3 "><p id="as_06_1002__p3419593114441">String</p>
</td>
<td class="cellrowborder" valign="top" width="47.474747474747474%" headers="mcps1.3.2.3.2.5.1.4 "><p id="as_06_1002__p8551641114441">Specifies the resource ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="as_06_1002__section21594338114441"><h4 class="sectiontitle">Request Message</h4><ul id="as_06_1002__ul9007507"><li id="as_06_1002__li56913160">Request parameters<p id="as_06_1002__p60400126203515"><a name="as_06_1002__li56913160"></a><a name="li56913160"></a>None</p>
</li><li id="as_06_1002__li3640858994017">Example request<p id="as_06_1002__p15614505203519"><a name="as_06_1002__li3640858994017"></a><a name="li3640858994017"></a>This example shows how to query the tags of the AS group with ID <strong id="as_06_1002__b142785322044">e5d27f5c-dd76-4a61-b4bc-a67c5686719a</strong>.</p>
<pre class="screen" id="as_06_1002__screen1857223373817">GET https://{Endpoint}/autoscaling-api/v1/{project_id}/scaling_group_tag/e5d27f5c-dd76-4a61-b4bc-a67c5686719a/tags</pre>
</li></ul>
</div>
<div class="section" id="as_06_1002__section38798307114441"><h4 class="sectiontitle">Response Message</h4><ul id="as_06_1002__ul55655135114441"><li id="as_06_1002__li31134174114441">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_1002__table11772112114441" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response parameters</caption><thead align="left"><tr id="as_06_1002__row26751727114441"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.1.1.2.4.1.1"><p id="as_06_1002__p19406274114441"><strong id="as_06_1002__b1344643534416">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27%" id="mcps1.3.4.2.1.1.2.4.1.2"><p id="as_06_1002__p28404370114441">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="53%" id="mcps1.3.4.2.1.1.2.4.1.3"><p id="as_06_1002__p19052614114441"><strong id="as_06_1002__b82901636154418">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_1002__row66866759114441"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="as_06_1002__p47498364114441">tags</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="as_06_1002__p6339193387">Array of <a href="#as_06_1002__table64069331114716">ResourceTag</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="53%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="as_06_1002__p50312100114441">Specifies tags. For details, see <a href="#as_06_1002__table64069331114716">Table 3</a>.</p>
</td>
</tr>
<tr id="as_06_1002__row4141311201216"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="as_06_1002__p414118114121">sys_tags</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="as_06_1002__p791520713534">Array of <a href="#as_06_1002__table64069331114716">ResourceTag</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="53%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="as_06_1002__p1514111131210">Specifies system tags. For details, see <a href="#as_06_1002__table64069331114716">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="as_06_1002__table64069331114716"></a><a name="table64069331114716"></a><table cellpadding="4" cellspacing="0" summary="" id="as_06_1002__table64069331114716" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="as_06_1002__b6699296094725">ResourceTag</strong> field description</caption><thead align="left"><tr id="as_06_1002__row5644334114716"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.1.2.2.4.1.1"><p id="as_06_1002__p54537872114716">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="26%" id="mcps1.3.4.2.1.2.2.4.1.2"><p id="as_06_1002__p65628731114716">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54%" id="mcps1.3.4.2.1.2.2.4.1.3"><p id="as_06_1002__p14326995114716">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_1002__row19635960114716"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="as_06_1002__p1282573185716">key</p>
</td>
<td class="cellrowborder" valign="top" width="26%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="as_06_1002__p982511316573">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="as_06_1002__p168251231185711">Specifies the tag key.</p>
</td>
</tr>
<tr id="as_06_1002__row33928679114716"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="as_06_1002__p1882573110576">value</p>
</td>
<td class="cellrowborder" valign="top" width="26%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="as_06_1002__p482583120570">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="as_06_1002__p1882573111573">Specifies the tag values.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="as_06_1002__ul40133694114441"><li id="as_06_1002__li25658933114441">Example response<pre class="screen" id="as_06_1002__screen2595435211467"> {
"tags": [
{
"key": "ENV15",
"value": "ENV15"
},
{
"key": "ENV151",
"value": "ENV151"
},
{
"key": "ENV152",
"value": "ENV152"
}
],
"sys_tags": null
} </pre>
</li></ul>
</div>
<div class="section" id="as_06_1002__section18464239114441"><h4 class="sectiontitle">Returned Values</h4><ul id="as_06_1002__ul19208428114441"><li id="as_06_1002__li38658127114441">Normal<p id="as_06_1002__p12378825114441"><a name="as_06_1002__li38658127114441"></a><a name="li38658127114441"></a>200</p>
</li><li id="as_06_1002__li44300563114441">Abnormal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_1002__table63160750114441" frame="border" border="1" rules="all"><thead align="left"><tr id="as_06_1002__row4049738114441"><th align="left" class="cellrowborder" valign="top" width="43.69%" id="mcps1.3.5.2.2.1.1.3.1.1"><p id="as_06_1002__p59593393114441"><strong id="as_06_1002__b842352706175024">Returned Value</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="56.31%" id="mcps1.3.5.2.2.1.1.3.1.2"><p id="as_06_1002__p62335491114441"><strong id="as_06_1002__b84235270616929">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_1002__row16010026114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p21743758114441">400 Bad Request</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p16413974114441">The server failed to process the request.</p>
</td>
</tr>
<tr id="as_06_1002__row13508043114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p20409733114441">401 Unauthorized</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p42575704114441">You must enter the username and password to access the requested page.</p>
</td>
</tr>
<tr id="as_06_1002__row47637018114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p33393220114441">403 Forbidden</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p20496282114441">You are forbidden to access the requested page.</p>
</td>
</tr>
<tr id="as_06_1002__row50248818114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p43622454114441">404 Not Found</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p43757915114441">The server could not find the requested page.</p>
</td>
</tr>
<tr id="as_06_1002__row58276921114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p22810194114441">405 Method Not Allowed</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p35686431114441">You are not allowed to use the method specified in the request.</p>
</td>
</tr>
<tr id="as_06_1002__row52742429114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p44278356114441">406 Not Acceptable</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p29777075114441">The response generated by the server could not be accepted by the client.</p>
</td>
</tr>
<tr id="as_06_1002__row66667090114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p31325185114441">407 Proxy Authentication Required</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p54312045114441">You must use the proxy server for authentication to process the request.</p>
</td>
</tr>
<tr id="as_06_1002__row19046357114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p66359910114441">408 Request Timeout</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p6443624114441">The request timed out.</p>
</td>
</tr>
<tr id="as_06_1002__row57992618114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p66890520114441">409 Conflict</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p49423050114441">The request could not be processed due to a conflict.</p>
</td>
</tr>
<tr id="as_06_1002__row42154273114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p59052916114441">500 Internal Server Error</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p18556929114441">Failed to complete the request because an internal service error occurred.</p>
</td>
</tr>
<tr id="as_06_1002__row32794636114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p39119840114441">501 Not Implemented</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p14590465114441">Failed to complete the request because the server does not support the requested function.</p>
</td>
</tr>
<tr id="as_06_1002__row64205321114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p33248519114441">502 Bad Gateway</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p8775558114441">Failed to complete the request because the server has received an invalid response.</p>
</td>
</tr>
<tr id="as_06_1002__row11871166114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p22040352114441">503 Service Unavailable</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p40438103114441">Failed to complete the request because the system is currently unavailable.</p>
</td>
</tr>
<tr id="as_06_1002__row28398614114441"><td class="cellrowborder" valign="top" width="43.69%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_1002__p18586407114441">504 Gateway Timeout</p>
</td>
<td class="cellrowborder" valign="top" width="56.31%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_1002__p29104000114441">A gateway timeout error occurred.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="as_06_1002__section17669131616110"><h4 class="sectiontitle">Error Codes</h4><p id="as_06_1002__p172692548116">See <a href="as_07_0102.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="as_06_1000.html">Tags</a></div>
</div>
</div>