ó FRTc@sèddlmZddlmZddlmZddlmZddlm Z ddl m Z de fd„ƒYZ d e fd „ƒYZd e fd „ƒYZd efd„ƒYZde fd„ƒYZde fd„ƒYZdS(iÿÿÿÿ(t ListElement(t ResultSet(tLaunchConfiguration(tRequest(tInstance(tTagt ProcessTypecBs/eZdd„Zd„Zd„Zd„ZRS(cCs||_d|_dS(N(t connectiontNonet process_name(tselfR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyt__init__s cCs d|jS(NsProcessType(%s)(R (R ((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyt__repr__#scCsdS(N((R tnametattrsR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyt startElement&scCs|dkr||_ndS(Nt ProcessName(R (R R tvalueR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyt endElement)s N(t__name__t __module__RR R RR(((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRs   tSuspendedProcesscBs/eZdd„Zd„Zd„Zd„ZRS(cCs||_d|_d|_dS(N(RRR treason(R R((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyR /s  cCsd|j|jfS(NsSuspendedProcess(%s, %s)(R R(R ((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyR 4scCsdS(N((R R RR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyR7scCs4|dkr||_n|dkr0||_ndS(NRtSuspensionReason(R R(R R RR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyR:s   N(RRRR R RR(((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyR.s   t EnabledMetriccBs5eZdddd„Zd„Zd„Zd„ZRS(cCs||_||_||_dS(N(Rtmetrict granularity(R RRR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyR Bs  cCsd|j|jfS(NsEnabledMetric(%s, %s)(RR(R ((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyR GscCsdS(N((R R RR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRJscCs4|dkr||_n|dkr0||_ndS(Nt GranularitytMetric(RR(R R RR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRMs   N(RRRR R RR(((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRAs  tTerminationPoliciescBseZd„Zd„ZRS(cCsdS(N((R R RR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRVscCs |dkr|j|ƒndS(Ntmember(tappend(R R RR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRYs (RRRR(((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRTs tAutoScalingGroupcBsÝeZddddddddddddddddd„Zd„Zd„ZeeeƒZd„Zd„Z d„Z d„Z d„Z d„Z ed „Zdd d „Zd „Zd „Zdd„Zdd„ZRS(c Ks¢|p|jdƒ|_||_| dk r9t| ƒnd|_| dk rZt| ƒnd|_d|_|p~|jdƒ}|dk rœt|ƒ}n||_||_ |rÒt |t ƒrÒ|j|_ n| |_ |päg}t |ƒ|_|pÿg}t |ƒ|_||_||_| |_d|_t| ƒtkrYdj| ƒ} n| |_d|_|ptd|_|pƒg}t |ƒ|_||_dS(s. 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 max_size: Maximum size of group (required). :type min_size: int :param min_size: 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 or list :param vpc_zone_identifier: A comma-separated string or python list of the subnet identifiers of the Virtual Private Cloud. :type tags: list :param tags: List of :class:`boto.ec2.autoscale.tag.Tag`s :type termination_policies: list :param termination_policies: A list of termination policies. Valid values are: "OldestInstance", "NewestInstance", "OldestLaunchConfiguration", "ClosestToNextInstanceHour", "Default". If no value is specified, the "Default" value is used. :type instance_id: str :param instance_id: The ID of the Amazon EC2 instance you want to use to create the Auto Scaling group. :rtype: :class:`boto.ec2.autoscale.group.AutoScalingGroup` :return: An autoscale group. t group_nametcooldownt,N(tgetR RRtinttmin_sizetmax_sizet created_timetdefault_cooldowntlaunch_config_namet isinstanceRtdesired_capacityRtload_balancerstavailability_zonesthealth_check_periodthealth_check_typetplacement_grouptautoscaling_group_arnttypetlisttjointvpc_zone_identifiert instancesttagsttermination_policiest instance_id(R RR t launch_configR.R-R)R0R/R1R6R,R&R'R8R9R:tkwargstlbstzones((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyR _s:J !!              cCs|jS(N(R)(R ((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyt _get_cooldownÉscCs ||_dS(N(R)(R tval((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyt _set_cooldownÌscCs d|jS(NsAutoScaleGroup<%s>(R (R ((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyR ÑscCsí|dkr+tdtfgƒ|_|jS|dkr>|jS|dkrQ|jS|dkr|tdtfgƒ|_|jS|dkr§tdtfgƒ|_|jS|dkrÒtdt fgƒ|_ |j S|dkrå|j SdSdS( Nt InstancesRtLoadBalancerNamestAvailabilityZonestEnabledMetricstSuspendedProcessestTagsR( RRR7R-R.Rtenabled_metricsRtsuspended_processesRR8R9(R R RR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRÔs&       cCs‹|dkrt|ƒ|_ni|dkr6||_nQ|dkrN||_n9|dkrlt|ƒ|_n|dkr„||_n|dkr¢t|ƒ|_nå|dkrÀt|ƒ|_nÇ|dkrØ||_n¯|d krð||_ n—|d kr/yt|ƒ|_ Wq‡t k r+d|_ q‡XnX|d krG||_ n@|d kr_||_n(|d krw||_nt|||ƒdS(NtMinSizetAutoScalingGroupARNt CreatedTimetDefaultCooldowntLaunchConfigurationNametDesiredCapacitytMaxSizetAutoScalingGroupNametPlacementGrouptHealthCheckGracePeriodtHealthCheckTypetVPCZoneIdentifiert InstanceId(R%R&R2R(R)R*R,R'R R1R/t ValueErrorRR0R6R:tsetattr(R R RR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRês<                      cCs?i|jd6|d6}|jjd|tƒ}||j_|S(s9 Set the desired capacity for the group. RQROtSetDesiredCapacity(R Rt get_objectRt last_request(R tcapacitytparamstreq((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyt set_capacity s     cCs|jjd|ƒS(s< Sync local changes with AutoScaling group. tUpdateAutoScalingGroup(Rt _update_group(R ((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pytupdatescCs)d|_d|_d|_|jƒdS(sg Convenience method which shuts down all instances associated with this group. iN(R&R'R,Rb(R ((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pytshutdown_instancess   cCs|jj|j|ƒS(sw Delete this auto-scaling group if no instances attached or no scaling activities in progress. (Rtdelete_auto_scaling_groupR (R t force_delete((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pytdelete&si2cCs|jj|||ƒS(s2 Get all activies for this group. (Rtget_all_activities(R t activity_idst max_records((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pytget_activities.scCs|jj|||ƒS(sv Configures an Auto Scaling group to send notifications when specified events take place. Valid notification types are: 'autoscaling:EC2_INSTANCE_LAUNCH', 'autoscaling:EC2_INSTANCE_LAUNCH_ERROR', 'autoscaling:EC2_INSTANCE_TERMINATE', 'autoscaling:EC2_INSTANCE_TERMINATE_ERROR', 'autoscaling:TEST_NOTIFICATION' (Rtput_notification_configuration(R ttopictnotification_types((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRk5s cCs|jj||ƒS(sR Deletes notifications created by put_notification_configuration. (Rt!delete_notification_configuration(R Rl((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRnCscCs|jj|j|ƒS(sL Suspends Auto Scaling processes for an Auto Scaling group. (Rtsuspend_processesR (R tscaling_processes((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRoIscCs|jj|j|ƒS(sK Resumes Auto Scaling processes for an Auto Scaling group. (Rtresume_processesR (R Rp((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRqOsN(RRRR R?RAtpropertyR"R RRR_RbRctFalseRfRjRkRnRoRq(((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyR ^s, d     !     tAutoScalingGroupMetriccBs/eZdd„Zd„Zd„Zd„ZRS(cCs||_d|_d|_dS(N(RRRR(R R((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyR Ws  cCs d|jS(NsAutoScalingGroupMetric:%s(R(R ((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyR ]scCsdS(N((R R RR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyR`scCsD|dkr||_n(|dkr0||_nt|||ƒdS(NRR(RRRX(R R RR((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRcs     N(RRRR R RR(((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyRtVs   N(tboto.ec2.elb.listelementRtboto.resultsetRtboto.ec2.autoscale.launchconfigRtboto.ec2.autoscale.requestRtboto.ec2.autoscale.instanceRtboto.ec2.autoscale.tagRtobjectRRRR4RR Rt(((sE/opt/freeware/lib/python2.7/site-packages/boto/ec2/autoscale/group.pyts ø