https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/boto/ec2/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/boto/ec2/__pycache__/networkinterface.cpython-310.pyc
o

ckF[5�@s�dZddlmZddlmZddlmZddlmZGdd�de	�Z
Gdd	�d	e�ZGd
d�de	�ZGdd
�d
e
�ZGdd�de	�ZdS)z-
Represents an EC2 Elastic Network Interface
�)�BotoClientError)�TaggedEC2Object)�	ResultSet)�Groupc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
Attachmenta`
    :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.
    cCs.d|_d|_d|_d|_d|_d|_d|_dS)NrF)�id�instance_id�instance_owner_id�device_index�status�attach_time�delete_on_termination��self�r�;/usr/lib/python3/dist-packages/boto/ec2/networkinterface.py�__init__+s
zAttachment.__init__cC�
d|jS)Nz
Attachment:%s�rrrrr�__repr__4�
zAttachment.__repr__cC�dS�Nr�r�name�attrs�
connectionrrr�startElement7�zAttachment.startElementcCs�|dkr	||_dS|dkr||_dS|dkrt|�|_dS|dkr&||_dS|dkr/||_dS|dkr8||_dS|dkrL|��dkrGd	|_dSd
|_dSt	|||�dS)N�attachmentId�
instanceId�deviceIndex�instanceOwnerIdr�
attachTime�deleteOnTermination�trueTF)
rr�intr
r	rr�lowerr
�setattr�rr�valuerrrr�
endElement:s"






zAttachment.endElementN)�__name__�
__module__�__qualname__�__doc__rrrr+rrrrr s
	rcsneZdZdZd�fdd�	Zdd�Z�fdd�Zd	d
�Zdd�Zddd�Z	ddd�Z
ddd�Zddd�Z�Z
S)�NetworkInterfacea
    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.
    Ncshtt|��|�d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
g|_d|_g|_dS)NF)�superr0rr�	subnet_id�vpc_id�availability_zone�description�owner_id�requester_managedr�mac_address�private_ip_address�source_dest_check�groups�
attachment�private_ip_addresses)rr��	__class__rrres
zNetworkInterface.__init__cCr)NzNetworkInterface:%srrrrrrvrzNetworkInterface.__repr__csvtt|��|||�}|dur|S|dkrtdtfg�|_|jS|dkr*t�|_|jS|dkr9tdtfg�|_	|j	SdS)N�groupSet�itemr<�privateIpAddressesSet)
r1r0rrrr;rr<�PrivateIPAddressr=)rrrr�retvalr>rrryszNetworkInterface.startElementcCs|dkr	||_dS|dkr||_dS|dkr||_dS|dkr$||_dS|dkr-||_dS|dkr6||_dS|dkrJ|��dkrEd	|_dSd
|_dS|dkrS||_dS|dkr\||_	dS|d
kre||_
dS|dkry|��dkrtd	|_dSd
|_dSt|||�dS)N�networkInterfaceId�subnetId�vpcId�availabilityZoner5�ownerId�requesterManagedr%TFr�
macAddress�privateIpAddress�sourceDestCheck)
rr2r3r4r5r6r'r7rr8r9r:r(r)rrrr+�s6












zNetworkInterface.endElementcCs|j�|j�dSr)�__dict__�update)r�updatedrrr�_update�szNetworkInterface._updateFcCsL|jj|jg|d�}t|�dkr|�|d�|jS|r#td|j��|jS)a�
        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.
        ��dry_runrz%s is not a valid ENI ID)r�get_all_network_interfacesr�lenrQ�
ValueErrorr)r�validaterS�rsrrrrO�s��zNetworkInterface.updatecCs|jj|j|||d�S)ar
        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
        rR)r�attach_network_interfacer)rrr
rSrrr�attach�s�zNetworkInterface.attachcCs t|jdd�}|jj|||d�S)a
        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
        rNrR)�getattrr<r�detach_network_interface)r�forcerS�
attachment_idrrr�detach�s�zNetworkInterface.detachcCs|jj|j|d�S)NrR)r�delete_network_interfacer)rrSrrr�delete�s�zNetworkInterface.deleter)FF)F)r,r-r.r/rrrr+rQrOrZr_ra�
__classcell__rrr>rr0Ps 


r0c@s2eZdZ		d
dd�Zdd�Zdd�Zdd	�ZdS)rCNcCs||_||_||_dSr)rr9�primary)rrr9rcrrrr�s
zPrivateIPAddress.__init__cCrrrrrrrr�rzPrivateIPAddress.startElementcCs8|dkr	||_dS|dkr|��dkrdnd|_dSdS)NrLrcr%TF)r9r'rcr)rrrr+�s

�zPrivateIPAddress.endElementcCsd|j|jfS)Nz PrivateIPAddress(%s, primary=%s))r9rcrrrrrs�zPrivateIPAddress.__repr__)NNN)r,r-r.rrr+rrrrrrC�s
�rCc@seZdZdd�Zddd�ZdS)�NetworkInterfaceCollectioncGs|�|�dSr)�extend)r�
interfacesrrrrsz#NetworkInterfaceCollection.__init__�c
Cs�t|�D]�\}}d||f}|jdurt|j�||d<|jdur+t|j�||d<nd||d<|jdur?t|j�||d<|jdurMt|j�||d<|jdur]|jrWdnd||d	<|jdurkt|j�||d
<|jduryt|j�||d<|j	dur�t|j	�D]\}}d||f}t|�||<q�|j
dur�t|j
�D]#\}	}
d
||	f}t|
j�||d<|
jdur�|
jr�dnd||d<q�|jdur�||ddvr�t
d��t|�dkr�t
d��|d}|jr�d||<qd||<qdS)Nz%sNetworkInterface.%s.�NetworkInterfaceId�DeviceIndexr�SubnetId�Descriptionr%�false�DeleteOnTermination�SecondaryPrivateIpAddressCount�PrivateIpAddressz%sSecurityGroupId.%sz%sPrivateIpAddresses.%sz.PrivateIpAddressz.Primary)r�0zcOnly the interface with device index of 0 can be provided when using 'associate_public_ip_address'.�zLOnly one interface can be provided when using 'associate_public_ip_address'.�AssociatePublicIpAddress)�	enumerate�network_interface_id�strr
r2r5r
�"secondary_private_ip_address_countr9r;r=rc�associate_public_ip_addressrrU)
r�params�prefix�i�spec�full_prefix�j�group_id�query_param_key�k�ip_addr�query_param_key_prefix�keyrrr�build_list_params	sf

�
�



�

�

�


�
�

��
��
��z,NetworkInterfaceCollection.build_list_paramsN)rg)r,r-r.rr�rrrrrdsrdc@s"eZdZ						ddd�ZdS)�NetworkInterfaceSpecificationNcCs@||_||_||_||_||_||_||_||_|	|_|
|_	dSr)
rtr
r2r5r9r;r
r=rvrw)rrtr
r2r5r9r;r
r=rvrwrrrrOs�
z&NetworkInterfaceSpecification.__init__)
NNNNNNNNNN)r,r-r.rrrrrr�Ns�r�N)r/�boto.exceptionr�boto.ec2.ec2objectr�boto.resultsetr�boto.ec2.groupr�objectrr0rC�listrdr�rrrr�<module>s0!I

https://t.me/RX1948 - 2025