Esempio n. 1
0
 def __init__(self, connection=None, name=None, endpoints=None):
     """
     :ivar boto.ec2.elb.ELBConnection connection: The connection this load
         balancer was instance was instantiated from.
     :ivar list listeners: A list of tuples in the form of
         ``(<Inbound port>, <Outbound port>, <Protocol>)``
     :ivar boto.ec2.elb.healthcheck.HealthCheck health_check: The health
         check policy for this load balancer.
     :ivar boto.ec2.elb.policies.Policies policies: Cookie stickiness and
         other policies.
     :ivar str name: The name of the Load Balancer.
     :ivar str dns_name: The external DNS name for the balancer.
     :ivar str created_time: A date+time string showing when the
         load balancer was created.
     :ivar list instances: A list of :py:class:`boto.ec2.instanceinfo.InstanceInfo`
         instances, representing the EC2 instances this load balancer is
         distributing requests to.
     :ivar list availability_zones: The availability zones this balancer
         covers.
     :ivar str canonical_hosted_zone_name: Current CNAME for the balancer.
     :ivar str canonical_hosted_zone_name_id: The Route 53 hosted zone
         ID of this balancer. Needed when creating an Alias record in a
         Route 53 hosted zone.
     :ivar boto.ec2.elb.securitygroup.SecurityGroup source_security_group:
         The security group that you can use as part of your inbound rules
         for your load balancer back-end instances to disallow traffic
         from sources other than your load balancer.
     :ivar list subnets: A list of subnets this balancer is on.
     :ivar list security_groups: A list of additional security groups that
         have been applied.
     :ivar str vpc_id: The ID of the VPC that this ELB resides within.
     :ivar list backends: A list of :py:class:`boto.ec2.elb.loadbalancer.Backend
         back-end server descriptions.
     """
     self.connection = connection
     self.name = name
     self.listeners = None
     self.health_check = None
     self.policies = None
     self.dns_name = None
     self.created_time = None
     self.instances = None
     self.availability_zones = ListElement()
     self.canonical_hosted_zone_name = None
     self.canonical_hosted_zone_name_id = None
     self.source_security_group = None
     self.subnets = ListElement()
     self.security_groups = ListElement()
     self.vpc_id = None
     self.scheme = None
     self.backends = None
     self._attributes = None
     self._tags = None
    def __init__(self, connection=None, name=None, image_id=None,
                 key_name=None, security_groups=None, user_data=None,
                 instance_type='m1.small', kernel_id=None,
                 ramdisk_id=None, block_device_mappings=None):
        """
        A launch configuration.

        @type name: str
        @param name: Name of the launch configuration to create.

        @type image_id: str
        @param image_id: Unique ID of the Amazon Machine Image (AMI) which was
                         assigned during registration.

        @type key_name: str
        @param key_name: The name of the EC2 key pair.

        @type security_groups: list
        @param security_groups: Names of the security groups with which to
                                associate the EC2 instances.

        """
        self.connection = connection
        self.name = name
        self.instance_type = instance_type
        self.block_device_mappings = block_device_mappings
        self.key_name = key_name
        sec_groups = security_groups or []
        self.security_groups = ListElement(sec_groups)
        self.image_id = image_id
        self.ramdisk_id = ramdisk_id
        self.created_time = None
        self.kernel_id = kernel_id
        self.user_data = user_data
        self.created_time = None
Esempio n. 3
0
 def __init__(self, connection=None, name=None, endpoints=None):
     self.connection = connection
     self.name = name
     self.listeners = None
     self.health_check = None
     self.policies = None
     self.dns_name = None
     self.created_time = None
     self.instances = None
     self.availability_zones = ListElement()
     self.canonical_hosted_zone_name = None
     self.canonical_hosted_zone_name_id = None
     self.source_security_group = None
     self.subnets = ListElement() 
     self.security_groups = ListElement()
     self.vpc_id = None 
Esempio n. 4
0
 def __init__(self, load_balancer=None, load_balancer_port=0,
              instance_port=0, protocol='', ssl_certificate_id=None):
     self.load_balancer = load_balancer
     self.load_balancer_port = load_balancer_port
     self.instance_port = instance_port
     self.protocol = protocol
     self.ssl_certificate_id = ssl_certificate_id
     self.policy_names = ListElement()
Esempio n. 5
0
    def __init__(self,
                 connection=None,
                 group_name=None,
                 availability_zone=None,
                 launch_config=None,
                 load_balancers=None,
                 cooldown=0,
                 min_size=None,
                 max_size=None):
        """
        Creates a new AutoScalingGroup with the specified name.

        You must not have already used up your entire quota of
        AutoScalingGroups in order for this call to be successful. Once the
        creation request is completed, the AutoScalingGroup is ready to be
        used in other calls.

        @type name: str
        @param name: Name of autoscaling group.

        @type availability_zone: str
        @param availability_zone: An availability zone.

        @type launch_config: str
        @param launch_config: Name of launch configuration name.

        @type load_balancers: list
        @param load_balancers: List of load balancers.

        @type minsize: int
        @param minsize: Minimum size of group

        @type maxsize: int
        @param maxsize: Maximum size of group

        @type cooldown: int
        @param cooldown: Amount of time after a Scaling Activity completes
                         before any further scaling activities can start.

        @rtype: tuple
        @return: Updated healthcheck for the instances.
        """
        self.name = group_name
        self.connection = connection
        self.min_size = min_size
        self.max_size = max_size
        self.created_time = None
        self.cooldown = cooldown
        self.launch_config = launch_config
        if self.launch_config:
            self.launch_config_name = self.launch_config.name
        else:
            self.launch_config_name = None
        self.desired_capacity = None
        lbs = load_balancers or []
        self.load_balancers = ListElement(lbs)
        self.availability_zone = availability_zone
        self.instances = None
 def __init__(self, connection=None, name=None, endpoints=None):
     self.connection = connection
     self.name = name
     self.listeners = None
     self.health_check = None
     self.dns_name = None
     self.created_time = None
     self.instances = None
     self.availability_zones = ListElement()
Esempio n. 7
0
    def __init__(self, connection=None, name=None, image_id=None,
                 key_name=None, security_groups=None, user_data=None,
                 instance_type='m1.small', kernel_id=None,
                 ramdisk_id=None, block_device_mappings=None,
                 instance_monitoring=False):
        """
        A launch configuration.

        :type name: str
        :param name: Name of the launch configuration to create.

        :type image_id: str
        :param image_id: Unique ID of the Amazon Machine Image (AMI) which was
                         assigned during registration.

        :type key_name: str
        :param key_name: The name of the EC2 key pair.

        :type security_groups: list
        :param security_groups: Names of the security groups with which to
                                associate the EC2 instances.

        :type user_data: str
        :param user_data: The user data available to launched EC2 instances.

        :type instance_type: str
        :param instance_type: The instance type

        :type kern_id: str
        :param kern_id: Kernel id for instance

        :type ramdisk_id: str
        :param ramdisk_id: RAM disk id for instance

        :type block_device_mappings: list
        :param block_device_mappings: Specifies how block devices are exposed
                                      for instances

        :type instance_monitoring: bool
        :param instance_monitoring: Whether instances in group are launched
                                    with detailed monitoring.
        """
        self.connection = connection
        self.name = name
        self.instance_type = instance_type
        self.block_device_mappings = block_device_mappings
        self.key_name = key_name
        sec_groups = security_groups or []
        self.security_groups = ListElement(sec_groups)
        self.image_id = image_id
        self.ramdisk_id = ramdisk_id
        self.created_time = None
        self.kernel_id = kernel_id
        self.user_data = user_data
        self.created_time = None
        self.instance_monitoring = instance_monitoring
        self.launch_configuration_arn = None
Esempio n. 8
0
 def __init__(self, connection=None):
     self.connection = connection
     self.zones = ListElement()
Esempio n. 9
0
    def __init__(self, connection=None, name=None,
                 launch_config=None, availability_zones=None,
                 load_balancers=None, default_cooldown=None,
                 health_check_type=None, health_check_period=None,
                 placement_group=None, vpc_zone_identifier=None,
                 desired_capacity=None, min_size=None, max_size=None, **kwargs):
        """
        Creates a new AutoScalingGroup with the specified name.

        You must not have already used up your entire quota of
        AutoScalingGroups in order for this call to be successful. Once the
        creation request is completed, the AutoScalingGroup is ready to be
        used in other calls.

        :type name: str
        :param name: Name of autoscaling group (required).

        :type availability_zones: list
        :param availability_zones: List of availability zones (required).

        :type default_cooldown: int
        :param default_cooldown: Number of seconds after a Scaling Activity
            completes before any further scaling activities can start.

        :type desired_capacity: int
        :param desired_capacity: The desired capacity for the group.

        :type health_check_period: str
        :param health_check_period: Length of time in seconds after a new
            EC2 instance comes into service that Auto Scaling starts
            checking its health.

        :type health_check_type: str
        :param health_check_type: The service you want the health status from,
            Amazon EC2 or Elastic Load Balancer.

        :type launch_config: str or LaunchConfiguration
        :param launch_config: Name of launch configuration (required).

        :type load_balancers: list
        :param load_balancers: List of load balancers.

        :type max_size: int
        :param maxsize: Maximum size of group (required).

        :type min_size: int
        :param minsize: Minimum size of group (required).

        :type placement_group: str
        :param placement_group: Physical location of your cluster placement
            group created in Amazon EC2.

        :type vpc_zone_identifier: str
        :param vpc_zone_identifier: The subnet identifier of the Virtual
            Private Cloud.
            
        :rtype: :class:`boto.ec2.autoscale.group.AutoScalingGroup`
        :return: An autoscale group.
        """
        self.name = name or kwargs.get('group_name')   # backwards compatibility
        self.connection = connection
        self.min_size = int(min_size) if min_size is not None else None
        self.max_size = int(max_size) if max_size is not None else None
        self.created_time = None
        # backwards compatibility
        default_cooldown = default_cooldown or kwargs.get('cooldown')
        if default_cooldown is not None:
            default_cooldown = int(default_cooldown)
        self.default_cooldown = default_cooldown
        self.launch_config_name = launch_config
        if launch_config and isinstance(launch_config, LaunchConfiguration):
            self.launch_config_name = launch_config.name
        self.desired_capacity = desired_capacity
        lbs = load_balancers or []
        self.load_balancers = ListElement(lbs)
        zones = availability_zones or []
        self.availability_zones = ListElement(zones)
        self.health_check_period = health_check_period
        self.health_check_type = health_check_type
        self.placement_group = placement_group
        self.autoscaling_group_arn = None
        self.vpc_zone_identifier = vpc_zone_identifier
        self.instances = None
        self.tags = None
Esempio n. 10
0
 def __init__(self, connection=None):
     self.connection = connection
     self.adjustment_types = ListElement([])
Esempio n. 11
0
    def __init__(self, connection=None, name=None, image_id=None,
                 key_name=None, security_groups=None, user_data=None,
                 instance_type='m1.small', kernel_id=None,
                 ramdisk_id=None, block_device_mappings=None,
                 instance_monitoring=False, spot_price=None,
                 instance_profile_name=None, ebs_optimized=False,
                 associate_public_ip_address=None):
        """
        A launch configuration.

        :type name: str
        :param name: Name of the launch configuration to create.

        :type image_id: str
        :param image_id: Unique ID of the Amazon Machine Image (AMI) which was
            assigned during registration.

        :type key_name: str
        :param key_name: The name of the EC2 key pair.

        :type security_groups: list
        :param security_groups: Names or security group id's of the security
            groups with which to associate the EC2 instances or VPC instances,
            respectively.

        :type user_data: str
        :param user_data: The user data available to launched EC2 instances.

        :type instance_type: str
        :param instance_type: The instance type

        :type kern_id: str
        :param kern_id: Kernel id for instance

        :type ramdisk_id: str
        :param ramdisk_id: RAM disk id for instance

        :type block_device_mappings: list
        :param block_device_mappings: Specifies how block devices are exposed
            for instances

        :type instance_monitoring: bool
        :param instance_monitoring: Whether instances in group are launched
            with detailed monitoring.

        :type spot_price: float
        :param spot_price: The spot price you are bidding.  Only applies
            if you are building an autoscaling group with spot instances.

        :type instance_profile_name: string
        :param instance_profile_name: The name or the Amazon Resource
            Name (ARN) of the instance profile associated with the IAM
            role for the instance.

        :type ebs_optimized: bool
        :param ebs_optimized: Specifies whether the instance is optimized
            for EBS I/O (true) or not (false).

        :type associate_public_ip_address: bool
        :param associate_public_ip_address: Used for Auto Scaling groups that launch instances into an Amazon Virtual Private Cloud. 
            Specifies whether to assign a public IP address to each instance launched in a Amazon VPC.
        """
        self.connection = connection
        self.name = name
        self.instance_type = instance_type
        self.block_device_mappings = block_device_mappings
        self.key_name = key_name
        sec_groups = security_groups or []
        self.security_groups = ListElement(sec_groups)
        self.image_id = image_id
        self.ramdisk_id = ramdisk_id
        self.created_time = None
        self.kernel_id = kernel_id
        self.user_data = user_data
        self.created_time = None
        self.instance_monitoring = instance_monitoring
        self.spot_price = spot_price
        self.instance_profile_name = instance_profile_name
        self.launch_configuration_arn = None
        self.ebs_optimized = ebs_optimized
        self.associate_public_ip_address = associate_public_ip_address
Esempio n. 12
0
    def __init__(self,
                 connection=None,
                 name=None,
                 launch_config=None,
                 availability_zones=None,
                 load_balancers=None,
                 default_cooldown=None,
                 desired_capacity=None,
                 min_size=None,
                 max_size=None,
                 **kwargs):
        """
        Creates a new AutoScalingGroup with the specified name.

        You must not have already used up your entire quota of
        AutoScalingGroups in order for this call to be successful. Once the
        creation request is completed, the AutoScalingGroup is ready to be
        used in other calls.

        :type name: str
        :param name: Name of autoscaling group.

        :type launch_config: str
        :param launch_config: Name of launch configuration name.

        :type availability_zones: list
        :param availability_zones: List of availability zones.

        :type load_balancers: list
        :param load_balancers: List of load balancers.

        :type minsize: int
        :param minsize: Minimum size of group

        :type maxsize: int
        :param maxsize: Maximum size of group

        :type default_cooldown: int
        :param default_cooldown: Number of seconds after a Scaling Activity completes
                                 before any further scaling activities can start.

        :type desired_capacity: int
        :param desired_capacity: The desired capacity for the group.

        :rtype: :class:`boto.ec2.autoscale.group.AutoScalingGroup`
        :return: An autoscale group.
        """
        self.name = name or kwargs.get('group_name')  # backwards compatibility
        self.connection = connection
        self.min_size = int(min_size) if min_size is not None else None
        self.max_size = int(max_size) if max_size is not None else None
        self.created_time = None
        default_cooldown = default_cooldown or kwargs.get(
            'cooldown')  # backwards compatibility
        self.default_cooldown = int(
            default_cooldown) if default_cooldown is not None else None
        self.launch_config = launch_config
        if self.launch_config:
            self.launch_config_name = self.launch_config.name
        else:
            self.launch_config_name = None
        self.desired_capacity = desired_capacity
        lbs = load_balancers or []
        self.load_balancers = ListElement(lbs)
        zones = availability_zones or []
        self.availability_zones = ListElement(zones)
        self.instances = None
        self.placement_group = None
        self.autoscaling_group_arn = None
        self.healthcheck_grace_period = None
        self.healthcheck_type = None
        self.vpc_zone_identifier = None
Esempio n. 13
0
    def __init__(self,
                 connection=None,
                 group_name=None,
                 availability_zone=None,
                 launch_config=None,
                 availability_zones=None,
                 load_balancers=None,
                 cooldown=0,
                 min_size=None,
                 max_size=None,
                 group_arn=None,
                 health_check_type=None,
                 health_check_period=None,
                 suspended=None,
                 placement_group=None,
                 vpc_zone=None):
        """
        Creates a new AutoScalingGroup with the specified name.

        You must not have already used up your entire quota of
        AutoScalingGroups in order for this call to be successful. Once the
        creation request is completed, the AutoScalingGroup is ready to be
        used in other calls.

        :type name: str
        :param name: Name of autoscaling group.

        :type availability_zone: str
        :param availability_zone: An availability zone. DEPRECATED - use the
                                  availability_zones parameter, which expects
                                  a list of availability zone
                                  strings

        :type availability_zone: list
        :param availability_zone: List of availability zones.

        :type launch_config: str
        :param launch_config: Name of launch configuration name.

        :type load_balancers: list
        :param load_balancers: List of load balancers.

        :type minsize: int
        :param minsize: Minimum size of group

        :type maxsize: int
        :param maxsize: Maximum size of group

        :type cooldown: int
        :param cooldown: Amount of time after a Scaling Activity completes
                         before any further scaling activities can start.

        :rtype: tuple
        :return: Updated healthcheck for the instances.
        """
        self.name = group_name
        self.connection = connection
        self.min_size = min_size
        self.max_size = max_size
        self.created_time = None
        self.cooldown = cooldown
        self.launch_config = launch_config
        if self.launch_config:
            self.launch_config_name = self.launch_config.name
        else:
            self.launch_config_name = None
        self.desired_capacity = None
        lbs = load_balancers or []
        self.load_balancers = ListElement(lbs)
        zones = availability_zones or []
        self.availability_zone = availability_zone
        self.availability_zones = ListElement(zones)
        self.group_arn = group_arn
        self.health_check_type = health_check_type
        self.health_check_period = health_check_period
        self.suspended = suspended
        self.placement_group = placement_group
        self.vpc_zone = vpc_zone
        self.metrics = None
        self.instances = None