in footmark/ess/connection.py [0:0]
def modify_group(self, scaling_group_id, max_size=None, min_size=None, name=None, default_cooldown=None,
removal_policies=None, scaling_configuration_id=None):
"""
Modifies the attributes of a scaling group.
The interface can be called only when the scaling group is active or inactive.
When the scaling configuration specified for the scaling group needs to be modified,
the instance type attribute of the modified scaling configuration must be consistent with that of the active scaling configuration.
After a new scaling configuration is added to the scaling group, the running ECS instances which are created based on the previous scaling configuration remain unchanged.
When the number (total capacity) of ECS instances in the scaling group does not meet the modified MaxSize or MinSize specification,
the Auto Scaling service automatically attaches or removes ECS instances to/from the group to make odds even.
:type str
:param scaling_group_id: ID of a scaling group.
:type int
:param max_size: Maximum number of ECS instances in the scaling group. Value range: [0, 100].
:type int
:param min_size: Minimum number of ECS instances in the scaling group. Value range: [0, 100].
:type str
:param name: Name shown for the scaling group, which must contain 2-40 characters (English or Chinese).
The name must begin with a number, an upper/lower-case letter or a Chinese character and may contain numbers, “_“, “-“ or “.”.
The account name is unique in the same region.
If this parameter is not specified, the default value is its ID.
:type int
:param default_cooldown: Default cool-down time (in seconds) of the scaling group. Value range: [0, 86400]. Default to is 300.
:type list
:param removal_policies: Policy for removing ECS instances from the scaling group.
Optional values:
OldestInstance: removes the first ECS instance attached to the scaling group.
NewestInstance: removes the first ECS instance attached to the scaling group.
OldestScalingConfiguration: removes the ECS instance with the oldest scaling configuration.
Default values: OldestScalingConfiguration and OldestInstance.
At most 2 policies can be entered.
:type str
:param scaling_configuration_id: ID of a active scaling configuration.
:rtype: object
:return: Returns a <footmark.ess.Group> object.
"""
params = {}
self.build_list_params(params, scaling_group_id, 'ScalingGroupId')
if max_size is not None:
self.build_list_params(params, max_size, 'MaxSize')
if min_size is not None:
self.build_list_params(params, min_size, 'MinSize')
if name:
self.build_list_params(params, name, 'ScalingGroupName')
if default_cooldown:
self.build_list_params(params, default_cooldown, 'DefaultCooldown')
if removal_policies:
for i in range(len(removal_policies)):
if i < 2 and removal_policies[i]:
self.build_list_params(params, removal_policies[i], 'RemovalPolicy' + bytes(i + 1));
if scaling_configuration_id:
self.build_list_params(params, scaling_configuration_id, 'ActiveScalingConfigurationId')
return self.get_status('ModifyScalingGroup', params)