HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/boto_elb.cpython-310.pyc
o

�N�g��@sdZddlZddlZddlZddlmmZddlZz'ddl	Z	ddl
Z	ddlmZddl
mZmZmZmZe�d��ej�dZWneyMdZYnwe�e�Zdd	�ZdKd
d�ZdKdd
�ZdKdd�ZdKdd�Zdd�Z							dLdd�ZdKdd�Z dKdd�Z!dKdd�Z"	dKdd�Z#	dKdd �Z$	dKd!d"�Z%dKd#d$�Z&dKd%d&�Z'dKd'd(�Z(dKd)d*�Z)dKd+d,�Z*	dKd-d.�Z+	dKd/d0�Z,	dKd1d2�Z-	dMd3d4�Z.	dNd5d6�Z/				dKd7d8�Z0dKd9d:�Z1	dNd;d<�Z2	dNd=d>�Z3dKd?d@�Z4dKdAdB�Z5dCdD�Z6dOdEdF�Z7dGdH�Z8dIdJ�Z9dS)Pa�
Connection module for Amazon ELB

.. versionadded:: 2014.7.0

:configuration: This module accepts explicit elb credentials but can also utilize
    IAM roles assigned to the instance through Instance Profiles. Dynamic
    credentials are then automatically obtained from AWS API and no further
    configuration is necessary. More Information available at:

    .. code-block:: text

        http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

    If IAM roles are not used you need to specify them either in a pillar or
    in the minion's config file:

    .. code-block:: yaml

        elb.keyid: GKTADJGHEIQSXMKKRBJ08H
        elb.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

    A region may also be specified in the configuration:

    .. code-block:: yaml

        elb.region: us-east-1

    If a region is not specified, the default is us-east-1.

    It's also possible to specify key, keyid and region via a profile, either
    as a passed in dict, or as a string to pull from pillars or minion config:

    .. code-block:: yaml

        myprofile:
            keyid: GKTADJGHEIQSXMKKRBJ08H
            key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
            region: us-east-1

:depends: boto >= 2.33.0
�N)�HealthCheck)�AccessLogAttribute�ConnectionDrainingAttribute�ConnectionSettingAttribute�CrossZoneLoadBalancingAttribute�botoTFcCs2tjjjddd�}|durtdtddtd�|S)	z,
    Only load if boto libraries exist.
    z2.33.0F)Zboto_verZcheck_boto3Tzboto.assign_funcs�elbzec2.elb)�module�pack)�salt�utilsZversionsZcheck_boto_reqs�	__utils__�__name__Z__salt__)Z
has_boto_reqs�r�I/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_elb.py�__virtual__Is�rc
Cspt||||d�}z|j|gd�}|rWdSt�d|�WdStjjy7}zt�|�WYd}~dSd}~ww)z�
    Check to see if an ELB exists.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.exists myelb region=us-east-1
    ��region�key�keyid�profile��load_balancer_namesTz-The load balancer does not exist in region %sFN)�	_get_conn�get_all_load_balancers�log�debugr�	exception�BotoServerError�warning)�namerrrr�connr�errorrrr�existsVs

��r#c
Cs\t||||d�}z
dd�|��D�WStjjy-}z
t�|�gWYd}~Sd}~ww)z�
    Return all load balancers associated with an account

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.get_all_elbs region=us-east-1
    rcSsg|]}|�qSrr��.0�errr�
<listcomp>{sz get_all_elbs.<locals>.<listcomp>N)rrrrrrr)rrrrr!r"rrr�get_all_elbsns

��r(cCsdd�t||||d�D�S)z�
    Return names of all load balancers associated with an account

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.list_elbs region=us-east-1
    cS�g|]}|j�qSr)r r$rrrr'�s��zlist_elbs.<locals>.<listcomp>r)r(rrrr�	list_elbs�s�r*c
Cs�t||||d�}d}|r�z�|j|gd�}|d}i}|j|d<g}	|jD]*}
i}|
j|d<|
j|d<|
j|d<|
j|d	<|
j|d
<|
j	rI|
j	|d<|	�
|�q$|	|d<g}|jD]}
i}|
j|d<d
d�|
jD�|d
<|�
|�qX||d<|j
|d<|j|d<|j|d<|j|d<t||�|d<|jj|jj|jjg}g}|D]}|dd�|D�7}q�||d
<|j|d<|j|d<|j|d<|WStjjy�}z.|jdkr�t�d�t�d�|d8}WYd}~q
t� d||j!�t� |�iWYd}~Sd}~wwiS)z�
    Get an ELB configuration.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.exists myelb region=us-east-1
    r�rr�availability_zones�elb_port�elb_protocol�
instance_port�instance_protocol�policies�certificate�	listenerscSr)r��policy_name�r%�prrrr'��z"get_elb_config.<locals>.<listcomp>�backends�subnets�security_groups�scheme�dns_name�tagscSr)rr4r6rrrr'�r8�canonical_hosted_zone_name�canonical_hosted_zone_name_id�vpc_id�
Throttling�.Throttled by AWS API, will retry in 5 seconds.��Nz$Error fetching config for ELB %s: %s)"rrr,r3Zload_balancer_port�protocolr/r0Zpolicy_namesZssl_certificate_id�appendr9r1r:r;r<r=�
_get_all_tagsZapp_cookie_stickiness_policiesZlb_cookie_stickiness_policiesZother_policiesr?r@rArrr�
error_coderr�time�sleepr"�message)r rrrrr!�retries�lb�retr3Z	_listenerZ
listener_dictr9Z_backendZbs_dictZlb_policy_listsr1Zpolicy_listr"rrr�get_elb_config�sp














�






��	rPcCsXd|vr|d��}n|d��}|d|d|d|g}d|vr(|�|d�t|�S)a
    Convert an ELB listener dict into a listener tuple used by certain parts of
    the AWS ELB API.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.listener_dict_to_tuple '{"elb_port":80,"instance_port":80,"elb_protocol":"HTTP"}'
    r0r.r-r/r2)�upperrG�tuple)�listenerr0Zlistener_tuplerrr�listener_dict_to_tuple�s�rT�internet-facingc

Cs�t||||	d�}
t|||||	�rdSt|t�rtjj�|�}t|t�r*tjj�|�}g}|D]	}|�t	|��q.z|
j
||||||d�}
|
rOt�d|�WdSt�
d|�WdStjjyy}ztj
d||j|jtjd�WYd	}~dSd	}~ww)
z�
    Create an ELB

    CLI example to create an ELB:

    .. code-block:: bash

        salt myminion boto_elb.create myelb '["us-east-1a", "us-east-1e"]' '{"elb_port": 443, "elb_protocol": "HTTPS", ...}' region=us-east-1
    rT)r Zzonesr:r;r<Zcomplex_listenerszCreated ELB %szFailed to create ELB %sFzFailed to create ELB %s: %s: %s�Zexc_info_on_loglevelN)rr#�
isinstance�strrr�json�loadsrGrTZcreate_load_balancerr�infor"rrrrIrL�logging�DEBUG)r r,r3r:r;r<rrrrr!�_complex_listenersrSrNr"rrr�create�sF

����r_c
Cs~t||||d�}t|||||�sdSz|�|�t�d|�WdStjjy>}ztjd|t	j
d�WYd}~dSd}~ww)z�
    Delete an ELB.

    CLI example to delete an ELB:

    .. code-block:: bash

        salt myminion boto_elb.delete myelb region=us-east-1
    rTzDeleted ELB %s.zFailed to delete ELB %srVNF)rr#Zdelete_load_balancerrr[rrrr"r\r])r rrrrr!r"rrr�delete-s

��r`c

Cs�t||||d�}t|t�rtjj�|�}g}|D]	}|�t|��qz|�	|g|�t
�d|�WdStj
jyQ}	zt
jd||	tjd�WYd}	~	dSd}	~	ww)z�
    Create listeners on an ELB.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.create_listeners myelb '[["HTTPS", "HTTP", 443, 80, "arn:aws:iam::11  11111:server-certificate/mycert"]]'
    rzCreated ELB listeners on %sTz(Failed to create ELB listeners on %s: %srVNF)rrWrXrrrYrZrGrTZcreate_load_balancer_listenersrr[rrrr"r\r])
r r3rrrrr!r^rSr"rrr�create_listenersDs(

���rac
C�t||||d�}t|t�rtjj�|�}z|�||�t�	d|�WdSt
jjyB}ztj
d||tjd�WYd}~dSd}~ww)z�
    Delete listeners on an ELB.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.delete_listeners myelb '[80,443]'
    rzDeleted ELB listeners on %sTz(Failed to delete ELB listeners on %s: %srVNF)rrWrXrrrYrZZdelete_load_balancer_listenersrr[rrrr"r\r])r Zportsrrrrr!r"rrr�delete_listenersd�"

���rcc
Cs�t||||d�}t|t�rtjj�|�}z|�||�t�	d|�WdSt
jjyE}zt�
|�t�d||j�WYd}~dSd}~ww)z�
    Apply security groups to ELB.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.apply_security_groups myelb '["mysecgroup1"]'
    rz!Applied security_groups on ELB %sTz.Failed to appply security_groups on ELB %s: %sNF)rrWrXrrrYrZZapply_security_groups_to_lbrr[rrrrr"rL)r r;rrrrr!r&rrr�apply_security_groups�s

��rec
Cs�t||||d�}t|t�rtjj�|�}z|�||�t�	d|�WdSt
jjy?}zt�
d||�WYd}~dSd}~ww)z�
    Enable availability zones for ELB.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.enable_availability_zones myelb '["us-east-1a"]'
    rz$Enabled availability_zones on ELB %sTz1Failed to enable availability_zones on ELB %s: %sNF)rrWrXrrrYrZ�enable_availability_zonesrr[rrrr"�r r,rrrrr!r"rrrrf�s
��rfc
Crb)z�
    Disable availability zones for ELB.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.disable_availability_zones myelb '["us-east-1a"]'
    rz%Disabled availability_zones on ELB %sTz2Failed to disable availability_zones on ELB %s: %srVNF)rrWrXrrrYrZ�disable_availability_zonesrr[rrrr"r\r]rgrrrrh�s"
���rhc
Crb)z�
    Attach ELB to subnets.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.attach_subnets myelb '["mysubnet"]'
    rzAttached ELB %s on subnets.Tz&Failed to attach ELB %s on subnets: %srVNF)rrWrXrrrYrZZattach_lb_to_subnetsrr[rrrr"r\r]�r r:rrrrr!r"rrr�attach_subnets�rdrjc
Crb)z�
    Detach ELB from subnets.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.detach_subnets myelb '["mysubnet"]'
    rzDetached ELB %s from subnets.Tz(Failed to detach ELB %s from subnets: %srVNF)rrWrXrrrYrZZdetach_lb_from_subnetsrr[rrrr"r\r]rirrr�detach_subnets�rdrkc
Cs\t||||d�}d}|r�zh|�|�}t��}t��|d<t��|d<t��|d<t��|d<|j}	|j}
|j}|j}|	j|dd<|	j	|dd<|	j
|dd	<|	j|dd
<|
j|dd<|j|dd<|j|dd<|j
|dd<|WStjjy�}
z)|
jd
kr�t�d�t�d�|d8}WYd}
~
q
t�d||
j�iWYd}
~
Sd}
~
wwiS)z�
    Check to see if attributes are set on an ELB.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.get_attributes myelb
    rr+�
access_log�cross_zone_load_balancing�connection_draining�connecting_settings�enabled�s3_bucket_name�s3_bucket_prefix�
emit_interval�timeout�idle_timeoutrBz0Throttled by AWS API, will retry in 5 seconds...rDrENzELB %s does not exist: %s)rZget_all_lb_attributes�odict�OrderedDictrlrmrnrorprqrrrsrtrurrrrIrrrJrKr"rL)r rrrrr!rMZlbattrsrO�al�czlb�cd�csr&rrr�get_attributes	sD




��r|cCs�t||||d�}|�di�}|�di�}|�di�}	|�di�}
|s/|s/|	s/|
s/t�d�dS|rtt�}|�dd�|_|jsGd	}t�|�dS|�d
d�|_|�dd�|_|�d
d�|_|�	|d|�}
|
rlt�
d|�nt�d|�dS|r�t�}|d|_|�	|d|j�}
|
r�t�
d|�nt�d�dS|	r�t�}|	d|_|	�dd�|_
|�	|d|�}
|
r�t�
d|�nt�d�dS|
r�t�}|
�dd�|_|�	|d|�}
|
r�t�
d|�dSt�d�dSdS)a
    Set attributes on an ELB.

    name (string)
        Name of the ELB instance to set attributes for

    attributes
        A dict of attributes to set.

        Valid attributes are:

        access_log (dict)
            enabled (bool)
                Enable storage of access logs.
            s3_bucket_name (string)
                The name of the S3 bucket to place logs.
            s3_bucket_prefix (string)
                Prefix for the log file name.
            emit_interval (int)
                Interval for storing logs in S3 in minutes. Valid values are
                5 and 60.

        connection_draining (dict)
            enabled (bool)
                Enable connection draining.
            timeout (int)
                Maximum allowed time in seconds for sending existing
                connections to an instance that is deregistering or unhealthy.
                Default is 300.

        cross_zone_load_balancing (dict)
            enabled (bool)
                Enable cross-zone load balancing.

    CLI example to set attributes on an ELB:

    .. code-block:: bash

        salt myminion boto_elb.set_attributes myelb '{"access_log": {"enabled": "true", "s3_bucket_name": "mybucket", "s3_bucket_prefix": "mylogs/", "emit_interval": "5"}}' region=us-east-1
    rrlrmrnroz No supported attributes for ELB.Frpz;Access log attribute configured, but enabled config missingrqNrrrsZ	accessLogz%Added access_log attribute to %s elb.z-Failed to add access_log attribute to %s elb.ZcrossZoneLoadBalancingz4Added cross_zone_load_balancing attribute to %s elb.z2Failed to add cross_zone_load_balancing attribute.rti,ZconnectionDrainingz.Added connection_draining attribute to %s elb.z,Failed to add connection_draining attribute.ru�<ZconnectingSettingsz.Added connecting_settings attribute to %s elb.z,Failed to add connecting_settings attribute.T)r�getrr"rrprqrrrsZmodify_lb_attributer[rrrtrru)r Z
attributesrrrrr!rxryrzr{Z_al�msgZ
added_attrZ_czlbZ_cdZ_csrrr�set_attributes6sh)


�



�r�c
Cs�t||||d�}d}	z.|j|gd�}|d}t��}|j}	|	j|d<|	j|d<|	j|d<|	j|d	<|	j	|d
<|WSt
jjys}
z,|r^|
j
dkr^t�d�t�d
�|d8}WYd}
~
q
tjd|tjd�iWYd}
~
Sd}
~
ww)z�
    Get the health check configured for this ELB.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.get_health_check myelb
    rr+Trr�interval�target�healthy_thresholdrt�unhealthy_thresholdrBrCrDrENzELB %s not found.)Zexc_info_on_logleve)rrrvrw�health_checkr�r�r�rtr�rrr�coderrrJrKr"r\r])r rrrrr!rMrNrO�hcr&rrr�get_health_check�s0







��r�c

Cs�t||||d�}d}tdi|��}	z|�||�t�d|�WdStjjyW}	z(|rFtj	dkrFt�
d�t�d�|d8}WYd	}	~	qt�d
|�WYd	}	~	dSd	}	~	ww)
z�
    Set attributes on an ELB.

    CLI example to set attributes on an ELB:

    .. code-block:: bash

        salt myminion boto_elb.set_health_check myelb '{"target": "HTTP:80/"}'
    rr+Tz!Configured health check on ELB %srBrCrDrENz*Failed to configure health check on ELB %sFr)
rrZconfigure_health_checkrr[rrrr&r�rrJrK)
r r�rrrrr!rMr�r"rrr�set_health_check�s$

��r�c
Cs�t|t�s
t|t�r
|g}t||||d�}z|�||�}Wntjjy7}zt�|�WYd}~dSd}~wwdd�|D�}	t	|��
t	|	��}
|
rWt�dt|
�|�d}|Sd}|S)a�
    Register instances with an ELB.  Instances is either a string
    instance id or a list of string instance id's.

    Returns:

    - ``True``: instance(s) registered successfully
    - ``False``: instance(s) failed to be registered

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.register_instances myelb instance_id
        salt myminion boto_elb.register_instances myelb "[instance_id,instance_id]"
    rNFcSr)r��id�r%�instancerrrr'�r8z&register_instances.<locals>.<listcomp>z+Instance(s): %s not registered with ELB %s.T)rWrXr�register_instancesrrrrr�set�
difference�list)r �	instancesrrrrr!�registered_instancesr"�registered_instance_idsZregister_failuresZregister_resultrrrr��s(
��
��r�c
Cs�t|t�s
t|t�r
|g}t||||d�}z|�||�}Wn-tjjyJ}z|jdkr:t�	d||�WYd}~dSt�	|�WYd}~dSd}~wwdd�|D�}	t
|��t
|	��}
|
rjt�	dt|
�|�d}|Sd	}|S)
a
    Deregister instances with an ELB.  Instances is either a string
    instance id or a list of string instance id's.

    Returns:

    - ``True``: instance(s) deregistered successfully
    - ``False``: instance(s) failed to be deregistered
    - ``None``: instance(s) not valid or not registered, no action taken

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.deregister_instances myelb instance_id
        salt myminion boto_elb.deregister_instances myelb "[instance_id, instance_id]"
    rZInvalidInstancezYOne or more of instance(s) %s are not part of ELB %s. deregister_instances not performed.NFcSr)rr�r�rrrr'3r8z(deregister_instances.<locals>.<listcomp>z-Instance(s): %s not deregistered from ELB %s.T)
rWrXr�deregister_instancesrrrrIrrr��intersectionr�)r r�rrrrr!r�r"r�Zderegister_failuresZderegister_resultrrrr�s:
�
����r�cCs�d}dd�t|||||�D�}t|�}	|	|}
||	}|r#t|
p!|�S|r4t|t|�||||�dur4d}|
rEt|t|
�||||�durEd}|S)z�
    Set the instances assigned to an ELB to exactly the list given

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.set_instances myelb region=us-east-1 instances="[instance_id,instance_id]"
    TcSsh|]}|d�qS)�instance_idr)r%�irrr�	<setcomp>Ps�z set_instances.<locals>.<setcomp>F)�get_instance_healthr��boolr�r�r�)r r��testrrrrrO�currentZdesired�add�removerrr�
set_instancesCs$��r�c
Cs�t||||d�}z|�||�}g}|D]}	|�|	j|	j|	j|	jd��q|WStjj	yA}
z
t
�|
�gWYd}
~
Sd}
~
ww)a
    Get a list of instances and their health state

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.get_instance_health myelb
        salt myminion boto_elb.get_instance_health myelb region=us-east-1 instances="[instance_id,instance_id]"
    r)r��description�state�reason_codeN)rZdescribe_instance_healthrGr�r�r�r�rrrrr)r rrrrr�r!Zinstance_statesrOZ	_instancer"rrrr�ds$
��
��r�c
Cs�t||||d�}t|||||�sdSz|�||||�}	|	r't�d||�WdSt�d||�WdStjjyQ}
ztjd|||
j	t
jd�WYd}
~
dSd}
~
ww)	z�
    Create an ELB policy.

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.create_policy myelb mypolicy LBCookieStickinessPolicyType '{"CookieExpirationPeriod": 3600}'
    rFzCreated policy %s on ELB %sTz$Failed to create policy %s on ELB %sz(Failed to create policy %s on ELB %s: %srVN)rr#Zcreate_lb_policyrr[r"rrrrLr\r])r r5Zpolicy_type�policyrrrrr!�successr&rrr�
create_policy�s*���r�c
Cs�t||||d�}t|||||�sdSz|�||�t�d||�WdStjjyC}ztjd|||j	t
jd�WYd}~dSd}~ww)z�
    Delete an ELB policy.

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.delete_policy myelb mypolicy
    rTzDeleted policy %s on ELB %sz(Failed to delete policy %s on ELB %s: %srVNF)rr#Zdelete_lb_policyrr[rrrr"rLr\r])r r5rrrrr!r&rrr�
delete_policy�s$���r�c	C�t||||d�}t|||||�sdS|durg}z|�|||�t�d|||�WdStjjyL}ztjd||||jt	j
d�WYd}~dSd}~ww)z�
    Set the policies of an ELB listener.

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: Bash

        salt myminion boto_elb.set_listener_policy myelb 443 "[policy1,policy2]"
    rTNz%Set policies %s on ELB %s listener %sz1Failed to set policy %s on ELB %s listener %s: %srVF)rr#Zset_lb_policies_of_listenerrr[rrrrLr\r]�	r �portr1rrrrr!r&rrr�set_listener_policy�s*����r�c	Cr�)z�
    Set the policies of an ELB backend server.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.set_backend_policy myelb 443 "[policy1,policy2]"
    rTNz+Set policies %s on ELB %s backend server %sz7Failed to set policy %s on ELB %s backend server %s: %srVF)rr#Z!set_lb_policies_of_backend_serverrr[rrrrLr\r]r�rrr�set_backend_policy�s*����r�cC�4t|||||�rt||||d�}t|||�}|SdS)a
    Add the tags on an ELB

    .. versionadded:: 2016.3.0

    name
        name of the ELB

    tags
        dict of name/value pair tags

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.set_tags my-elb-name "{'Tag1': 'Value', 'Tag2': 'Another Value'}"
    rF)r#r�	_add_tags�r r>rrrrr!rOrrr�set_tagss
r�cCr�)z�
    Add the tags on an ELB

    name
        name of the ELB

    tags
        list of tags to remove

    CLI Example:

    .. code-block:: bash

        salt myminion boto_elb.delete_tags my-elb-name ['TagToRemove1', 'TagToRemove2']
    rF)r#r�_remove_tagsr�rrr�delete_tags1s
r�cCsVt|���}d}|D]}||}||d|�d�<|dur$||d|�d�<|d7}q
dS)z?
    helper function to build a tag parameter list to send
    rEzTags.member.z.KeyNz.Value)�sorted�keys)�paramsr>r�r�r�valuerrr�_build_tag_param_listIs
�r�cCsBi}|r|�||d�|jd|td�dd�}||r||SdS)a
    Retrieve all the metadata tags associated with your ELB(s).

    :type load_balancer_names: list
    :param load_balancer_names: An optional list of load balancer names.

    :rtype: list
    :return: A list of :class:`boto.ec2.elb.tag.Tag` objects
    �LoadBalancerNames.member.%dZDescribeTagsz!boto_elb_tag.get_tag_descriptions�POST�ZverbN)�build_list_paramsZ
get_objectr
)r!rr�r>rrrrHWs
��rHcCs,i}|�||d�t||�|jd|dd�S)a�
    Create new metadata tags for the specified resource ids.

    :type load_balancer_names: list
    :param load_balancer_names: A list of load balancer names.

    :type tags: dict
    :param tags: A dictionary containing the name/value pairs.
                 If you want to create only a tag name, the
                 value for that tag should be the empty string
                 (e.g. '').
    r�ZAddTagsr�r�)r�r��
get_status�r!rr>r�rrrr�ss

r�cCs0i}|�||d�|�||d�|jd|dd�S)a
    Delete metadata tags for the specified resource ids.

    :type load_balancer_names: list
    :param load_balancer_names: A list of load balancer names.

    :type tags: list
    :param tags: A list containing just tag names for the tags to be
                 deleted.
    r�zTags.member.%d.KeyZ
RemoveTagsr�r�)r�r�r�rrrr��sr�)NNNN)NNrUNNNN)FNNNN)NNNNN)N):�__doc__r\rJZsalt.utils.jsonrZsalt.utils.odictrrvZsalt.utils.versionsrZboto.ec2Zboto.ec2.elbrZboto.ec2.elb.attributesrrrr�	getLogger�setLevel�CRITICALZHAS_BOTO�ImportErrorrrrr#r(r*rPrTr_r`rarcrerfrhrjrkr|r�r�r�r�r�r�r�r�r�r�r�r�r�r�rHr�r�rrrr�<module>s�.�




D
�
<

 
�
�
�



-
c$
� 
�-
�=
�"
�&
�
, 
�%
�
"