Modifies the scaling rule for an application.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
edas:ManageApplication | Write |
|
| none |
Request syntax
POST /pop/v5/app/scaling_rules
PUT /pop/v5/app/scaling_rules
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
AppId | string | Yes | The ID of the application. | 74ee****-db65-4322-a1f6-bcb60e5b**** |
GroupId | string | Yes | The ID of the instance group to which the application is deployed. | 8123db90-880f-486f-****-************ |
InCondition | string | No | The relationship among the conditions that trigger a scale-in.
| "OR" |
InEnable | boolean | No | Specifies whether to allow scale-ins.
| true |
InCpu | integer | No | The CPU utilization that triggers a scale-in. | 50 |
InDuration | integer | No | The duration in which the metric threshold is exceeded. Unit: minutes. | 50 |
InInstanceNum | integer | No | The minimum number of instances that must be retained in each group when a scale-in is performed. | 3 |
InLoad | integer | No | The system load that triggers a scale-in. | 50 |
InRT | integer | No | The minimum service latency that triggers a scale-in. The lower limit is 0. Unit: milliseconds. | 50 |
InStep | integer | No | The number of instances that are removed during each scale-in. | 1 |
OutCondition | string | No | The relationship among the conditions that trigger a scale-out.
| "OR" |
OutCPU | integer | No | The CPU utilization that triggers a scale-out. | 50 |
OutDuration | integer | No | The duration in which the metric threshold is exceeded. Unit: minutes. | 50 |
OutEnable | boolean | No | Specifies whether to allow scale-outs. | true |
OutInstanceNum | integer | No | The maximum number of instances in each group when a scale-out is performed. | 10 |
OutLoad | integer | No | The system load that triggers a scale-out. | 50 |
OutRT | integer | No | The minimum service latency that triggers a scale-out. The lower limit is 0. Unit: milliseconds. | 0 |
OutStep | integer | No | The number of instances that are added during each scale-out. | 0 |
ResourceFrom | string | No | The source of the instance to be added during a scale-out. Valid values:
If you set this parameter to NEW or AVAILABLE_FIRST, you must specify the auto-scaling parameters. If you set this parameter to NEW, instances are created based on a launch template or the specifications of an existing instance. | "AVAILABLE" |
MultiAzPolicy | string | No | The multi-zone scaling policy. Valid values:
| "PRIORITY" |
VpcId | string | No | The ID of the virtual private cloud (VPC) that is associated with the instances created based on a launch template or the specifications of an existing instance. | "vpc-bp1j55oz3bg*****" |
VSwitchIds | string | No | The IDs of the vSwitches that are associated with the VPC. Separate multiple IDs with commas (,). | "vsw-bp1ldxs3d4fd*****" |
ScalingPolicy | string | No | The instance handling mode during a scale-in. Valid values:
| "release" |
TemplateInstanceId | string | No | The ID of the instance whose specifications are used to create instances during a scale-out. This parameter is valid only when you set the OutEnable parameter to true. | "1" |
TemplateInstanceName | string | No | The name of the instance whose specifications are used to create instances during a scale-out. This parameter takes effect only if you specify the TemplateInstanceId parameter. | "tpl-tdy218" |
Password | string | No | The password that is used to log on to the instance. This parameter takes effect only if you choose to create instances based on the specifications of an existing instance during a scale-out. | "Pwd*****" |
KeyPairName | string | No | The key pair that is used to log on to the instance. This parameter takes effect only if you choose to create instances based on the specifications of an existing instance during a scale-out. | "tdy218" |
AcceptEULA | boolean | No | Set the value to true if scale-outs are allowed. | true |
TemplateId | string | No | The ID of the launch template that is used to create instances during a scale-out. This parameter takes effect only if you set the OutEnable parameter to true. This parameter takes precedence over the TemplateInstanceId parameter. | "lt-wz9hkhn8wp*****" |
TemplateVersion | integer | No | The version of the launch template that is used to create instances during a scale-out. This parameter takes effect only if you set the OutEnable parameter to true. To use the default template version, set this parameter to | -1 |
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": 200,
"Message": "success",
"RequestId": "CB36E997-FE54-476C-8C0D-********"
}
Error codes
For a list of error codes, visit the Service error codes.