
    9i'                     &   S r SSKrSSK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  SS	KJr  SS
KJr  SSKJr  \R*                  " \5      r\R0                  " S5      r " S S\R4                  5      rS rS r\rg)z.
This module provides a client class for BBC.
    N)bce_base_client)bce_v1_signer)bce_http_client)handler)http_methods)aes128_encrypt_16char_key)required)	bbc_model)compatPostpaidc                      \ rS rSrSrSrS9S jrS9S jr  S:S jr\	" \
\4\
\4\
\4S9    S;S	 j5       rS<S
 jr\	" \
\4S9S=S j5       r\	" \
\4S9S9S j5       r\	" \
\4S9S=S j5       r\	" \
\4S9S=S j5       r\	" \S9S>S j5       r\	" \\S9S9S j5       r\	" \
\4\
\4\S9S9S j5       r\	" \
\4S9S9S j5       rS9S jr\	" \
\4\
\4S9S9S j5       rS9S jr\	" \
\4\
\4\
\4S9 S?S j5       r\	" \
\4S9S9S j5       r\	" \
\4\
\4S9S9S j5       r\	" \S9S9S  j5       r\	" \
\4\S!9S9S" j5       r\	" \
\4\S!9S9S# j5       r \	" \\S$9S9S% j5       r!\	" \\S$9S9S& j5       r"S9S' jr#\	" \
\4S(9S9S) j5       r$\	" \
\4S(9S9S* j5       r%\	" \
\4\
\4S+9  S@S, j5       r&SAS- jr'\	" \
\4S.9S9S/ j5       r(\	" \
\4S.9S9S0 j5       r)SBS1 jr*\	" \\
\4S29SCS3 j5       r+S9S4 jr,\	" \
\4S59S9S6 j5       r-\	" \
\4S59S9S7 j5       r.S8r/g)D	BbcClient'   z
Bbc client sdk
   /v2Nc                 B    [         R                  R                  X5        g N)r   BceBaseClient__init__)selfconfigs     `/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/baidubce/services/bbc/bbc_client.pyr   BbcClient.__init__-   s    %%..t<    c                     Uc  U R                   $ [        R                  " U R                   5      nUR                  U5        U$ r   )r   copymerge_non_none_values)r   r   
new_configs      r   _merge_configBbcClient._merge_config0   s7    >;;4;;/J,,V4r   c	           
          U R                  U5      nUc  [        R                  n[        R                  " U[
        R                  [        R                  U/XU-   X4U5      $ r   )r   r   
parse_jsonr   send_requestr   signparse_error)	r   http_methodpathbodyheadersparamsr   body_parserapi_versions	            r   _send_requestBbcClient._send_request8   s^     ##F+!,,K++M&&)<)<k(Jt+TFD 	Dr   )	flavor_idimage_idraid_idc                 
   Sn0 nUc  [        5       US'   OUUS'   US:X  a  SnUS:  a  SnUc  [        nUUUUUUR                  S.nUb  UUS'   Ub  UUS'   Ub  UUS	'   U	b  U	US
'   Ub  UUS'   U(       a  SUS'   U
b1  U R                  R                  R
                  n[        U
U5      nUUS'   Uc  SUS'   OUUS'   US:w  a  UUS'   Ub  UUS'   U R                  [        R                  U[        R                  " U5      UUS9$ )a"  
Create a bbc instance with the specified options.
You must fill the field of clientToken, which is especially for keeping idempotent.
This is an asynchronous interface.

:param flavor_id:
    The id of flavor, list all available flavors in BbcClient.list_flavors.
:type flavor_id: string

:param image_id:
    The id of image, list all available images in BbcClient.list_images.
:type image_id: string

:param raid_id:
    The id of raid, list all available raids in BbcClient.get_flavor_raid.
:type raid_id: string

:param root_disk_size_in_gb:
    System disk size of the physical machine to be created
:type root_disk_size_in_gb: int

:param purchase_count:
    The number of instances to buy, the default value is 1.
:type purchase_count: int

:param zone_name:
    The optional parameter to specify the available zone for the instance.
    See more detail through list_zones method
:type zone_name: string

:param subnet_id:
    The optional parameter to specify the id of subnet from vpc, optional param
     default value is default subnet from default vpc
:type subnet_id: string

:param billing:
    Billing information.
:type billing: bbc_model.Billing

:param name:
    The optional parameter to desc the instance that will be created.
:type name: string

:param enable_ht:
    The optional parameter to enable instance hyperthread.
:type name: bool

:param admin_pass:
    The optional parameter to specify the password for the instance.
    If specify the adminPass,the adminPass must be a 8-16 characters String
    which must contains letters, numbers and symbols.
    The symbols only contains "!@#$%^*()".
    The adminPass will be encrypted in AES-128 algorithm
    with the substring of the former 16 characters of user SecretKey.
    If not specify the adminPass, it will be specified by an random string.
    See more detail on
    https://cloud.baidu.com/doc/BBC/s/3jwvxu9iz#%E5%AF%86%E7%A0%81%E5%8A%A0%E5%AF%86%E4%BC%A0%E8%BE%93%E8%A7%84%E8%8C%83
:type admin_pass: string

:param auto_renew_time_unit
    The parameter to specify the unit of the auto renew time.
    The auto renew time unit can be "month" or "year".
    The default value is "month".
:type auto_renew_time_unit: string

:param auto_renew_time
    The parameter to specify the auto renew time, the default value is 0.
:type auto_renew_time: string

:deploy_set_id:
    The id of the deploy set
:type deploy_set_id: string

:param security_group_id:
    The optional parameter to specify the securityGroupId of the instance
    vpcId of the securityGroupId must be the same as the vpcId of subnetId
:type security_group_id: string

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if client token is provided.
    If the clientToken is not specified by the user,
    a random String generated by default algorithm will be used.
    See more detail at
    https://bce.baidu.com/doc/BCC/API.html#.E5.B9.82.E7.AD.89.E6.80.A7
:type client_token: string

:param tags:
    List of tags to be bind
:type tags: list

:return:
:rtype baidubce.bce_response.BceResponse
	   /instanceclientTokenr         )flavorIdimageIdraidIdrootDiskSizeInGbpurchaseCountbillingzoneNamesubnetIdsecurityGroupIdnamedeploySetIdTenableHt	adminPassmonthautoRenewTimeUnitautoRenewTimetagsr)   r   )generate_client_token#default_billing_to_purchase_created__dict__r   credentialssecret_access_keyr   r,   r   POSTjsondumps)r   r.   r/   r0   root_disk_size_in_gbpurchase_count	zone_name	subnet_idr;   r?   
admin_passauto_renew_time_unitauto_renew_timedeploy_set_id	enable_htsecurity_group_idclient_tokenr   rF   r&   r)   r'   rL   cipher_admin_passs                           r   create_instanceBbcClient.create_instanceE   sx   H $9$;F=!$0F=!  1$#% AN?9G " 4+''
  (D (D(&7D"#DL$"/D#D! $ 7 7 I I 9*FW X 1D'(/D$%(<D$%a$3D!DL!!,"3"3T4::d;K)/ " @ 	@r   c                 r    Sn0 nUb  XS'   Ub  X&S'   Ub  X6S'   U R                  [        R                  XVUS9$ )a  
Return a list of instances owned by the authenticated user.

:param marker:
    The optional parameter marker specified in the original request to specify
    where in the results to begin listing.
    Together with the marker, specify 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 specify the max number of list result to return.
    The default value is 1000.
:type max_keys: int

:param internal_ip:
    The identified internal ip of instance.
:type internal_ip: string

:return:
:rtype baidubce.bce_response.BceResponse
r2   markermaxKeys
internalIprG   r,   r   GET)r   r_   max_keysinternal_ipr   r&   r)   s          r   list_instancesBbcClient.list_instances   sW    0 %8 (9"#.< !!,"2"2DPV!WWr   )instance_idc                     [         R                  " U5      nSU-  n0 nU(       a  X%S'   U R                  [        R                  XEUS9$ )aG  
Get the detailed information of specified instance.

:param instance_id:
    The id of instance.
:type instance_id: string

:param contains_failed:
    The optional parameters to get the failed message.If true, it means get the failed message.
:type contains_failed: boolean

:return:
:rtype baidubce.bce_response.BceResponse
   /instance/%scontainsFailedrG   r   convert_to_bytesr,   r   rc   )r   rh   contains_failedr   r&   r)   s         r   get_instanceBbcClient.get_instance  sN      --k:,'6#$!!,"2"2DPV!WWr   c                 ~    [         R                  " U5      nSU-  nSS0nU R                  [        R                  X4US9$ )a6  
Starting the instance owned by the user.
You can start the instance only when the instance is Stopped,
otherwise, it's will get 409 errorCode.
This is an asynchronous interface.

:param instance_id: id of instance proposed to start
:type instance_id: string

:return:
:rtype baidubce.bce_response.BceResponse
rj   startNrG   )r   rm   r,   r   PUT)r   rh   r   r&   r)   s        r   start_instanceBbcClient.start_instance  sK     --k:,T
 !!,"2"2DPV!WWr   c                     [         R                  " U5      nSU-  nSU0nSS0nU R                  [        R                  U[
        R                  " U5      XcS9$ )a.  
Stopping the instance owned by the user.
You can stop the instance only when the instance is Running,
otherwise, it's will get 409 errorCode.
This is an asynchronous interface.

:param instance_id:
    The id of instance.
:type instance_id: string

:param force_stop:
    The optional parameter to stop the instance forcibly.If true,
    it will stop the instance just like power off immediately
    and it may result in losing important data which have not been written to disk.
:type force_stop: boolean

:return:
:rtype baidubce.bce_response.BceResponse
rj   	forceStopstopNrG   r   rm   r,   r   rs   rN   rO   r   rh   
force_stopr   r&   r'   r)   s          r   stop_instanceBbcClient.stop_instance/  sl    * --k:,
 D
 !!,"2"2D$**T:J)/ " @ 	@r   c                     [         R                  " U5      nSU-  nSU0nSS0nU R                  [        R                  U[
        R                  " U5      XcS9$ )a1  
Rebooting the instance owned by the user.
You can reboot the instance only when the instance is Running,
otherwise, it's will get 409 errorCode.
This is an asynchronous interface.

:param instance_id:
    The id of instance.
:type instance_id: string

:param force_stop:
    The optional parameter to stop the instance forcibly.If true,
    it will stop the instance just like power off immediately
    and it may result in losing important data which have not been written to disk.
:type force_stop: boolean

:return:
:rtype baidubce.bce_response.BceResponse
rj   rw   rebootNrG   ry   rz   s          r   reboot_instanceBbcClient.reboot_instanceO  sl    * --k:,
 d
 !!,"2"2D$**T:J)/ " @ 	@r   c                     SnSU0nUb  X&S'   Ub  X6S'   0 nU R                  [        R                  U[        R                  " U5      XtS9$ )z
batch_add_ip
:param instance_id:
:param private_ips:
:param secondary_private_ip_address_count:
:param config:
:return:
:rtype baidubce.bce_response.BceResponse
s   /instance/batchAddIp
instanceId
privateIpssecondaryPrivateIpAddressCountrG   r,   r   rs   rN   rO   )r   rh   private_ips"secondary_private_ip_address_countr   r&   r'   r)   s           r   batch_add_ipBbcClient.batch_add_ipo  so     '+
 "!,-95W12
 !!,"2"2D$**T:J)/ " @ 	@r   )rh   r   c                 |    SnUUS.n0 nU R                  [        R                  U[        R                  " U5      XcS9$ )zA
:param instance_id:
:param private_ips:
:param config:
:return:
s   /instance/batchDelIp)r   r   rG   r   )r   rh   r   r   r&   r'   r)   s          r   batch_delete_ipBbcClient.batch_delete_ip  sQ     '%%

 !!,"2"2D$**T:J)/ " @ 	@r   )rh   renew_time_unit
renew_timec                     [         R                  " U5      nSnUUUS.n0 nU R                  [        R                  U[
        R                  " U5      XtS9$ )a  
Creating auto renew rules for the bbc.
It only works for the prepaid bbc.

:param instance_id:
    The id of instance.
:type instance_id: string

:param renew_time_unit
    The parameter to specify the unit of the renew time.
    The renew time unit can be "month" or "year".
:type renew_time_unit: string

:param renew_time
    The parameter to specify the renew time.
:type renew_time: int
s#   /instance/batchCreateAutoRenewRules)r   renewTimeUnit	renewTimerG   r   rm   r,   r   rM   rN   rO   )r   rh   r   r   r   r&   r'   r)   s           r   create_auto_renew_rules!BbcClient.create_auto_renew_rules  sd    * --k:5%,#


 !!,"3"3T4::d;K)/ " @ 	@r   c                     [         R                  " U5      nSnSU0n0 nU R                  [        R                  U[
        R                  " U5      XRS9$ )z
Deleting auto renew rules for the bbc.
It only works for the prepaid bbc.

:param instance_id:
    The id of instance.
:type instance_id: string
s#   /instance/batchDeleteAutoRenewRulesr   rG   r   )r   rh   r   r&   r'   r)   s         r   delete_auto_renew_rules!BbcClient.delete_auto_renew_rules  s`     --k:5+

 !!,"3"3T4::d;K)/ " @ 	@r   c           	          SnSU0n0 nU R                  [        R                  U[        R                  " U5      XRU R
                  S9$ )z
List all region's endpoint information with the specific parameters.
Use global endpoint bbc.baidubce.com to get BBC's endpoint.

:param region:
    The id of region.
:type region: string

:return:
:rtype baidubce.bce_response.BceResponse
s   /region/describeRegionsregionr)   r   r+   )r,   r   rM   rN   rO   	prefix_v2)r   r   r   r&   r'   r)   s         r   describe_regionsBbcClient.describe_regions  sT     *f
 !!,"3"3T4::d;K)/DNN " \ 	\r   )rh   r?   c                     [         R                  " U5      nSU-  nSU0nSS0nU R                  [        R                  U[
        R                  " U5      XcS9$ )a_  
Modifying the name of the instance.
You can modify the instance name only when the instance is Running or Stopped ,
otherwise, it's will get 409 errorCode.

:param instance_id:
    The id of instance.
:type instance_id: string

:param name:
    The new value for instance's name.
:type name: string

:return:
:rtype baidubce.bce_response.BceResponse
rj   r?   renameNrG   ry   )r   rh   r?   r   r&   r'   r)   s          r   modify_instance_nameBbcClient.modify_instance_name  sl    & --k:,D
 d
 !!,"2"2D$**T:J)/ " @ 	@r   c                     [         R                  " U5      nSU-  nSU0nSS0nU R                  [        R                  U[
        R                  " U5      XcS9$ )ag  
Modifying the description  of the instance.
You can modify the description only when the instance is Running or Stopped ,
otherwise, it's will get 409 errorCode.

:param instance_id:
    The id of instance.
:type instance_id: string

:param desc:
    The new description of the instance.
:type name: string

:return:
:rtype baidubce.bce_response.BceResponse
rj   desc
updateDescNrG   ry   )r   rh   r   r   r&   r'   r)   s          r   modify_instance_descBbcClient.modify_instance_desc  sl    " --k:,D
 $
 !!,"2"2D$**T:J)/ " @ 	@r   )rh   r/   rT   c                    U R                   R                  R                  n[        X85      n	[        R
                  " U5      nSU-  n
UU	UUUS.nSS0nU R                  [        R                  U
[        R                  " U5      XS9$ )a  
Rebuilding the instance owned by the user.
After rebuilding the instance,
all of snapshots created from original instance system disk will be deleted,
all of customized images will be saved for using in the future.
This is an asynchronous interface

:param instance_id:
    The id of instance.
:type instance_id: string

:param image_id:
    The id of the image which is used to rebuild the instance.
:type image_id: string

:param admin_pass:
    The admin password to login the instance.
    The admin password will be encrypted in AES-128 algorithm
    with the substring of the former 16 characters of user SecretKey.
    See more detail on
    https://cloud.baidu.com/doc/BBC/s/3jwvxu9iz#%E5%AF%86%E7%A0%81%E5%8A%A0%E5%AF%86%E4%BC%A0%E8%BE%93%E8%A7%84%E8%8C%83
:type admin_pass: string

:param is_preserve_data:
    Whether or not to retain data, the default is true. The raid_id and
    sys_root_size fields do not take effect when the value is true
:type is_preserve_data: bool

:param raid_id:
    The id of raid. See more details on
    https://cloud.baidu.com/doc/BBC/s/Bjwvxu9ul#%E6%9F%A5%E8%AF%A2raid
:type raid_id: string

:param sys_root_size:
    System root partition size, default is 20G, value range is 20-100
:type sys_root_size: int

:return:
:rtype baidubce.bce_response.BceResponse
rj   )r7   rB   isPreserveDatar8   sysRootSizerebuildNrG   r   rK   rL   r   r   rm   r,   r   rs   rN   rO   )r   rh   r/   rT   is_preserve_datar0   sys_root_sizer   rL   r[   r&   r'   r)   s                r   rebuild_instanceBbcClient.rebuild_instance#  s    Z !KK33EE5jT--k:,*.(
 t
 !!,"2"2D$**T:J)/ " @ 	@r   c                 z    [         R                  " U5      nSnSU-  nU R                  [        R                  XBUS9$ )a  
Releasing the instance owned by the user.
Only the Postpaid instance or Prepaid which is expired can be released.
After releasing the instance,
all of the data will be deleted.
all of snapshots created from original instance system disk will be deleted,
all of customized images created from original instance system disk will be reserved.

:param instance_id:
    The id of instance.
:type instance_id: string

:return:
:rtype baidubce.bce_response.BceResponse
r   rj   )r   r+   r   rm   r,   r   DELETE)r   rh   r   r+   r&   s        r   release_instanceBbcClient.release_instancea  sB    " --k:,!!,"5"5tXc!ddr   )rh   rT   c                    U R                   R                  R                  n[        X$5      n[        R
                  " U5      nSU-  nSU0nSS0nU R                  [        R                  U[        R                  " U5      XS9$ )a  
Modifying the password of the instance.
You can change the instance password only when the instance is Running or Stopped ,
otherwise, it's will get 409 errorCode.
This is an asynchronous interface.

:param instance_id:
    The id of instance.
:type instance_id: string

:param admin_pass:
    The new password to update.
    The adminPass will be encrypted in AES-128 algorithm
    with the substring of the former 16 characters of user SecretKey.
:type admin_pass: string

:return:
:rtype baidubce.bce_response.BceResponse
rj   rB   
changePassNrG   r   )	r   rh   rT   r   rL   r[   r&   r'   r)   s	            r   modify_instance_password"BbcClient.modify_instance_passwordw  s    , !KK33EE5jT--k:,*
 $
 !!,"2"2D$**T:J)/ " @ 	@r   )bbc_idsc                 v    SnSU0nU R                  [        R                  U[        R                  " U5      US9$ )z
Query VPC / Subnet information by BBC instance id

:param bbc_ids:
    List of BBC instance IDs that need to query VPC / Subnet information
:type bbc_ids: list

:return:
:rtype baidubce.bce_response.BceResponse
s
   /vpcSubnetbbcIds)r'   r   )r,   r   rM   rN   rO   )r   r   r   r&   r'   s        r   get_vpc_subnetBbcClient.get_vpc_subnet  sA     g
 !!,"3"3T

4@P[a!bbr   )rh   change_tagsc                     [         R                  " U5      nSU-  nSS0nSU0nU R                  [        R                  U[
        R                  " U5      XSS9$ )z
Unbind the tags of existing instances

:param instance_id:
    The id of instance.
:type instance_id: string

:param change_tags:
    List of tags to be unbind
:type change_tags: list

:return:
:rtype baidubce.bce_response.BceResponse

   /instance/%s/tagunbindN
changeTagsr'   r)   r   ry   r   rh   r   r   r&   r)   r'   s          r   unbind_tagsBbcClient.unbind_tags  sn    " --k:"[0 d

 +
 !!,"2"2Dtzz$?O)/ " @ 	@r   c                     [         R                  " U5      nSU-  nSS0nSU0nU R                  [        R                  U[
        R                  " U5      XSS9$ )z
bind the tags of existing instances

:param instance_id:
    The id of instance.
:type instance_id: string

:param change_tags:
    List of tags to be bind
:type change_tags: list

:return:
:rtype baidubce.bce_response.BceResponse

r   bindNr   r   ry   r   s          r   	bind_tagsBbcClient.bind_tags  sn    " --k:"[0 D

 +
 !!,"2"2Dtzz$?O)/ " @ 	@r   )reserved_instance_idsrF   c           	          SnU Vs/ s H  oUR                   PM     nnUUS.nSS0nU R                  [        R                  U[        R
                  " U5      XU R                  S9$ s  snf )D
:param reserved_instance_ids:
:param tags:
:param config:
:return:
   /bbc/reserved/tagr   reservedInstanceIdsr   Nr   rJ   r,   r   rs   rN   rO   r   	r   r   rF   r   r&   tagtag_listr'   r)   s	            r   bind_reserved_instance_to_tags(BbcClient.bind_reserved_instance_to_tags  sy     $,01DSLLD1"#8

 D
 !!,"2"2D$**T:J)/DNN " \ 	\ 2   A&c           	          SnU Vs/ s H  oUR                   PM     nnUUS.nSS0nU R                  [        R                  U[        R
                  " U5      XU R                  S9$ s  snf )r   r   r   r   Nr   r   r   s	            r   "unbind_reserved_instance_from_tags,BbcClient.unbind_reserved_instance_from_tags  sy     $,01DSLLD1"#8

 d
 !!,"2"2D$**T:J)/DNN " \ 	\ 2r   c                 B    SnU R                  [        R                  X!S9$ )z4
:return:
:rtype baidubce.bce_response.BceResponse

s   /flavorr   rb   r   r   r&   s      r   list_flavorsBbcClient.list_flavors  s%     !!,"2"2D!JJr   )r.   c                 t    [         R                  " U5      nSU-  nU R                  [        R                  X2S9$ )zu
:param flavor_id:
    The id of flavor.
:type flavor_id: string

:return:
:rtype baidubce.bce_response.BceResponse

s
   /flavor/%sr   rl   r   r.   r   r&   s       r   
get_flavorBbcClient.get_flavor  s:     ++I6	y(!!,"2"2D!HHr   c                 t    [         R                  " U5      nSU-  nU R                  [        R                  X2S9$ )zt
:param flavor_id:
    The id of flavor.
:type flavor_id: string

:return:
:rtype baidubce.bce_response.BceResponse
s   /flavorRaid/%sr   rl   r   s       r   get_flavor_raidBbcClient.get_flavor_raid.  s:     ++I6	 9,!!,"2"2D!HHr   )
image_namerh   c                     SnSnUc  S[        5       0nOSU0nUUS.nU R                  [        R                  U[        R
                  " U5      XdS9$ )aZ  
Creating a customized image which can be used for creating instance.
You can create an image from an instance with this method.
While creating an image from an instance, the instance must be Running or Stopped,
otherwise, it's will get 409 errorCode.
This is an asynchronous interface.

:param image_name:
    The name for the image that will be created.
    The name length from 1 to 65,only contains letters,digital and underline.
:type image_name: string

:param instance_id:
    The optional parameter specify the id of the instance which will be used to create the new image.
    When instanceId and snapshotId are specified ,only instanceId will be used.
:type instance_id: string

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if client token is provided.
    If the clientToken is not specified by the user,
    a random String generated by default algorithm will be used.
    See more detail at
    https://bce.baidu.com/doc/BCC/API.html#.E5.B9.82.E7.AD.89.E6.80.A7
:type client_token: string

:return:
:rtype baidubce.bce_response.BceResponse
   /imageNr3   )	imageNamer   rG   rH   r,   r   rM   rN   rO   )r   r   rh   rZ   r   r&   r)   r'   s           r   create_image_from_instance_id'BbcClient.create_image_from_instance_id<  sv    H 46F
 |F $%

 !!,"3"3T4::d;K)/ " @ 	@r   c                 h    SnSU0nUb  X&S'   Ub  X6S'   U R                  [        R                  XVUS9$ )a  
Listing images owned by the authenticated user.

:param image_type:
    The optional parameter to filter image to list.
    See more detail at
    https://bce.baidu.com/doc/BCC/API.html#ImageType"
:type image_type: menu{'All', System', 'Custom', 'Integration'}

: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 specify the max number of list result to return.
    The default value is 1000.
:type max_keys: int

:return:
:rtype baidubce.bce_response.BceResponse
r   	imageTyper_   r`   rG   rb   )r   
image_typer_   rd   r   r&   r)   s          r   list_imagesBbcClient.list_imagesr  sR    2 
 %8 (9!!,"2"2DPV!WWr   )r/   c                 t    [         R                  " U5      nSU-  nU R                  [        R                  X2S9$ )z
Get the detail information of specified image.

:param image_id:
    The id of image.
:type image_id: string

:return:
:rtype baidubce.bce_response.BceResponse
	   /image/%sr   rl   r   r/   r   r&   s       r   	get_imageBbcClient.get_image  s:     **84h&!!,"2"2D!HHr   c                 t    [         R                  " U5      nSU-  nU R                  [        R                  X2S9$ )z
Deleting the specified image.
Only the customized image can be deleted,
otherwise, it's will get 403 errorCode.

:param image_id:
    The id of image.
:type image_id: string

:return:
:rtype baidubce.bce_response.BceResponse
r   r   r   r   s       r   delete_imageBbcClient.delete_image  s:     **84h&!!,"5"5t!KKr   c                     Sn0 nUb  XS'   Ub  X'S'   Ub  X7S'   Ub  XGS'   U R                  [        R                  XgUS9$ )a  
Querying information about physical machine operation logs

: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 specify the max number of list result to return.
    The default value is 1000.
:type max_keys: int

:param start_time:
    The start time of the physical machine operation (UTC time),
    the format is yyyy-MM-dd'T'HH: mm: ss'Z ', if it is empty, query the operation log of the day
:type start_time: string

:params end_time
    The end time of the physical machine operation (UTC time),
    the format is yyyy-MM-dd'T'HH: mm: ss'Z ', if it is empty, query the operation log of the day
:type end_time: string

:return:
:rtype baidubce.bce_response.BceResponse
s   /operationLogr_   r`   	startTimeendTimerG   rb   )r   r_   rd   
start_timeend_timer   r&   r)   s           r   get_operation_logBbcClient.get_operation_log  se    :  %8 (9!",; (9!!,"2"2DPV!WWr   )concurrencystrategyc                     Sn0 nUc  [        5       US'   OXXS'   UUS.n	Ub  X9S'   Ub  XIS'   U R                  [        R                  U[        R
                  " U	5      XS9$ )a  
Create a deploy set based on a specified policy and concurrency

:param concurrency:
    Deployment set concurrency, range [1,5]
:type concurrency: int

:param strategy:
    Deployment set strategy, currently BBC strategy only supports: "tor_ha", "host_ha"
:type strategy: string

:param name:
    Deployment set name, supports uppercase and lowercase letters, numbers,
    Chinese, and -_ /. Special characters, must start with a letter, length 1-65
:type name: string

:param desc:
    Deployment set description
:type desc: string

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if client token is provided.
    If the clientToken is not specified by the user,
    a random String generated by default algorithm will be used.
    See more detail at
    https://bce.baidu.com/doc/BCC/API.html#.E5.B9.82.E7.AD.89.E6.80.A7
:type client_token: string

:return:
:rtype baidubce.bce_response.BceResponse

   /deploysetr3   )r  r  r?   r   rG   r   )
r   r  r  r?   r   rZ   r   r&   r)   r'   s
             r   create_deploy_setBbcClient.create_deploy_set  s    D $9$;F=!$0=! &
 LL!!,"3"3T4::d;K)/ " @ 	@r   c                 B    SnU R                  [        R                  X!S9$ )zI
List all deploy sets

:return:
:rtype baidubce.bce_response.BceResponse
r  r   rb   r   s      r   list_deploy_setsBbcClient.list_deploy_sets  s%     !!,"2"2D!HHr   )deploy_set_idsc                 t    [         R                  " U5      nSU-  nU R                  [        R                  X2S9$ )z
Get the specified deploy set

:param deploy_set_id:
    The id of the deploy set
:type deploy_set_id: String

:return:
:rtype baidubce.bce_response.BceResponse
   /deployset/%sr   rl   r   rW   r   r&   s       r   get_deploy_setBbcClient.get_deploy_set  s:     //>-/!!,"2"2D!HHr   c                 t    [         R                  " U5      nSU-  nU R                  [        R                  X2S9$ )z
Delete the specified deploy sets

:param deploy_set_ids:
    The ids of the deploy sets you want to delete
:type deploy_set_ids: list

:return:
:rtype baidubce.bce_response.BceResponse
r  r   r   r  s       r   delete_deploy_setBbcClient.delete_deploy_set/  s:     //>-/!!,"5"5t!KKr    r   )NNNNNs   /v1)r4   r5   NNNNNNr   NFNNNN)N  NN)FN)NNN)TNr4   N)NN)AllNr  N)Nd   NNN)NNNN)0__name__
__module____qualname____firstlineno____doc__r   r   r   r,   r	   bytesstrr\   rf   ro   rt   r|   r   r   listr   intr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r
  r  r  __static_attributes__r  r   r   r   r   '   s    I= 7;AG	D 5#,E3<ESV<Xde\`diUYT@ YT@n"XL 5#,'X (X, 5#,'X (X( 5#,'@ (@> 5#,'@ (@> #@ @0 #40@ 1@$ 5#,$cl@@> 5#,'@ (@(\* 5#,3<!@!@<@8 5#,s|' X\9@'9@v 5#,'e (e* 5#,'@'@B c c$ 5#,d;@ <@< 5#,d;@ <@> D\\& D\\&K 5#,'I (I %I &I % #,(
 48-1	2@(2@h"XH s|$I %I s|$L %L"(XT #50@ 60@dI eS\*I +I eS\*L +Lr   r   c                  >    [        [        R                  " 5       5      $ )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   generate_client_token_by_uuidr&  G  s     tzz|r   c                      SR                  [        R                  " [        R                  [        R
                  -   S5      5      n U $ )z
The alternative method to generate the random string for client_token
if the optional parameter client_token is not specified by the user.
:return:
:rtype string
 $   )joinrandomsamplestringascii_lettersdigits)rZ   s    r   generate_client_token_by_randomr0  Q  s2     776==)=)=)MrRSLr   )r  r   rN   loggingr+  r-  r$  baidubcer   baidubce.authr   baidubce.httpr   r   r   baidubce.utilsr   r	   baidubce.services.bbcr
   r   	getLoggerr  _loggerBillingrI   r   r   r&  r0  rH   r  r   r   <module>r:     s          $ ' ) ! & 4 # + 


H
%&/&7&7
&C #VL-- VL@! 6 r   