Пример #1
0
    def modify_group(self, group_config):
        """
        Modify the Auto-Scaling Group

        :type group_config: dict
        :param group_config: auto-scaling group configuration
        """
        group_name = group_config['AutoScalingGroupName']

        endpoint = {'endpoint': self.endpoint}
        cmd = "UpdateAutoScalingGroup"
        params = fetch_used_params(self.name, cmd, group_config)
        params.update(endpoint)
        try:
            self.handle_response(operate(self.service, cmd, params))
        except Exception, e:
            raise IcsASException(e)
Пример #2
0
    def delete_scaling_policy(self, scaling_policy, metric_alarm):
        """
        Delete an existing Scaling Policy

        :type scaling_policy: dict
        :param scaling_policy: scaling policy configuration

        :type metric_alarm: dict
        :param metric_alarm: metric alarm configuration
        """
        result = 0
        endpoint = {'endpoint': self.endpoint}
        cmd = "DeletePolicy"
        params = fetch_used_params(self.name, cmd, scaling_policy)
        params.update(endpoint)
        log.info("delete the scaling policy")
        log.info(">> %s" % scaling_policy["PolicyName"])
        try:
            self.handle_response(operate(self.service, cmd, params))
        except Exception, e:
            log.error(e)
Пример #3
0
        try:
            self.handle_response(operate(self.service, cmd, params))
        except Exception, e:
            raise IcsASException(e)
        log.info("OK")

        if "Tags" in group_config:
            log.info("update the tags of this auto-scaling group")
            log.info(">> %s" % group_name)
            cmd = "CreateOrUpdateTags"
            params = {"Tags": group_config["Tags"]}

            for tag in params["Tags"]:
                tag["ResourceType"] = "auto-scaling-group"

            params = fetch_used_params(self.name, cmd, params)
            params.update(endpoint)
            try:
                self.handle_response(operate(self.service, cmd, params))
            except Exception, e:
                raise IcsASException(e)
            log.info("OK")

    def update_group(self, group_config, launch_config):
        """
        Update the Auto-Scaling Group

        :type group_config: dict
        :param group_config: auto-scaling group configuration

        :type launch_config: dict