ó FRTc@s¸dZddlmZddlmZddlmZddlmZde fd„ƒYZ defd „ƒYZ d e fd „ƒYZ d e fd „ƒYZde fd„ƒYZdS(s- Represents an EC2 Elastic Network Interface iÿÿÿÿ(tBotoClientError(tTaggedEC2Object(t ResultSet(tGroupt AttachmentcBs2eZdZd„Zd„Zd„Zd„ZRS(s` :ivar id: The ID of the attachment. :ivar instance_id: The ID of the instance. :ivar device_index: The index of this device. :ivar status: The status of the device. :ivar attach_time: The time the device was attached. :ivar delete_on_termination: Whether the device will be deleted when the instance is terminated. cCsCd|_d|_d|_d|_d|_d|_t|_dS(Ni( tNonetidt instance_idtinstance_owner_idt device_indextstatust attach_timetFalsetdelete_on_termination(tself((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyt__init__+s      cCs d|jS(Ns Attachment:%s(R(R((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyt__repr__4scCsdS(N(R(Rtnametattrst connection((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyt startElement7scCsà|dkr||_nÄ|dkr0||_n¬|dkrNt|ƒ|_nŽ|dkrf||_nv|dkr~||_n^|dkr–||_nF|dkrÌ|jƒdkrÀt|_ qÜt |_ nt |||ƒdS( Nt attachmentIdt instanceIdt deviceIndextinstanceOwnerIdR t attachTimetdeleteOnTerminationttrue( RRtintR RR R tlowertTrueR R tsetattr(RRtvalueR((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyt endElement:s"              (t__name__t __module__t__doc__RRRR!(((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyR s    tNetworkInterfacecBsteZdZd d„Zd„Zd„Zd„Zd„Ze e d„Z e d„Z e e d„Z e d „Z RS( s An Elastic Network Interface. :ivar id: The ID of the ENI. :ivar subnet_id: The ID of the VPC subnet. :ivar vpc_id: The ID of the VPC. :ivar description: The description. :ivar owner_id: The ID of the owner of the ENI. :ivar requester_managed: :ivar status: The interface's status (available|in-use). :ivar mac_address: The MAC address of the interface. :ivar private_ip_address: The IP address of the interface within the subnet. :ivar source_dest_check: Flag to indicate whether to validate network traffic to or from this network interface. :ivar groups: List of security groups associated with the interface. :ivar attachment: The attachment object. :ivar private_ip_addresses: A list of PrivateIPAddress objects. cCs˜tt|ƒj|ƒd|_d|_d|_d|_d|_d|_ t |_ d|_ d|_ d|_d|_g|_d|_g|_dS(N(tsuperR%RRRt subnet_idtvpc_idtavailability_zonet descriptiontowner_idR trequester_managedR t mac_addresstprivate_ip_addresstsource_dest_checktgroupst attachmenttprivate_ip_addresses(RR((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyRes             cCs d|jS(NsNetworkInterface:%s(R(R((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyRvscCs«tt|ƒj|||ƒ}|dk r.|S|dkrYtdtfgƒ|_|jS|dkrxtƒ|_|jS|dkr£tdt fgƒ|_ |j SdSdS(NtgroupSettitemR1tprivateIpAddressesSet( R&R%RRRRR0RR1tPrivateIPAddressR2(RRRRtretval((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyRys     cCsX|dkr||_n<|dkr0||_n$|dkrH||_n |dkr`||_nô|dkrx||_nÜ|dkr||_nÄ|dkrÆ|jƒdkrºt|_qTt |_nŽ|d krÞ||_ nv|d krö||_ n^|d kr||_ nF|d krD|jƒdkr8t|_ qTt |_ nt|||ƒdS( NtnetworkInterfaceIdtsubnetIdtvpcIdtavailabilityZoneR*townerIdtrequesterManagedRR t macAddresstprivateIpAddresstsourceDestCheck(RR'R(R)R*R+RRR,R R R-R.R/R(RRR R((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyR!‰s6                        cCs|jj|jƒdS(N(t__dict__tupdate(Rtupdated((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyt_update©scCsg|jj|jgd|ƒ}t|ƒdkrD|j|dƒn|r`td|jƒ‚n|jS(s© Update the data associated with this ENI by querying EC2. :type validate: bool :param validate: By default, if EC2 returns no data about the ENI the update method returns quietly. If the validate param is True, however, it will raise a ValueError exception if no data is returned from EC2. tdry_runis%s is not a valid ENI ID(Rtget_all_network_interfacesRtlenRDt ValueErrorR (RtvalidateREtrs((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyRB¬s   cCs|jj|j||d|ƒS(sr Attach this ENI to an EC2 instance. :type instance_id: str :param instance_id: The ID of the EC2 instance to which it will be attached. :type device_index: int :param device_index: The interface nunber, N, on the instance (eg. ethN) :rtype: bool :return: True if successful RE(Rtattach_network_interfaceR(RRR RE((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pytattachÁs  cCs.t|jddƒ}|jj||d|ƒS(s Detach this ENI from an EC2 instance. :type force: bool :param force: Forces detachment if the previous detachment attempt did not occur cleanly. :rtype: bool :return: True if successful RREN(tgetattrR1RRtdetach_network_interface(RtforceREt attachment_id((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pytdetachÖs  cCs|jj|jd|ƒS(NRE(Rtdelete_network_interfaceR(RRE((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pytdeleteés  N(R"R#R$RRRRR!RDR RBRLRQRS(((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyR%Ps     R6cBs5eZdddd„Zd„Zd„Zd„ZRS(cCs||_||_||_dS(N(RR.tprimary(RRR.RT((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyRñs  cCsdS(N((RRRR((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyR÷scCsL|dkr||_n0|dkrH|jƒdkr<tnt|_ndS(NR?RTR(R.RRR RT(RRR R((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyR!ús   cCsd|j|jfS(Ns PrivateIPAddress(%s, primary=%s)(R.RT(R((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyRs N(R"R#RRRR!R(((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyR6ðs    tNetworkInterfaceCollectioncBseZd„Zdd„ZRS(cGs|j|ƒdS(N(textend(Rt interfaces((sF/opt/freeware/lib/python2.7/site-packages/boto/ec2/networkinterface.pyRstc CsÊxÃt|ƒD]µ\}}d||f}|jdk rRt|jƒ||ds0 I