
    9i1                         S r SSKrSSKrSSKrSSKrSSKJr  SSKJr  SSK	J
r
  SSK	Jr  SSK	Jr  SSKJr  \R                  " \5      r " S	 S
\5      rg)z3
This module provides a client class for ENDPOINT.
    N)BceBaseClient)bce_v1_signer)bce_http_client)handler)http_methods)compatc                       \ rS rSrSrSrSrSS jr\S 5       r	S r
  SS	 jrSS
 jr  SS jrSS jr  SS jrSS jrSS jrSS jr SS jrSrg)EndpointClient"   z

Endpoint base sdk client
s   /v1s	   /endpointNc                 0    [         R                  " X5        g N)r   __init__)selfconfigs     j/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/baidubce/services/endpoint/endpoint_client.pyr   EndpointClient.__init__+   s    t,    c                  ,    [         R                  " 5       $ )z 

default client token by uuid1
)uuiduuid1 r   r   _generate_default_client_token-EndpointClient._generate_default_client_token.   s     zz|r   c                     Uc  U R                   $ [        R                  " U R                   5      nUR                  U5        U$ )zH

:type config: baidubce.BceClientConfiguration
:param config:
:return:
)r   copymerge_non_none_values)r   r   
new_configs      r   _merge_configEndpointClient._merge_config6   s9     >;;4;;/J,,V4r   c           
          U R                  U5      nUc  [        R                  nUc  SSS.n[        R                  " U[
        R                  [        R                  U/U[        R                  U-   X4U5      $ )z

:param http_method:
:param path:
:param body:
:param headers:
:param params:

:type config: baidubce.BceClientConfiguration
:param config:

:param body_parser:

:return: baidubce.BceResponse
s   */*s   application/json;charset=utf-8)s   Accepts   Content-Type)
r   r   
parse_jsonr   send_requestr   signparse_errorr
   prefix)r   http_methodpathbodyheadersparamsr   body_parsers           r   _send_requestEndpointClient._send_requestD   s|    " ##F+!,,K?"((IKG ++FM4F4F-4-@-@+,N,79N9NQU9UW[,24 	4r   c                 d    [         R                  S-   nU R                  [        R                  X!S9$ )z

return all services
s   /publicServicer   )r
   r'   r,   r   GET)r   r   r'   s      r   list_servicesEndpointClient.list_servicesb   s1    
 ""%66!!,"2"2D!HHr   c
                     Uc  U R                  5       nSU0n
UUUUSUR                  0S.nUb  XkS'   Ub  X{S'   U R                  [        R                  [
        R                  [        R                  " U5      U
U	S9$ )a  

The method of endpoint to be created.

:param vpc_id:
    vpc id
:type vpc_id: str

:param subnet_id:
    subnet id
:type subnet_id: str

:param name:
    name
:type name: str

:param service:
    service
:type service: str

:param billing:
   order_configuration
:type billing:Billing

:param ip_address:
    ip_address ipv4 address
:type ip_address: str

:param description:
    description .
:type description: string

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by the user, a random String
    generated by default algorithm will be used.
:type client_token: string
   clientTokenpaymentTiming)vpcIdsubnetIdnameservicebillingdescription	ipAddressr(   r*   r   )	r   payment_timingr,   r   POSTr
   r'   jsondumps)r   vpc_id	subnet_idr8   r9   r:   r;   
ip_addressclient_tokenr   r*   r(   s               r   create_endpointEndpointClient.create_endpointj   s    R >>@LL

 !!7!7
 ""-! *!!,"3"3^5H5HtzzZ^O_hn)/ " 1 	1r   c                     [         R                  S-   [        R                  " U5      -   nUc  U R	                  5       nSU0nU R                  [        R                  XEUS9$ )a  

release endpoint

:param endpoint_id:
    The id of endpoint.
:type endpoint_id: string

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    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
   /r4   r*   r   )r
   r'   r   convert_to_bytesr   r,   r   DELETE)r   endpoint_idrE   r   r'   r*   s         r   delete_endpointEndpointClient.delete_endpoint   se    , ""T)F,C,CK,PP>>@LL
 !!,"5"5tSY!ZZr   c
                     SU0n
Ub  X*S'   Ub  X:S'   Ub  XJS'   Ub  XZS'   Ub  XjS'   Ub  XzS'   Ub  XS'   U R                  [        R                  [        R                  XS	9$ )
a  

return all endpoint about vpc

:param vpc_id:
    vpc id
:type vpc_id:string

:param name:
    name
:type name:string

:param ip_address:
    ip address
:type ip_address:string

:param status:
    status
:type status:string

:param subnet_id:
    subnet id
:type subnet_id:string

:param service:
    service
:type service: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
s   vpcIds   names	   ipAddresss   statuss   subnetIds   services   markers   maxKeysrJ   )r,   r   r0   r
   r'   )r   rB   r8   rD   statusrC   r9   markermax_Keysr   r*   s              r   list_endpointsEndpointClient.list_endpoints   s    ` F#"7O!#-<  &9 "+;!(: &9!):!!,"2"2N4G4GPV!ffr   c                     [         R                  S-   [        R                  " U5      -   nU R	                  [
        R                  X2S9$ )z

Get the detail information of  endpoint.

:param endpoint_id:
    The id of endpoint.
:type endpoint_id: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
rI   r/   )r
   r'   r   rK   r,   r   r0   )r   rM   r   r'   s       r   get_endpointEndpointClient.get_endpoint
  s@     ""T)F,C,CK,PP!!,"2"2D!HHr   c                    [         R                  S-   [        R                  " U5      -   nUc  U R	                  5       nSU0n0 nUb  X8S'   Ub  X(S'   U R                  [        R                  U[        R                  " U5      UUS9$ )a\  

The method of endpoint to be update.

:param endpoint_id: endpoint id
:type endpoint_id: str

:param name: endpoint name
:type name: str

:param description: the description of endpoint
:type description: str

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    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
rI   r4   r;   r8   r=   
r
   r'   r   rK   r   r,   r   PUTr@   rA   )	r   rM   r8   r;   rE   r   r'   r*   r(   s	            r   update_endpointEndpointClient.update_endpoint  s    8 ""T)F,C,CK,PP>>@LL
 ""-L!!,"2"2Dtzz$?OX^)/ " 1 	1r   c                     [         R                  S-   [        R                  " U5      -   nUc  U R	                  5       nUSSU0nSU0nU R                  [        R                  U[        R                  " U5      UUS9$ )a  

The method of endpoint's security group to be update.

:param endpoint_id: endpoint id
:type endpoint_id: str

:param security_group_list: the id list of security group to be bind with.
:type security_group_list: list

:param name: action
:type name: str

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    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
rI    r4   securityGroupIdsr=   rZ   )	r   rM   security_group_listactionrE   r   r'   r*   r(   s	            r   update_endpoint_sg!EndpointClient.update_endpoint_sgJ  s    8 ""T)F,C,CK,PP>>@LBL
  3
 !!,"2"2Dtzz$?OX^)/ " 1 	1r   c                     [         R                  S-   [        R                  " U5      -   nUc  U R	                  5       nUSSU0nSU0nU R                  [        R                  U[        R                  " U5      UUS9$ )a  

The method of endpoint's enterprise security group to be update.

:param endpoint_id: endpoint id
:type endpoint_id: str

:param enterprise_sg_list: the id list of enterprise security group to be bind.
:type enterprise_sg_list: list

:param action: action
:type action: str

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    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
rI   r_   r4   s   enterpriseSecurityGroupIdsr=   rZ   )	r   rM   enterprise_sg_listrb   rE   r   r'   r*   r(   s	            r   update_endpoint_enterprise_sg,EndpointClient.update_endpoint_enterprise_sgv  s    : ""T)F,C,CK,PP>>@LBL
 *+=
 !!,"2"2Dtzz$?OX^)/ " 1 	1r   r   r   )NNNNN)NNNN)NN)NNNNNNNN)s   bindSgNN)s   bindEsgNN)__name__
__module____qualname____firstlineno____doc__r%   r'   r   staticmethodr   r   r,   r1   rF   rN   rT   rW   r\   rc   rg   __static_attributes__r   r   r   r
   r
   "   s    
 FD-   CG<@4<I gk26=1~[< tx-1AgFI&+1Z*1Z TX+1r   r
   )rm   r   r@   loggingr   baidubce.bce_base_clientr   baidubce.authr   baidubce.httpr   r   r   baidubcer   	getLoggerri   _loggerr
   r   r   r   <module>rw      sH        2 ' ) ! & 


H
%1] 1r   