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

395 lines
39 KiB
HTML

<a name="as_06_0404"></a><a name="as_06_0404"></a>
<h1 class="topictitle1">Modifying an AS Policy (V2)</h1>
<div id="body1521704457471"><div class="section" id="as_06_0404__section162101610131118"><h4 class="sectiontitle">Function</h4><p id="as_06_0404__p67501439121118">This API is used to modify a specified AS policy.</p>
<p id="as_06_0404__p105976136425">The difference between the V2 and V1 APIs for modifying an AS policy is that V2 supports modifying a scaling resource type.</p>
</div>
<div class="section" id="as_06_0404__section172511349131118"><h4 class="sectiontitle">URI</h4><p id="as_06_0404__p10686220124">PUT /autoscaling-api/v2/{project_id}/scaling_policy/{scaling_policy_id}</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_0404__table196449220128" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="as_06_0404__row968662121215"><th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.2.3.2.5.1.1"><p id="as_06_0404__p16686102141210"><strong id="as_06_0404__b103135717555">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="as_06_0404__p116867220122">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.000000000000002%" id="mcps1.3.2.3.2.5.1.3"><p id="as_06_0404__p668614251210">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="45%" id="mcps1.3.2.3.2.5.1.4"><p id="as_06_0404__p0686026125"><strong id="as_06_0404__b12353815550">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_0404__row20686172111219"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.2.3.2.5.1.1 "><p id="as_06_0404__p20686626126">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="as_06_0404__p156866215123">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.2.3.2.5.1.3 "><p id="as_06_0404__p1068612212127">String</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.3.2.5.1.4 "><p id="as_06_0404__p36520930">Specifies the project ID.</p>
</td>
</tr>
<tr id="as_06_0404__row9686625124"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.2.3.2.5.1.1 "><p id="as_06_0404__p26871321123">scaling_policy_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="as_06_0404__p1468714215127">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.2.3.2.5.1.3 "><p id="as_06_0404__p16871624125">String</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.3.2.5.1.4 "><p id="as_06_0404__p65325544">Specifies an AS policy ID. For details, see <a href="as_06_0406.html">Querying AS Policies Bound to a Scaling Resource (V2)</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="as_06_0404__section935221761218"><h4 class="sectiontitle">Request</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_0404__table1179511327124" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="as_06_0404__row092313221219"><th align="left" class="cellrowborder" valign="top" width="21.21212121212121%" id="mcps1.3.3.2.2.5.1.1"><p id="as_06_0404__p1292320329126">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.202020202020204%" id="mcps1.3.3.2.2.5.1.2"><p id="as_06_0404__p9923193231211">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.131313131313133%" id="mcps1.3.3.2.2.5.1.3"><p id="as_06_0404__p29231832131217">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="45.45454545454546%" id="mcps1.3.3.2.2.5.1.4"><p id="as_06_0404__p13923203221213">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_0404__row1292315328122"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.3.3.2.2.5.1.1 "><p id="as_06_0404__p15923113215123">scaling_policy_name</p>
</td>
<td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.3.2.2.5.1.2 "><p id="as_06_0404__p15923193216120">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.131313131313133%" headers="mcps1.3.3.2.2.5.1.3 "><p id="as_06_0404__p29231932171213">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.45454545454546%" headers="mcps1.3.3.2.2.5.1.4 "><p id="as_06_0404__p52610097">Specifies the AS policy name. The name contains only letters, digits, underscores (_), and hyphens (-), and cannot exceed 64 characters.</p>
</td>
</tr>
<tr id="as_06_0404__row892314324124"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.3.3.2.2.5.1.1 "><p id="as_06_0404__p129233321127">scaling_policy_type</p>
</td>
<td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.3.2.2.5.1.2 "><p id="as_06_0404__p792319325121">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.131313131313133%" headers="mcps1.3.3.2.2.5.1.3 "><p id="as_06_0404__p1292353231210">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.45454545454546%" headers="mcps1.3.3.2.2.5.1.4 "><p id="as_06_0404__p292343251218">Specifies the AS policy type.</p>
<ul id="as_06_0404__ul492363291213"><li id="as_06_0404__li169246320128"><strong id="as_06_0404__b8908878154133">ALARM</strong> (corresponding to <strong id="as_06_0404__b13071039154133">alarm_id</strong>): indicates that the scaling action is triggered by an alarm.</li><li id="as_06_0404__li149241321126"><strong id="as_06_0404__b47749798154133">SCHEDULED</strong> (corresponding to <strong id="as_06_0404__b27095003154133">scheduled_policy</strong>): indicates that the scaling action is triggered as scheduled.</li><li id="as_06_0404__li16924432111215"><strong id="as_06_0404__b48283661154133">RECURRENCE</strong> (corresponding to <strong id="as_06_0404__b31899767154133">scheduled_policy</strong>): indicates that the scaling action is triggered periodically.</li></ul>
</td>
</tr>
<tr id="as_06_0404__row692411324122"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.3.3.2.2.5.1.1 "><p id="as_06_0404__p1392483218122">scaling_resource_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.3.2.2.5.1.2 "><p id="as_06_0404__p209246327127">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.131313131313133%" headers="mcps1.3.3.2.2.5.1.3 "><p id="as_06_0404__p12924183221220">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.45454545454546%" headers="mcps1.3.3.2.2.5.1.4 "><p id="as_06_0404__p1692511320121">Specifies the scaling resource ID, which is the ID of a unique AS group or bandwidth.</p>
</td>
</tr>
<tr id="as_06_0404__row149261432181211"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.3.3.2.2.5.1.1 "><p id="as_06_0404__p3926232181213">scaling_resource_type</p>
</td>
<td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.3.2.2.5.1.2 "><p id="as_06_0404__p11926032161216">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.131313131313133%" headers="mcps1.3.3.2.2.5.1.3 "><p id="as_06_0404__p179268324123">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.45454545454546%" headers="mcps1.3.3.2.2.5.1.4 "><p id="as_06_0404__p89262032131220">Specifies the scaling resource type.</p>
<ul id="as_06_0404__ul592653214122"><li id="as_06_0404__li149264326122">AS group: <strong id="as_06_0404__b84235270691950">SCALING_GROUP</strong></li><li id="as_06_0404__li19926143218126">Bandwidth: <strong id="as_06_0404__b8423527069204">BANDWIDTH</strong></li></ul>
</td>
</tr>
<tr id="as_06_0404__row4926832121212"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.3.3.2.2.5.1.1 "><p id="as_06_0404__p20926183213124">alarm_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.3.2.2.5.1.2 "><p id="as_06_0404__p19926132141212">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.131313131313133%" headers="mcps1.3.3.2.2.5.1.3 "><p id="as_06_0404__p11926103211210">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.45454545454546%" headers="mcps1.3.3.2.2.5.1.4 "><p id="as_06_0404__p692653216125">Specifies the alarm rule ID. This parameter is mandatory when <strong id="as_06_0404__b842352706153331">scaling_policy_type</strong> is set to <strong id="as_06_0404__b842352706153340">ALARM</strong>. After this parameter is specified, the value of <strong id="as_06_0404__b842352706153543">scheduled_policy</strong> does not take effect.</p>
<p id="as_06_0404__p129265329129">After you modify an alarm policy, the system automatically adds an alarm triggering activity of the autoscaling type to the <strong id="as_06_0404__b84235270619718">alarm_actions</strong> field in the alarm rule specified by the parameter value.</p>
<p id="as_06_0404__p79261732101214">You can obtain the parameter value by querying Cloud Eye alarm rules. </p>
</td>
</tr>
<tr id="as_06_0404__row129261932161214"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.3.3.2.2.5.1.1 "><p id="as_06_0404__p119267328123">scheduled_policy</p>
</td>
<td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.3.2.2.5.1.2 "><p id="as_06_0404__p1592673211217">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.131313131313133%" headers="mcps1.3.3.2.2.5.1.3 "><p id="as_06_0404__a4c03d226ca78442f99e13b8d363cd51d"><a href="#as_06_0404__table412818526127">scheduled_policy</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="45.45454545454546%" headers="mcps1.3.3.2.2.5.1.4 "><p id="as_06_0404__p149267329126">Specifies the periodic or scheduled AS policy. This parameter is mandatory when <strong id="as_06_0404__b842352706171742">scaling_policy_type</strong> is set to <strong id="as_06_0404__b842352706171747">SCHEDULED</strong> or <strong id="as_06_0404__b842352706171752">RECURRENCE</strong>. After this parameter is specified, the value of <strong id="as_06_0404__b84235270614268">alarm_id</strong> does not take effect. For details, see <a href="#as_06_0404__table412818526127">Table 3</a>.</p>
</td>
</tr>
<tr id="as_06_0404__row1926183211127"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.3.3.2.2.5.1.1 "><p id="as_06_0404__p3926332111211">scaling_policy_action</p>
</td>
<td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.3.2.2.5.1.2 "><p id="as_06_0404__p12926153217121">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.131313131313133%" headers="mcps1.3.3.2.2.5.1.3 "><p id="as_06_0404__p1574044754119"><a href="#as_06_0404__table2418132017131">scaling_policy_action</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="45.45454545454546%" headers="mcps1.3.3.2.2.5.1.4 "><p id="as_06_0404__p7926732101219">Specifies the scaling action of the AS policy. For details, see <a href="#as_06_0404__table2418132017131">Table 4</a>.</p>
</td>
</tr>
<tr id="as_06_0404__row39264322122"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.3.3.2.2.5.1.1 "><p id="as_06_0404__p19926183219126">cool_down_time</p>
</td>
<td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.3.2.2.5.1.2 "><p id="as_06_0404__p12926032121213">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.131313131313133%" headers="mcps1.3.3.2.2.5.1.3 "><p id="as_06_0404__p19263324126">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="45.45454545454546%" headers="mcps1.3.3.2.2.5.1.4 "><p id="as_06_0404__p292753214122">Specifies the cooldown period (in seconds). The value ranges from 0 to 86400.</p>
</td>
</tr>
<tr id="as_06_0404__row137028143463"><td class="cellrowborder" valign="top" width="21.21212121212121%" headers="mcps1.3.3.2.2.5.1.1 "><p id="as_06_0404__p7501355122517">description</p>
</td>
<td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.3.2.2.5.1.2 "><p id="as_06_0404__p1504555257">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.131313131313133%" headers="mcps1.3.3.2.2.5.1.3 "><p id="as_06_0404__p6506558259">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.45454545454546%" headers="mcps1.3.3.2.2.5.1.4 "><p id="as_06_0404__p3501755202518">Specifies the description of the AS policy. The value can contain 1 to 256 characters.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="as_06_0404__table412818526127"></a><a name="table412818526127"></a><table cellpadding="4" cellspacing="0" summary="" id="as_06_0404__table412818526127" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="as_06_0404__b2025514281456">scheduled_policy</strong> field description</caption><thead align="left"><tr id="as_06_0404__row425265215123"><th align="left" class="cellrowborder" valign="top" width="20.792079207920793%" id="mcps1.3.3.3.2.5.1.1"><p id="as_06_0404__p15252185210120">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.801980198019802%" id="mcps1.3.3.3.2.5.1.2"><p id="as_06_0404__p2025295291211">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.861386138613863%" id="mcps1.3.3.3.2.5.1.3"><p id="as_06_0404__p17252252141218">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="45.54455445544555%" id="mcps1.3.3.3.2.5.1.4"><p id="as_06_0404__p162521352141220">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_0404__row16252155213129"><td class="cellrowborder" valign="top" width="20.792079207920793%" headers="mcps1.3.3.3.2.5.1.1 "><p id="as_06_0404__p112521052151215">launch_time</p>
</td>
<td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.3.3.2.5.1.2 "><p id="as_06_0404__p162521752191211">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.3.3.2.5.1.3 "><p id="as_06_0404__p52521052201214">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.54455445544555%" headers="mcps1.3.3.3.2.5.1.4 "><p id="as_06_0404__p1025225261220">Specifies the time when the scaling action is triggered. The time format complies with UTC.</p>
<ul id="as_06_0404__ul4252652101215"><li id="as_06_0404__li9252105217126">If <strong id="as_06_0404__b15731452153412">scaling_policy_type</strong> is set to <strong id="as_06_0404__b9573752173413">SCHEDULED</strong>, the time format is <strong id="as_06_0404__b3573155293410">YYYY-MM-DDThh:mmZ</strong>.</li><li id="as_06_0404__li15252185211210">If <strong id="as_06_0404__b1557625211347">scaling_policy_type</strong> is set to <strong id="as_06_0404__b1357665220344">RECURRENCE</strong>, the time format is <strong id="as_06_0404__b13576135218346">hh:mm</strong>.</li></ul>
</td>
</tr>
<tr id="as_06_0404__row16252125271218"><td class="cellrowborder" valign="top" width="20.792079207920793%" headers="mcps1.3.3.3.2.5.1.1 "><p id="as_06_0404__p18252115281210">recurrence_type</p>
</td>
<td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.3.3.2.5.1.2 "><p id="as_06_0404__p72521252181217">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.3.3.2.5.1.3 "><p id="as_06_0404__p152521152101214">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.54455445544555%" headers="mcps1.3.3.3.2.5.1.4 "><p id="as_06_0404__p7252552111219">Specifies the periodic triggering type. This parameter is mandatory when <strong id="as_06_0404__b842352706172110">scaling_policy_type</strong> is set to <strong id="as_06_0404__b842352706172115">RECURRENCE</strong>.</p>
<ul id="as_06_0404__ul1470172810520"><li id="as_06_0404__li6705281855"><strong id="as_06_0404__b8584952103412">Daily</strong>: indicates that the scaling action is triggered once a day.</li><li id="as_06_0404__li18701281252"><strong id="as_06_0404__b115851052173418">Weekly</strong>: indicates that the scaling action is triggered once a week.</li><li id="as_06_0404__li27017281553"><strong id="as_06_0404__b15586105210344">Monthly</strong>: indicates that the scaling action is triggered once a month.</li></ul>
</td>
</tr>
<tr id="as_06_0404__row125285261215"><td class="cellrowborder" valign="top" width="20.792079207920793%" headers="mcps1.3.3.3.2.5.1.1 "><p id="as_06_0404__p1425213524126">recurrence_value</p>
</td>
<td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.3.3.2.5.1.2 "><p id="as_06_0404__p1225265216124">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.3.3.2.5.1.3 "><p id="as_06_0404__p225219524124">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.54455445544555%" headers="mcps1.3.3.3.2.5.1.4 "><p id="as_06_0404__a07f48cfcdafa4ffd87bba3b4e90c0111">Specifies the day when a periodic scaling action is triggered. This parameter is mandatory when <strong id="as_06_0404__b1266624155318">scaling_policy_type</strong> is set to <strong id="as_06_0404__b4267122417533">RECURRENCE</strong>.</p>
<ul id="as_06_0404__ul225285218123"><li id="as_06_0404__li1125375241214">If <strong id="as_06_0404__b658915214349">recurrence_type</strong> is set to <strong id="as_06_0404__b8589145214340">Daily</strong>, the value is <strong id="as_06_0404__b16589952153420">null</strong>, indicating that the scaling action is triggered once a day.</li><li id="as_06_0404__li172533527125">If <strong id="as_06_0404__b1093011360419">recurrence_type</strong> is set to <strong id="as_06_0404__b293118361545">Weekly</strong>, the value ranges from <strong id="as_06_0404__b129314361548">1</strong> (Sunday) to <strong id="as_06_0404__b18931103617414">7</strong> (Saturday). The digits refer to dates in each week and separated by a comma, such as <strong id="as_06_0404__b893119361643">1,3,5</strong>.</li><li id="as_06_0404__li18253185201210">If <strong id="as_06_0404__b84235270617528">recurrence_type</strong> is set to <strong id="as_06_0404__b2592252143415">Monthly</strong>, the value ranges from <strong id="as_06_0404__b1859211525349">1</strong> to <strong id="as_06_0404__b7592135211343">31</strong>. The digits refer to the dates in each month and separated by a comma, such as <strong id="as_06_0404__b125921552103412">1,10,13,28</strong>.</li></ul>
</td>
</tr>
<tr id="as_06_0404__row132532052111211"><td class="cellrowborder" valign="top" width="20.792079207920793%" headers="mcps1.3.3.3.2.5.1.1 "><p id="as_06_0404__p2253135212128">start_time</p>
</td>
<td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.3.3.2.5.1.2 "><p id="as_06_0404__p142531752171215">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.3.3.2.5.1.3 "><p id="as_06_0404__p17253165201214">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.54455445544555%" headers="mcps1.3.3.3.2.5.1.4 "><p id="as_06_0404__p1925311523128">Specifies the start time of the scaling action triggered periodically. The time format complies with UTC.</p>
<p id="as_06_0404__p9253952121215">The time format is <strong id="as_06_0404__b205970526348">YYYY-MM-DDThh:mmZ</strong>.</p>
</td>
</tr>
<tr id="as_06_0404__row525385215128"><td class="cellrowborder" valign="top" width="20.792079207920793%" headers="mcps1.3.3.3.2.5.1.1 "><p id="as_06_0404__p15253135211127">end_time</p>
</td>
<td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.3.3.2.5.1.2 "><p id="as_06_0404__p925313529121">No</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.3.3.2.5.1.3 "><p id="as_06_0404__p5253165291219">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.54455445544555%" headers="mcps1.3.3.3.2.5.1.4 "><p id="as_06_0404__p52539521129">Specifies the end time of the scaling action triggered periodically. The time format complies with UTC. This parameter is mandatory when <strong id="as_06_0404__b842352706173440">scaling_policy_type</strong> is set to <strong id="as_06_0404__b842352706173444">RECURRENCE</strong>.</p>
<p id="as_06_0404__p8253852181215">When the scaling action is triggered periodically, the end time cannot be earlier than the current and start time.</p>
<p id="as_06_0404__p525315211215">The time format is <strong id="as_06_0404__b3599175243412">YYYY-MM-DDThh:mmZ</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="as_06_0404__table2418132017131"></a><a name="table2418132017131"></a><table cellpadding="4" cellspacing="0" summary="" id="as_06_0404__table2418132017131" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="as_06_0404__as_06_0402_b93951447104417">scaling_policy_action</strong> field description</caption><thead align="left"><tr id="as_06_0404__as_06_0402_row914933174911"><th align="left" class="cellrowborder" valign="top" width="20.202020202020204%" id="mcps1.3.3.4.2.5.1.1"><p id="as_06_0404__as_06_0402_p1984914718496">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.191919191919194%" id="mcps1.3.3.4.2.5.1.2"><p id="as_06_0404__as_06_0402_p68491047104920">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.151515151515152%" id="mcps1.3.3.4.2.5.1.3"><p id="as_06_0404__as_06_0402_p12849747144916">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="45.45454545454546%" id="mcps1.3.3.4.2.5.1.4"><p id="as_06_0404__as_06_0402_p98494475496">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_0404__as_06_0402_row19149123164911"><td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.3.4.2.5.1.1 "><p id="as_06_0404__as_06_0402_p118491447144918">operation</p>
</td>
<td class="cellrowborder" valign="top" width="19.191919191919194%" headers="mcps1.3.3.4.2.5.1.2 "><p id="as_06_0404__as_06_0402_p12849647124917">No</p>
</td>
<td class="cellrowborder" valign="top" width="15.151515151515152%" headers="mcps1.3.3.4.2.5.1.3 "><p id="as_06_0404__as_06_0402_p19849164719493">String</p>
</td>
<td class="cellrowborder" valign="top" width="45.45454545454546%" headers="mcps1.3.3.4.2.5.1.4 "><div class="p" id="as_06_0404__as_06_0402_p12849194711498">Specifies the operation to be performed. The default operation is <strong id="as_06_0404__as_06_0402_b1898710304536">ADD</strong>.<ul id="as_06_0404__as_06_0402_ul627111141476"><li id="as_06_0404__as_06_0402_li79048588174">If <strong id="as_06_0404__as_06_0402_b13175144944616">scaling_resource_type</strong> is set to <strong id="as_06_0404__as_06_0402_b1906755154616">SCALING_GROUP</strong>, the following operations are supported:<ul id="as_06_0404__as_06_0402_ul4517141421818"><li id="as_06_0404__as_06_0402_li1027113147720"><strong id="as_06_0404__as_06_0402_b8423527069234">ADD</strong>: indicates adding instances.</li><li id="as_06_0404__as_06_0402_li127210148716"><strong id="as_06_0404__as_06_0402_b84235270692351">REMOVE/REDUCE</strong>: indicates removing or reducing instances.</li><li id="as_06_0404__as_06_0402_li72721414572"><strong id="as_06_0404__as_06_0402_b84235270692418">SET</strong>: indicates setting the number of instances to a specified value.</li></ul>
</li><li id="as_06_0404__as_06_0402_li657252681717">If <strong id="as_06_0404__as_06_0402_b142804917503">scaling_resource_type</strong> is set to <strong id="as_06_0404__as_06_0402_b1741712985119">BANDWIDTH</strong>, the following operations are supported:<ul id="as_06_0404__as_06_0402_ul10599126171711"><li id="as_06_0404__as_06_0402_li175991826141717"><strong id="as_06_0404__as_06_0402_b643951612511">ADD</strong>: indicates adding instances.</li><li id="as_06_0404__as_06_0402_li65991526111711"><strong id="as_06_0404__as_06_0402_b2271915151019">REDUCE</strong>: indicates reducing instances.</li><li id="as_06_0404__as_06_0402_li1259916262179"><strong id="as_06_0404__as_06_0402_b5271191519102">SET</strong>: indicates setting the number of instances to a specified value.</li></ul>
</li></ul>
</div>
</td>
</tr>
<tr id="as_06_0404__as_06_0402_row8149143119496"><td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.3.4.2.5.1.1 "><p id="as_06_0404__as_06_0402_p484914764910">size</p>
</td>
<td class="cellrowborder" valign="top" width="19.191919191919194%" headers="mcps1.3.3.4.2.5.1.2 "><p id="as_06_0404__as_06_0402_p208491947124912">No</p>
</td>
<td class="cellrowborder" valign="top" width="15.151515151515152%" headers="mcps1.3.3.4.2.5.1.3 "><p id="as_06_0404__as_06_0402_p5849247124914">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="45.45454545454546%" headers="mcps1.3.3.4.2.5.1.4 "><p id="as_06_0404__as_06_0402_p18849194784912">Specifies the operation size. The value is an integer from 0 to 300. The default value is <strong id="as_06_0404__as_06_0402_b11732181112413">1</strong>. This parameter can be set to <strong id="as_06_0404__as_06_0402_b5635125912547">0</strong> only when <strong id="as_06_0404__as_06_0402_b9320322105511">operation</strong> is set to <strong id="as_06_0404__as_06_0402_b196421525125513">SET</strong>.</p>
<ul id="as_06_0404__as_06_0402_ul1883910551366"><li id="as_06_0404__as_06_0402_li178399551463">If <strong id="as_06_0404__as_06_0402_b147459333448">scaling_resource_type</strong> is set to <strong id="as_06_0404__as_06_0402_b18745173311441">SCALING_GROUP</strong>, this parameter indicates the number of instances. The value is an integer from 0 to 300 and the default value is <strong id="as_06_0404__as_06_0402_b3745153384420">1</strong>.</li><li id="as_06_0404__as_06_0402_li118396551860">If <strong id="as_06_0404__as_06_0402_b14747163313448">scaling_resource_type</strong> is set to <strong id="as_06_0404__as_06_0402_b9747193317446">BANDWIDTH</strong>, this parameter indicates the bandwidth (Mbit/s). The value is an integer from 1 to 300 and the default value is <strong id="as_06_0404__as_06_0402_b8747133154419">1</strong>.</li><li id="as_06_0404__as_06_0402_li188391555769">If <strong id="as_06_0404__as_06_0402_b8423527061619">scaling_resource_type</strong> is set to <strong id="as_06_0404__as_06_0402_b84235270616122">SCALING_GROUP</strong>, either <strong id="as_06_0404__as_06_0402_b842352706105430">size</strong> or <strong id="as_06_0404__as_06_0402_b842352706105435">percentage</strong> can be set.</li></ul>
</td>
</tr>
<tr id="as_06_0404__as_06_0402_row16150133114912"><td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.3.4.2.5.1.1 "><p id="as_06_0404__as_06_0402_p184984724914">percentage</p>
</td>
<td class="cellrowborder" valign="top" width="19.191919191919194%" headers="mcps1.3.3.4.2.5.1.2 "><p id="as_06_0404__as_06_0402_p785044715492">No</p>
</td>
<td class="cellrowborder" valign="top" width="15.151515151515152%" headers="mcps1.3.3.4.2.5.1.3 "><p id="as_06_0404__as_06_0402_p178501847124913">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="45.45454545454546%" headers="mcps1.3.3.4.2.5.1.4 "><p id="as_06_0404__as_06_0402_p38501247184913">Specifies the percentage of instances to be operated. If <strong id="as_06_0404__as_06_0402_b16372183920211">operation</strong> is set to <strong id="as_06_0404__as_06_0402_b1037363917217">ADD</strong>, <strong id="as_06_0404__as_06_0402_b11642163516565">REMOVE</strong>, or <strong id="as_06_0404__as_06_0402_b1237543912118">REDUCE</strong>, the value of this parameter is an integer from 1 to 20000. If <strong id="as_06_0404__as_06_0402_b13375939102115">operation</strong> is set to <strong id="as_06_0404__as_06_0402_b23771239132117">SET</strong>, the value is an integer from 0 to 20000.</p>
<ul id="as_06_0404__as_06_0402_ul1740120777"><li id="as_06_0404__as_06_0402_li974019014710">If <strong id="as_06_0404__as_06_0402_b84235270616313">scaling_resource_type</strong> is set to <strong id="as_06_0404__as_06_0402_b84235270616320">SCALING_GROUP</strong>, either <strong id="as_06_0404__as_06_0402_b190074049516530">size</strong> or <strong id="as_06_0404__as_06_0402_b35265935816530">percentage</strong> can be set. If neither <strong id="as_06_0404__as_06_0402_b84235270616550">size</strong> nor <strong id="as_06_0404__as_06_0402_b84235270616556">percentage</strong> is set, the default value of <strong id="as_06_0404__as_06_0402_b8423527061667">size</strong> is <strong id="as_06_0404__as_06_0402_b84235270616612">1</strong>.</li><li id="as_06_0404__as_06_0402_li15740608717">If <strong id="as_06_0404__as_06_0402_b7913672816">scaling_resource_type</strong> is set to <strong id="as_06_0404__as_06_0402_b0590640112810">BANDWIDTH</strong>, <strong id="as_06_0404__as_06_0402_b51941644192810">percentage</strong> is unavailable.</li></ul>
</td>
</tr>
<tr id="as_06_0404__as_06_0402_row2150173194911"><td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.3.4.2.5.1.1 "><p id="as_06_0404__as_06_0402_p4850347164914">limits</p>
</td>
<td class="cellrowborder" valign="top" width="19.191919191919194%" headers="mcps1.3.3.4.2.5.1.2 "><p id="as_06_0404__as_06_0402_p4850547184915">No</p>
</td>
<td class="cellrowborder" valign="top" width="15.151515151515152%" headers="mcps1.3.3.4.2.5.1.3 "><p id="as_06_0404__as_06_0402_p385004711497">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="45.45454545454546%" headers="mcps1.3.3.4.2.5.1.4 "><p id="as_06_0404__as_06_0402_p11850647164919">Specifies the operation restrictions.</p>
<p id="as_06_0404__as_06_0402_p1785064744911">If <strong id="as_06_0404__as_06_0402_b172916117291">scaling_resource_type</strong> is set to <strong id="as_06_0404__as_06_0402_b172949118294">BANDWIDTH</strong> and <strong id="as_06_0404__as_06_0402_b129451172919">operation</strong> is not <strong id="as_06_0404__as_06_0402_b2029515172914">SET</strong>, this parameter takes effect and the unit is Mbit/s.</p>
<ul id="as_06_0404__as_06_0402_ul19875103016377"><li id="as_06_0404__as_06_0402_li17875830203719">If <strong id="as_06_0404__as_06_0402_b11433157115">operation</strong> is set to <strong id="as_06_0404__as_06_0402_b1414531516119">ADD</strong>, this parameter indicates the maximum bandwidth allowed.</li><li id="as_06_0404__as_06_0402_li4875113014375">If <strong id="as_06_0404__as_06_0402_b19763733154416">operation</strong> is set to <strong id="as_06_0404__as_06_0402_b107634331442">REDUCE</strong>, this parameter indicates the minimum bandwidth allowed.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
<p id="as_06_0404__p1463184570"></p>
</div>
<div class="section" id="as_06_0404__section1797173810461"><h4 class="sectiontitle">Example Request</h4><p id="as_06_0404__p61464429467">This example modifies an AS policy with ID <strong id="as_06_0404__b1798018203210">0h327883-324n-4dzd-9c61-68d03ee191dd</strong>. The AS policy name is changed to <strong id="as_06_0404__b13991218193218">hth_aspolicy_1</strong>, the alarm rule ID is changed to <strong id="as_06_0404__b099181863219">al1513822380493GvlJKZwA8</strong>, the cooldown period is changed to 900 seconds, and the scaling action is changed to increase the bandwidth by 1 Mbit/s until the bandwidth reaches 10 Mbit/s.</p>
</div>
<pre class="screen" id="as_06_0404__screen573410225298">PUT https://{Endpoint}/autoscaling-api/v2/{project_id}/scaling_policy/0h327883-324n-4dzd-9c61-68d03ee191dd
{
"alarm_id": "al1513822380493GvlJKZwA8",
"cool_down_time": 900,
"scaling_policy_action": {
"size": 1,
"operation": "ADD",
"limits": 10
},
"scaling_policy_name": "hth_aspolicy_1",
"scaling_policy_type": "ALARM"
}</pre>
<div class="section" id="as_06_0404__section1537864501420"><h4 class="sectiontitle">Response</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_0404__table546316312154" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response parameters</caption><thead align="left"><tr id="as_06_0404__row194905318158"><th align="left" class="cellrowborder" valign="top" width="28.000000000000004%" id="mcps1.3.6.2.2.4.1.1"><p id="as_06_0404__p13490133112156"><strong id="as_06_0404__b66531816105520">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.6.2.2.4.1.2"><p id="as_06_0404__p14490193171515"><strong id="as_06_0404__b84235270693914">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52%" id="mcps1.3.6.2.2.4.1.3"><p id="as_06_0404__p8490183118158"><strong id="as_06_0404__b817691818558">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_0404__row74906318156"><td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.6.2.2.4.1.1 "><p id="as_06_0404__p19490193181518">scaling_policy_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.6.2.2.4.1.2 "><p id="as_06_0404__p149018313154">String</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.3.6.2.2.4.1.3 "><p id="as_06_0404__p17490113112150">Specifies the AS policy ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="as_06_0404__section89284964715"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="as_06_0404__screen2490133110157">{
"scaling_policy_id": "0h327883-324n-4dzd-9c61-68d03ee191dd"
}</pre>
</div>
<div class="section" id="as_06_0404__section18212125191619"><h4 class="sectiontitle">Returned Values</h4><ul id="as_06_0404__ul865619232168"><li id="as_06_0404__li156561023161612">Normal<p id="as_06_0404__p1565622317169"><a name="as_06_0404__li156561023161612"></a><a name="li156561023161612"></a>200</p>
</li><li id="as_06_0404__li12657172391611">Abnormal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="as_06_0404__table1658372311162" frame="border" border="1" rules="all"><thead align="left"><tr id="as_06_0404__row5658132331619"><th align="left" class="cellrowborder" valign="top" width="35%" id="mcps1.3.8.2.2.1.1.3.1.1"><p id="as_06_0404__p1465862381619">Returned Value</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="65%" id="mcps1.3.8.2.2.1.1.3.1.2"><p id="as_06_0404__p96595234168">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="as_06_0404__row8659523101612"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p865952319161">400 Bad Request</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p665982318164">The server failed to process the request.</p>
</td>
</tr>
<tr id="as_06_0404__row106596233164"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p26591123201618">401 Unauthorized</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p36599231160">You must enter the username and password to access the requested page.</p>
</td>
</tr>
<tr id="as_06_0404__row36592023151610"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p465917233169">403 Forbidden</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p065962317161">You are forbidden to access the requested page.</p>
</td>
</tr>
<tr id="as_06_0404__row1565920239163"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p1365942315167">404 Not Found</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p14659152321616">The server could not find the requested page.</p>
</td>
</tr>
<tr id="as_06_0404__row16659323181613"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p96591239161">405 Method Not Allowed</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p1265942371615">You are not allowed to use the method specified in the request.</p>
</td>
</tr>
<tr id="as_06_0404__row16591123191619"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p12659172381615">406 Not Acceptable</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p1365982313169">The response generated by the server could not be accepted by the client.</p>
</td>
</tr>
<tr id="as_06_0404__row165992317167"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p2659122310166">407 Proxy Authentication Required</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p3659162391619">You must use the proxy server for authentication to process the request.</p>
</td>
</tr>
<tr id="as_06_0404__row1565952316167"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p16599238164">408 Request Timeout</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p17659152316164">The request timed out.</p>
</td>
</tr>
<tr id="as_06_0404__row565913231168"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p2065914235168">409 Conflict</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p1365962341614">The request could not be processed due to a conflict.</p>
</td>
</tr>
<tr id="as_06_0404__row36591923111619"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p11659623181616">500 Internal Server Error</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p196593235163">Failed to complete the request because of an internal service error.</p>
</td>
</tr>
<tr id="as_06_0404__row3659623181619"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p19659182319161">501 Not Implemented</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p36593231168">Failed to complete the request because the server does not support the requested function.</p>
</td>
</tr>
<tr id="as_06_0404__row1166032312164"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p16660102361616">502 Bad Gateway</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p76607239160">Failed to complete the request because the request is invalid.</p>
</td>
</tr>
<tr id="as_06_0404__row16601623111615"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p166062341610">503 Service Unavailable</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p1266082371619">Failed to complete the request because the system is unavailable.</p>
</td>
</tr>
<tr id="as_06_0404__row36603235161"><td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.8.2.2.1.1.3.1.1 "><p id="as_06_0404__p9660162301616">504 Gateway Timeout</p>
</td>
<td class="cellrowborder" valign="top" width="65%" headers="mcps1.3.8.2.2.1.1.3.1.2 "><p id="as_06_0404__p3660423101617">A gateway timeout error occurred.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="as_06_0404__section17669131616110"><h4 class="sectiontitle">Error Codes</h4><p id="as_06_0404__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>