ó
è?F[c           @   s’   d  d l  m Z d  d l m Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ d e	 f d „  ƒ  YZ
 d S(   iÿÿÿÿ(   t	   ResultSet(   t   ListElementt   Alarmc           B   s/   e  Z d d  „ Z d „  Z d „  Z d „  Z RS(   c         C   s   | |  _  d  |  _ d  |  _ d  S(   N(   t
   connectiont   Nonet   namet	   alarm_arn(   t   selfR   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyt   __init__   s    		c         C   s   d |  j  S(   Ns   Alarm:%s(   R   (   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyt   __repr__!   s    c         C   s   d  S(   N(   R   (   R   R   t   attrsR   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyt   startElement$   s    c         C   sD   | d k r | |  _  n( | d k r0 | |  _ n t |  | | ƒ d  S(   Nt	   AlarmNamet   AlarmARN(   R   R   t   setattr(   R   R   t   valueR   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyt
   endElement'   s
    N(   t   __name__t
   __module__R   R   R	   R   R   (    (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR      s   		t   AdjustmentTypec           B   s/   e  Z d d  „ Z d „  Z d „  Z d „  Z RS(   c         C   s   | |  _  d  |  _ d  S(   N(   R   R   t   adjustment_type(   R   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   1   s    	c         C   s   d |  j  S(   Ns   AdjustmentType:%s(   R   (   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR	   5   s    c         C   s   d  S(   N(    (   R   R   R
   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   8   s    c         C   s   | d k r | |  _  n  d  S(   NR   (   R   (   R   R   R   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   ;   s    N(   R   R   R   R   R	   R   R   (    (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   0   s   		t   MetricCollectionTypesc           B   sq   e  Z d  e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d
 d „ Z d „  Z d „  Z	 d	 „  Z
 RS(   t   BaseTypec           B   s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   t    c         C   s   | |  _  d  |  _ d  S(   N(   R   R   t   val(   R   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   E   s    	c         C   s   d |  j  |  j f S(   Ns   %s:%s(   t   argR   (   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR	   I   s    c         C   s   d  S(   N(    (   R   R   R
   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   L   s    c         C   s   | |  j  k r | |  _ n  d  S(   N(   R   R   (   R   R   R   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   O   s    (   R   R   R   R   R	   R   R   (    (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   B   s
   			t   Metricc           B   s   e  Z d  Z RS(   R   (   R   R   R   (    (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   S   s   t   Granularityc           B   s   e  Z d  Z RS(   R   (   R   R   R   (    (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   V   s   c         C   s   | |  _  g  |  _ g  |  _ d  S(   N(   R   t   metricst   granularities(   R   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   Y   s    		c         C   s   d |  j  |  j f S(   Ns   MetricCollectionTypes:<%s, %s>(   R   R   (   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR	   ^   s    c         C   s`   | d k r. t  d |  j f g ƒ |  _ |  j S| d k r\ t  d |  j f g ƒ |  _ |  j Sd  S(   Nt   Granularitiest   membert   Metrics(   R    R   R   R   R   (   R   R   R
   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   a   s    c         C   s   d  S(   N(    (   R   R   R   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   i   s    N(   R   R   t   objectR   R   R   R   R   R	   R   R   (    (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   A   s   		t   ScalingPolicyc           B   s8   e  Z d d  „ Z d „  Z d „  Z d „  Z d „  Z RS(   c         K   s‹   | j  d d ƒ |  _ | j  d d ƒ |  _ | j  d d ƒ |  _ | j  d d ƒ |  _ | j  d d ƒ |  _ | |  _ | j  d d ƒ |  _ d S(   s  
        Scaling Policy

        :type name: str
        :param name: Name of scaling policy.

        :type adjustment_type: str
        :param adjustment_type: Specifies the type of adjustment. Valid values are `ChangeInCapacity`, `ExactCapacity` and `PercentChangeInCapacity`.

        :type as_name: str or int
        :param as_name: Name or ARN of the Auto Scaling Group.

        :type scaling_adjustment: int
        :param scaling_adjustment: Value of adjustment (type specified in `adjustment_type`).

        :type min_adjustment_step: int
        :param min_adjustment_step: Value of min adjustment step required to
            apply the scaling policy (only make sense when use `PercentChangeInCapacity` as adjustment_type.).

        :type cooldown: int
        :param cooldown: Time (in seconds) before Alarm related Scaling Activities can start after the previous Scaling Activity ends.

        R   R   t   as_namet   scaling_adjustmentt   cooldownt   min_adjustment_stepN(	   t   getR   R   R   R#   R$   R%   R   R&   (   R   R   t   kwargs(    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   n   s    	c         C   s   d |  j  |  j |  j f S(   Ns(   ScalingPolicy(%s group:%s adjustment:%s)(   R   R#   R   (   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR	   Ž   s    	c         C   s/   | d k r+ t  d t f g ƒ |  _ |  j Sd  S(   Nt   AlarmsR   (   R    R   t   alarms(   R   R   R
   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   “   s    c         C   s¾   | d k r | |  _  n¢ | d k r0 | |  _ nŠ | d k rH | |  _ nr | d k rf t | ƒ |  _ nT | d k r„ t | ƒ |  _ n6 | d k rœ | |  _ n | d k rº t | ƒ |  _ n  d  S(   Nt
   PolicyNamet   AutoScalingGroupNamet	   PolicyARNt   ScalingAdjustmentt   CooldownR   t   MinAdjustmentStep(   R   R#   t
   policy_arnt   intR$   R%   R   R&   (   R   R   R   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   ˜   s    c         C   s   |  j  j |  j |  j ƒ S(   N(   R   t   delete_policyR   R#   (   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyt   delete¨   s    N(   R   R   R   R   R	   R   R   R4   (    (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR"   m   s
    			t   TerminationPoliciesc           B   s&   e  Z d d  „ Z d „  Z d „  Z RS(   c         K   s   d  S(   N(    (   R   R   R(   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   ­   s    c         C   s   d  S(   N(    (   R   R   R
   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   °   s    c         C   s    | d k r |  j  | ƒ n  d  S(   NR   (   t   append(   R   R   R   R   (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR   ³   s    N(   R   R   R   R   R   R   (    (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyR5   ¬   s   	N(   t   boto.resultsetR    t   boto.ec2.elb.listelementR   R!   R   R   R   R"   t   listR5   (    (    (    s8   lib/python2.7/site-packages/boto/ec2/autoscale/policy.pyt   <module>   s   ,?