o
    #jG.                    @   s   d Z ddlZddlZddlZddlZddlZddlmZ ddlm	Z	 ddl
mZ ddl
mZ ddl
mZ ddlmZ dd	lmZ dd
lmZ ejdk rTee ed eeZG dd dejZdd ZeZdS )z2
This module provides a client class for APP BLB.
    N)bce_base_client)bce_v1_signer)bce_http_client)handler)http_methods)utils)required)compat3zutf-8c                   @   sz  e Zd ZdZdZdddZdddZ		ddd	Zee	e
fe	e
fd
										dddZee	e
fd			dddZ				dddZee	e
fddddZee	e
fddddZ	 ee	e
fee	e
fd			dddZee	e
fee	e
fd			dddZee	e
fee	e
fd												dddZee	e
fee	e
fed														dddZee	e
fee	e
fed							dd d!Zee	e
fed"					dd#d$Zee	e
fed"			dd%d&Zee	e
fed"												dd'd(Zee	e
fed"																			dd)d*Zee	e
fed"											dd+d,Zee	e
fd			dd-d.Zee	e
fd			dd/d0Zee	e
fd			dd1d2Zee	e
fd			dd3d4Zee	e
fd		dd5d6Z ee	e
fd		dd7d8Z!ee	e
fed9			dd:d;Z"ee	e
feed<			dd=d>Z#ee	e
fed"			dd?d@Z$ee	e
feedA		ddBdCZ%ee	e
feedD	ddEdFZ&	 ee	e
fd					ddGdHZ'ee	e
fe	e
fdI				ddJdKZ(ee	e
fd				ddLdMZ)ee	e
fe	e
fdI		ddNdOZ*ee	e
fe	e
fee	e
fdP													ddQdRZ+ee	e
fe	e
fe	e
fdS													ddTdUZ,ee	e
fe	e
fedV	ddWdXZ-ee	e
fe	e
fedY		ddZd[Z.ee	e
fe	e
fedY		dd\d]Z/ee	e
fe	e
fdI		dd^d_Z0ee	e
fe	e
fedY		dd`daZ1ee	e
fe	e
fdIddbdcZ2ee	e
fe	e
fdIddddeZ3ee	e
fd					ddfdgZ4ee	e
fe	e
fdh				ddidjZ5ee	e
fd				ddkdlZ6ee	e
fe	e
fdh		ddmdnZ7ee	e
fe	e
fe	e
fdo											ddpdqZ8ee	e
fe	e
fe	e
fdr											ddsdtZ9ee	e
fe	e
fedu	ddvdwZ:ee	e
fe	e
fdh				ddxdyZ;ee	e
fe	e
fdh				ddzd{Z<ee	e
fe	e
fdh		dd|d}Z=ee	e
fe	e
fdh				dd~dZ>ee	e
fed	dddZ?ee	e
fed	dddZ@ee	e
fddddZAee	e
fed	dddZBee	e
fed	dddZCee	e
fddddZDee	e
feed		dddZEee	e
fed		dddZFdS )AppBlbClientz!
    APP BLB base sdk client
    s   /v1Nc                 C   s   t j| | d S N)r   BceBaseClient__init__)selfconfig r   e/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/baidubce/services/blb/app_blb_client.pyr   /   s   zAppBlbClient.__init__c                 C   s(   |du r| j S t| j }|| |S )zg
        :param config:
        :type config: baidubce.BceClientConfiguration
        :return:
        N)r   copyZmerge_non_none_values)r   r   Z
new_configr   r   r   _merge_config2   s
   
zAppBlbClient._merge_configc              
   C   sJ   |  |}|d u rtj}|d u rddd}t|tjtj|g|||||S )Ns   */*s   application/json;charset=utf-8)s   Accepts   Content-Type)r   r   Z
parse_jsonr   send_requestr   signZparse_error)r   Zhttp_methodpathbodyheadersparamsr   Zbody_parserr   r   r   _send_request?   s   

zAppBlbClient._send_request)vpc_id	subnet_idc                 C   sj  t | jd}i }|du rt |d< n||d< i }t||d< t||d< |dur2t||d< |dur=t||d< |durHt||d< |durSt||d	< |dur^t||d
< |durf||d< |	durn|	|d< |
duryt|
|d< |dur||d< |durt||d< |durt||d< |dur||d< |dur||d< | jtj|t	
|||dS )a-  
        Create a app LoadBalancer with the specified options.

        :param vpc_id:
                id of vpc which the LoadBalancer belong to
        :type vpc_id: string

        :param subnet_id:
                id of subnet which the LoadBalancer belong to
        :type subnet_id: string

        :param name:
                the name of LoadBalancer to create
        :type name: string

        :param desc:
                The description of LoadBalancer
        :type desc: string

        :param type:
                LoadBalancer type, default is "application"
        :type type: string

        :param address:
                specify the private IP address of LoadBalancer
        :type address: string

        :param eip:
                bind an existing eip to the LoadBalancer
        :type eip: string

        :param tags:
                list of tag key-value pairs
        :type tags: list

        :param billing:
                billing information, required for prepaid LoadBalancer
        :type billing: dict

        :param performance_level:
                performance level parameter
        :type performance_level: string

        :param auto_renew_length:
                auto renew length
        :type auto_renew_length: int

        :param auto_renew_time_unit:
                auto renew time unit, "month" or "year"
        :type auto_renew_time_unit: string

        :param resource_group_id:
                resource group id
        :type resource_group_id: string

        :param allow_delete:
                whether allow to delete, default is true
        :type allow_delete: bool

        :param allocate_ipv6:
                whether allocate ipv6 address
        :type allocate_ipv6: bool

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        appblbN   clientTokenZvpcIdZsubnetIdnamedescaddresstypeeiptagsbillingZperformanceLevelZautoRenewLengthZautoRenewTimeUnitZresourceGroupIdallowDeleteallocateIpv6r   r   r   r   
append_uriversiongenerate_client_tokenr	   convert_to_stringr   r   POSTjsondumps)r   r   r   r    r!   r"   r#   r$   r%   r&   Zperformance_levelZauto_renew_lengthZauto_renew_time_unitZresource_group_idallow_deleteallocate_ipv6client_tokenr   r   r   r   r   r   r   create_app_loadbalancerL   sL   V

z$AppBlbClient.create_app_loadbalancer)blb_idc                 C   s   t | jd|}i }	|du rt |	d< n||	d< i }
|dur%t||
d< |dur0t||
d< |dur8||
d< |dur@||
d< | jtj|t	
|
|	|dS )	a  
        Modify the special attribute to new value of the LoadBalancer
        owned by the user.

        :param blb_id:
                id of LoadBalancer to update
        :type blb_id: string

        :param name:
                name of LoadBalancer
        :type name: string

        :param desc:
                The description of LoadBalancer
        :type desc: string

        :param allow_delete:
                whether allow to delete, default is true
        :type allow_delete: bool

        :param allocate_ipv6:
                whether allocate ipv6 address
        :type allocate_ipv6: bool

        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm
                will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   Nr   r    r!   r'   r(   r   r   r   r+   r,   r-   r	   r.   r   r   PUTr0   r1   )r   r6   r    r!   r2   r3   r4   r   r   r   r   r   r   r   update_app_loadbalancer   s"   (z$AppBlbClient.update_app_loadbalancerc	                 C   s   t | jd}	i }
|dur||
d< |dur||
d< |dur!||
d< |dur)||
d< |dur1||
d< |dur9||
d< |durA||
d	< | jtj|	|
|d
S )a[  
        Return a list of LoadBalancers

        :param address:
            Intranet service address in dotted decimal notation
        :type address: string

        :param name:
            name of LoadBalancer to describe
        :type name: string

        :param blb_id:
            id of LoadBalancer to describe (exact match only)
        :type blb_id: string

        :param bcc_id:
            bcc which bind the LoadBalancers (exact match only)
        :type bcc_id: string

        :param exactly_match:
            true for exact match, false for fuzzy match, default is false
        :type exactly_match: bool

        :param marker:
            The optional parameter marker specified in the original
            request to specify where in the results to begin listing.
            Together with the marker, specifies the list result
            which listing should begin.
            If the marker is not specified, the list result will
            listing from the first one.
        :type marker: string

        :param max_keys:
            The optional parameter to specifies the max number of list
            result to return.
            The default value is 1000.
        :type max_keys: int

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   Ns   address   names   blbIds   bccId   exactlyMatch   marker   maxKeysr7   r   r+   r,   r   r   GET)r   r"   r    r6   Zbcc_idexactly_matchmarkermax_keysr   r   r   r   r   r   describe_app_loadbalancers
  s&   0
z'AppBlbClient.describe_app_loadbalancersc                 C   s"   t | jd|}| jtj||dS )a5  
        Return detail imformation of specific LoadBalancer

        :param blb_id:
            id of LoadBalancer to describe
        :type blb_id: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   r?   )r   r6   r   r   r   r   r    describe_app_loadbalancer_detailO  s   
z-AppBlbClient.describe_app_loadbalancer_detailc                 C   sD   t | jd|}i }|du rt |d< n||d< | jtj|||dS )a  
        delete the LoadBalancer owned by the user.

        :param blb_id:
                id of LoadBalancer to describe
        :type blb_id: string

        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm
                will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   Nr   r7   )r   r+   r,   r-   r   r   DELETE)r   r6   r4   r   r   r   r   r   r   delete_app_loadbalancerc  s   
z$AppBlbClient.delete_app_loadbalancer)r6   listener_port	schedulerc                 C   ~   t | jd|d}i }	|du rt |	d< n||	d< |t|d}
|dur)||
d< |dur1||
d< | jtj|t	
|
|	|dS )	aT  
        Create a app tcp listener rule with the specified options.

        :param blb_id:
            the id of blb which the listener work on
        :type blb_id: string

        :param listener_port:
            port to be linstened owned by listener
        :value 1-65535
        :type listener_port: int

        :param scheduler
            balancing algorithm
        :value 'RoundRobin' or 'LeastConnection' or 'Hash'
        :type scheduler: string

        :param tcp_session_timeout:
            tcp connection timeout (unit: second), default 900
        :value 10-4000
        :type tcp_session_timeout: int

        :param description:
            description of the listener, no more than 200 characters
        :type description: string

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

         :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   TCPlistenerNr   listenerPortrJ   tcpSessionTimeoutdescriptionr)   r*   r   r6   rI   rJ   Ztcp_session_timeoutrP   r4   r   r   r   r   r   r   r   create_app_tcp_listener      ,

z$AppBlbClient.create_app_tcp_listenerc                 C   rK   )	aR  
        Create a app udp listener rule with the specified options.

        :param blb_id:
            the id of blb which the listener work on
        :type blb_id: string

        :param listener_port:
            port to be linstened owned by listener
        :value 1-65535
        :type listener_port: int

        :param scheduler
            balancing algorithm
        :value 'RoundRobin' or 'LeastConnection' or 'Hash'
        :type scheduler: string

        :param udp_session_timeout:
            udp connection timeout (unit: second), default 90
        :value 5-4000
        :type udp_session_timeout: int

        :param description:
            description of the listener, no more than 200 characters
        :type description: string

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

         :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   UDPlistenerNr   rM   udpSessionTimeoutrP   r)   r*   r   r6   rI   rJ   Zudp_session_timeoutrP   r4   r   r   r   r   r   r   r   create_app_udp_listener  rS   z$AppBlbClient.create_app_udp_listenerc                 C   s  t | jd|d}i }|du rt |d< n||d< |t|d}|dur)||d< |dur4t||d< |dur<||d< |durD||d	< |durL||d
< |	durT|	|d< |
dur\|
|d< |durd||d< |durl||d< |durt||d< | jtj|t	
|||dS )a  
        Create a app http listener rule with the specified options.
        :param blb_id:
            the id of blb which the listener work on
        :type blb_id: string

        :param listener_port:
            port to be linstened owned by listener
        :value 1-65535
        :type listener_port: int

        :param scheduler:
            balancing algorithm
        :value 'RoundRobin' or 'LeastConnection'
        :type scheduler: string

        :param keep_session:
            Whether to enable the session hold function,
            that is,the request sent by the same client will
            reach the same backend server
        :value true or false  default:false
        :type keep_session: bool

        :param keep_session_type:
            The cookie handling method maintained by the session,
            valid only if the session is held open
            :value 'insert' or 'rewrite'  default:insert
        :type keep_session_type: string

        :param keep_session_timeout:
            The time the cookie is kept in session (in seconds),
            valid only if the session is held open
            :value 1-15552000  default:3600
        :type keep_session_timeout: int

        :param keep_session_cookie_name:
            The session keeps the name of the cookie that needs to be
            overridden if and only if session persistence is enabled
            and keep_session_type="rewrite"
        :type keep_session_cookie_name: int

        :param x_forwarded_for:
            Whether to enable the real IP address of the client,
            the backend server can obtain the real address of the client
            through the X-Forwarded-For HTTP header.
        :value true or false, default: False
        :type x_forwarded_for: bool

        :param server_timeout:
            Backend server maximum timeout (unit: second)
        :value 1-3600, default: 30
        :type server_timeout:int

        :param redirect_port:
            Forward the request received by this listener to the
            HTTPS listener, which is specified by the HTTPS listener.
        :type redirect_port:int

        :param x_forwarded_proto:
            Whether to obtain the listener protocol type through
            X-Forwarded-Proto header.
        :value true or false, default: False
        :type x_forwarded_proto: bool

        :param additional_attributes:
            HTTP custom configuration, such as gzip settings.
        :type additional_attributes: list

        :param description:
            description of the listener, no more than 200 characters
        :type description: string

        :param client_token:
            If the clientToken is not specified by the user,
            a random String generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   HTTPlistenerNr   rM   keepSessionkeepSessionTypekeepSessionTimeoutkeepSessionCookieNamexForwardedForserverTimeoutredirectPortxForwardedProtoadditionalAttributesrP   r)   r*   r   r6   rI   rJ   keep_sessionkeep_session_typekeep_session_timeoutkeep_session_cookie_namex_forwarded_forserver_timeoutZredirect_portx_forwarded_protoadditional_attributesrP   r4   r   r   r   r   r   r   r   create_app_http_listener  sB   b

z%AppBlbClient.create_app_http_listener)r6   rI   rJ   cert_idsc                 C   sr  t | jd|d}i }|du rt |d< n||d< |t||d}|dur*||d< |dur5t||d< |dur=||d< |durE||d	< |	durM|	|d
< |
durU|
|d< |dur]||d< |durht||d< |durp||d< |durx||d< |dur||d< |dur||d< |dur||d< |dur||d< |durt||d< |dur||d< | jtj|t	
|||dS )a  
        Create a app https listener rule with the specified options.
        :param blb_id:
            The id of blb which the listener work on
        :type blb_id: string
        :param listener_port:
            port to be linstened owned by listener
        :value 1-65535
        :type listener_port: int
        :param scheduler:
            balancing algorithm
        :value 'RoundRobin' or 'LeastConnection'
        :type scheduler: string
        :param cert_ids:
            The certificate to be loaded by the listener.
        :type cert_ids: List<String>
        :param keep_session:
            Whether to enable the session hold function,
            that is, the request sent by the same client will reach the
            same backend server
        :value true or false, default: false
        :type keep_session: bool
        :param keep_session_type:
            The cookie handling method maintained by the session,
            valid only if the session is held open
        :value 'insert' or 'rewrite', default:insert
        :type keep_session_type: string
        :param keep_session_timeout:
            The time the cookie is kept in session (in seconds),
            valid only if the session is held open
        :value 1-15552000, default:3600
        :type keep_session_timeout: int
        :param keep_session_cookie_name:
            The session keeps the name of the cookie that needs
            to be overridden if and only if session persistence
            is enabled and keep_session_type="rewrite"
        :type keep_session_cookie_name: int
        :param x_forwarded_for:
            Whether to enable the real IP address of the client,
            the backend server can obtain the real address of the client
            through the X-Forwarded-For HTTP header.
        :value true or false, default: false
        :type x_forwarded_for: bool
        :param server_timeout:
            Backend server maximum timeout (unit: second)
        :value 1-3600, default: 30
        :type server_timeout: int
        :param ie6_compatible:
            compatible with IE6 HTTPS request
            (the protocol format is earlier SSL3.0, the security is poor)
        :value true or false, default: true
        :type ie6_compatible: bool
        :param encryption_type:
            Encryption options, support three types:
            compatibleIE/incompatibleIE/userDefind,
            corresponding to:
            IE-compatible encryption/disabled unsecure encryption/custom encryption,
            when encryptionType is valid and legitimate,
            ie6Compatible field transfer value will not take effect
        type: encryption_type:string
        :param encryption_protocols:
            When the encryptionType value is userDefind,
            the list of protocol types is a string list composed of four protocols:
            "sslv3", "tlsv10", "tlsv11", "tlsv12".
        type: encryption_protocols:list
        :param dual_auth:
            Whether to Open Two-way Authentication,
            default:false
        :type dual_auth: boolean
        :param client_certIds:
            When dualAuth is true, the loaded client certificate chain
        :type client_certIds: list
        :param client_token:
            If the clientToken is not specified by the user,
            a random String generated by default algorithm will be used.
        :type client_token: string
        :param additional_cert_domains:
            Additional domain,each element is an object that contains two attributes, namely "cert_id" and "host"
        :type additional_cert_domains: list
        :param x_forwarded_proto:
            Whether to obtain the listener protocol type through
            X-Forwarded-Proto header.
        :value true or false, default: False
        :type x_forwarded_proto: bool
        :param additional_attributes:
            HTTP custom configuration, such as gzip settings.
        :type additional_attributes: list
        :param applied_ciphers:
            Custom cipher suite string.
        :type applied_ciphers: string
        :param description:
            description of the listener, no more than 200 characters
        :type description: string
        :param config:
        :type config: baidubce.BceClientConfiguration
        :return
        :rtype baidubce.bce_response.BceResponse
        r   HTTPSlistenerNr   rN   rJ   certIdsrY   rZ   r[   r\   r]   r^   ie6CompatibleencryptionTypeencryptionProtocolsdualAuthclientCertIdsadditionalCertDomainsr`   ra   appliedCiphersrP   r)   r*   )r   r6   rI   rJ   rl   rc   rd   re   rf   rg   rh   ie6_compatibleencryption_typeencryption_protocols	dual_authclient_certIdsadditional_cert_domainsri   rj   applied_ciphersrP   r4   r   r   r   r   r   r   r   create_app_https_listener  s^   t
z&AppBlbClient.create_app_https_listenerc                 C   s   t | jd|d}i }|du rt |d< n||d< |t||d}|dur*||d< |dur5t||d< |dur=||d< |durE||d	< |	durM|	|d
< |
durXt|
|d< |dur`||d< | jtj|t	
|||dS )a  
        Create a app ssl listener rule with the specified options.

        :param blb_id:
            The id of blb which the listener work on
        :type blb_id: string

        :param listener_port:
            port to be linstened owned by listener
        :value 1-65535
        :type listener_port: int

        :param scheduler:
            balancing algorithm
        :value 'RoundRobin' or 'LeastConnection'
        :type scheduler: string

        :param cert_ids:
            The SSL certificate to be loaded by the listener.
            Currently HTTPS listeners can only bind one SSL certificate.
        :type cert_ids: List<String>

        :param ie6_compatible:
            compatible with IE6 HTTPS request
            (the protocol format is earlier SSL3.0, the security is poor)
        :value true or false, default: true
        :type ie6_compatible: bool

        :param encryption_type:
            Encryption options, support three types:
            compatibleIE/incompatibleIE/userDefind,
            corresponding to:
            IE-compatible encryption/disabled unsecure encryption/custom encryption,
            when encryptionType is valid and legitimate,
            ie6Compatible field transfer value will not take effect
        type: encryption_type:string

        :param encryption_protocols:
            When the encryptionType value is userDefind,
            the list of protocol types is a string list composed of four protocols:
            "sslv3", "tlsv10", "tlsv11", "tlsv12".
        type: encryption_protocols:list

        :param dual_auth:
            Whether to Open Two-way Authentication,
            default:false
        :type dual_auth: boolean

        :param client_certIds:
            When dualAuth is true, the loaded client certificate chain
        :type client_certIds: list

        :param client_token:
            If the clientToken is not specified by the user,
            a random String generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return
        :rtype baidubce.bce_response.BceResponse
        r   SSLlistenerNr   rn   rp   rq   rr   rs   rt   rv   rP   r)   r*   r   r6   rI   rJ   rl   rw   rx   ry   rz   r{   r}   rP   r4   r   r   r   r   r   r   r   create_app_ssl_listener0  s8   J
z$AppBlbClient.create_app_ssl_listener)r6   rI   c                 C      t | jd|d}i }	|du rt |	d< n||	d< ||	d< i }
|dur*t||
d< |dur2||
d< |dur:||
d< | jtj|t	
|
|	|d	S )
aU  
        update a app tcp listener rule with the specified options.

        :param blb_id:
            the id of blb which the listener work on
        :type blb_id:string

        :param listener_port:
             port to be linstened owned by listener
        :value 1-65535
        :type listener_port:int

        :param scheduler
            balancing algorithm
        :value 'RoundRobin'or'LeastConnection'or'Hash'
        :type scheduler:string

        :param tcp_session_timeout:
            tcp connection timeout (unit: second), default 900
        :value 10-4000
        :type tcp_session_timeout: int

        :param description:
            description of the listener, no more than 200 characters
        :type description: string

        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   rL   Nr      listenerPortrJ   rO   rP   r)   r8   rQ   r   r   r   update_app_tcp_listener  s"   -

z$AppBlbClient.update_app_tcp_listenerc                 C   r   )
a]  
        update a app udp listener rule with the specified options.

        :param blb_id:
                the id of blb which the listener work on
        :type blb_id:string

        :param listener_port:
                port to be linstened owned by listener
        :value 1-65535
        :type listener_port:int

        :param scheduler
              balancing algorithm
        :value 'RoundRobin'or'LeastConnection'or'Hash'
        :type scheduler:string

        :param udp_session_timeout:
            udp connection timeout (unit: second), default 90
        :value 5-4000
        :type udp_session_timeout: int

        :param description:
            description of the listener, no more than 200 characters
        :type description: string

        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm will be used.
        :type client_token: string

         :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   rT   Nr   r   rJ   rU   rP   r)   r8   rV   r   r   r   update_app_udp_listener  s"   +
z$AppBlbClient.update_app_udp_listenerc                 C   s  t | jd|d}i }|du rt |d< n||d< ||d< i }|dur*t||d< |dur2||d< |dur=t||d< |durE||d	< |durM||d
< |durU||d< |	dur]|	|d< |
dure|
|d< |durm||d< |duru||d< |dur}||d< | jtj|t	
|||dS )a	  
        update a app http listener rule with the specified options.
        :param blb_id:
            The id of blb which the listener work on
        :type blb_id: string
        :param listener_port:
            Port to be linstened owned by listener
        :value 1-65535
        :type listener_port: int
        :param scheduler:
            Balancing algorithm
        :value 'RoundRobin' or 'LeastConnection' or 'Hash'
        :type scheduler: string
        :param keep_session:
            Whether to enable the session hold function, that is,
            the request sent by the same client will reach the
            same backend server
        :value true or false, default:false
        :type keep_session: bool
        :param keep_session_type:
            The cookie handling method maintained by the session,
            valid only if the session is held open
        :value 'insert' or 'rewrite', default:insert
        :type keep_session_type: string
        :param keep_session_timeout:
            The time the cookie is kept in session (in seconds),
            valid only if the session is held open
        :value 1-15552000, default:3600
        :type keep_session_timeout: int
        :param keep_session_cookie_name:
            The session keeps the name of the cookie that needs
            to be overridden,if and only if session persistence is
            enabled and keep_session_type="rewrite"
        :type keep_session_cookie_name: int
        :param x_forwarded_for:
            Whether to enable the real IP address of the client,
            the backend server can obtain the real address of the
            client through the X-Forwarded-For HTTP header.
        :value true or false, default: false
        :type x_forwarded_for: bool
        :param server_timeout:
            Backend server maximum timeout (unit: second)
        :value 1-3600, default: 30
        :type server_timeout: int
        :param redirect_port:
            Forward the request received by this listener to the HTTPS
            listener, which is specified by the HTTPS listener.
        :type redirect_port: int
        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm will be used.
        :type client_token: string
        :param config:
        :type config: baidubce.BceClientConfiguration
        :return:
        :rtype baidubce.bce_response.BceResponse
        r   rX   Nr   r   rJ   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rP   r)   r8   rb   r   r   r   update_app_http_listener  sD   H
z%AppBlbClient.update_app_http_listenerc                 C   s  t | jd|d}i }|du rt |d< n||d< ||d< i }|dur*t||d< |dur2||d< |dur=t||d< |durE||d	< |durM||d
< |durU||d< |	dur]|	|d< |
dure|
|d< |durm||d< |durxt||d< |dur||d< |dur||d< |dur||d< |dur||d< |dur||d< |durt||d< |dur||d< | jtj|t	
|||dS )a  
        update a app https listener rule with the specified options.
        :param blb_id:
            The id of blb which the listener work on
        :type blb_id: string
        :param listener_port:
            Port to be linstened owned by listener
        :value 1-65535
        :type listener_port: int
        :param scheduler:
            Balancing algorithm
        :value 'RoundRobin' or 'LeastConnection' or 'Hash'
        :type scheduler: string
        :param keep_session:
            Whether to enable the session hold function, that is, the request
            sent by the same client will reach the same backend server
        :value true or false, default: false
        :type keep_session: bool
        :param keep_session_type:
            The cookie handling method maintained by the session,
            valid only if the session is held open
        :value 'insert' or 'rewrite', default: insert
        :type keep_session_type: string
        :param keep_session_timeout:
            The time the cookie is kept in session (in seconds),
            valid only if the session is held open
        :value 1-15552000, default:3600
        :type keep_session_timeout: int
        :param keep_session_cookie_name:
            The session keeps the name of the cookie that needs to be
            overridden,if and only if session persistence is enabled and
            keep_session_type="rewrite"
        :type keep_session_cookie_name: int
        :param x_forwarded_for:
            Whether to enable the real IP address of the client,
            the backend server can obtain the real address of the client
            through the X-Forwarded-For HTTP header.
        :value true or false, default: False
        :type x_forwarded_for: bool
        :param server_timeout:
            Backend server maximum timeout (unit: second)
        :value 1-3600, default: 30
        :type server_timeout: int
        :param cert_ids:
            The SSL certificate to be loaded by the listener.
            Currently HTTPS listeners can only bind one SSL certificate.
        :type cert_ids:List<String>
        :param ie6_compatible:
            Is it compatible with IE6 HTTPS request
            (the protocol format is earlier SSL3.0, the security is poor)
        :value true or false, default: true
        :type ie6_compatible: bool
        :param encryption_type:
            Encryption options, support three types:
            compatibleIE/incompatibleIE/userDefind,
            corresponding to:
            IE-compatible encryption/disabled unsecure encryption/custom encryption,
            when encryptionType is valid and legitimate,
            ie6Compatible field transfer value will not take effect
        type: encryption_type:string
        :param encryption_protocols:
            When the encryptionType value is userDefind,
            the list of protocol types is a string list composed of four protocols:
            "sslv3", "tlsv10", "tlsv11", "tlsv12".
        type: encryption_protocols:list
        :param dual_auth:
            Whether to Open Two-way Authentication,
            default:false
        :type dual_auth: boolean
        :param client_certIds:
            When dualAuth is true, the loaded client certificate chain
        :type client_certIds: list
        :param additional_cert_domains:
            Additional domain name,each element is an object that contains two attributes, namely "cert_id" and "host"
        :type additional_cert_domains: list
        :param x_forwarded_proto:
            Whether to obtain the listener protocol type through
            X-Forwarded-Proto header.
        :value true or false, default: False
        :type x_forwarded_proto: bool
        :param applied_ciphers:
            Custom cipher suite string.
        :type applied_ciphers: string
        :param description:
            description of the listener, no more than 200 characters
        :type description: string
        :param client_token:
            If the clientToken is not specified by the user,
            a random String generated by default algorithm will be used.
        :type client_token: string
        :param config:
        :type config: baidubce.BceClientConfiguration
        :return:
        :rtype baidubce.bce_response.BceResponse
        r   rm   Nr   r   rJ   rY   rZ   r[   r\   r]   r^   ro   compatibleIErq   rr   rs   rt   ru   r`   rv   rP   r)   r8   )r   r6   rI   rJ   rc   rd   re   rf   rg   rh   rl   rw   rx   ry   rz   r{   r|   ri   r}   rP   r4   r   r   r   r   r   r   r   update_app_https_listener  s^   t

z&AppBlbClient.update_app_https_listenerc                 C   s   t | jd|d}i }|du rt |d< n||d< ||d< i }|dur*t||d< |dur2||d< |dur:||d< |durEt||d	< |durM||d
< |durU||d< |	dur]|	|d< |
durht|
|d< |durp||d< | jtj|t	
|||dS )a  
        update a app ssl listener rule with the specified options.

        :param blb_id:
            The id of blb which the listener work on
        :type blb_id: string

        :param listener_port:
            port to be linstened owned by listener
        :value 1-65535
        :type listener_port: int

        :param scheduler:
            balancing algorithm
        :value 'RoundRobin' or 'LeastConnection'
        :type scheduler: string

        :param cert_ids:
            The SSL certificate to be loaded by the listener.
            Currently HTTPS listeners can only bind one SSL certificate.
        :type cert_ids: List<String>

        :param ie6_compatible:
            compatible with IE6 HTTPS request
            (the protocol format is earlier SSL3.0, the security is poor)
        :value true or false, default: true
        :type ie6_compatible: bool

        :param encryption_type:
            Encryption options, support three types:
            compatibleIE/incompatibleIE/userDefind,
            corresponding to:
            IE-compatible encryption/disabled unsecure encryption/custom encryption,
            when encryptionType is valid and legitimate,
            ie6Compatible field transfer value will not take effect
        type: encryption_type:string

        :param encryption_protocols:
            When the encryptionType value is userDefind,
            the list of protocol types is a string list composed of four protocols:
            "sslv3", "tlsv10", "tlsv11", "tlsv12".
        type: encryption_protocols:list

        :param dual_auth:
            Whether to Open Two-way Authentication,
            default:false
        :type dual_auth: boolean

        :param client_certIds:
            When dualAuth is true, the loaded client certificate chain
        :type client_certIds: list

        :param client_token:
            If the clientToken is not specified by the user,
            a random String generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return
        :rtype baidubce.bce_response.BceResponse
        r   r   Nr   r   rJ   ro   r   rq   rr   rs   rt   rv   rP   r)   r8   r   r   r   r   update_app_ssl_listener(  s<   L
z$AppBlbClient.update_app_ssl_listenerc                 C   Z   t | jd|d}i }|dur||d< |dur||d< |dur#||d< | jtj|||dS )a  
        get app tcp listeners identified by bibID

        :param blb_id
             the id of blb which the listener work on
        :type blb_id:string

        :param listener_port
             The listener port to query
        :type listener_port:int

        :param marker
            The optional parameter marker specified in the
            original request to specify
            where in the results to begin listing.
            Together with the marker, specifies the list result
            which listing should begin.
            If the marker is not specified, the list result will
            listing from the first one.
        :type marker: string

        :param max_keys
            The optional parameter to specifies the max number of
            list result to return.
            The default value is 1000.
        :type max_keys: int

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   rL   Nr   r=   r>   r7   r?   r   r6   rI   rB   rC   r   r   r   r   r   r   describe_app_tcp_listener  s   %
z&AppBlbClient.describe_app_tcp_listenerc                 C   r   )a  
        get app udp listeners identified by bibID

        :param blb_id
             the id of blb which the listener work on
        :type blb_id:string

        :param listener_port
             The listener port to query
        :type listener_port:int

        :param marker
            The optional parameter marker specified in the original
            request to specify where in the results to begin listing.
            Together with the marker, specifies the list result which
            listing should begin.
            If the marker is not specified, the list result will
            listing from the first one.
        :type marker: string

        :param max_keys
        The optional parameter to specifies the max number of
        list result to return.
            The default value is 1000.
        :type max_keys: int

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   rT   Nr   r=   r>   r7   r?   r   r   r   r   describe_app_udp_listener     $
z&AppBlbClient.describe_app_udp_listenerc                 C   r   )a  
        get app http listeners identified by bibID

        :param blb_id
             the id of blb which the listener work on
        :type blb_id:string

        :param listener_port
             The listener port to query
        :type listener_port:int

        :param marker
            The optional parameter marker specified in the original
            request to specify where in the results to begin listing.
            Together with the marker, specifies the list result which
            listing should begin.
            If the marker is not specified, the list result will listing
            from the first one.
        :type marker: string

        :param max_keys
            The optional parameter to specifies the max number of list
            result to return.
            The default value is 1000.
        :type max_keys: int

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   rX   Nr   r=   r>   r7   r?   r   r   r   r   describe_app_http_listener  r   z'AppBlbClient.describe_app_http_listenerc                 C   r   )a  
        get app https listeners identified by bibID

        :param blb_id
             the id of blb which the listener work on
        :type blb_id:string

        :param listener_port
             The listener port to query
        :type listener_port:int

        :param marker
            The optional parameter marker specified in the original
            request to specify where in the results to begin listing.
            Together with the marker, specifies the list result which
            listing should begin.
            If the marker is not specified, the list result will listing
            from the first one.
        :type marker: string

        :param max_keys
            The optional parameter to specifies the max number of list
            result to return.
            The default value is 1000.
        :type max_keys: int

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   rm   Nr   r=   r>   r7   r?   r   r   r   r   describe_app_https_listener(  r   z(AppBlbClient.describe_app_https_listenerc                 C   r   )a  
        get app ssl listeners identified by bibID

        :param blb_id
             the id of blb which the listener work on
        :type blb_id:string

        :param listener_port
             The listener port to query
        :type listener_port:int

        :param marker
            The optional parameter marker specified in the original
            request to specify where in the results to begin listing.
            Together with the marker, specifies the list result which
            listing should begin.
            If the marker is not specified, the list result will listing
            from the first one.
        :type marker: string

        :param max_keys
            The optional parameter to specifies the max number of list
            result to return.
            The default value is 1000.
        :type max_keys: int

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   Nr   r=   r>   r7   r?   r   r   r   r   describe_app_ssl_listenerY     #
z&AppBlbClient.describe_app_ssl_listenerc                 C   r   )a  
        get app all listeners identified by bibID

        :param blb_id
             the id of blb which the listener work on
        :type blb_id:string

        :param listener_port
             The listener port to query
        :type listener_port:int

        :param marker
            The optional parameter marker specified in the original
            request to specify where in the results to begin listing.
            Together with the marker, specifies the list result which
            listing should begin.
            If the marker is not specified, the list result will listing
            from the first one.
        :type marker: string

        :param max_keys
            The optional parameter to specifies the max number of list
            result to return.
            The default value is 1000.
        :type max_keys: int

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   listenerNr   r=   r>   r7   r?   r   r   r   r   describe_app_all_listener  r   z&AppBlbClient.describe_app_all_listener)r6   portListc           	      C   sr   t | jd|d}i }d|d< |du rt |d< n||d< i }||d< |dur+||d< | jtj|t|||dS )	ar  
        Release app listener under the specified LoadBalancer,
        the listener is specified by listening to the port.

        :param blb_id:
            id of LoadBalancer
        :type blb_id:string

        :param portList:
            The ports of listeners to be released
        :type portList:list<int>

        :param port_type_list:
            List of port+type objects for deleting by protocol on the same port.
            Each element is a dict with "port" and "type" fields.
        :type port_type_list: list

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   N   batchdeleter   r   ZportTypeListr)   	r   r+   r,   r-   r   r   r9   r0   r1   )	r   r6   r   Zport_type_listr4   r   r   r   r   r   r   r   delete_app_listeners  s   "

z!AppBlbClient.delete_app_listeners)r6   rI   app_policy_vosc           
      C   sn   t | jd|d}i }|du rt |d< n||d< ||d}	|dur)t||	d< | jtj|t	
|	||dS )a5  
        Create policys.

        :param blb_id:
            the id of blb which the listener work on
        :type blb_id: string

        :param listener_port:
            port to be linstened owned by listener
        :value 1-65535
        :type listener_port: int

        :param app_policy_vos
            policy list the listener binds.
            If the listener type is TCP,
            there is only one policy
            and only the full match is supported.
        https://cloud.baidu.com/doc/BLB/API.html#AppPolicy
        :type app_policy_vos: list<AppPolicy>

        :param listener_type:
            Protocol type, required when multiple protocols share the same port.
        :type listener_type: string

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   policysNr   )rN   appPolicyVosr#   r)   r*   )
r   r6   rI   r   listener_typer4   r   r   r   r   r   r   r   create_policys  s   *

zAppBlbClient.create_policysc           	      C   sb   t | jd|d}i }||d< |dur||d< |dur||d< |dur'||d< | jtj|||dS )	ai  
        get policys

        :param blb_id
             the id of blb which the listener work on
        :type blb_id:string

        :param listener_port
             The listener port used by listener
        :type listener_port:int

        :param listener_type:
            Protocol type, required when multiple protocols share the same port.
        :type listener_type: string

        :param marker
            The optional parameter marker specified in the original
            request to specify where in the results to begin listing.
            Together with the marker, specifies the list result which
            listing should begin.
            If the marker is not specified, the list result will listing
            from the first one.
        :type marker: string

        :param max_keys
            The optional parameter to specifies the max number of list
            result to return.
            The default value is 1000.
        :type max_keys: int

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r      portN   typer=   r>   r7   r?   )	r   r6   rI   r   rB   rC   r   r   r   r   r   r   describe_policys+  s   *
zAppBlbClient.describe_policys)r6   rI   policys_listc           
      C   sv   t | jd|d}i }d|d< |du rt |d< n||d< ||d}	|dur-t||	d< | jtj|t	
|	||dS )	a  
        Release the listener under the specified LoadBalancer,
        the listener is specified by listening to the port.

        :param blb_id:
            id of LoadBalancer
        :type blb_id:string

        :param listener_port
             The listener port used by listener
        :type listener_port:int

         :param policys_list
             All policy identifiers to be released
        :type policys_list:list<str>

        :param listener_type:
            Protocol type, required when multiple protocols share the same port.
        :type listener_type: string

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   Nr   r   )portZpolicyIdListr#   r)   r8   )
r   r6   rI   r   r   r4   r   r   r   r   r   r   r   delete_policysb  s   &

zAppBlbClient.delete_policys)r6   rI   policy_listc           
      C   sr   t | jd|d}ddi}|du rt |d< n||d< ||d}	|dur+t||	d< | jtj|t	
|	||dS )	a  
        Batch update policies for the specified listener.

        :param blb_id:
            the id of blb which the listener work on
        :type blb_id: string

        :param listener_port:
            port to be listened owned by listener
        :value 1-65535
        :type listener_port: int

        :param policy_list:
            list of policy objects to be updated, each contains
            policyId, priority, description
        :type policy_list: list

        :param listener_type:
            Protocol type, required when multiple protocols share the same port.
        :type listener_type: string

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   s   batchupdateNr   )r   Z
policyListr#   r)   r8   )
r   r6   rI   r   r   r4   r   r   r   r   r   r   r   update_policys  s   #

zAppBlbClient.update_policysc           
      C      t | jd|d}i }|du rt |d< n||d< i }	|dur&t||	d< |dur1t||	d< |dur9||	d< | jtj|t	
|	||dS )	a  
        create server group for the specified LoadBalancer,
        support batch add

        :param blb_id:
            id of LoadBalancer
        :type blb_id:string

        :param name:
            name of server group
        :type name:string

        :param desc:
            description of server group
        :type desc:string

        :param backend_server_list
            List of backend servers to be added
        https://cloud.baidu.com/doc/BLB/API.html#AppBackendServer
        :type backend_server_list:List<AppBackendServer>

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   appservergroupNr   r    r!   backendServerListr)   r*   )
r   r6   r    r!   backend_server_listr4   r   r   r   r   r   r   r   create_app_server_group      '

z$AppBlbClient.create_app_server_group)r6   sg_idc           
      C      t | jd|d}i }|du rt |d< n||d< i }	t||	d< |dur-t||	d< |dur8t||	d< | jtj|t	
|	||dS )	a  
        update the information of the app server group
        of the specified LoadBalancer

        :param blb_id:
            id of LoadBalancer
        :type blb_id:string

        :param sg_id:
            id of the server group to be updated
        :type sg_id:string

        :param name:
            name of server group
        :type name:string

        :param desc:
            description of server group
        :type desc:string

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   Nr   sgIdr    r!   r)   r8   )
r   r6   r   r    r!   r4   r   r   r   r   r   r   r   update_app_server_group     &

z$AppBlbClient.update_app_server_groupc           	      C   j   t | jd|d}i }|dur||d< |dur||d< |dur#||d< |dur+||d< | jtj|||dS )	aQ  
        Query the imformation of app server group
        of the specified LoadBalancer

        :param blb_id:
            Id of LoadBalancer
        :type blb_id:string

        :param name:
            name of server group
        :type name:string

        :param exactly_match:
            Set whether the name matches globally
        :type exactly_match:boolean

        :param marker:
            The optional parameter marker specified in the original
            request to specify where in the results to begin listing.
            Together with the marker, specifies the list result which
            listing should begin. If the marker is not specified,
            the list result will listing from the first one.
        :type marker: string

        :param max_keys:
            The optional parameter to specifies the max number of
            list result to return.
            The default value is 1000.
        :type max_keys: int

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   Nr;   r<   r=   r>   r7   r?   	r   r6   r    rA   rB   rC   r   r   r   r   r   r   describe_app_server_groupJ     *z&AppBlbClient.describe_app_server_groupc                 C   h   t | jd|d}i }d|d< |du rt |d< n||d< i }t||d< | jtj|t	
|||dS )af  
        delete the app server group of the specified LoadBalancer,

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param sg_id:
            id of the server group to be updated
        :type sg_id:string

        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   N   deleter   r   r)   r8   )r   r6   r   r4   r   r   r   r   r   r   r   delete_app_server_group     

z$AppBlbClient.delete_app_server_group)r6   r   r   protocol_typec                 C   s4  t | jd|d}i }|du rt |d< n||d< t||t|d}|dur-||d< |dur8t||d< |dur@||d< |durKt||d	< |	durS|	|d
< |
dur[|
|d< |durc||d< |durk||d< |durvt||d< |durt||d< |durt||d< | jtj|t	
|||dS )a  
        create server group for the specified LoadBalancer,
        support batch add
        :param blb_id:
            id of LoadBalancer
        :type blb_id:string
        :param sg_id:
            id of the server group
        :type sg_id:string
        :param port:
            Port number, integer between 1 and 65535
        :type port:string
        :param protocol_type:
            Protocol type of listening port, "TCP"/"UDP"/"HTTP"
        :type protocol_type:string
        :param enable_health_check:
            Whether to enable health check, default is true
        :type enable_health_check: bool

        :param health_check:
            Health check protocol
        :value 'HTTP' or 'TCP',default:'HTTP'
        :type health_check: string
        :param health_check_port:
            Health check port, the default is the same as port
        :type health_check_port: int
        :param health_check_urlpath:
            Health check URI, default '/'.
            Effective when the health check protocol is "HTTP"
        :type health_check_urlpath: string
         :param health_check_timeout_insecond:
            Health check timeout (unit: second)
        :value 1-60, default: 3
        :type health_check_timeout_insecond: int
        :param health_check_interval_insecond:
            Health check interval (unit: second)
        :value 1-10, default: 3
        :type health_check_interval_insecond: int
        :param health_check_down_retry:
            The unhealthy down retry, that is, how many consecutive health
            check failures, shields the backend server.
        :value 2-5, default: 3
        :type health_check_down_retry: int
        :param health_check_up_retry:
            Health up retry, that is, how many consecutive health checks
            are successful, then re-use the back-end server
        :value:2-5, default: 3
        :type health_check_up_retry: int
        :param health_check_normal_status:
            The HTTP status code when the health check is normal supports
            a combination of five types of status codes,
            such as "http_1xx|http_2xx", Effective when the health check
            protocol is "HTTP"
        :value default: http_2xx|http_3xx
        :type health_check_normal_status: string
        :param health_check_host:
            The host field in the header of the 7-layer health check request,
            for example "localhost", effective when the health check protocol is "HTTP"
        :type health_check_host: string
        :param udp_health_check_string:
            The health check string for the udp listener,
            it must be passed when the health check type is "UDP"
        :type udp_health_check_string: string
        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string
          :param config:
        :type config: baidubce.BceClientConfiguration
        :return:
        :rtype baidubce.bce_response.BceResponse
        r   appservergroupportNr   )r   r   r#   enableHealthCheckhealthCheckhealthCheckPorthealthCheckUrlPathhealthCheckTimeoutInSecondhealthCheckIntervalInSecondhealthCheckDownRetryhealthCheckUpRetryhealthCheckNormalStatushealthCheckHostudpHealthCheckStringr)   r*   )r   r6   r   r   r   enable_health_checkhealth_checkhealth_check_porthealth_check_urlpathhealth_check_timeout_insecondhealth_check_interval_insecondhealth_check_down_retryhealth_check_up_retryhealth_check_normal_statushealth_check_hostudp_health_check_stringr4   r   r   r   r   r   r   r   create_app_server_group_port  sN   Z

z)AppBlbClient.create_app_server_group_port)r6   r   port_idc                 C   s2  t | jd|d}i }|du rt |d< n||d< t|t|d}|dur,||d< |dur7t||d< |dur?||d< |durJt||d	< |durR||d
< |	durZ|	|d< |
durb|
|d< |durj||d< |durut||d< |durt||d< |durt||d< | jtj|t	
|||dS )al  
        update server group for the specified LoadBalancer,
        support batch add

        :param blb_id:
            id of LoadBalancer
        :type blb_id:string

        :param sg_id:
            id of the server group
        :type sg_id:string

        :param port_id:
            The id of the server group port to be updated
        :type port_id:string

        :param enable_health_check:
            Whether to enable health check, default is true
        :type enable_health_check: bool

        :param health_check:
            Health check protocol
        :value 'HTTP' or 'TCP',default:'HTTP'
        :type health_check: string

        :param health_check_port:
            Health check port, the default is the same as port
        :type health_check_port: int

        :param health_check_urlpath:
            Health check URI, default '/'.
            Effective when the health check protocol is "HTTP"
        :type health_check_urlpath: string

         :param health_check_timeout_insecond:
            Health check timeout (unit: second)
        :value 1-60, default: 3
        :type health_check_timeout_insecond: int

        :param health_check_interval_insecond:
            Health check interval (unit: second)
        :value 1-10, default: 3
        :type health_check_interval_insecond: int

        :param health_check_down_retry:
            The unhealthy down retry, that is, how many consecutive health
            check failures, shields the backend server.
        :value 2-5, default: 3
        :type health_check_down_retry: int

        :param health_check_up_retry:
            Health up retry, that is, how many consecutive health checks
            are successful, then re-use the back-end server
        :value:2-5, default: 3
        :type health_check_up_retry: int

        :param health_check_normal_status:
            The HTTP status code when the health check is normal supports
            a combination of five types of status codes,
            such as "http_1xx|http_2xx", Effective when the health check
            protocol is "HTTP"
        :value default: http_2xx|http_3xx
        :type health_check_normal_status: string

        :param health_check_host:
            The host field in the header of the 7-layer health check request,
            for example "localhost", effective when the health check protocol is "HTTP"
        :type health_check_host: string

        :param udp_health_check_string:
            The health check string for the udp listener
        :type udp_health_check_string: string

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   Nr   )r   ZportIdr   r   r   r   r   r   r   r   r   r   r   r)   r8   )r   r6   r   r   r   r   r   r   r   r   r   r   r   r   r   r4   r   r   r   r   r   r   r   update_app_server_group_port3	  sL   e

z)AppBlbClient.update_app_server_group_port)r6   r   	port_listc           	      C   f   t | jd|d}i }d|d< |du rt |d< n||d< t||d}| jtj|t	
|||dS )a  
        delete server group of the specified LoadBalancer,

        :param blb_id:
            id of LoadBalancer
        :type blb_id:string

        :param sg_id:
            id of the server group
        :type sg_id:string

        :param port_list:
            The ports of listeners to be released
        :type port_list:list<string>

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   Nr   r   )r   Z
portIdListr)   r8   )	r   r6   r   r   r4   r   r   r   r   r   r   r   delete_app_server_group_port	  s    

z)AppBlbClient.delete_app_server_group_port)r6   r   r   c           	      C   ^   t | jd|d}i }|du rt |d< n||d< t||d}| jtj|t	
|||dS )aF  
        Add backend server for the specified LoadBalancer and server group,
        support batch add

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param sg_id:
            id of the server group
        :type sg_id:string

        :param backend_server_list
                List of backend servers to be added
        https://cloud.baidu.com/doc/BLB/API.html#AppBackendServer
        :type backend_server_list:List<AppBackendServer>

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   blbrsNr   r   r   r)   r*   	r   r6   r   r   r4   r   r   r   r   r   r   r   create_app_blb_rs	     #

zAppBlbClient.create_app_blb_rsc           	      C   r   )aL  
        update backend server for the specified LoadBalancer and server group,
        support batch update

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param sg_id:
            id of the server group
        :type sg_id:string

        :param backend_server_list
                List of backend servers to be added
        https://cloud.baidu.com/doc/BLB/API.html#AppBackendServer
        :type backend_server_list:List<AppBackendServer>

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   Nr   r   r)   r8   r   r   r   r   update_app_blb_rs)
  r   zAppBlbClient.update_app_blb_rsc                 C   sX   t | jd|d}i }t||d< |dur||d< |dur"||d< | jtj|||dS )a  
        Query the list of backend servers under the specified LoadBalancer
        and server group

        :param blb_id:
            Id of LoadBalancer
        :type blb_id:string

        :param sg_id:
            id of the server group
        :type sg_id:string

        :param marker:
            The optional parameter marker specified in the original
            request to specify where in the results to begin listing.
            Together with the marker, specifies the list result which
            listing should begin. If the marker is not specified,
            the list result will listing from the first one.
        :type marker: string

        :param max_keys:
            The optional parameter to specifies the max number of
            list result to return.
            The default value is 1000.
        :type max_keys: int

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   s   sgIdNr=   r>   r7   r   r+   r,   r	   r.   r   r   r@   )r   r6   r   rB   rC   r   r   r   r   r   r   describe_app_blb_rs]
  s   %z AppBlbClient.describe_app_blb_rsc           	      C   r   )a  
        delete backend server for the specified LoadBalancer and server group,
        support batch delete

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param sg_id:
            id of the server group
        :type sg_id:string

        :param backend_server_list
                List of backend servers to be deleted
        :type backend_server_list:List<string>

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   Nr   r   )r   ZbackendServerIdListr)   r8   r   r   r   r   delete_app_blb_rs
  s   "

zAppBlbClient.delete_app_blb_rsc                 C   4   t | jd|d}dt|i}| jtj|||dS )x  
        describe servers of specific server group

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param sg_id:
            id of the server group
        :type sg_id:string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   Z
blbrsmountr   r7   r   r   r6   r   r   r   r   r   r   r   describe_rs_mount
     
zAppBlbClient.describe_rs_mountc                 C   r   )r   r   Zblbrsunmountr   r7   r   r   r   r   r   describe_rs_unmount
  r   z AppBlbClient.describe_rs_unmountc           
      C   r   )	ah  
        create ip group for the specified LoadBalancer,
        support batch add

        :param blb_id:
            id of LoadBalancer
        :type blb_id:string

        :param name:
            name of ip group
        :type name:string

        :param desc:
            description of ip group
        :type desc:string

        :param member_list
            List of backend servers to be added
        https://cloud.baidu.com/doc/BLB/API.html#AppBackendServer
        :type member_list:List<AppIpGroupMemberVO>

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   ipgroupNr   r    r!   
memberListr)   r*   )
r   r6   r    r!   member_listr4   r   r   r   r   r   r   r   create_app_ip_group
  r   z AppBlbClient.create_app_ip_group)r6   ip_group_idc           
      C   r   )	a!  
        update the information of the app ip group
        of the specified LoadBalancer

        :param blb_id:
            id of LoadBalancer
        :type blb_id:string

        :param ip_group_id:
            id of the ip group to be updated
        :type ip_group_id:string

        :param name:
            name of server group
        :type name:string

        :param desc:
            description of server group
        :type desc:string

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   Nr   	ipGroupIdr    r!   r)   r8   )
r   r6   r   r    r!   r4   r   r   r   r   r   r   r   update_app_ip_group7  r   z AppBlbClient.update_app_ip_groupc           	      C   r   )	aI  
        Query the imformation of app ip group
        of the specified LoadBalancer

        :param blb_id:
            Id of LoadBalancer
        :type blb_id:string

        :param name:
            name of ip group
        :type name:string

        :param exactly_match:
            Set whether the name matches globally
        :type exactly_match:boolean

        :param marker:
            The optional parameter marker specified in the original
            request to specify where in the results to begin listing.
            Together with the marker, specifies the list result which
            listing should begin. If the marker is not specified,
            the list result will listing from the first one.
        :type marker: string

        :param max_keys:
            The optional parameter to specifies the max number of
            list result to return.
            The default value is 1000.
        :type max_keys: int

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   Nr;   r<   r=   r>   r7   r?   r   r   r   r   describe_app_ip_groupp  r   z"AppBlbClient.describe_app_ip_groupc                 C   r   )aj  
        delete the app ip group of the specified LoadBalancer,

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param ip_group_id:
            id of the ip group to be updated
        :type ip_group_id:string

        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   Nr   r   r   r)   r8   )r   r6   r   r4   r   r   r   r   r   r   r   delete_app_ip_group  r   z AppBlbClient.delete_app_ip_group)r6   r   r   c                 C     t | jd|dd}i }|du rt |d< n||d< t|t|d}|dur0t||d< |dur8||d< |durCt||d	< |durK||d
< |durS||d< |	dur[|	|d< |
durc|
|d< |durnt||d< |duryt||d< | jtj|t	
|||dS )a@
  
        create server group for the specified LoadBalancer,
        support batch add
        :param blb_id:
            id of LoadBalancer
        :type blb_id:string
        :param ip_group_id:
            id of the ip group
        :type ip_group_id:string
        :param protocol_type:
            Protocol type of listening port, "TCP"/"UDP"/"HTTP"
        :type protocol_type:string
        :param health_check:
            Health check protocol
        :value 'HTTP' or 'TCP',default:'HTTP'
        :type health_check: string
        :param health_check_port:
            Health check port, the default is the same as port
        :type health_check_port: int
        :param health_check_urlpath:
            Health check URI, default '/'.
            Effective when the health check protocol is "HTTP"
        :type health_check_urlpath: string
         :param health_check_timeout_insecond:
            Health check timeout (unit: second)
        :value 1-60, default: 3
        :type health_check_timeout_insecond: int
        :param health_check_interval_insecond:
            Health check interval (unit: second)
        :value 1-10, default: 3
        :type health_check_interval_insecond: int
        :param health_check_down_retry:
            The unhealthy down retry, that is, how many consecutive health
            check failures, shields the backend server.
        :value 2-5, default: 3
        :type health_check_down_retry: int
        :param health_check_up_retry:
            Health up retry, that is, how many consecutive health checks
            are successful, then re-use the back-end server
        :value:2-5, default: 3
        :type health_check_up_retry: int
        :param health_check_normal_status:
            The HTTP status code when the health check is normal supports
            a combination of five types of status codes,
            such as "http_1xx|http_2xx", Effective when the health check
            protocol is "HTTP"
        :value default: http_2xx|http_3xx
        :type health_check_normal_status: string
        :param udp_health_check_string:
            The health check string for the udp listener,
            it must be passed when the health check type is "UDP"
        :type udp_health_check_string: string
        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string
        :param config:
        :type config: baidubce.BceClientConfiguration
        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   backendpolicyNr   )r   r#   r   r   r   r   r   r   r   r   r   r)   r*   )r   r6   r   r   r   r   r   r   r   r   r   r   r   r4   r   r   r   r   r   r   r   create_app_ip_group_port  sB   M

z%AppBlbClient.create_app_ip_group_port)r6   r   r   c                 C   r   )a	  
        update server group for the specified LoadBalancer,
        support batch add

        :param blb_id:
            id of LoadBalancer
        :type blb_id:string

        :param ip_group_id:
            id of the ip group
        :type ip_group_id:string

        :param port_id:
            The id of the server group port to be updated
        :type port_id:string

        :param health_check:
            Health check protocol
        :value 'HTTP' or 'TCP',default:'HTTP'
        :type health_check: string

        :param health_check_port:
            Health check port, the default is the same as port
        :type health_check_port: int

        :param health_check_urlpath:
            Health check URI, default '/'.
            Effective when the health check protocol is "HTTP"
        :type health_check_urlpath: string

         :param health_check_timeout_insecond:
            Health check timeout (unit: second)
        :value 1-60, default: 3
        :type health_check_timeout_insecond: int

        :param health_check_interval_insecond:
            Health check interval (unit: second)
        :value 1-10, default: 3
        :type health_check_interval_insecond: int

        :param health_check_down_retry:
            The unhealthy down retry, that is, how many consecutive health
            check failures, shields the backend server.
        :value 2-5, default: 3
        :type health_check_down_retry: int

        :param health_check_up_retry:
            Health up retry, that is, how many consecutive health checks
            are successful, then re-use the back-end server
        :value:2-5, default: 3
        :type health_check_up_retry: int

        :param health_check_normal_status:
            The HTTP status code when the health check is normal supports
            a combination of five types of status codes,
            such as "http_1xx|http_2xx", Effective when the health check
            protocol is "HTTP"
        :value default: http_2xx|http_3xx
        :type health_check_normal_status: string

        :param udp_health_check_string:
            The health check string for the udp listener
        :type udp_health_check_string: string

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   r   Nr   )r   idr   r   r   r   r   r   r   r   r   r)   r8   )r   r6   r   r   r   r   r   r   r   r   r   r   r   r4   r   r   r   r   r   r   r   update_app_ip_group_portF  sB   Z

z%AppBlbClient.update_app_ip_group_port)r6   r   r   c           	      C   s`   t | jd|dd}i }|du rt |d< n||d< t||d}| jtj|t	
|||dS )a  
        delete server group of the specified LoadBalancer,

        :param blb_id:
            id of LoadBalancer
        :type blb_id:string

        :param ip_group_id:
            id of the ip group
        :type ip_group_id:string

        :param port_list:
            The ports of listeners to be released
        :type port_list:list<string>

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   r   Nr   )r   ZbackendPolicyIdListr)   )r   r+   r,   r-   r	   r.   r   r   rG   r0   r1   )	r   r6   r   r   r4   r   r   r   r   r   r   r   delete_app_ip_group_port  s    

z%AppBlbClient.delete_app_ip_group_portc                 C      t | jd|dd}i }	|du rt |	d< n||	d< i }
t||
d< ||
d< |dur2t||
d< |dur=t||
d	< | jtj|t	
|
|	|d
S )a  
        create ip group for the specified LoadBalancer,
        support batch add

        :param blb_id:
            id of LoadBalancer
        :type blb_id:string

        :param ip_group_id:
            id of the ip group to be updated
        :type ip_group_id:string

        :param member_list
            List of member to be added
        https://cloud.baidu.com/doc/BLB/API.html#AppBackendServer
        :type member_list:List<AppIpGroupMemberVO>

        :param name:
            name of ip group
        :type name:string

        :param desc:
            description of ip group
        :type desc:string

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   memberNr   r   r   r    r!   r)   r*   r   r6   r   r   r    r!   r4   r   r   r   r   r   r   r   create_app_ip_group_member      +

z'AppBlbClient.create_app_ip_group_memberc                 C   r   )a  
        update the information of the app ip group
        of the specified LoadBalancer

        :param blb_id:
            id of LoadBalancer
        :type blb_id:string

        :param ip_group_id:
            id of the ip group to be updated
        :type ip_group_id:string

        :param member_list
            List of member to be updated
        https://cloud.baidu.com/doc/BLB/API.html#AppBackendServer
        :type member_list:List<AppIpGroupMemberVO>

        :param name:
            name of server group
        :type name:string

        :param desc:
            description of server group
        :type desc:string

        :param client_token:
            If the clientToken is not specified by the user, a random String
            generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   r   Nr   r   r   r    r!   r)   r8   r   r   r   r   update_app_ip_group_member5  r   z'AppBlbClient.update_app_ip_group_memberc           	      C   sr   t | jd|dd}i }d|d< |du rt |d< n||d< i }t||d< ||d< | jtj|t	
|||d	S )
a  
        delete the app ip group of the specified LoadBalancer,

        :param blb_id:
            id of LoadBalancer
        :type blb_id:string

        :param ip_group_id:
            id of the ip group to be updated
        :type ip_group_id:string

        :param memberid_list
            List of memberid to be deleted
        https://cloud.baidu.com/doc/BLB/API.html#AppBackendServer
        :type memberid_list:List<string>

        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   r   Nr   r   r   ZmemberIdListr)   r8   )	r   r6   r   Zmemberid_listr4   r   r   r   r   r   r   r   delete_app_ip_group_membert  s    

z'AppBlbClient.delete_app_ip_group_memberc           
      C   sT   t | jd|dd}i }	||	d< |dur||	d< |dur ||	d< | jtj||	|dS )	a  
        Query the imformation of app ip group
        of the specified LoadBalancer

        :param blb_id:
            Id of LoadBalancer
        :type blb_id:string

        :param ip_group_id:
            id of the ip group to be updated
        :type ip_group_id:string

        :param marker:
            The optional parameter marker specified in the original
            request to specify where in the results to begin listing.
            Together with the marker, specifies the list result which
            listing should begin. If the marker is not specified,
            the list result will listing from the first one.
        :type marker: string

        :param max_keys:
            The optional parameter to specifies the max number of
            list result to return.
            The default value is 1000.
        :type max_keys: int

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   r   s	   ipGroupIdNr=   r>   r7   r?   )
r   r6   r   r    rA   rB   rC   r   r   r   r   r   r   describe_app_ip_group_member  s   'z)AppBlbClient.describe_app_ip_group_member)r6   securitygroupidsc                 C   b   t | jd|d}i }d|d< |du rt |d< n||d< i }||d< | jtj|t|||dS )a  
        bind the blb security groups (application/ipv6 LoadBalancer)

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param securitygroupids:
                List of security group ids to be unbind
        :type securitygroupids:List<string>

        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        blbsecuritygroupN   bindr   securityGroupIdsr)   r   r   r6   r   r4   r   r   r   r   r   r   r   bind_app_security_groups     

z%AppBlbClient.bind_app_security_groupsc                 C   r   )a  
        unbind the blb security groups (application/ipv6 LoadBalancer)

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param securitygroupids:
                List of security group ids to be bind
        :type securitygroupids:List<string>

        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r  N   unbindr   r  r)   r   r  r   r   r   unbind_app_security_groups  r  z'AppBlbClient.unbind_app_security_groupsc                 C   s(   t | jd|d}i }| jtj||dS )a:  
        describe the blb security groups (application/ipv6 LoadBalancer)

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r  rE   r?   r   r6   r   r   r   r   r   r   describe_app_security_groups*  s   z)AppBlbClient.describe_app_security_groups)r6   enterprisesecuritygroupidsc                 C   d   t | jd|dd}i }d|d< |du rt |d< n||d< i }||d< | jtj|t|||dS )	a  
        bind the blb enterprise security groups (application/ipv6 LoadBalancer)

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param enterprisesecuritygroupids:
                List of enterprise security group ids to be bind
        :type enterprisesecuritygroupids:List<string>

        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   
enterpriser  Nr  r   enterpriseSecurityGroupIdsr)   r   r   r6   r  r4   r   r   r   r   r   r   r   #bind_app_enterprise_security_groups>     

z0AppBlbClient.bind_app_enterprise_security_groupsc                 C   r  )	a  
        unbind the blb enterprise security groups (application/ipv6 LoadBalancer)

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param enterprisesecuritygroupids:
                List of enterprise security group ids to be unbind
        :type enterprisesecuritygroupids:List<string>

        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r  r  Nr  r   r  r)   r   r  r   r   r   %unbind_app_enterprise_security_groupsg  r  z2AppBlbClient.unbind_app_enterprise_security_groupsc                 C   s*   t | jd|dd}i }| jtj||dS )aE  
        describe the blb enterprise security groups (application/ipv6 LoadBalancer)

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r  r  rE   r?   r	  r   r   r   'describe_app_enterprise_security_groups  s   z4AppBlbClient.describe_app_enterprise_security_groups)r6   rI   apppolicyvosc           
      C   sr   t | jd|d}i }|du rt |d< n||d< i }	||	d< |dur'||	d< ||	d< | jtj|t|	||dS )	a#  
        create app blb ipgroup policys (application/ipv6 LoadBalancer)

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param listener_port:
                port of listener
        :type blb_id:int

        :param apppolicyvos:
                binding policy list of listener
        :type apppolicyvos:list

        :param type:
                protocol of listener
        :type type:string

        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   Nr   rN   r#   r   r)   )	r   r+   r,   r-   r   r   r/   r0   r1   )
r   r6   rI   r  r#   r4   r   r   r   r   r   r   r   create_app_ipgroup_policys  s   !

z'AppBlbClient.create_app_ipgroup_policys)r6   r   c           
      C   s~   t | jd|d}i }	||	d< |dur||	d< |dur||	d< |dur'||	d< |du r1t |	d< n||	d< | jtj||	|d	S )
a0  
        describe app blb ipgroup policys (application/ipv6 LoadBalancer)

        :param blb_id:
                id of LoadBalancer
        :type blb_id:string

        :param port:
                the listener port used by listener
        :type port:int

        :param type:
                protocol of listener
        :type type:string

        :param marker:
                The optional parameter marker specified in the original
                request to specify where in the results to begin listing.
                Together with the marker, specifies the list result which
                listing should begin.
                If the marker is not specified, the list result will listing
                from the first one.
        :type marker:string

        :param maxkeys:
                The optional parameter to specifies the max number of
                list result to return.
                The default value is 1000.
        :type maxkeys:int

        :param client_token:
                If the clientToken is not specified by the user,
                a random String generated by default algorithm will be used.
        :type client_token: string

        :param config:
        :type config: baidubce.BceClientConfiguration

        :return:
        :rtype baidubce.bce_response.BceResponse
        r   r   r   Nr   r=   r>   r   r7   )r   r+   r,   r-   r   r   r@   )
r   r6   r   r#   rB   Zmaxkeysr4   r   r   r   r   r   r   describe_app_ipgroup_policys  s   ,z)AppBlbClient.describe_app_ipgroup_policysr   )NNNNN)NNNNNNNNNNNNNNN)NNNNNN)NNNNNNNN)NN)NNNN)NNNNNNNNNNNN)NNNNNNNNNNNNNNNNNN)	NNNNNNNNN)NNNNNNNNNNNNN)NNNNNNNNNNNNNNNNNNN)NNNNNNNNNNN)NNN)G__name__
__module____qualname____doc__r,   r   r   r   r   bytesstrr5   r:   rD   rF   rH   intrR   rW   rk   listr~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r
  r  r  r  r  r  r   r   r   r   r   )   s   


<
E>
> 
 
#f?=j $k1000//3:584:78)  011/1:78)o|.==/1''''2r   c                   C   s   t t S )z
    The default method to generate the random string for client_token
    if the optional parameter client_token is not specified by the user.

    :return:
    :rtype string
    )r  uuiduuid4r   r   r   r   generate_client_token_by_uuid  s   r!  )r  r   r0   loggingr  sysZbaidubcer   Zbaidubce.authr   Zbaidubce.httpr   r   r   r   Zbaidubce.utilsr   r	   r,   reloadZsetdefaultencoding	getLoggerr  _loggerr   r   r!  r-   r   r   r   r   <module>   sf   


                              