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

194 lines
15 KiB
HTML

<a name="as_06_0412"></a><a name="as_06_0412"></a>
<h1 class="topictitle1">Batch Managing AS Policies</h1>
<div id="body1523241658754"><div class="section" id="as_06_0412__section10263773"><h4 class="sectiontitle">Function</h4><p id="as_06_0412__p66540326101039">This interface is used to enable, disable, or delete AS policies in batches.</p>
<ul id="as_06_0412__ul8872146184616"><li id="as_06_0412__li10872346124611">A batch operation can be performed on a maximum of 20 AS policies at a time.</li></ul>
</div>
<div class="section" id="as_06_0412__section25265097"><h4 class="sectiontitle">URI</h4><p id="as_06_0412__p22493366">POST /autoscaling-api/v1/{project_id}/scaling_policies/action</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_0412__table10023380" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="as_06_0412__row17946858"><th align="left" class="cellrowborder" valign="top" width="18.81188118811881%" id="mcps1.3.2.3.2.5.1.1"><p id="as_06_0412__p44409397"><strong id="as_06_0412__b1433165413591">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.801980198019802%" id="mcps1.3.2.3.2.5.1.2"><p id="as_06_0412__p40391380"><strong id="as_06_0412__b842352706141528">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.801980198019802%" id="mcps1.3.2.3.2.5.1.3"><p id="as_06_0412__p50476336"><strong id="as_06_0412__b84235270693914">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="41.584158415841586%" id="mcps1.3.2.3.2.5.1.4"><p id="as_06_0412__p62051376"><strong id="as_06_0412__b499105510591">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_0412__row60105532"><td class="cellrowborder" valign="top" width="18.81188118811881%" headers="mcps1.3.2.3.2.5.1.1 "><p id="as_06_0412__p36709949">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.2.3.2.5.1.2 "><p id="as_06_0412__p20715931">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.2.3.2.5.1.3 "><p id="as_06_0412__p268861">String</p>
</td>
<td class="cellrowborder" valign="top" width="41.584158415841586%" headers="mcps1.3.2.3.2.5.1.4 "><p id="as_06_0412__p36520930">Specifies the project ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="as_06_0412__section42782262104146"><h4 class="sectiontitle">Request Message</h4><ul id="as_06_0412__ul1579110"><li id="as_06_0412__li14211994">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_0412__table60799090" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="as_06_0412__row8858194"><th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="as_06_0412__p46425119"><strong id="as_06_0412__b355175615599">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="as_06_0412__p2338313"><strong id="as_06_0412__b444921223">Mandatory</strong></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_0412__p55185655"><strong id="as_06_0412__b1223511969">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="41%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="as_06_0412__p40853074"><strong id="as_06_0412__b188775995912">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_0412__row20764673"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_0412__p4216941">scaling_policy_id</p>
</td>
<td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_0412__p6027901">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_0412__p18497945">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="41%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_0412__p21938602">Specifies the AS policy ID.</p>
</td>
</tr>
<tr id="as_06_0412__row416365216942"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_0412__p4883500616945">action</p>
</td>
<td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_0412__p6332141216945">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_0412__p2876071816945">String</p>
</td>
<td class="cellrowborder" valign="top" width="41%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_0412__p52855456104651">Specifies an action to be performed on AS policies in batches. The options are as follows:</p>
<ul id="as_06_0412__ul23014345104621"><li id="as_06_0412__li5802519104621"><strong id="as_06_0412__b16734192141618">delete</strong>: deletes AS policies.</li><li id="as_06_0412__li52222671104621"><strong id="as_06_0412__b84235270617755">resume</strong>: enables AS policies.</li><li id="as_06_0412__li241996104621"><strong id="as_06_0412__b8423527061784">pause</strong>: disables AS policies.</li></ul>
</td>
</tr>
<tr id="as_06_0412__row1888584433413"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_0412__p1754244916917">force_delete</p>
</td>
<td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_0412__p1165227516917">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_0412__p431024216917">String</p>
</td>
<td class="cellrowborder" valign="top" width="41%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_0412__p1256132114711">Specifies whether to forcibly delete an AS policy. If the value is set to <strong id="as_06_0412__b54151328135418">no</strong>, in-progress AS policies cannot be deleted. Options:</p>
<ul id="as_06_0412__ul1463112774710"><li id="as_06_0412__li14597194411472"><strong id="as_06_0412__b48691541543">no</strong> (default): indicates that the AS policy is not forcibly deleted.</li><li id="as_06_0412__li1163110276475"><strong id="as_06_0412__b9938131365518">yes</strong>: indicates that the AS policy is forcibly deleted.</li></ul>
<p id="as_06_0412__p61828895105430">This parameter is available only when <strong id="as_06_0412__b273152918148">action</strong> is set to <strong id="as_06_0412__b47314292147">delete</strong>.</p>
</td>
</tr>
<tr id="as_06_0412__row15675420212"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="as_06_0412__p2252119229">delete_alarm</p>
</td>
<td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="as_06_0412__p725101122210">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_0412__p6253152211">String</p>
</td>
<td class="cellrowborder" valign="top" width="41%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="as_06_0412__p102571112217">Specifies whether to delete the alarm rule used by the alarm policy. The value can be <strong id="as_06_0412__b1650342519514">yes</strong> or <strong id="as_06_0412__b131741628195117">no</strong> (default).</p>
<p id="as_06_0412__p526101132213">This parameter is available only when <strong id="as_06_0412__b1251082499">action</strong> is set to <strong id="as_06_0412__b145231921">delete</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="as_06_0412__li2266666410530">Example request<p id="as_06_0412__p29881744153210"><a name="as_06_0412__li2266666410530"></a><a name="li2266666410530"></a>This example shows how to enable the AS policies with IDs <strong id="as_06_0412__b18606151217560">policy_id1</strong> and <strong id="as_06_0412__b112992035619">policy_id2</strong> in a batch.</p>
<pre class="screen" id="as_06_0412__screen4813163512323">POST https://{Endpoint}/autoscaling-api/v1/{project_id}/scaling_policies/action
{
"action": "resume",
"scaling_policy_id": [
"policy_id1",
"policy_id2"
]
}</pre>
</li></ul>
</div>
<div class="section" id="as_06_0412__section33206990"><h4 class="sectiontitle">Response Message</h4><ul id="as_06_0412__ul9007507"><li id="as_06_0412__li56913160">Response parameters<p id="as_06_0412__p60400126203515"><a name="as_06_0412__li56913160"></a><a name="li56913160"></a>None</p>
</li><li id="as_06_0412__li3640858994017">Example response<p id="as_06_0412__p15614505203519"><a name="as_06_0412__li3640858994017"></a><a name="li3640858994017"></a>None</p>
</li></ul>
</div>
<div class="section" id="as_06_0412__section30427456"><h4 class="sectiontitle">Returned Values</h4><ul id="as_06_0412__ul40603851"><li id="as_06_0412__li29890343">Normal<p id="as_06_0412__p577635"><a name="as_06_0412__li29890343"></a><a name="li29890343"></a>204</p>
</li><li id="as_06_0412__li5198720">Abnormal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_0412__table46788488" frame="border" border="1" rules="all"><thead align="left"><tr id="as_06_0412__row8624464"><th align="left" class="cellrowborder" valign="top" width="44.18%" id="mcps1.3.5.2.2.1.1.3.1.1"><p id="as_06_0412__p27492955">Returned Value</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="55.82%" id="mcps1.3.5.2.2.1.1.3.1.2"><p id="as_06_0412__p12336887">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_0412__row59763787"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p9028608">400 Bad Request</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p60228670">The server failed to process the request.</p>
</td>
</tr>
<tr id="as_06_0412__row5187119"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p17503500">401 Unauthorized</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p8497414">You must enter the username and password to access the requested page.</p>
</td>
</tr>
<tr id="as_06_0412__row9367865"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p20599592">403 Forbidden</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p57954280">You are forbidden to access the requested page.</p>
</td>
</tr>
<tr id="as_06_0412__row51826478"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p37195178">404 Not Found</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p60019402">The server could not find the requested page.</p>
</td>
</tr>
<tr id="as_06_0412__row3303707"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p66273709">405 Method Not Allowed</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p66570199">You are not allowed to use the method specified in the request.</p>
</td>
</tr>
<tr id="as_06_0412__row62260885"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p9966935">406 Not Acceptable</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p2015430">The response generated by the server could not be accepted by the client.</p>
</td>
</tr>
<tr id="as_06_0412__row18138873"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p59962646">407 Proxy Authentication Required</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p25136147">You must use the proxy server for authentication to process the request.</p>
</td>
</tr>
<tr id="as_06_0412__row24898733"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p3531486">408 Request Timeout</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p17614915">The request timed out.</p>
</td>
</tr>
<tr id="as_06_0412__row24316508"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p23480171">409 Conflict</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p22845731">The request could not be processed due to a conflict.</p>
</td>
</tr>
<tr id="as_06_0412__row4284989"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p11539844">500 Internal Server Error</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p62312200">Failed to complete the request because of an internal service error.</p>
</td>
</tr>
<tr id="as_06_0412__row23938892"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p60002101">501 Not Implemented</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p28332047">Failed to complete the request because the server does not support the requested function.</p>
</td>
</tr>
<tr id="as_06_0412__row53661838"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p51641620">502 Bad Gateway</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p22221662">Failed to complete the request because the request is invalid.</p>
</td>
</tr>
<tr id="as_06_0412__row65777232"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p26355580">503 Service Unavailable</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p54427232">Failed to complete the request because the system is unavailable.</p>
</td>
</tr>
<tr id="as_06_0412__row20083047"><td class="cellrowborder" valign="top" width="44.18%" headers="mcps1.3.5.2.2.1.1.3.1.1 "><p id="as_06_0412__p16114131">504 Gateway Timeout</p>
</td>
<td class="cellrowborder" valign="top" width="55.82%" headers="mcps1.3.5.2.2.1.1.3.1.2 "><p id="as_06_0412__p30176268">A gateway timeout error occurred.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="as_06_0412__section17669131616110"><h4 class="sectiontitle">Error Codes</h4><p id="as_06_0412__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_0400.html">AS Policies</a></div>
</div>
</div>