doc-exports/docs/as/api-ref/as_06_1004.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

481 lines
38 KiB
HTML

<a name="as_06_1004"></a><a name="as_06_1004"></a>
<h1 class="topictitle1">Querying Resources by Tag</h1>
<div id="body1534918427193"><div class="section" id="as_06_1004__section8988193392019"><h4 class="sectiontitle">Function</h4><p id="as_06_1004__p1444123422011">This API is used to query resources in a project by tag.</p>
<p id="as_06_1004__p1044418349201">By default, resources and resource tags are in descending order of their creation time.</p>
</div>
<div class="section" id="as_06_1004__section109942333208"><h4 class="sectiontitle">URI</h4><p id="as_06_1004__p164451234132015">POST /autoscaling-api/v1/{project_id}/{resource_type}/resource_instances/action</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_1004__table12999833152012" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="as_06_1004__row4445123412011"><th align="left" class="cellrowborder" valign="top" width="24.752475247524753%" id="mcps1.3.2.3.2.5.1.1"><p id="as_06_1004__p104453340205"><strong id="as_06_1004__b8711161017462">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.861386138613863%" id="mcps1.3.2.3.2.5.1.2"><p id="as_06_1004__p1944523472016">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.85148514851485%" id="mcps1.3.2.3.2.5.1.3"><p id="as_06_1004__p104451334132013">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="46.53465346534653%" id="mcps1.3.2.3.2.5.1.4"><p id="as_06_1004__p1744553492017"><strong id="as_06_1004__b81182013174618">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_1004__row1445173413208"><td class="cellrowborder" valign="top" width="24.752475247524753%" headers="mcps1.3.2.3.2.5.1.1 "><p id="as_06_1004__p20445193416208">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.3.2.5.1.2 "><p id="as_06_1004__p1044573432019">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.85148514851485%" headers="mcps1.3.2.3.2.5.1.3 "><p id="as_06_1004__p1044543442012">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.53465346534653%" headers="mcps1.3.2.3.2.5.1.4 "><p id="as_06_1004__p36520930">Specifies the project ID.</p>
</td>
</tr>
<tr id="as_06_1004__row54459346209"><td class="cellrowborder" valign="top" width="24.752475247524753%" headers="mcps1.3.2.3.2.5.1.1 "><p id="as_06_1004__p94452346209">resource_type</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.3.2.5.1.2 "><p id="as_06_1004__p16445133414202">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.85148514851485%" headers="mcps1.3.2.3.2.5.1.3 "><p id="as_06_1004__p17445143422012">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.53465346534653%" headers="mcps1.3.2.3.2.5.1.4 "><p id="as_06_1004__p1344523422016">Specifies the resource type. An example value is <strong id="as_06_1004__b842352706134936">scaling_group_tag</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="as_06_1004__section231123103614"><h4 class="sectiontitle">Request Message</h4><ul id="as_06_1004__ul0926135753617"><li id="as_06_1004__li109263572368">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_1004__table1471417579369" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="as_06_1004__row17927115773612"><th align="left" class="cellrowborder" valign="top" width="23%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="as_06_1004__p592716575364"><strong id="as_06_1004__b8215101434614">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="as_06_1004__p1992745711365">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="as_06_1004__p692717571364">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="as_06_1004__p1292775715360"><strong id="as_06_1004__b14371171517463">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_1004__row492755723618"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_1004__p29291657163610">tags</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_1004__p49294573369">No</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="as_06_1004__p6339193387">Array of <a href="#as_06_1004__table97581357153610">Tag</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="44%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_1004__p39291357123619">Specifies filter criteria with tags included. A maximum of 10 keys can be contained. The structure body must be complete. For details, see <a href="#as_06_1004__table97581357153610">Table 3</a>.</p>
</td>
</tr>
<tr id="as_06_1004__row69291557183612"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_1004__p5929135719369">tags_any</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_1004__p9929185713365">No</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="as_06_1004__p67901621165314">Array of <a href="#as_06_1004__table97581357153610">Tag</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="44%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_1004__p89311857143618">Specifies filter criteria with any tag included. A maximum of 10 keys can be contained. For details, see <a href="#as_06_1004__table97581357153610">Table 3</a>.</p>
</td>
</tr>
<tr id="as_06_1004__row1193195717364"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_1004__p11931175773612">not_tags</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_1004__p7931185717366">No</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="as_06_1004__p112727234533">Array of <a href="#as_06_1004__table97581357153610">Tag</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="44%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_1004__p1193114572362">Specifies filter criteria without tags included. A maximum of 10 keys can be contained. For details, see <a href="#as_06_1004__table97581357153610">Table 3</a>.</p>
</td>
</tr>
<tr id="as_06_1004__row139311757103615"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_1004__p593165793610">not_tags_any</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_1004__p793135753619">No</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="as_06_1004__p139314577367">Array of <a href="#as_06_1004__table97581357153610">Tag</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="44%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_1004__p393175733615">Specifies filter criteria without any tag included. A maximum of 10 keys can be contained. For details, see <a href="#as_06_1004__table97581357153610">Table 3</a>.</p>
</td>
</tr>
<tr id="as_06_1004__row20931175753613"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_1004__p893116571366">limit</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_1004__p16931195712367">No</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="as_06_1004__p1293185733610">String</p>
</td>
<td class="cellrowborder" valign="top" width="44%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_1004__p2931145719365">Specifies the maximum number of query records. The maximum value is 1,000, and the minimum value is 1.</p>
<ul id="as_06_1004__ul1965214204415"><li id="as_06_1004__li176521120344">If <strong id="as_06_1004__b12996834131413">action</strong> is set to <strong id="as_06_1004__b899715342142">count</strong>, this parameter is invalid.</li><li id="as_06_1004__li166529201741">If <strong id="as_06_1004__b17426216154">action</strong> is set to <strong id="as_06_1004__b1942612191515">filter</strong>, the default value is <strong id="as_06_1004__b1942721111516">1000</strong>.</li></ul>
</td>
</tr>
<tr id="as_06_1004__row54711651114714"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_1004__p1947235124719">marker</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_1004__p1447214513471">No</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="as_06_1004__p4472175112473">String</p>
</td>
<td class="cellrowborder" valign="top" width="44%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_1004__p12472145114717">Marks the paging location (index position). You are advised to use the <strong id="as_06_1004__b842352706203932">offset</strong> parameter to set the index position.</p>
<p id="as_06_1004__p51941230114617">Marks the paging location (resource ID or index location).</p>
</td>
</tr>
<tr id="as_06_1004__row1293195719364"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_1004__p17931185720363">action</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_1004__p29311857153619">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="as_06_1004__p1593195773618">String</p>
</td>
<td class="cellrowborder" valign="top" width="44%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_1004__p176016363494">Specifies the operation, which can be <strong>filter</strong> or <strong>count</strong>.</p>
<ul id="as_06_1004__ul9874843105817"><li id="as_06_1004__li687484312584"><strong id="as_06_1004__b1519710317171">filter</strong>: indicates that resources are filtered by tag and the resources meeting the search criteria are returned on pages.</li><li id="as_06_1004__li2368104613585"><strong>count</strong>: indicates that resources are searched by tag and the number of resources meeting the search criteria is returned.</li></ul>
</td>
</tr>
<tr id="as_06_1004__row4931195763619"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_1004__p39311257183614">offset</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_1004__p18931195718362">No</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="as_06_1004__p3931205714368">String</p>
</td>
<td class="cellrowborder" valign="top" width="44%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_1004__p6931125716366">Specifies the index position. The query starts from the next image indexed by this parameter. The value must be a non-negative number.</p>
<p id="as_06_1004__p4931135712361">You do not need to specify this parameter when querying resources on the first page. When you query resources on subsequent pages, set <strong id="as_06_1004__b842352706101324">offset</strong> to the location returned in the response body for the previous query.</p>
<ul id="as_06_1004__ul129511127259"><li id="as_06_1004__li39520271254">If the <strong>action</strong> value is <strong>count</strong>, this parameter is invalid.</li><li id="as_06_1004__li189551327757">If the <strong>action</strong> value is <strong>filter</strong>, the default value is <strong>0</strong>.</li></ul>
</td>
</tr>
<tr id="as_06_1004__row2931457143620"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_1004__p793117579363">matches</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_1004__p893115714366">No</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="as_06_1004__p92701328105314">Array of <a href="#as_06_1004__table197711657123614">match</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="44%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_1004__p16931185753618">Specifies fuzzy search. For details, see <a href="#as_06_1004__table197711657123614">Table 4</a>.</p>
</td>
</tr>
<tr id="as_06_1004__row13801745211"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_1004__p680112482118">without_any_tag</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_1004__p195199423237">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="as_06_1004__p168021748212">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="44%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_1004__p1480219422119">If this parameter is set to <strong id="as_06_1004__b557910266530">true</strong>, all resources without tags are queried. In this case, the <strong id="as_06_1004__b6580526185310">tags</strong>, <strong id="as_06_1004__b258019261538">tags_any</strong>, <strong id="as_06_1004__b105801926185316">not_tags</strong>, and <strong id="as_06_1004__b35821126185314">not_tags_any</strong> fields are ignored.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="as_06_1004__table97581357153610"></a><a name="table97581357153610"></a><table cellpadding="4" cellspacing="0" summary="" id="as_06_1004__table97581357153610" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="as_06_1004__b6699296094725">Tag</strong> field description</caption><thead align="left"><tr id="as_06_1004__row69331457153611"><th align="left" class="cellrowborder" valign="top" width="20.792079207920793%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="as_06_1004__p693345718361">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.782178217821784%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="as_06_1004__p5933115763614">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.81188118811881%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="as_06_1004__p6933145703618">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="38.613861386138616%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="as_06_1004__p1793355718363">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_1004__row12933757103612"><td class="cellrowborder" valign="top" width="20.792079207920793%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="as_06_1004__p209331557143618">key</p>
</td>
<td class="cellrowborder" valign="top" width="21.782178217821784%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="as_06_1004__p4933165713368">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.81188118811881%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="as_06_1004__p7933195763613">String</p>
</td>
<td class="cellrowborder" valign="top" width="38.613861386138616%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="as_06_1004__p199337572361">Specifies the tag key. It contains a maximum of 127 Unicode characters. It cannot be left blank (This parameter is not verified in the search process.) A maximum of 10 keys are allowed and the key cannot be left blank or an empty string. Each key must be unique.</p>
</td>
</tr>
<tr id="as_06_1004__row79331657143613"><td class="cellrowborder" valign="top" width="20.792079207920793%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="as_06_1004__p89332574369">values</p>
</td>
<td class="cellrowborder" valign="top" width="21.782178217821784%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="as_06_1004__p1093395715360">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.81188118811881%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="as_06_1004__p2933105713361">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="38.613861386138616%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="as_06_1004__p199331757103618">Specifies tag values. A value contains a maximum of 255 Unicode characters. A key contains a maximum of 10 values. Each value of the same key must be unique.</p>
<ul id="as_06_1004__ul12336293017"><li id="as_06_1004__li4233172173018">The asterisk (*) is reserved for the system. If the value starts with *, it indicates that fuzzy match is performed for the digits following *. The value cannot contain only asterisks (*).</li><li id="as_06_1004__li1923352183010">If the values are null (not default), it indicates <strong id="as_06_1004__b842352706175623">any_value</strong> (querying any value). The resources contain one or multiple values listed in <strong id="as_06_1004__b84235270619578">values</strong> will be found and displayed.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="as_06_1004__table197711657123614"></a><a name="table197711657123614"></a><table cellpadding="4" cellspacing="0" summary="" id="as_06_1004__table197711657123614" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="as_06_1004__b1632353617536">match</strong> field description</caption><thead align="left"><tr id="as_06_1004__row193510576361"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.1.3.2.5.1.1"><p id="as_06_1004__p12935457123615">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.3.2.1.3.2.5.1.2"><p id="as_06_1004__p5935155719369">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.1.3.2.5.1.3"><p id="as_06_1004__p179352572364">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="42%" id="mcps1.3.3.2.1.3.2.5.1.4"><p id="as_06_1004__p1693545723613">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_1004__row1793555733614"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.3.2.5.1.1 "><p id="as_06_1004__p3935557143610">key</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.2.1.3.2.5.1.2 "><p id="as_06_1004__p6935757183612">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.1.3.2.5.1.3 "><p id="as_06_1004__p0935135718368">String</p>
</td>
<td class="cellrowborder" valign="top" width="42%" headers="mcps1.3.3.2.1.3.2.5.1.4 "><p id="as_06_1004__p23438378275">Specifies the key based on which to query resources.</p>
<p id="as_06_1004__p1047715257337">The parameter value can only be <strong id="as_06_1004__b84235270621544">resource_name</strong>.</p>
</td>
</tr>
<tr id="as_06_1004__row19935115723612"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.3.2.5.1.1 "><p id="as_06_1004__p13935857103611">value</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.2.1.3.2.5.1.2 "><p id="as_06_1004__p1935135783613">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.1.3.2.5.1.3 "><p id="as_06_1004__p1893515793616">String</p>
</td>
<td class="cellrowborder" valign="top" width="42%" headers="mcps1.3.3.2.1.3.2.5.1.4 "><p id="as_06_1004__p993518579366">Specifies the value. The value is a fixed dictionary value. A value contains a maximum of 255 Unicode characters. If the value is an empty string or <strong id="as_06_1004__b84235270616358">resource_id</strong>, exact match is used.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<ul id="as_06_1004__ul134698152370"><li id="as_06_1004__li3652114815459">Example request<ul id="as_06_1004__ul873814112465"><li id="as_06_1004__li54691815183718">Example request when <strong id="as_06_1004__b29775114112928">action</strong> is set to <strong id="as_06_1004__b66649438112928">filter</strong><p id="as_06_1004__p16691743914">This example shows how to query AS groups of a tenant using the following search criteria: including tag (key = <strong id="as_06_1004__b84235270621715">key1</strong> and value = <strong id="as_06_1004__b84235270621718">value</strong>), excluding tag (key = <strong id="as_06_1004__b203068894621730">key2</strong> and value = <strong id="as_06_1004__b98888917421730">value2</strong>), index position 100, and maximum number of records 100.</p>
<pre class="screen" id="as_06_1004__screen10570341134916">POST https: //{Endpoint}/autoscaling-api/v1/{project_id}/scaling_group_tag/resource_instances/action
{
"offset": "100",
"limit": "100",
"action": "filter",
"matches": [{
"key": "resource_name",
"value": "resource1"
}],
"not_tags": [{
"key": "key2",
"values": ["value2"]
}],
"tags": [{
"key": "key1",
"values": ["value1"]
}]
}</pre>
</li></ul>
<ul id="as_06_1004__ul1984123715517"><li id="as_06_1004__li1865163312397">Example request when <strong id="as_06_1004__b84235270620353">action</strong> is set to <strong id="as_06_1004__b84235270620359">count</strong><div class="p" id="as_06_1004__p1891134133913">This example shows how to query the number of AS groups for a tenant using the following search criteria: including the tag (key = <strong id="as_06_1004__b842352706205844">key1</strong> and value = <strong id="as_06_1004__b842352706205849">value</strong>) and excluding the tag (key = <strong id="as_06_1004__b2044495359205910">key2</strong> and value = <strong id="as_06_1004__b1017765232205910">value2</strong>).<pre class="screen" id="as_06_1004__screen940914675514">POST https: //{Endpoint}/autoscaling-api/v1/{project_id}/scaling_group_tag/resource_instances/action
{
"action": "count",
"not_tags": [{
"key": "key2",
"values": ["value2"]
}],
"tags": [{
"key": "key1",
"values": ["value1"]
},
{
"key": "key2",
"values": ["value1",
"value2"]
}],
"matches": [{
"key": "resource_name",
"value": "resource1"
}]
}</pre>
</div>
</li></ul>
</li></ul>
<div class="section" id="as_06_1004__section410163462018"><h4 class="sectiontitle">Response Message</h4><ul id="as_06_1004__ul16450434152011"><li id="as_06_1004__li7450153452016">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_1004__table711023482015" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response parameters</caption><thead align="left"><tr id="as_06_1004__row1445073415203"><th align="left" class="cellrowborder" valign="top" width="19.801980198019802%" id="mcps1.3.5.2.1.1.2.4.1.1"><p id="as_06_1004__p1345013341203"><strong id="as_06_1004__b245312016465">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.792079207920793%" id="mcps1.3.5.2.1.1.2.4.1.2"><p id="as_06_1004__p345023402015">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="59.4059405940594%" id="mcps1.3.5.2.1.1.2.4.1.3"><p id="as_06_1004__p12450123432019"><strong id="as_06_1004__b1357719218469">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_1004__row345063472018"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.5.2.1.1.2.4.1.1 "><p id="as_06_1004__p1445017347209">resources</p>
</td>
<td class="cellrowborder" valign="top" width="20.792079207920793%" headers="mcps1.3.5.2.1.1.2.4.1.2 "><p id="as_06_1004__p5688103535317">Array of <a href="#as_06_1004__table111211234112010">Resource</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.5.2.1.1.2.4.1.3 "><p id="as_06_1004__p1145083414205">Specifies tag resources. For details, see <a href="#as_06_1004__table111211234112010">Table 6</a>.</p>
</td>
</tr>
<tr id="as_06_1004__row0450103412209"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.5.2.1.1.2.4.1.1 "><p id="as_06_1004__p144501234162010">total_count</p>
</td>
<td class="cellrowborder" valign="top" width="20.792079207920793%" headers="mcps1.3.5.2.1.1.2.4.1.2 "><p id="as_06_1004__p1450203442017">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.5.2.1.1.2.4.1.3 "><p id="as_06_1004__p5450203492018">Specifies the total number of records. When <strong id="as_06_1004__b84235270621116">action</strong> is set to <strong id="as_06_1004__b84235270621123">count</strong>, only this parameter is returned. The values of <strong id="as_06_1004__b84235270621137">resources</strong> and <strong id="as_06_1004__b84235270621139">marker</strong> are not returned.</p>
</td>
</tr>
<tr id="as_06_1004__row54501434142018"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.5.2.1.1.2.4.1.1 "><p id="as_06_1004__p645015343201">marker</p>
</td>
<td class="cellrowborder" valign="top" width="20.792079207920793%" headers="mcps1.3.5.2.1.1.2.4.1.2 "><p id="as_06_1004__p184501934122015">String</p>
</td>
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.5.2.1.1.2.4.1.3 "><p id="as_06_1004__p4450193411206">Specifies the paging location identifier.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="as_06_1004__table111211234112010"></a><a name="table111211234112010"></a><table cellpadding="4" cellspacing="0" summary="" id="as_06_1004__table111211234112010" frame="border" border="1" rules="all"><caption><b>Table 6 </b><strong id="as_06_1004__b19767174972320">Resource</strong> field description</caption><thead align="left"><tr id="as_06_1004__row9451163414206"><th align="left" class="cellrowborder" valign="top" width="20.56794320567943%" id="mcps1.3.5.2.1.2.2.4.1.1"><p id="as_06_1004__p14511346203"><strong id="as_06_1004__b10531522134612">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.848015198480155%" id="mcps1.3.5.2.1.2.2.4.1.2"><p id="as_06_1004__p94511134162016">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="59.58404159584042%" id="mcps1.3.5.2.1.2.2.4.1.3"><p id="as_06_1004__p645120347202"><strong id="as_06_1004__b228712364616">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_1004__row1645113341207"><td class="cellrowborder" valign="top" width="20.56794320567943%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="as_06_1004__p045115340207">resource_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.848015198480155%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="as_06_1004__p645183462014">String</p>
</td>
<td class="cellrowborder" valign="top" width="59.58404159584042%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="as_06_1004__p445123452020">Specifies the resource ID.</p>
</td>
</tr>
<tr id="as_06_1004__row245143422017"><td class="cellrowborder" valign="top" width="20.56794320567943%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="as_06_1004__p1045193419201">resource_detail</p>
</td>
<td class="cellrowborder" valign="top" width="19.848015198480155%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="as_06_1004__p5451934112017">String</p>
</td>
<td class="cellrowborder" valign="top" width="59.58404159584042%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="as_06_1004__p84511434122018">Specifies the resource details.</p>
</td>
</tr>
<tr id="as_06_1004__row44511534162010"><td class="cellrowborder" valign="top" width="20.56794320567943%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="as_06_1004__p1451163419204">tags</p>
</td>
<td class="cellrowborder" valign="top" width="19.848015198480155%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="as_06_1004__p1840743875316">Array of <a href="#as_06_1004__table191301634112010">ResourceTag</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="59.58404159584042%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="as_06_1004__p6451183416202">Specifies tags. If there is no tag, <strong id="as_06_1004__b84235270620128">tags</strong> is taken as an empty array by default. For details, see <a href="#as_06_1004__table191301634112010">Table 7</a>.</p>
</td>
</tr>
<tr id="as_06_1004__row24511334152018"><td class="cellrowborder" valign="top" width="20.56794320567943%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="as_06_1004__p545193472015">resource_name</p>
</td>
<td class="cellrowborder" valign="top" width="19.848015198480155%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="as_06_1004__p1451203415202">String</p>
</td>
<td class="cellrowborder" valign="top" width="59.58404159584042%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="as_06_1004__p545143415205">Specifies the resource name. If there is no resource, this parameter is an empty string by default.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="as_06_1004__table191301634112010"></a><a name="table191301634112010"></a><table cellpadding="4" cellspacing="0" summary="" id="as_06_1004__table191301634112010" frame="border" border="1" rules="all"><caption><b>Table 7 </b><strong id="as_06_1004__b2113212460">ResourceTag</strong> field description</caption><thead align="left"><tr id="as_06_1004__row1345193422010"><th align="left" class="cellrowborder" valign="top" width="20.597940205979402%" id="mcps1.3.5.2.1.3.2.4.1.1"><p id="as_06_1004__p11451183418207"><strong id="as_06_1004__b1125412417467">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.81801819818018%" id="mcps1.3.5.2.1.3.2.4.1.2"><p id="as_06_1004__p545163412012">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="59.58404159584042%" id="mcps1.3.5.2.1.3.2.4.1.3"><p id="as_06_1004__p849215412315"><strong id="as_06_1004__b332122574610">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_1004__row44511934142014"><td class="cellrowborder" valign="top" width="20.597940205979402%" headers="mcps1.3.5.2.1.3.2.4.1.1 "><p id="as_06_1004__p124515342204">key</p>
</td>
<td class="cellrowborder" valign="top" width="19.81801819818018%" headers="mcps1.3.5.2.1.3.2.4.1.2 "><p id="as_06_1004__p945153410202">String</p>
</td>
<td class="cellrowborder" valign="top" width="59.58404159584042%" headers="mcps1.3.5.2.1.3.2.4.1.3 "><p id="as_06_1004__p84511234172016">Specifies the tag key. It contains a maximum of 36 Unicode characters.</p>
</td>
</tr>
<tr id="as_06_1004__row14525348204"><td class="cellrowborder" valign="top" width="20.597940205979402%" headers="mcps1.3.5.2.1.3.2.4.1.1 "><p id="as_06_1004__p14521346205">value</p>
</td>
<td class="cellrowborder" valign="top" width="19.81801819818018%" headers="mcps1.3.5.2.1.3.2.4.1.2 "><p id="as_06_1004__p84521034192012">String</p>
</td>
<td class="cellrowborder" valign="top" width="59.58404159584042%" headers="mcps1.3.5.2.1.3.2.4.1.3 "><p id="as_06_1004__p7452173452010">Specifies the tag value. It contains a maximum of 36 Unicode characters.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="as_06_1004__li8452193414207">Example response<ul id="as_06_1004__ul15662124395811"><li id="as_06_1004__li206561439145815">Example response when <strong id="as_06_1004__b842352706212033">action</strong> is set to <strong id="as_06_1004__b842352706212055">filter</strong><pre class="screen" id="as_06_1004__screen4995122612442">{
"resources": [{
"resource_id": "64af4b6f-ec51-4436-8004-7a8f30080c87",
"resource_detail": "SCALING_GROUP_TAG",
"tags": [{
"key": "key1","value": "value1"
}],
"resource_name": "as_scaling_group_1"
},
{
"resource_id": "7122ef51-604b-40e7-b9b2-1de4cd78dc60",
"resource_detail": "SCALING_GROUP_TAG",
"tags": [{
"key": "key1","value": "value1"
}],
"resource_name": "as_scaling_group_2"
}],
"marker": "2",
"total_count": 2
}</pre>
</li><li id="as_06_1004__li83611749145815">Example response when <strong id="as_06_1004__b57222443112928">action</strong> is set to <strong id="as_06_1004__b45239940112928">count</strong><pre class="screen" id="as_06_1004__screen13452103415201">{
"total_count": 1000
}</pre>
</li></ul>
</li></ul>
</div>
<div class="section" id="as_06_1004__section1014063418207"><h4 class="sectiontitle">Returned Values</h4><ul id="as_06_1004__ul9452434192010"><li id="as_06_1004__li945213349202">Normal<p id="as_06_1004__p54521734202013"><a name="as_06_1004__li945213349202"></a><a name="li945213349202"></a>200</p>
</li><li id="as_06_1004__li545218346208">Abnormal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_1004__table201401734152012" frame="border" border="1" rules="all"><thead align="left"><tr id="as_06_1004__row1545263412016"><th align="left" class="cellrowborder" valign="top" width="43.5%" id="mcps1.3.6.2.2.1.1.3.1.1"><p id="as_06_1004__p1345217348206">Returned Values</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="56.49999999999999%" id="mcps1.3.6.2.2.1.1.3.1.2"><p id="as_06_1004__p3452534172015">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_1004__row1145213349202"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p10453133482015">400 Bad Request</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p7453734182018">The server failed to process the request.</p>
</td>
</tr>
<tr id="as_06_1004__row124531734162018"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p745323452014">401 Unauthorized</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p745311349207">You must enter the username and password to access the requested page.</p>
</td>
</tr>
<tr id="as_06_1004__row745363415209"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p94538342202">403 Forbidden</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p54531634172011">You are forbidden to access the requested page.</p>
</td>
</tr>
<tr id="as_06_1004__row845333415205"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p1445311341204">404 Not Found</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p1245313492013">The server could not find the requested page.</p>
</td>
</tr>
<tr id="as_06_1004__row10453123410203"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p6453634112015">405 Method Not Allowed</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p5453123416202">You are not allowed to use the method specified in the request.</p>
</td>
</tr>
<tr id="as_06_1004__row2453123442011"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p1145383462016">406 Not Acceptable</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p445311345204">The response generated by the server could not be accepted by the client.</p>
</td>
</tr>
<tr id="as_06_1004__row1345313342201"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p5453034182015">407 Proxy Authentication Required</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p845383412016">You must use the proxy server for authentication to process the request.</p>
</td>
</tr>
<tr id="as_06_1004__row16453113411205"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p1045310349202">408 Request Timeout</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p174531634172017">The request timed out.</p>
</td>
</tr>
<tr id="as_06_1004__row164533343203"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p345317345207">409 Conflict</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p15453113482017">The request could not be processed due to a conflict.</p>
</td>
</tr>
<tr id="as_06_1004__row54531934172015"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p17453113419207">500 Internal Server Error</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p16453334112013">Failed to complete the request because of an internal service error.</p>
</td>
</tr>
<tr id="as_06_1004__row2453153411205"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p134531334142018">501 Not Implemented</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p1945317344206">Failed to complete the request because the server does not support the requested function.</p>
</td>
</tr>
<tr id="as_06_1004__row1345323452017"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p7453734172016">502 Bad Gateway</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p3453153482013">Failed to complete the request because the request is invalid.</p>
</td>
</tr>
<tr id="as_06_1004__row144532341208"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p174531334142013">503 Service Unavailable</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p64531334112011">Failed to complete the request because the system is unavailable.</p>
</td>
</tr>
<tr id="as_06_1004__row045314345204"><td class="cellrowborder" valign="top" width="43.5%" headers="mcps1.3.6.2.2.1.1.3.1.1 "><p id="as_06_1004__p145318348201">504 Gateway Timeout</p>
</td>
<td class="cellrowborder" valign="top" width="56.49999999999999%" headers="mcps1.3.6.2.2.1.1.3.1.2 "><p id="as_06_1004__p0454734182019">A gateway timeout error occurred.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="as_06_1004__section17669131616110"><h4 class="sectiontitle">Error Codes</h4><p id="as_06_1004__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>