doc-exports/docs/as/api-ref/as_06_0410.html
Zaoxu, Li eda4b9181d AS API DOC
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com>
Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
2024-09-19 11:04:13 +00:00

169 lines
12 KiB
HTML

<a name="as_06_0410"></a><a name="as_06_0410"></a>
<h1 class="topictitle1">Executing, Enabling, or Disabling an AS Policy</h1>
<div id="body45521706"><div class="section" id="as_06_0410__section40235071"><h4 class="sectiontitle">Function</h4><p id="as_06_0410__p63379561">This interface is used to immediately execute, enable, or disable a specified AS policy.</p>
<p id="as_06_0410__p522361411214">An AS policy can be executed only when the AS group and AS policy are in the <strong id="as_06_0410__b51352685161518">INSERVICE</strong> state. Otherwise, the execution fails.</p>
</div>
<div class="section" id="as_06_0410__section26571327"><h4 class="sectiontitle">URI</h4><p id="as_06_0410__p39725971">POST /autoscaling-api/v1/{project_id}/scaling_policy/{scaling_policy_id}/action</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_0410__table63687043" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="as_06_0410__row46742451"><th align="left" class="cellrowborder" valign="top" width="22%" id="mcps1.3.2.3.2.5.1.1"><p id="as_06_0410__p28042199"><strong id="as_06_0410__b15212911135915">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.2.3.2.5.1.2"><p id="as_06_0410__p56825610">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19%" id="mcps1.3.2.3.2.5.1.3"><p id="as_06_0410__p39471735">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="38%" id="mcps1.3.2.3.2.5.1.4"><p id="as_06_0410__p43093956"><strong id="as_06_0410__b16962014145913">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_0410__row949529"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.2.3.2.5.1.1 "><p id="as_06_0410__p9803039">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.2.3.2.5.1.2 "><p id="as_06_0410__p55848701">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19%" headers="mcps1.3.2.3.2.5.1.3 "><p id="as_06_0410__p27450972">String</p>
</td>
<td class="cellrowborder" valign="top" width="38%" headers="mcps1.3.2.3.2.5.1.4 "><p id="as_06_0410__p36520930">Specifies the project ID.</p>
</td>
</tr>
<tr id="as_06_0410__row13317766"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.2.3.2.5.1.1 "><p id="as_06_0410__p4997277">scaling_policy_id</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.2.3.2.5.1.2 "><p id="as_06_0410__p2126321">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19%" headers="mcps1.3.2.3.2.5.1.3 "><p id="as_06_0410__p38014313">String</p>
</td>
<td class="cellrowborder" valign="top" width="38%" headers="mcps1.3.2.3.2.5.1.4 "><p id="as_06_0410__p59260526">Specifies the AS policy ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="as_06_0410__section37815352"><h4 class="sectiontitle">Request</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_0410__table17322790" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="as_06_0410__row19920592"><th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.3.2.2.5.1.1"><p id="as_06_0410__p2955276"><strong id="as_06_0410__b1646401655912">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.3.2.2.5.1.2"><p id="as_06_0410__p38050837">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="as_06_0410__p62218962">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="38%" id="mcps1.3.3.2.2.5.1.4"><p id="as_06_0410__p0772218550"><strong id="as_06_0410__b6315161725911">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_0410__row62503562"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.2.2.5.1.1 "><p id="as_06_0410__p29623765">action</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.3.2.2.5.1.2 "><p id="as_06_0410__p50714740">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="as_06_0410__p14253264">String</p>
</td>
<td class="cellrowborder" valign="top" width="38%" headers="mcps1.3.3.2.2.5.1.4 "><p id="as_06_0410__p3552977619244">Specifies the operation for an AS policy.</p>
<ul id="as_06_0410__ul6530813782310"><li id="as_06_0410__li2417762019110"><strong id="as_06_0410__b115031530511">execute</strong>: immediately executes the AS policy.</li><li id="as_06_0410__li497062282310"><strong id="as_06_0410__b84235270617755">resume</strong>: enables the AS group.</li><li id="as_06_0410__li6445314582310"><strong id="as_06_0410__b8423527061784">pause</strong>: disables the AS group.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="as_06_0410__section1653104475116"><h4 class="sectiontitle">Example Request</h4><div class="p" id="as_06_0410__p163691045173112">This example executes the AS policy with ID <strong id="as_06_0410__b1540642045210">906f73ff-56e8-41b2-a005-8157d0c60361</strong>.<pre class="screen" id="as_06_0410__screen8645134113318">POST https://{Endpoint}/autoscaling-api/v1/{project_id}/scaling_policy/906f73ff-56e8-41b2-a005-8157d0c60361/action
{
"action": "execute"
}</pre>
</div>
</div>
<div class="section" id="as_06_0410__section4793853"><h4 class="sectiontitle">Response</h4><p id="as_06_0410__p60400126203515">None</p>
</div>
<div class="section" id="as_06_0410__section18253443525"><h4 class="sectiontitle">Example Response</h4><p id="as_06_0410__p15614505203519">None</p>
</div>
<div class="section" id="as_06_0410__section43144677"><h4 class="sectiontitle">Returned Values</h4><ul id="as_06_0410__ul9847817"><li id="as_06_0410__li21521490">Normal<p id="as_06_0410__p59475690"><a name="as_06_0410__li21521490"></a><a name="li21521490"></a>204</p>
</li><li id="as_06_0410__li65519169">Abnormal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_0410__table52801617" frame="border" border="1" rules="all"><thead align="left"><tr id="as_06_0410__row4862753"><th align="left" class="cellrowborder" valign="top" width="43.99%" id="mcps1.3.7.2.2.1.1.3.1.1"><p id="as_06_0410__p58338722">Returned Value</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="56.010000000000005%" id="mcps1.3.7.2.2.1.1.3.1.2"><p id="as_06_0410__p27816043">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_0410__row38507045"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p32062968">400 Bad Request</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p46963595">The server failed to process the request.</p>
</td>
</tr>
<tr id="as_06_0410__row20019172"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p10940218">401 Unauthorized</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p13742502">You must enter the username and password to access the requested page.</p>
</td>
</tr>
<tr id="as_06_0410__row56573654"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p19063291">403 Forbidden</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p622761">You are forbidden to access the requested page.</p>
</td>
</tr>
<tr id="as_06_0410__row5604850"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p51339711">404 Not Found</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p64875945">The server could not find the requested page.</p>
</td>
</tr>
<tr id="as_06_0410__row47012596"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p49923923">405 Method Not Allowed</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p17305987">You are not allowed to use the method specified in the request.</p>
</td>
</tr>
<tr id="as_06_0410__row21536161"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p66707469">406 Not Acceptable</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p34595869">The response generated by the server could not be accepted by the client.</p>
</td>
</tr>
<tr id="as_06_0410__row42927366"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p54564616">407 Proxy Authentication Required</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p57657762">You must use the proxy server for authentication to process the request.</p>
</td>
</tr>
<tr id="as_06_0410__row49157816"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p22360170">408 Request Timeout</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p66343369">The request timed out.</p>
</td>
</tr>
<tr id="as_06_0410__row60219412"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p45934241">409 Conflict</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p29686030">The request could not be processed due to a conflict.</p>
</td>
</tr>
<tr id="as_06_0410__row65847680"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p32061857">500 Internal Server Error</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p46873590">Failed to complete the request because of an internal service error.</p>
</td>
</tr>
<tr id="as_06_0410__row19209127"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p12435494">501 Not Implemented</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p642126">Failed to complete the request because the server does not support the requested function.</p>
</td>
</tr>
<tr id="as_06_0410__row5779136"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p65456887">502 Bad Gateway</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p407659">Failed to complete the request because the request is invalid.</p>
</td>
</tr>
<tr id="as_06_0410__row3668935"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p28748320">503 Service Unavailable</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p46912618">Failed to complete the request because the system is unavailable.</p>
</td>
</tr>
<tr id="as_06_0410__row19560385"><td class="cellrowborder" valign="top" width="43.99%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="as_06_0410__p40887351">504 Gateway Timeout</p>
</td>
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="as_06_0410__p23541105">A gateway timeout error occurred.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="as_06_0410__section17669131616110"><h4 class="sectiontitle">Error Codes</h4><p id="as_06_0410__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>