ó
è?F[c           @   s¤   d  d l  m Z d  d l m Z d  d l m Z d  d l Z d  d l	 Z	 d e
 f d „  ƒ  YZ d e
 f d „  ƒ  YZ d	 e
 f d
 „  ƒ  YZ d e
 f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   ListElement(   t   BlockDeviceMapping(   t	   ResultSetNt   Ebsc           B   s5   e  Z d d d d  „ Z d „  Z d „  Z d „  Z RS(   c         C   s   | |  _  | |  _ | |  _ d  S(   N(   t
   connectiont   snapshot_idt   volume_size(   t   selfR   R   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyt   __init__"   s    		c         C   s   d |  j  |  j f S(   Ns   Ebs(%s, %s)(   R   R   (   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyt   __repr__'   s    c         C   s   d  S(   N(    (   R   t   namet   attrsR   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyt   startElement*   s    c         C   s4   | d k r | |  _  n | d k r0 | |  _ n  d  S(   Nt
   SnapshotIdt
   VolumeSize(   R   R   (   R   R
   t   valueR   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyt
   endElement-   s    N(   t   __name__t
   __module__t   NoneR   R	   R   R   (    (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR   !   s   		t   InstanceMonitoringc           B   s2   e  Z d d  d „ Z d „  Z d „  Z d „  Z RS(   t   falsec         C   s   | |  _  | |  _ d  S(   N(   R   t   enabled(   R   R   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR   5   s    	c         C   s   d |  j  S(   Ns   InstanceMonitoring(%s)(   R   (   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR	   9   s    c         C   s   d  S(   N(    (   R   R
   R   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR   <   s    c         C   s   | d k r | |  _  n  d  S(   Nt   Enabled(   R   (   R   R
   R   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR   ?   s    N(   R   R   R   R   R	   R   R   (    (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR   4   s   		R   c           B   s;   e  Z d d d d d d  „ Z d „  Z d „  Z d „  Z RS(   c         C   s1   | |  _  | |  _ | |  _ | |  _ | |  _ d  S(   N(   R   t   device_namet   virtual_namet   ebst	   no_device(   R   R   R   R   R   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR   H   s
    				c         C   s   d |  j  |  j f S(   Ns   BlockDeviceMapping(%s, %s)(   R   R   (   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR	   P   s    	c         C   s&   | d k r" t  |  ƒ |  _ |  j Sd  S(   NR   (   R   R   (   R   R
   R   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR   T   s    c         C   sR   | d k r | |  _  n6 | d k r0 | |  _ n | d k rN t | ƒ |  _ n  d  S(   Nt
   DeviceNamet   VirtualNamet   NoDevice(   R   R   t   boolR   (   R   R
   R   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR   Y   s    N(   R   R   R   R   R	   R   R   (    (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR   G   s
   			t   LaunchConfigurationc           B   st   e  Z d d d d d d d  d d d e d d e d d e d e d d d „ Z d „  Z d „  Z d „  Z d „  Z	 RS(   s   m1.smallc         C   s  | |  _  | |  _ | |  _ |
 |  _ | |  _ | p6 g  } t | ƒ |  _ | |  _ |	 |  _ d |  _
 | |  _ | |  _ d |  _
 | |  _ | |  _ | |  _ d |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | pê g  } t | ƒ |  _ | d k	 r| j |  _ n  d S(   sl	  
        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 kernel_id: str
        :param kernel_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.

        :type classic_link_vpc_id: str
        :param classic_link_vpc_id: ID of ClassicLink enabled VPC.

        :type classic_link_vpc_security_groups: list
        :param classic_link_vpc_security_groups: Security group
            id's of the security groups with which to associate the
            ClassicLink VPC instances.
        N(   R   R
   t   instance_typet   block_device_mappingst   key_nameR    t   security_groupst   image_idt
   ramdisk_idR   t   created_timet	   kernel_idt	   user_datat   instance_monitoringt
   spot_pricet   instance_profile_namet   launch_configuration_arnt   ebs_optimizedt   associate_public_ip_addresst   volume_typet   delete_on_terminationt   iopst   use_block_device_typest   classic_link_vpc_idt    classic_link_vpc_security_groups(   R   R   R
   R%   R#   R$   R)   R!   R(   R&   R"   R*   R+   R,   R.   R/   R0   R1   R2   R3   R4   R5   t
   sec_groupst   classic_link_vpc_sec_groups(    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR   c   s8    J																						c         C   s   d |  j  S(   Ns   LaunchConfiguration:%s(   R
   (   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR	   Ì   s    c         C   s   | d k r |  j  S| d k r& |  j S| d k ri |  j rJ t ƒ  |  _ n t d t f g ƒ |  _ |  j S| d k r‹ t |  ƒ |  _ |  j Sd  S(   Nt   SecurityGroupst   ClassicLinkVPCSecurityGroupst   BlockDeviceMappingst   memberR   (	   R$   R5   R3   t   BDMR"   R   R   R   R*   (   R   R
   R   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR   Ï   s    	c         C   sT  | d k r | |  _  n8| d k r0 | |  _ n | d k rH | |  _ n| d k r` | |  _ nð| d k r„ t j j | ƒ |  _ nÌ| d k rœ | |  _ n´| d k r´ | |  _	 nœ| d k rö y t
 j | ƒ |  _ WqPt k
 rò | |  _ qPXnZ| d	 k r| |  _ nB| d
 k r&| |  _ n*| d k rDt | ƒ |  _ n| d k r\| |  _ nô | d k rŒ| j ƒ  d k r€t n t |  _ nÄ | d k r¼| j ƒ  d k r°t n t |  _ n” | d k rÔ| |  _ n| | d k r
| j ƒ  d k rþt |  _ qPt |  _ nF | d k r(t | ƒ |  _ n( | d k r@| |  _ n t |  | | ƒ d  S(   Nt   InstanceTypet   LaunchConfigurationNamet   KeyNamet   ImageIdt   CreatedTimet   KernelIdt	   RamdiskIdt   UserDatat   LaunchConfigurationARNR   t	   SpotPricet   IamInstanceProfilet   EbsOptimizedt   truet   AssociatePublicIpAddresst
   VolumeTypet   DeleteOnTerminationt   Iopst   ClassicLinkVPCId(   R!   R
   R#   R%   t   botot   utilst   parse_tsR'   R(   R&   t   base64t	   b64decodeR)   t	   TypeErrorR-   R*   t   floatR+   R,   t   lowert   Truet   FalseR.   R/   R0   R1   t   intR2   R4   t   setattr(   R   R
   R   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR   Þ   sT    $$c         C   s   |  j  j |  j ƒ S(   s#    Delete this launch configuration. (   R   t   delete_launch_configurationR
   (   R   (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyt   delete  s    N(
   R   R   R   RX   RW   R   R	   R   R   R\   (    (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyR    b   s   		`			.(   t   boto.ec2.elb.listelementR    t   boto.ec2.blockdevicemappingR   R<   t   boto.resultsetR   t
   boto.utilsRO   RR   t   objectR   R   R    (    (    (    s>   lib/python2.7/site-packages/boto/ec2/autoscale/launchconfig.pyt   <module>   s   