ó
è?F[c           @   s˜   d  d l  Z  d  d l m Z 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 S(   iÿÿÿÿN(   t   datetime(   t	   ResultSet(   t   TaggedEC2Objectt   VpnConnectionOptionsc           B   s5   e  Z d  Z d d „ Z d „  Z d „  Z d „  Z RS(   sÙ   
    Represents VPN connection options

    :ivar static_routes_only: Indicates whether the VPN connection uses static
        routes only.  Static routes must be used for devices that don't support
        BGP.

    c         C   s   | |  _  d  S(   N(   t   static_routes_only(   t   selfR   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyt   __init__(   s    c         C   s   d S(   NR   (    (   R   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyt   __repr__+   s    c         C   s   d  S(   N(    (   R   t   namet   attrst
   connection(    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyt   startElement.   s    c         C   s>   | d k r* | d k r t  n t |  _ n t |  | | ƒ d  S(   Nt   staticRoutesOnlyt   true(   t   Truet   FalseR   t   setattr(   R   R   t   valueR
   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyt
   endElement1   s    N(   t   __name__t
   __module__t   __doc__t   NoneR   R   R   R   (    (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR      s
   		t   VpnStaticRoutec           B   s;   e  Z d  Z d d d d „ Z d „  Z d „  Z d „  Z RS(   s#  
    Represents a static route for a VPN connection.

    :ivar destination_cidr_block: The CIDR block associated with the local
        subnet of the customer data center.
    :ivar source: Indicates how the routes were provided.
    :ivar state: The current state of the static route.
    c         C   s   | |  _  | |  _ | |  _ d  S(   N(   t   destination_cidr_blockt   sourcet	   available(   R   R   R   t   state(    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   @   s    		c         C   s   d |  j  S(   Ns   VpnStaticRoute: %s(   R   (   R   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   E   s    c         C   s   d  S(   N(    (   R   R   R	   R
   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   H   s    c         C   s\   | d k r | |  _  n@ | d k r0 | |  _ n( | d k rH | |  _ n t |  | | ƒ d  S(   Nt   destinationCidrBlockR   R   (   R   R   R   R   (   R   R   R   R
   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   K   s    N(   R   R   R   R   R   R   R   R   (    (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   7   s
   		t	   VpnTunnelc           B   sA   e  Z d  Z d d d d d d „ Z d „  Z d „  Z d „  Z RS(   sÊ  
    Represents telemetry for a VPN tunnel

    :ivar outside_ip_address: The Internet-routable IP address of the
        virtual private gateway's outside interface.
    :ivar status: The status of the VPN tunnel. Valid values: UP | DOWN
    :ivar last_status_change: The date and time of the last change in status.
    :ivar status_message: If an error occurs, a description of the error.
    :ivar accepted_route_count: The number of accepted routes.
    c         C   s1   | |  _  | |  _ | |  _ | |  _ | |  _ d  S(   N(   t   outside_ip_addresst   statust   last_status_changet   status_messaget   accepted_route_count(   R   R   R   R    R!   R"   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   `   s
    				c         C   s   d |  j  S(   Ns   VpnTunnel: %s(   R   (   R   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   h   s    c         C   s   d  S(   N(    (   R   R   R	   R
   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   k   s    c         C   sÐ   | d k r | |  _  n´ | d k r0 | |  _ nœ | d k rT t j | d ƒ |  _ nx | d k rl | |  _ n` | d k r¼ y t | ƒ } Wn% t k
 r¯ t j	 j
 d | ƒ n X| |  _ n t |  | | ƒ d  S(   Nt   outsideIpAddressR   t   lastStatusChanges   %Y-%m-%dT%H:%M:%S.%fZt   statusMessaget   acceptedRouteCounts!   Error converting code (%s) to int(   R   R   R    t   strptimeR    R!   t   intt
   ValueErrort   botot   logt   warningR"   R   (   R   R   R   R
   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   n   s     	N(   R   R   R   R   R   R   R   R   (    (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   U   s   
			t   VpnConnectionc           B   sA   e  Z d  Z d d „ Z d „  Z d „  Z d „  Z e d „ Z	 RS(   sq  
    Represents a VPN Connection

    :ivar id: The ID of the VPN connection.
    :ivar state: The current state of the VPN connection.
        Valid values: pending | available | deleting | deleted
    :ivar customer_gateway_configuration: The configuration information for the
        VPN connection's customer gateway (in the native XML format). This
        element is always present in the
        :class:`boto.vpc.VPCConnection.create_vpn_connection` response;
        however, it's present in the
        :class:`boto.vpc.VPCConnection.get_all_vpn_connections` response only
        if the VPN connection is in the pending or available state.
    :ivar type: The type of VPN connection (ipsec.1).
    :ivar customer_gateway_id: The ID of the customer gateway at your end of
        the VPN connection.
    :ivar vpn_gateway_id: The ID of the virtual private gateway
        at the AWS side of the VPN connection.
    :ivar tunnels: A list of the vpn tunnels (always 2)
    :ivar options: The option set describing the VPN connection.
    :ivar static_routes: A list of static routes associated with a VPN
        connection.

    c         C   sk   t  t |  ƒ j | ƒ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _	 g  |  _
 d  |  _ g  |  _ d  S(   N(   t   superR-   R   R   t   idR   t   customer_gateway_configurationt   typet   customer_gateway_idt   vpn_gateway_idt   tunnelst   optionst   static_routes(   R   R
   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   š   s    								c         C   s   d |  j  S(   Ns   VpnConnection:%s(   R/   (   R   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   ¦   s    c         C   s§   t  t |  ƒ j | | | ƒ } | d  k	 r. | S| d k rY t d t f g ƒ |  _ |  j S| d k r„ t d t f g ƒ |  _ |  j S| d k r£ t	 ƒ  |  _
 |  j
 Sd  S(   Nt   vgwTelemetryt   itemt   routesR5   (   R.   R-   R   R   R   R   R4   R   R6   R   R5   (   R   R   R	   R
   t   retval(    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   ©   s    c         C   s¤   | d k r | |  _  nˆ | d k r0 | |  _ np | d k rH | |  _ nX | d k r` | |  _ n@ | d k rx | |  _ n( | d k r | |  _ n t |  | | ƒ d  S(   Nt   vpnConnectionIdR   t   customerGatewayConfigurationR1   t   customerGatewayIdt   vpnGatewayId(   R/   R   R0   R1   R2   R3   R   (   R   R   R   R
   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR   ¸   s    c         C   s   |  j  j |  j d | ƒS(   Nt   dry_run(   R
   t   delete_vpn_connectionR/   (   R   R?   (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyt   deleteÈ   s    		N(
   R   R   R   R   R   R   R   R   R   RA   (    (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyR-      s   			(   R*   R    t   boto.resultsetR   t   boto.ec2.ec2objectR   t   objectR   R   R   R-   (    (    (    s5   lib/python2.7/site-packages/boto/vpc/vpnconnection.pyt   <module>   s   ,