o ckF[*@srddlZddlmZddlmZ ddlmZGdddeZGdddeZGd d d eZ Gd d d eZ dS) N)datetime) ResultSet)TaggedEC2Objectc@2eZdZdZd ddZddZddZd d ZdS) VpnConnectionOptionsz 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. NcCs ||_dSN)static_routes_only)selfrr 8/usr/lib/python3/dist-packages/boto/vpc/vpnconnection.py__init__( zVpnConnectionOptions.__init__cCsdS)Nrr r r r r __repr__+zVpnConnectionOptions.__repr__cCdSrr r nameattrs connectionr r r startElement.rz!VpnConnectionOptions.startElementcCs4|dkr|dkr d|_dSd|_dSt|||dS)NstaticRoutesOnlytrueTF)rsetattrr rvaluerr r r endElement1szVpnConnectionOptions.endElementr__name__ __module__ __qualname____doc__r rrrr r r r rs   rc@r) VpnStaticRoutea# 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. NcCs||_||_||_dSr)destination_cidr_blocksource available)r r#r$stater r r r @s zVpnStaticRoute.__init__cC d|jS)NzVpnStaticRoute: %s)r#rr r r rEr zVpnStaticRoute.__repr__cCrrr rr r r rHrzVpnStaticRoute.startElementcCsF|dkr ||_dS|dkr||_dS|dkr||_dSt|||dS)NdestinationCidrBlockr$r&)r#r$r&rrr r r rKs   zVpnStaticRoute.endElement)NNNrr r r r r"7s   r"c@s6eZdZdZ  d ddZddZddZd d ZdS) VpnTunnela 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. NcCs"||_||_||_||_||_dSr)outside_ip_addressstatuslast_status_changestatus_messageaccepted_route_count)r r*r+r,r-r.r r r r `s  zVpnTunnel.__init__cCr')Nz VpnTunnel: %s)r*rr r r rhr zVpnTunnel.__repr__cCrrr rr r r rkrzVpnTunnel.startElementcCs|dkr ||_dS|dkr||_dS|dkrt|d|_dS|dkr(||_dS|dkrIzt|}WntyCtj d|Ynw||_ dSt |||dS)NoutsideIpAddressr+lastStatusChangez%Y-%m-%dT%H:%M:%S.%fZ statusMessageacceptedRouteCountz!Error converting code (%s) to int) r*r+rstrptimer,r-int ValueErrorbotologwarningr.rrr r r rns$       zVpnTunnel.endElement)NNNNNrr r r r r)Us   r)csHeZdZdZdfdd ZddZfddZd d Zdd d ZZ S) VpnConnectionaq 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. NcsJtt||d|_d|_d|_d|_d|_d|_g|_ d|_ g|_ dSr) superr9r idr&customer_gateway_configurationtypecustomer_gateway_idvpn_gateway_idtunnelsoptions static_routes)r r __class__r r r s zVpnConnection.__init__cCr')NzVpnConnection:%s)r;rr r r rr zVpnConnection.__repr__csvtt||||}|dur|S|dkrtdtfg|_|jS|dkr.tdtfg|_|jS|dkr9t|_ |j SdS)N vgwTelemetryitemroutesrA) r:r9rrr)r@r"rBrrA)r rrrretvalrCr r rszVpnConnection.startElementcCs||dkr ||_dS|dkr||_dS|dkr||_dS|dkr$||_dS|dkr-||_dS|dkr6||_dSt|||dS)NvpnConnectionIdr&customerGatewayConfigurationr=customerGatewayId vpnGatewayId)r;r&r<r=r>r?rrr r r rs      zVpnConnection.endElementFcCs|jj|j|dS)N)dry_run)rdelete_vpn_connectionr;)r rMr r r deleteszVpnConnection.deleter)F) rrr r!r rrrrO __classcell__r r rCr r9s r9) r6rboto.resultsetrboto.ec2.ec2objectrobjectrr"r)r9r r r r s   ,