Implemented autoscale method create_or_update_tags
This commit is contained in:
parent
4372c346d9
commit
0efea0af2b
@ -440,6 +440,13 @@ class AutoScalingBackend(BaseBackend):
|
||||
self.elb_backend.register_instances(elb.name, group_instance_ids - elb_instace_ids)
|
||||
self.elb_backend.deregister_instances(elb.name, elb_instace_ids - group_instance_ids)
|
||||
|
||||
def create_or_update_tags(self, tags):
|
||||
for tag in tags:
|
||||
group_name = tag["ResourceId"]
|
||||
group = self.autoscaling_groups[group_name]
|
||||
updated_tags = group.tags.copy()
|
||||
updated_tags.update(tag)
|
||||
group.tags = updated_tags
|
||||
|
||||
autoscaling_backends = {}
|
||||
for region, ec2_backend in ec2_backends.items():
|
||||
|
@ -105,6 +105,11 @@ class AutoScalingResponse(BaseResponse):
|
||||
template = self.response_template(SET_DESIRED_CAPACITY_TEMPLATE)
|
||||
return template.render()
|
||||
|
||||
def create_or_update_tags(self):
|
||||
tags = self._get_param('Tags')
|
||||
self.autoscaling_backend.create_or_update_tags(tags)
|
||||
return None
|
||||
|
||||
def describe_auto_scaling_instances(self):
|
||||
instance_states = self.autoscaling_backend.describe_autoscaling_instances()
|
||||
template = self.response_template(DESCRIBE_AUTOSCALING_INSTANCES_TEMPLATE)
|
||||
|
Loading…
Reference in New Issue
Block a user