public static final class CreateScalingGroupRequest.Builder extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
CreateScalingGroupRequest.Builder |
albServerGroups(List<CreateScalingGroupRequest.AlbServerGroups> albServerGroups)
The Application Load Balancer (ALB) server groups.
|
CreateScalingGroupRequest.Builder |
allocationStrategy(String allocationStrategy)
The allocation policy of instances.
|
CreateScalingGroupRequest.Builder |
azBalance(Boolean azBalance)
Specifies whether to evenly distribute instances in the scaling group across multiple zones.
|
CreateScalingGroupRequest |
build() |
CreateScalingGroupRequest.Builder |
clientToken(String clientToken)
The client token that is used to ensure the idempotence of the request.
|
CreateScalingGroupRequest.Builder |
compensateWithOnDemand(Boolean compensateWithOnDemand)
Specifies whether to automatically create pay-as-you-go instances to meet the requirement on the number of ECS instances when the expected capacity of preemptible instances cannot be provided due to reasons such as cost-related issues and insufficient resources.
|
CreateScalingGroupRequest.Builder |
containerGroupId(String containerGroupId)
The ID of the elastic container instance.
|
CreateScalingGroupRequest.Builder |
customPolicyARN(String customPolicyARN)
The Alibaba Cloud Resource Name (ARN) of the custom scale-in policy (Function).
|
CreateScalingGroupRequest.Builder |
DBInstanceIds(String DBInstanceIds)
The IDs of the ApsaraDB RDS instances that you want to associate with the scaling group.
|
CreateScalingGroupRequest.Builder |
DBInstances(List<CreateScalingGroupRequest.DBInstances> DBInstances)
The databases that you want to attach to the scaling group.
|
CreateScalingGroupRequest.Builder |
defaultCooldown(Integer defaultCooldown)
The cooldown period of the scaling group after a scaling activity is complete in the scaling group.
|
CreateScalingGroupRequest.Builder |
desiredCapacity(Integer desiredCapacity)
The expected number of ECS instances in the scaling group.
|
CreateScalingGroupRequest.Builder |
groupDeletionProtection(Boolean groupDeletionProtection)
Specifies whether to enable deletion protection for the scaling group.
|
CreateScalingGroupRequest.Builder |
groupType(String groupType)
The type of the instances that are managed by the scaling group.
|
CreateScalingGroupRequest.Builder |
healthCheckType(String healthCheckType)
The health check mode of the scaling group.
|
CreateScalingGroupRequest.Builder |
healthCheckTypes(List<String> healthCheckTypes)
The health check modes of the scaling group.
|
CreateScalingGroupRequest.Builder |
instanceId(String instanceId)
The ID of the ECS instance.
|
CreateScalingGroupRequest.Builder |
launchTemplateId(String launchTemplateId)
The ID of the launch template that provides instance configurations for Auto Scaling to create instances.
|
CreateScalingGroupRequest.Builder |
launchTemplateOverrides(List<CreateScalingGroupRequest.LaunchTemplateOverrides> launchTemplateOverrides)
Details of the instance types that you specify by using the Extended Configurations feature of the launch template.
|
CreateScalingGroupRequest.Builder |
launchTemplateVersion(String launchTemplateVersion)
The version number of the launch template.
|
CreateScalingGroupRequest.Builder |
lifecycleHooks(List<CreateScalingGroupRequest.LifecycleHooks> lifecycleHooks)
The lifecycle hooks.
|
CreateScalingGroupRequest.Builder |
loadBalancerConfigs(List<CreateScalingGroupRequest.LoadBalancerConfigs> loadBalancerConfigs)
The load balancer configurations.
|
CreateScalingGroupRequest.Builder |
loadBalancerIds(String loadBalancerIds)
The IDs of the CLB instances that you want to associate with the scaling group.
|
CreateScalingGroupRequest.Builder |
maxInstanceLifetime(Integer maxInstanceLifetime)
The maximum life span of an instance in the scaling group.
|
CreateScalingGroupRequest.Builder |
maxSize(Integer maxSize)
The maximum number of instances that can be contained in the scaling group.
|
CreateScalingGroupRequest.Builder |
minSize(Integer minSize)
The minimum number of instances that must be contained in the scaling group.
|
CreateScalingGroupRequest.Builder |
multiAZPolicy(String multiAZPolicy)
The scaling policy for ECS instances in the multi-zone scaling group.
|
CreateScalingGroupRequest.Builder |
onDemandBaseCapacity(Integer onDemandBaseCapacity)
The minimum number of pay-as-you-go instances that must be contained in the scaling group.
|
CreateScalingGroupRequest.Builder |
onDemandPercentageAboveBaseCapacity(Integer onDemandPercentageAboveBaseCapacity)
The percentage of pay-as-you-go instances in the excess instances when the minimum number of pay-as-you-go instances reaches the requirement.
|
CreateScalingGroupRequest.Builder |
ownerAccount(String ownerAccount)
OwnerAccount.
|
CreateScalingGroupRequest.Builder |
ownerId(Long ownerId)
OwnerId.
|
CreateScalingGroupRequest.Builder |
regionId(String regionId)
The region ID of the scaling group.
|
CreateScalingGroupRequest.Builder |
removalPolicies(List<String> removalPolicies)
The instance removal policies.
|
CreateScalingGroupRequest.Builder |
resourceGroupId(String resourceGroupId)
The ID of the resource group to which you want to add the scaling group.
|
CreateScalingGroupRequest.Builder |
resourceOwnerAccount(String resourceOwnerAccount)
ResourceOwnerAccount.
|
CreateScalingGroupRequest.Builder |
scalingGroupName(String scalingGroupName)
The name of the scaling group.
|
CreateScalingGroupRequest.Builder |
scalingPolicy(String scalingPolicy)
The reclaim mode of the scaling group.
|
CreateScalingGroupRequest.Builder |
serverGroups(List<CreateScalingGroupRequest.ServerGroups> serverGroups)
The server groups.
|
CreateScalingGroupRequest.Builder |
spotAllocationStrategy(String spotAllocationStrategy)
The allocation policy of preemptible instances.
|
CreateScalingGroupRequest.Builder |
spotInstancePools(Integer spotInstancePools)
The number of available instance types.
|
CreateScalingGroupRequest.Builder |
spotInstanceRemedy(Boolean spotInstanceRemedy)
Specifies whether to supplement preemptible instances.
|
CreateScalingGroupRequest.Builder |
syncAlarmRuleToCms(Boolean syncAlarmRuleToCms)
> This parameter is unavailable.
|
CreateScalingGroupRequest.Builder |
tags(List<CreateScalingGroupRequest.Tags> tags)
The tags that you want to add to the scaling group.
|
CreateScalingGroupRequest.Builder |
vServerGroups(List<CreateScalingGroupRequest.VServerGroups> vServerGroups)
The backend vServer group that you want to associate with the scaling group.
|
CreateScalingGroupRequest.Builder |
vSwitchId(String vSwitchId)
The ID of the vSwitch.
|
CreateScalingGroupRequest.Builder |
vSwitchIds(List<String> vSwitchIds)
The IDs of the vSwitches.
|
public CreateScalingGroupRequest.Builder albServerGroups(List<CreateScalingGroupRequest.AlbServerGroups> albServerGroups)
public CreateScalingGroupRequest.Builder allocationStrategy(String allocationStrategy)
* priority: Auto Scaling selects instance types based on the specified order of the instance types to create the required number of instances. * lowestPrice: Auto Scaling selects instance types that have the lowest unit price of vCPUs to create the required number of instances. Default value: priority.
public CreateScalingGroupRequest.Builder azBalance(Boolean azBalance)
* true * false > If you set `MultiAZPolicy` to `COMPOSABLE` and enable `AzBalance` to `true`, this setting has an equivalent effect to setting `MultiAZPolicy` to `BALANCE`. Default value: false.
public CreateScalingGroupRequest.Builder clientToken(String clientToken)
You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see [Ensure idempotence](~~25965~~).
public CreateScalingGroupRequest.Builder compensateWithOnDemand(Boolean compensateWithOnDemand)
* true * false Default value: true.
public CreateScalingGroupRequest.Builder containerGroupId(String containerGroupId)
public CreateScalingGroupRequest.Builder customPolicyARN(String customPolicyARN)
public CreateScalingGroupRequest.Builder DBInstanceIds(String DBInstanceIds)
You can associate only a limited number of ApsaraDB RDS instances with a scaling group. Go to [Quota Center](https://quotas.console.aliyun.com/products/ess/quotas) to check the maximum number of ApsaraDB RDS instances that you can associate with a scaling group.
public CreateScalingGroupRequest.Builder DBInstances(List<CreateScalingGroupRequest.DBInstances> DBInstances)
public CreateScalingGroupRequest.Builder defaultCooldown(Integer defaultCooldown)
During the cooldown period, Auto Scaling does not execute scaling activities that are triggered by CloudMonitor event-triggered tasks. Default value: 300.
public CreateScalingGroupRequest.Builder desiredCapacity(Integer desiredCapacity)
public CreateScalingGroupRequest.Builder groupDeletionProtection(Boolean groupDeletionProtection)
* true: enables deletion protection for the scaling group. This way, the scaling group cannot be deleted. * false: disables deletion protection for the scaling group. Default value: false.
public CreateScalingGroupRequest.Builder groupType(String groupType)
* ECS: ECS instances. * ECI: elastic container instances. Default value: ECS.
public CreateScalingGroupRequest.Builder healthCheckType(String healthCheckType)
* NONE: Auto Scaling does not check the health status of instances. * ECS: Auto Scaling checks the health status of ECS instances in the scaling group. * ECI: Auto Scaling checks the health status of elastic container instances in the scaling group. * LOAD_BALANCER: Auto Scaling checks the health status of instances in the scaling group based on the health check results of load balancers. The health check results of CLB instances are not supported as the health check basis for instances in the scaling group. Default value: ECS.
public CreateScalingGroupRequest.Builder healthCheckTypes(List<String> healthCheckTypes)
* NONE: Auto Scaling does not check the health status of instances. * ECS: Auto Scaling checks the health status of ECS instances in the scaling group. * ECI: Auto Scaling checks the health status of elastic container instances in the scaling group. * LOAD_BALANCER: Auto Scaling checks the health status of instances based on the health check results of load balancers. The health check results of CLB instances are not supported as the health check basis for instances in the scaling group. > HealthCheckTypes has the same effect as `HealthCheckType`. You can select one of them to specify based on your business requirements. If you specify `HealthCheckType`, `HealthCheckTypes` is ignored. HealthCheckTypes is optional. Default value: ECS.
public CreateScalingGroupRequest.Builder instanceId(String instanceId)
public CreateScalingGroupRequest.Builder launchTemplateId(String launchTemplateId)
public CreateScalingGroupRequest.Builder launchTemplateOverrides(List<CreateScalingGroupRequest.LaunchTemplateOverrides> launchTemplateOverrides)
public CreateScalingGroupRequest.Builder launchTemplateVersion(String launchTemplateVersion)
* A fixed template version number. * Default: the default template version. * Latest: the latest template version.
public CreateScalingGroupRequest.Builder lifecycleHooks(List<CreateScalingGroupRequest.LifecycleHooks> lifecycleHooks)
public CreateScalingGroupRequest.Builder loadBalancerConfigs(List<CreateScalingGroupRequest.LoadBalancerConfigs> loadBalancerConfigs)
public CreateScalingGroupRequest.Builder loadBalancerIds(String loadBalancerIds)
You can associate only a limited number of CLB instances with a scaling group. Go to [Quota Center](https://quotas.console.aliyun.com/products/ess/quotas) to check the maximum number of CLB instances that you can associate with a scaling group.
public CreateScalingGroupRequest.Builder maxInstanceLifetime(Integer maxInstanceLifetime)
Valid values: 86400 to the value of the Integer.maxValue parameter. Default value: null.
public CreateScalingGroupRequest.Builder maxSize(Integer maxSize)
The value range of MaxSize is directly correlated with the degree of dependency your business has on Auto Scaling. You can go to [Quota Center](https://quotas.console.aliyun.com/products/ess/quotas) to check **the maximum number of instances that a single scaling group can contain.** If **a single scaling group can contain up to 2,000 ECS instances**, the value range of MaxSize is 0 to 2,000.
public CreateScalingGroupRequest.Builder minSize(Integer minSize)
> The value of MinSize must be less than or equal to the value of MaxSize.
public CreateScalingGroupRequest.Builder multiAZPolicy(String multiAZPolicy)
* PRIORITY: scale ECS instances based on the priority of the vSwitches specified by VSwitchIds. Auto Scaling preferentially scales instances in the zone where the vSwitch of the highest priority resides. If the scaling fails, Auto Scaling scales instances in the zone where the vSwitch of the next highest priority resides. * COST_OPTIMIZED: create ECS instances that have the lowest unit price of vCPUs during scale-out events and removes ECS instances that have the highest unit price of vCPUs during scale-in events. If you specify preemptible instance types in your scaling configuration, Auto Scaling will preferentially create preemptible instances. You can also specify CompensateWithOnDemand to allow Auto Scaling to create pay-as-you-go instances in the case that preemptible instances cannot be created due to limited stock. ** **Note** The COST_OPTIMIZED setting takes effect only when your scaling configuration contains multiple instance types or specifically contains preemptible instance types. * BALANCE: evenly distribute ECS instances across the zones that are specified for the scaling group. If ECS instances are unevenly distributed across the specified zones due to insufficient inventory, you can call the [RebalanceInstance](~~71516~~) operation to evenly distribute the instances across the zones. ** **Note** When you set `MultiAZPolicy` to `BALANCE`, this setting has an equivalent effect to setting `MultiAZPolicy` to `COMPOSABLE` and enabling `AzBalance` to `true`. * COMPOSABLE: combine the preceding policies into a custom scaling policy based on your business requirements. Alternatively, you can specify custom parameters to finely control the capacity of the scaling group. Default value: PRIORITY.
public CreateScalingGroupRequest.Builder onDemandBaseCapacity(Integer onDemandBaseCapacity)
public CreateScalingGroupRequest.Builder onDemandPercentageAboveBaseCapacity(Integer onDemandPercentageAboveBaseCapacity)
public CreateScalingGroupRequest.Builder ownerAccount(String ownerAccount)
public CreateScalingGroupRequest.Builder ownerId(Long ownerId)
public CreateScalingGroupRequest.Builder regionId(String regionId)
public CreateScalingGroupRequest.Builder removalPolicies(List<String> removalPolicies)
* OldestInstance: removes ECS instances that are added at the earliest point in time to the scaling group. * NewestInstance: removes ECS instances that are most recently added to the scaling group. * OldestScalingConfiguration: removes ECS instances that are created based on the earliest scaling configuration. * CustomPolicy: removes ECS instances based on the custom scale-in policy (Function). The scaling configuration source specified by the OldestScalingConfiguration setting can be a scaling configuration or a launch template. The CustomPolicy setting takes effect only if you specify it as the first step to remove instances. If you specify CustomPolicy, you must also specify the CustomPolicyARN parameter. > The removal of ECS instances from a scaling group is also affected by the value of the MultiAZPolicy parameter. For more information, see the [Configure a combination policy for removing instances](~~254822~~) topic.
public CreateScalingGroupRequest.Builder resourceGroupId(String resourceGroupId)
> If you specify this parameter, new scaling groups are added to the specified resource group. If you do not specify this parameter, new scaling groups are added to the default resource group.
public CreateScalingGroupRequest.Builder resourceOwnerAccount(String resourceOwnerAccount)
public CreateScalingGroupRequest.Builder scalingGroupName(String scalingGroupName)
The name must be 2 to 64 characters in length, and can contain letters, digits, underscores (\_), hyphens (-), and periods (.). The name must start with a letter or a digit. If you do not specify this parameter, the value of the ScalingGroupId parameter is used.
public CreateScalingGroupRequest.Builder scalingPolicy(String scalingPolicy)
* recycle: the economical mode * release: the release mode * forcerelease: the forced release mode ** **Note** If you set the value to forcerelease, Auto Scaling will forcibly release the ECS instances that are in the `Running` state during the scale-out events. Forced release equates to an immediate power-off, resulting in the irreversible deletion of all ephemeral data stored on the instance. Once executed, this action cannot be undone and the lost data cannot be recovered. Exercise caution when you select this option. * forcerecycle: the forced recycle mode ** **Note** If you set the value to forcerecycle, Auto Scaling will forcibly shut down the ECS instances that are in the `Running` state during the scale-out events. Forced recycle equates to an immediate power-off, resulting in the irreversible deletion of all ephemeral data stored on the instance. Once executed, this action cannot be undone and the lost data cannot be recovered. Exercise caution when you select this option. ScalingPolicy specifies the reclaim mode of the scaling group. RemovePolicy of the RemoveInstances operation specifies the specific instance removal action. For more information, see [RemoveInstances](~~25955~~).
public CreateScalingGroupRequest.Builder serverGroups(List<CreateScalingGroupRequest.ServerGroups> serverGroups)
> You cannot use AlbServerGroups and ServerGroups to specify the same server group.
public CreateScalingGroupRequest.Builder spotAllocationStrategy(String spotAllocationStrategy)
* priority: Auto Scaling selects instance types based on the specified order of the instance types to create the required number of preemptible instances. * lowestPrice: Auto Scaling selects instance types that have the lowest unit price of vCPUs to create the required number of preemptible instances. Default value: priority.
public CreateScalingGroupRequest.Builder spotInstancePools(Integer spotInstancePools)
public CreateScalingGroupRequest.Builder spotInstanceRemedy(Boolean spotInstanceRemedy)
public CreateScalingGroupRequest.Builder syncAlarmRuleToCms(Boolean syncAlarmRuleToCms)
public CreateScalingGroupRequest.Builder tags(List<CreateScalingGroupRequest.Tags> tags)
public CreateScalingGroupRequest.Builder vServerGroups(List<CreateScalingGroupRequest.VServerGroups> vServerGroups)
public CreateScalingGroupRequest.Builder vSwitchId(String vSwitchId)
> If you do not specify the VSwitchId or VSwitchIds parameter, the network type of the scaling group is classic network.
public CreateScalingGroupRequest.Builder vSwitchIds(List<String> vSwitchIds)
If you specify multiple vSwitches, take note of the following items: * The vSwitches must belong to the same VPC. * The vSwitches can belong to different zones. * vSwitches are sorted in ascending order based on their priorities. The first vSwitch has the highest priority. If Auto Scaling fails to create ECS instances in the zone where the vSwitch of the highest priority resides, Auto Scaling attempts to create ECS instances in the zone where the vSwitch of the next highest priority resides. > If you do not specify VSwitchId or VSwitchIds for your scaling group, the network type of the scaling group is classic network.
public CreateScalingGroupRequest build()
Copyright © 2024. All rights reserved.