o ckF[(\@sXddlZddlmZddlmZddlmZddlmZddl m Z GdddeZ dS) N)AWSQueryConnection) RegionInfo)JSONResponseError) exceptions)jsoncseZdZdZdZdZdZdZdZe Z e j e j dZfdd Zd d Zd d ZddZddZddZddZddZddZddZddZddZd d!Zd"d#Zd$d%Zd5d'd(Zd)d*Zd5d+d,Z d-d.Z!d/d0Z" & &d6d1d2Z#d3d4Z$Z%S)7DirectConnectConnectiona AWS Direct Connect makes it easy to establish a dedicated network connection from your premises to Amazon Web Services (AWS). Using AWS Direct Connect, you can establish private connectivity between AWS and your data center, office, or colocation environment, which in many cases can reduce your network costs, increase bandwidth throughput, and provide a more consistent network experience than Internet-based connections. The AWS Direct Connect API Reference provides descriptions, syntax, and usage examples for each of the actions and data types for AWS Direct Connect. Use the following links to get started using the AWS Direct Connect API Reference : + `Actions`_: An alphabetical list of all AWS Direct Connect actions. + `Data Types`_: An alphabetical list of all AWS Direct Connect data types. + `Common Query Parameters`_: Parameters that all Query actions can use. + `Common Errors`_: Client and server errors that all actions can return. z 2012-10-25z us-east-1z%directconnect.us-east-1.amazonaws.com DirectConnectOvertureService)DirectConnectClientExceptionDirectConnectServerExceptionc sR|dd}|st||j|j}d|vr|j|d<tt|jdi|||_dS)Nregionhost) poprDefaultRegionNameDefaultRegionEndpointendpointsuperr__init__r )selfkwargsr  __class__r;/usr/lib/python3/dist-packages/boto/directconnect/layer1.pyrDs   z DirectConnectConnection.__init__cCsdgS)Nzhmac-v4r)rrrr_required_auth_capabilityPsz1DirectConnectConnection._required_auth_capabilitycCs$|||||d}|jdt|dS)a5 Creates a hosted connection on an interconnect. Allocates a VLAN number and a specified amount of bandwidth for use by a hosted connection on the given interconnect. :type bandwidth: string :param bandwidth: Bandwidth of the connection. Example: " 500Mbps " Default: None :type connection_name: string :param connection_name: Name of the provisioned connection. Example: " 500M Connection to AWS " Default: None :type owner_account: string :param owner_account: Numeric account Id of the customer for whom the connection will be provisioned. Example: 123443215678 Default: None :type interconnect_id: string :param interconnect_id: ID of the interconnect on which the connection will be provisioned. Example: dxcon-456abc78 Default: None :type vlan: integer :param vlan: The dedicated VLAN provisioned to the connection. Example: 101 Default: None ) bandwidthconnectionName ownerAccountinterconnectIdvlan AllocateConnectionOnInterconnectactionbody make_requestrdumps)rrconnection_name owner_accountinterconnect_idrparamsrrr#allocate_connection_on_interconnectSs+z;DirectConnectConnection.allocate_connection_on_interconnectcC |||d}|jdt|dS)aw Provisions a private virtual interface to be owned by a different customer. The owner of a connection calls this function to provision a private virtual interface which will be owned by another AWS customer. Virtual interfaces created using this function must be confirmed by the virtual interface owner by calling ConfirmPrivateVirtualInterface. Until this step has been completed, the virtual interface will be in 'Confirming' state, and will not be available for handling traffic. :type connection_id: string :param connection_id: The connection ID on which the private virtual interface is provisioned. Default: None :type owner_account: string :param owner_account: The AWS account that will own the new private virtual interface. Default: None :type new_private_virtual_interface_allocation: dict :param new_private_virtual_interface_allocation: Detailed information for the private virtual interface to be provisioned. Default: None ) connectionIdr$newPrivateVirtualInterfaceAllocationAllocatePrivateVirtualInterfacer!r$)r connection_idr((new_private_virtual_interface_allocationr*rrr"allocate_private_virtual_interfaces"z:DirectConnectConnection.allocate_private_virtual_interfacecCr,)ao Provisions a public virtual interface to be owned by a different customer. The owner of a connection calls this function to provision a public virtual interface which will be owned by another AWS customer. Virtual interfaces created using this function must be confirmed by the virtual interface owner by calling ConfirmPublicVirtualInterface. Until this step has been completed, the virtual interface will be in 'Confirming' state, and will not be available for handling traffic. :type connection_id: string :param connection_id: The connection ID on which the public virtual interface is provisioned. Default: None :type owner_account: string :param owner_account: The AWS account that will own the new public virtual interface. Default: None :type new_public_virtual_interface_allocation: dict :param new_public_virtual_interface_allocation: Detailed information for the public virtual interface to be provisioned. Default: None )r-r#newPublicVirtualInterfaceAllocationAllocatePublicVirtualInterfacer!r$)rr0r('new_public_virtual_interface_allocationr*rrr!allocate_public_virtual_interfaces!z9DirectConnectConnection.allocate_public_virtual_interfacecCd|i}|jdt|dS)a Confirm the creation of a hosted connection on an interconnect. Upon creation, the hosted connection is initially in the 'Ordering' state, and will remain in this state until the owner calls ConfirmConnection to confirm creation of the hosted connection. :type connection_id: string :param connection_id: ID of the connection. Example: dxcon-fg5678gh Default: None r-ConfirmConnectionr!r$rr0r*rrrconfirm_connectionz*DirectConnectConnection.confirm_connectioncC||d}|jdt|dS)aB Accept ownership of a private virtual interface created by another customer. After the virtual interface owner calls this function, the virtual interface will be created and attached to the given virtual private gateway, and will be available for handling traffic. :type virtual_interface_id: string :param virtual_interface_id: ID of the virtual interface. Example: dxvif-123dfg56 Default: None :type virtual_gateway_id: string :param virtual_gateway_id: ID of the virtual private gateway that will be attached to the virtual interface. A virtual private gateway can be managed via the Amazon Virtual Private Cloud (VPC) console or the `EC2 CreateVpnGateway`_ action. Default: None )virtualInterfaceIdvirtualGatewayIdConfirmPrivateVirtualInterfacer!r$)rvirtual_interface_idvirtual_gateway_idr*rrr!confirm_private_virtual_interfaces z9DirectConnectConnection.confirm_private_virtual_interfacecCr7)a Accept ownership of a public virtual interface created by another customer. After the virtual interface owner calls this function, the specified virtual interface will be created and made available for handling traffic. :type virtual_interface_id: string :param virtual_interface_id: ID of the virtual interface. Example: dxvif-123dfg56 Default: None r=ConfirmPublicVirtualInterfacer!r$rr@r*rrr confirm_public_virtual_interfacesz8DirectConnectConnection.confirm_public_virtual_interfacecCr,)ar Creates a new connection between the customer network and a specific AWS Direct Connect location. A connection links your internal network to an AWS Direct Connect location over a standard 1 gigabit or 10 gigabit Ethernet fiber-optic cable. One end of the cable is connected to your router, the other to an AWS Direct Connect router. An AWS Direct Connect location provides access to Amazon Web Services in the region it is associated with. You can establish connections with AWS Direct Connect locations in multiple regions, but a connection in one region does not provide connectivity to other regions. :type location: string :param location: Where the connection is located. Example: EqSV5 Default: None :type bandwidth: string :param bandwidth: Bandwidth of the connection. Example: 1Gbps Default: None :type connection_name: string :param connection_name: The name of the connection. Example: " My Connection to AWS " Default: None )locationrrCreateConnectionr!r$)rrFrr'r*rrrcreate_connection"s#z)DirectConnectConnection.create_connectioncCr,)a% Creates a new interconnect between a AWS Direct Connect partner's network and a specific AWS Direct Connect location. An interconnect is a connection which is capable of hosting other connections. The AWS Direct Connect partner can use an interconnect to provide sub-1Gbps AWS Direct Connect service to tier 2 customers who do not have their own connections. Like a standard connection, an interconnect links the AWS Direct Connect partner's network to an AWS Direct Connect location over a standard 1 Gbps or 10 Gbps Ethernet fiber- optic cable. One end is connected to the partner's router, the other to an AWS Direct Connect router. For each end customer, the AWS Direct Connect partner provisions a connection on their interconnect by calling AllocateConnectionOnInterconnect. The end customer can then connect to AWS resources by creating a virtual interface on their connection, using the VLAN assigned to them by the AWS Direct Connect partner. :type interconnect_name: string :param interconnect_name: The name of the interconnect. Example: " 1G Interconnect to AWS " Default: None :type bandwidth: string :param bandwidth: The port bandwidth Example: 1Gbps Default: None Available values: 1Gbps,10Gbps :type location: string :param location: Where the interconnect is located Example: EqSV5 Default: None )interconnectNamerrFCreateInterconnectr!r$)rinterconnect_namerrFr*rrrcreate_interconnectLs,z+DirectConnectConnection.create_interconnectcCr<)aV Creates a new private virtual interface. A virtual interface is the VLAN that transports AWS Direct Connect traffic. A private virtual interface supports sending traffic to a single virtual private cloud (VPC). :type connection_id: string :param connection_id: ID of the connection. Example: dxcon-fg5678gh Default: None :type new_private_virtual_interface: dict :param new_private_virtual_interface: Detailed information for the private virtual interface to be created. Default: None )r-newPrivateVirtualInterfaceCreatePrivateVirtualInterfacer!r$)rr0new_private_virtual_interfacer*rrr create_private_virtual_interface z8DirectConnectConnection.create_private_virtual_interfacecCr<)au Creates a new public virtual interface. A virtual interface is the VLAN that transports AWS Direct Connect traffic. A public virtual interface supports sending traffic to public services of AWS such as Amazon Simple Storage Service (Amazon S3). :type connection_id: string :param connection_id: ID of the connection. Example: dxcon-fg5678gh Default: None :type new_public_virtual_interface: dict :param new_public_virtual_interface: Detailed information for the public virtual interface to be created. Default: None )r-newPublicVirtualInterfaceCreatePublicVirtualInterfacer!r$)rr0new_public_virtual_interfacer*rrrcreate_public_virtual_interfacerQz7DirectConnectConnection.create_public_virtual_interfacecCr7)a Deletes the connection. Deleting a connection only stops the AWS Direct Connect port hour and data transfer charges. You need to cancel separately with the providers any services or charges for cross-connects or network circuits that connect you to the AWS Direct Connect location. :type connection_id: string :param connection_id: ID of the connection. Example: dxcon-fg5678gh Default: None r-DeleteConnectionr!r$r9rrrdelete_connectionr;z)DirectConnectConnection.delete_connectioncCr7)z Deletes the specified interconnect. :type interconnect_id: string :param interconnect_id: The ID of the interconnect. Example: dxcon-abc123 rDeleteInterconnectr!r$rr)r*rrrdelete_interconnects z+DirectConnectConnection.delete_interconnectcCr7)z Deletes a virtual interface. :type virtual_interface_id: string :param virtual_interface_id: ID of the virtual interface. Example: dxvif-123dfg56 Default: None r=DeleteVirtualInterfacer!r$rDrrrdelete_virtual_interfaces z0DirectConnectConnection.delete_virtual_interfaceNcC(i}|dur ||d<|jdt|dS)a. Displays all connections in this region. If a connection ID is provided, the call returns only that particular connection. :type connection_id: string :param connection_id: ID of the connection. Example: dxcon-fg5678gh Default: None Nr-DescribeConnectionsr!r$r9rrrdescribe_connectionss z,DirectConnectConnection.describe_connectionscCr7)a: Return a list of connections that have been provisioned on the given interconnect. :type interconnect_id: string :param interconnect_id: ID of the interconnect on which a list of connection is provisioned. Example: dxcon-abc123 Default: None r!DescribeConnectionsOnInterconnectr!r$rYrrr$describe_connections_on_interconnects zt |SdSt |}|d d}|j||j} | |j |j|d ) Nz%s.%szapplication/x-amz-json-1.1)z X-Amz-TargetHostz Content-TypezContent-LengthPOST/)methodpath auth_pathr*headersdata )senderoverride_num_retrieszutf-8__type)r#) TargetPrefixr rstrlenbuild_base_http_request_mexereaddecodebotologdebugstatusrloadsget_faults ResponseErrorreason) rr"r#rr http_requestresponse response_body json_body fault_nameexception_classrrrr%]s0        z$DirectConnectConnection.make_request)N)NN)&__name__ __module__ __qualname____doc__ APIVersionrr ServiceNameryrrrr r rrrr+r2r6r:rBrErHrLrPrUrWrZr\r_rarcrgrirkr% __classcell__rrrrrsF  4)(!*3    (r) rboto.connectionrboto.regioninforboto.exceptionrboto.directconnectr boto.compatrrrrrrs