o ckF[7*ã@sxddlmZddlmZddlmZddlZddl Z Gdd„de ƒZ Gdd„de ƒZ Gd d „d e ƒZGd d „d e ƒZ dS) é)Ú ListElement)ÚBlockDeviceMapping)Ú ResultSetNc@s.eZdZd dd„Zdd„Zdd„Zdd „ZdS) ÚEbsNcCs||_||_||_dS©N)Ú connectionÚ snapshot_idÚ volume_size)Úselfrrr ©r úA/usr/lib/python3/dist-packages/boto/ec2/autoscale/launchconfig.pyÚ__init__"s z Ebs.__init__cCód|j|jfS)Nz Ebs(%s, %s)©rr ©r r r r Ú__repr__'sz Ebs.__repr__cCódSrr ©r ÚnameÚattrsrr r r Ú startElement*ózEbs.startElementcCs(|dkr ||_dS|dkr||_dSdS)NÚ SnapshotIdÚ VolumeSizer©r rÚvaluerr r r Ú endElement-s   ÿzEbs.endElement)NNN©Ú__name__Ú __module__Ú __qualname__r rrrr r r r r!s   rc@s.eZdZd dd„Zdd„Zdd„Zd d „ZdS) ÚInstanceMonitoringNÚfalsecCs||_||_dSr)rÚenabled)r rr#r r r r 5s zInstanceMonitoring.__init__cCó d|jS)NzInstanceMonitoring(%s)©r#rr r r r9ó zInstanceMonitoring.__repr__cCrrr rr r r r<rzInstanceMonitoring.startElementcCs|dkr ||_dSdS)NÚEnabledr%rr r r r?s ÿzInstanceMonitoring.endElement)Nr"rr r r r r!4s   r!c@s2eZdZ  d dd„Zdd„Zdd„Zdd „ZdS) rNcCs"||_||_||_||_||_dSr)rÚ device_nameÚ virtual_nameÚebsÚ no_device)r rr(r)r*r+r r r r Hs  zBlockDeviceMapping.__init__cCr)NzBlockDeviceMapping(%s, %s))r(r)rr r r rPsÿzBlockDeviceMapping.__repr__cCs|dkr t|ƒ|_|jSdS)Nr)rr*rr r r rTs þzBlockDeviceMapping.startElementcCs>|dkr ||_dS|dkr||_dS|dkrt|ƒ|_dSdS)NÚ DeviceNameÚ VirtualNameÚNoDevice)r(r)Úboolr+rr r r rYs  ÿzBlockDeviceMapping.endElement)NNNNNrr r r r rGs ÿ rc@sJeZdZ          ddd„Zdd„Zd d „Zd d „Zd d„ZdS)ÚLaunchConfigurationNúm1.smallFTcCsÀ||_||_||_| |_||_|pg}t|ƒ|_||_| |_d|_ ||_ ||_ d|_ | |_ | |_ | |_d|_||_||_||_||_||_||_||_|pNg}t|ƒ|_|dur^|j|_dSdS)al 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)rrÚ instance_typeÚblock_device_mappingsÚkey_namerÚsecurity_groupsÚimage_idÚ ramdisk_idÚ created_timeÚ kernel_idÚ user_dataÚinstance_monitoringÚ spot_priceÚinstance_profile_nameÚlaunch_configuration_arnÚ ebs_optimizedÚassociate_public_ip_addressÚ volume_typeÚdelete_on_terminationÚiopsÚuse_block_device_typesÚclassic_link_vpc_idÚ classic_link_vpc_security_groups)r rrr6r4r5r:r2r9r7r3r;r<r=r?r@rArBrCrDrErFÚ sec_groupsÚclassic_link_vpc_sec_groupsr r r r cs<J ÿ ÿzLaunchConfiguration.__init__cCr$)NzLaunchConfiguration:%s)rrr r r rÌr&zLaunchConfiguration.__repr__cCsj|dkr|jS|dkr|jS|dkr'|jrtƒ|_|jStdtfgƒ|_|jS|dkr3t|ƒ|_|jSdS)NÚSecurityGroupsÚClassicLinkVPCSecurityGroupsÚBlockDeviceMappingsÚmemberr!) r5rFrDÚBDMr3rrr!r;rr r r rÏsÿ þz LaunchConfiguration.startElementcCsÊ|dkr ||_dS|dkr||_dS|dkr||_dS|dkr$||_dS|dkr1tj |¡|_dS|dkr:||_dS|dkrC||_ dS|dkr^z t   |¡|_ WdSt y]||_ YdSw|d krg||_dS|d krp||_dS|d kr{t|ƒ|_dS|d kr„||_dS|d kr˜| ¡dkr“d|_dSd|_dS|dkr¬| ¡dkr§d|_dSd|_dS|dkrµ||_dS|dkrÉ| ¡dkrÄd|_dSd|_dS|dkrÔt|ƒ|_dS|dkrÝ||_dSt|||ƒdS)NÚ InstanceTypeÚLaunchConfigurationNameÚKeyNameÚImageIdÚ CreatedTimeÚKernelIdÚ RamdiskIdÚUserDataÚLaunchConfigurationARNr!Ú SpotPriceÚIamInstanceProfileÚ EbsOptimizedÚtrueTFÚAssociatePublicIpAddressÚ VolumeTypeÚDeleteOnTerminationÚIopsÚClassicLinkVPCId)r2rr4r6ÚbotoÚutilsÚparse_tsr8r9r7Úbase64Ú b64decoder:Ú TypeErrorr>r;Úfloatr<r=Úlowerr?r@rArBÚintrCrEÚsetattrrr r r rÞsV        ÿ          zLaunchConfiguration.endElementcCs|j |j¡S)z# Delete this launch configuration. )rÚdelete_launch_configurationrrr r r Údelete szLaunchConfiguration.delete)NNNNNNr1NNNFNNFNNTNFNN)rrr r rrrrkr r r r r0bs  ÷i .r0)Úboto.ec2.elb.listelementrÚboto.ec2.blockdevicemappingrrMÚboto.resultsetrÚ boto.utilsr`rcÚobjectrr!r0r r r r Ús