
    9i)                         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)z/
This module provides a client class for LBDC.
    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rg)
LbdcClient"   z

LBDC base sdk client
s   /v1s   /lbdcNc                 0    [         R                  " X5        g)zA
:param config: client config info
reuse BceBaseClient init func
N)r   __init__)selfconfigs     b/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/baidubce/services/lbdc/lbdc_client.pyr   LbdcClient.__init__+   s    
 	t,    c                  ,    [         R                  " 5       $ )z 

default client token by uuid1
)uuiduuid1 r   r   _generate_default_client_token)LbdcClient._generate_default_client_token2   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LbdcClient._merge_config:   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LbdcClient._send_requestH   s{    " ##F+!,,K?"((IKG ++FM4F4F-4-@-@+,N,79J9JT9QSW,24 	4r   c	                 ,   Uc  U R                  5       nSU0n	UUUUR                  SUR                  0S.S.n
Ub  XZS'   Ub  SUR                  0U
S'   U R                  [        R
                  [        R                  [        R                  " U
5      U	US9$ )a"  

The method of lbdc to be created.
:param name:
    name
:type name: str

:param type:
    lbdc type
:type type: str

:param ccu_count:
    count of Cluster Capacity Unit
:type ccu_count: int

:param billing:
   order_configuration
:type billing:Billing

:param desc:
    description of the cluster
:type desc: string

:param renew:
   reservation info of order_configuration
:type renew:Billing.reservation

: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
   clientToken   reservationLength)s   paymentTiming   reservation)   names   type   ccuCount   billing   descs   renewReservationr'   r)   r   )
r   payment_timingreservation_lengthr+   r   POSTr
   r&   jsondumps)r   nametype	ccu_countbillingdescrenewclient_tokenr   r)   r'   s              r   create_lbdcLbdcClient.create_lbdcf   s    R >>@LL

 "")"8"8('*D*D!	

  M$g&@&@)D$% !!,"3"3Z__4::VZK[dj)/ " 1 	1r   c                     [         R                  S-   [        R                  " U5      -   nUc  U R	                  5       nSUUS0nSU0nU R                  [        R                  U[        R                  " U5      UUS9$ )aX  
The method of lbdc to be upgrade.

:param lbdc_id: lbdc id
:type lbdc_id: str

:param ccu_count: count of Cluster Capacity Unit
:type ccu_count: int

:param action: action to upgrade lbdc
: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
   /r.    r2   r5   
r
   r&   r   convert_to_bytesr   r+   r   PUTr9   r:   )	r   lbdc_idr=   actionrA   r   r&   r)   r'   s	            r   upgrade_lbdcLbdcClient.upgrade_lbdc   s    6 %(?(?(HH>>@LLB
 
 !!,"2"2Dtzz$?OX^)/ " 1 	1r   c                    [         R                  S-   [        R                  " U5      -   nUc  U R	                  5       nSUUS0nSSSUR
                  000nU R                  [        R                  U[        R                  " U5      UUS9$ )aA  

renew lbdc

:param lbdc_id:
    The id of lbdc.
:type lbdc_id: str

:param billing: order_configuration
:type billing:Billing

:param action: action to update lbdc
: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
rE   r.   rF   r3   r0   r/   r5   )r
   r&   r   rH   r   r7   r+   r   rI   r9   r:   )	r   rJ   r>   rK   rA   r   r&   r)   r'   s	            r   
renew_lbdcLbdcClient.renew_lbdc   s    8 %(?(?(HH>>@LLB
 ('*D*D!
 !!,"2"2Dtzz$?OX^)/ " 1 	1r   c                 |    0 nUb  XS'   Ub  X$S'   U R                  [        R                  [        R                  XCS9$ )z

return all lbdc list about query info

:param lbdc_id: lbdc id
:type lbdc_id: str

:param name: lbdc name
:type name: str

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
   idr1   r)   r   r+   r   GETr
   r&   )r   rJ   r;   r   r)   s        r   	list_lbdcLbdcClient.list_lbdc  sE    " #5M"7O!!,"2"2JOOF!bbr   c                     [         R                  S-   [        R                  " U5      -   nU R	                  [
        R                  X2S9$ )z

Get the detail information of lbdc.

:param lbdc_id:
    The id of lbdc.
:type lbdc_id: str

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
rE   )r   )r
   r&   r   rH   r+   r   rU   )r   rJ   r   r&   s       r   get_lbdcLbdcClient.get_lbdc  s>     %(?(?(HH!!,"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  X(S'   Ub  X8S'   U R                  [        R                  U[        R                  " U5      UUS9$ )a.  

renew lbdc

:param lbdc_id:
    The id of lbdc.
:type lbdc_id: string

:param name:
    The name of lbdc
:type name: str

:param desc: description
:type desc: 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
rE   r.   r1   r4   r5   rG   )	r   rJ   r;   r?   rA   r   r&   r)   r'   s	            r   update_lbdcLbdcClient.update_lbdc.  s    : %(?(?(HH>>@LL
  M M!!,"2"2Dtzz$?OX^)/ " 1 	1r   c                 n    0 nUb  XS'   U R                  [        R                  [        R                  X2S9$ )z

return all lbdc list about query info

:param lbdc_id: lbdc id
:type lbdc_id:string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
rR   rS   rT   )r   rJ   r   r)   s       r   list_lbdc_blbLbdcClient.list_lbdc_blbZ  s8     #5M!!,"2"2JOOF!bbr   r   )N)NNNNN)NNNN)s   resizeNN)s   purchaseReservedNN)NNN)__name__
__module____qualname____firstlineno____doc__r$   r&   r   staticmethodr   r   r+   rB   rL   rO   rV   rY   r\   r_   __static_attributes__r   r   r   r
   r
   "   sk    
 FD-   CG<@4<A1F)1V,1\c2I&*1Xcr   r
   )re   r   r9   loggingr   baidubce.bce_base_clientr   baidubce.authr   baidubce.httpr   r   r   baidubcer   	getLoggerra   _loggerr
   r   r   r   <module>ro      sJ        2 ' ) ! & 


H
%Jc Jcr   