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/elb/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

ckF[@�@s�ddlmZddlmZddlmZddlmZmZddl	m
Z
ddlmZddl
mZddlmZGd	d
�d
e�ZGdd�de�ZGd
d�de�ZdS)�)�HealthCheck)�Listener)�ListElement)�Policies�OtherPolicy)�
SecurityGroup)�InstanceInfo)�	ResultSet)�sixc@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)�BackendzBackend server descriptionNcCs||_d|_d|_dS�N)�
connection�
instance_port�policies��selfr
�r�;/usr/lib/python3/dist-packages/boto/ec2/elb/loadbalancer.py�__init__$s
zBackend.__init__cCsd|j|jfS)NzBackend(%r:%r))rr�rrrr�__repr__)szBackend.__repr__cCs"|dkrtdtfg�|_|jSdS)N�PolicyNames�member)r	rr�r�name�attrsr
rrr�startElement,s�zBackend.startElementcCs|dkr	t|�|_dS)N�InstancePort)�intr�rr�valuer
rrr�
endElement1s
zBackend.endElementr)�__name__�
__module__�__qualname__�__doc__rrrr!rrrrr!s
rc@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
�LoadBalancerZoneszj
    Used to collect the zones for a Load Balancer when enable_zones
    or disable_zones are called.
    NcCs||_t�|_dSr)r
r�zonesrrrrr<szLoadBalancerZones.__init__cCs|dkr|jSdS)N�AvailabilityZones)r'rrrrr@s�zLoadBalancerZones.startElementcCsdSrrrrrrr!DszLoadBalancerZones.endElementr)r"r#r$r%rrr!rrrrr&7s

r&c@seZdZdZd?dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	d@dd�Z
d@dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdAd d!�Zd"d#�ZdBd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Z dS)C�LoadBalancerz*
    Represents an EC2 Load Balancer.
    NcCsv||_||_d|_d|_d|_d|_d|_d|_t�|_	d|_
d|_d|_t�|_
t�|_d|_d|_d|_d|_dS)a�
        :ivar boto.ec2.elb.ELBConnection connection: The connection this load
            balancer was instance was instantiated from.
        :ivar list listeners: A list of tuples in the form of
            ``(<Inbound port>, <Outbound port>, <Protocol>)``
        :ivar boto.ec2.elb.healthcheck.HealthCheck health_check: The health
            check policy for this load balancer.
        :ivar boto.ec2.elb.policies.Policies policies: Cookie stickiness and
            other policies.
        :ivar str name: The name of the Load Balancer.
        :ivar str dns_name: The external DNS name for the balancer.
        :ivar str created_time: A date+time string showing when the
            load balancer was created.
        :ivar list instances: A list of :py:class:`boto.ec2.instanceinfo.InstanceInfo`
            instances, representing the EC2 instances this load balancer is
            distributing requests to.
        :ivar list availability_zones: The availability zones this balancer
            covers.
        :ivar str canonical_hosted_zone_name: Current CNAME for the balancer.
        :ivar str canonical_hosted_zone_name_id: The Route 53 hosted zone
            ID of this balancer. Needed when creating an Alias record in a
            Route 53 hosted zone.
        :ivar boto.ec2.elb.securitygroup.SecurityGroup source_security_group:
            The security group that you can use as part of your inbound rules
            for your load balancer back-end instances to disallow traffic
            from sources other than your load balancer.
        :ivar list subnets: A list of subnets this balancer is on.
        :ivar list security_groups: A list of additional security groups that
            have been applied.
        :ivar str vpc_id: The ID of the VPC that this ELB resides within.
        :ivar list backends: A list of :py:class:`boto.ec2.elb.loadbalancer.Backend
            back-end server descriptions.
        N)r
r�	listeners�health_checkr�dns_name�created_time�	instancesr�availability_zones�canonical_hosted_zone_name�canonical_hosted_zone_name_id�source_security_group�subnets�security_groups�vpc_id�scheme�backends�_attributes)rr
r�	endpointsrrrrMs$"
zLoadBalancer.__init__cCs
d|jS)NzLoadBalancer:%s)rrrrrr�s
zLoadBalancer.__repr__cCs�|dkrt|�|_|jS|dkrtdtfg�|_|jS|dkr"|jS|dkr1tdtfg�|_|jS|dkr=t|�|_	|j	S|dkrHt
�|_|jS|dkrO|jS|d	krV|j
S|d
kr\dS|dkrktdtfg�|_|jSdS)Nr�ListenerDescriptionsrr(�	Instancesr�SourceSecurityGroup�Subnets�SecurityGroups�VPCId�BackendServerDescriptions)rr+r	rr*r/rr.rrrr2r3r4rr7rrrrr�s6

zLoadBalancer.startElementcCs�|dkr	||_dS|dkr||_dS|dkr||_dS|dkr'|j�|�dS|dkr0||_dS|dkr9||_dS|dkrB||_dS|dkrK||_dSt	|||�dS)	N�LoadBalancerName�DNSName�CreatedTime�
InstanceId�CanonicalHostedZoneName�CanonicalHostedZoneNameIDr?�Scheme)
rr,r-r.�appendr0r1r5r6�setattrrrrrr!�s"






zLoadBalancer.endElementcC�,t|tj�r	|g}|j�|j|�}||_dS)z�
        Enable availability zones to this Access Point.
        All zones must be in the same region as the Access Point.

        :type zones: string or List of strings
        :param zones: The name of the zone(s) to add.

        N)�
isinstancer
�string_typesr
�enable_availability_zonesrr/�rr'�	new_zonesrrr�enable_zones�s	
zLoadBalancer.enable_zonescCrJ)z�
        Disable availability zones from this Access Point.

        :type zones: string or List of strings
        :param zones: The name of the zone(s) to add.

        N)rKr
rLr
�disable_availability_zonesrr/rNrrr�
disable_zones���
zLoadBalancer.disable_zonesFcCs |jr|r
|j�|j�|_|jS)z�
        Gets the LbAttributes.  The Attributes will be cached.

        :type force: bool
        :param force: Ignore cache value and reload.

        :rtype: boto.ec2.elb.attributes.LbAttributes
        :return: The LbAttribues object
        )r8r
�get_all_lb_attributesr�r�forcerrr�get_attributes�s

zLoadBalancer.get_attributescCs|�|�jjS)z�
        Identifies if the ELB is current configured to do CrossZone Balancing.

        :type force: bool
        :param force: Ignore cache value and reload.

        :rtype: bool
        :return: True if balancing is enabled, False if not.
        )rW�cross_zone_load_balancing�enabledrUrrr�is_cross_zone_load_balancing�s
z)LoadBalancer.is_cross_zone_load_balancingcC�*|j�|jdd�}|r|jrd|jj_|S)z�
        Turns on CrossZone Load Balancing for this ELB.

        :rtype: bool
        :return: True if successful, False if not.
        �crossZoneLoadBalancingT�r
�modify_lb_attributerr8rXrY�r�successrrr� enable_cross_zone_load_balancing���

z-LoadBalancer.enable_cross_zone_load_balancingcCr[)z�
        Turns off CrossZone Load Balancing for this ELB.

        :rtype: bool
        :return: True if successful, False if not.
        r\Fr]r_rrr�!disable_cross_zone_load_balancing�rbz.LoadBalancer.disable_cross_zone_load_balancingcCrJ)aS
        Adds instances to this load balancer. All instances must be in the same
        region as the load balancer. Adding endpoints that are already
        registered with the load balancer has no effect.

        :param list instances: List of instance IDs (strings) that you'd like
            to add to this load balancer.

        N)rKr
rLr
�register_instancesrr.�rr.�
new_instancesrrrrds

�
zLoadBalancer.register_instancescCrJ)a
        Remove instances from this load balancer. Removing instances that are
        not registered with the load balancer has no effect.

        :param list instances: List of instance IDs (strings) that you'd like
            to remove from this load balancer.

        N)rKr
rLr
�deregister_instancesrr.rerrrrgs	
�
z!LoadBalancer.deregister_instancescCs|j�|j�S)z,
        Delete this load balancer.
        )r
�delete_load_balancerrrrrr�delete&szLoadBalancer.deletecC�|j�|j|�S)af
        Configures the health check behavior for the instances behind this
        load balancer. See :ref:`elb-configuring-a-health-check` for a
        walkthrough.

        :param boto.ec2.elb.healthcheck.HealthCheck health_check: A
            HealthCheck instance that tells the load balancer how to check
            its instances for health.
        )r
�configure_health_checkr)rr+rrrrk,s
z#LoadBalancer.configure_health_checkcCrj)a�
        Returns a list of :py:class:`boto.ec2.elb.instancestate.InstanceState`
        objects, which show the health of the instances attached to this
        load balancer.

        :rtype: list
        :returns: A list of
            :py:class:`InstanceState <boto.ec2.elb.instancestate.InstanceState>`
            instances, representing the instances
            attached to this load balancer.
        )r
�describe_instance_healthr)rr.rrr�get_instance_health8sz LoadBalancer.get_instance_healthcCrjr)r
�create_load_balancer_listenersr�rr*rrr�create_listenersF�
�zLoadBalancer.create_listeners�tcpcCs|dur|}|�|||fg�Sr)rp)r�inPort�outPort�protorrr�create_listenerJszLoadBalancer.create_listenercCrjr)r
�delete_load_balancer_listenersrrorrr�delete_listenersOrqzLoadBalancer.delete_listenerscCs|�|g�Sr)rx)rrsrrr�delete_listenerSszLoadBalancer.delete_listenercCrj)z}
        Deletes a policy from the LoadBalancer. The specified policy must not
        be enabled for any listeners.
        )r
�delete_lb_policyr)r�policy_namerrr�
delete_policyVszLoadBalancer.delete_policycC�|j�|j||�Sr)r
�set_lb_policies_of_listenerr)r�lb_portrrrr�set_policies_of_listener]s
�z%LoadBalancer.set_policies_of_listenercCr}r)r
�!set_lb_policies_of_backend_serverr)rrrrrr�set_policies_of_backend_serverb��z+LoadBalancer.set_policies_of_backend_servercC�|j�||j|�Sr)r
�"create_lb_cookie_stickiness_policyr)r�cookie_expiration_periodr{rrr�create_cookie_stickiness_policyfs�z,LoadBalancer.create_cookie_stickiness_policycCr�r)r
�#create_app_cookie_stickiness_policyr)rrr{rrrr�ks�z0LoadBalancer.create_app_cookie_stickiness_policycCr}r)r
�set_lb_listener_SSL_certificater)rr�ssl_certificate_idrrr�set_listener_SSL_certificatepr�z)LoadBalancer.set_listener_SSL_certificatecCs|j�|j|||�Sr)r
�create_lb_policyr)rr{�policy_type�policy_attributerrrr�ts
�zLoadBalancer.create_lb_policycCrJ)a
        Attaches load balancer to one or more subnets.
        Attaching subnets that are already registered with the
        Load Balancer has no effect.

        :type subnets: string or List of strings
        :param subnets: The name of the subnet(s) to add.

        N)rKr
rLr
�attach_lb_to_subnetsrr3�rr3�new_subnetsrrr�attach_subnetsxs

zLoadBalancer.attach_subnetscCrJ)z�
        Detaches load balancer from one or more subnets.

        :type subnets: string or List of strings
        :param subnets: The name of the subnet(s) to detach.

        N)rKr
rLr
�detach_lb_from_subnetsrr3r�rrr�detach_subnets�rSzLoadBalancer.detach_subnetscCrJ)a7
        Associates one or more security groups with the load balancer.
        The provided security groups will override any currently applied
        security groups.

        :type security_groups: string or List of strings
        :param security_groups: The name of the security group(s) to add.

        N)rKr
rLr
�apply_security_groups_to_lbrr4)rr4�new_sgsrrr�apply_security_groups�s
�
z"LoadBalancer.apply_security_groups)NNN)Fr)Nrr)!r"r#r$r%rrrr!rPrRrWrZrarcrdrgrirkrmrprvrxryr|r�r�r�r�r�r�r�r�r�rrrrr)Hs>
5





r)N)�boto.ec2.elb.healthcheckr�boto.ec2.elb.listenerr�boto.ec2.elb.listelementr�boto.ec2.elb.policiesrr�boto.ec2.elb.securitygroupr�boto.ec2.instanceinfor�boto.resultsetr	�boto.compatr
�objectrr&r)rrrr�<module>s

https://t.me/RX1948 - 2025