
    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  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\R2                  5      rg)z.
This module provides a client class for CDN.
    N)bce_base_client)bce_v1_signer)bce_http_client)handler)http_content_types)http_headers)http_methods)BceClientError)BceServerError)required)utils)CdnStatsParamc                      \ rS rSrSrSrSeS jrSeS jrSfS jrSeS jr	SeS	 jr
SeS
 jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jrSeS jr SeS  jr!SeS! jr"SeS" jr#SeS# jr$SeS$ jr%SeS% jr&SeS& jr'SeS' jr(SeS( jr)SeS) jr*SeS* jr+SeS+ jr,SeS, jr-SeS- jr.SeS. jr/SeS/ jr0SeS0 jr1SeS1 jr2  SgS2 jr3SeS3 jr4SeS4 jr5SeS5 jr6SeS6 jr7SfS7 jr8SeS8 jr9SeS9 jr:SeS: jr;SeS; jr<SeS< jr=SfS= jr>SeS> jr?\@" \A\BS?9SeS@ j5       rCSeSA jrD\@" \ASB9  ShSC j5       rE\@" \ASB9SiSD j5       rF\@" \A\GSE9SeSF j5       rH\@" \A\ISG9SeSH j5       rJ\@" \A\GSI9SeSJ j5       rK\@" \LSK9SeSL j5       rM   SjSM jrN   SjSN jrO   SkSO jrP   SkSP jrQ   SjSQ jrR   SkSR jrS   SkSS jrT   SlST jrU   SkSU jrV\@" \BSV9SeSW j5       rW   SgSX jrX\@" \BSV9SeSY j5       rY   SgSZ jrZSeS[ jr[SeS\ jr\SeS] jr]SeS^ jr^\@" \ASB9SmS_ j5       r_\@" \ASB9SeS` j5       r`\@" \ASB9SeSa j5       ra\bSb 5       rc   SnSc jrdSdreg)o	CdnClient&   z
CdnClient
s   /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/cdn/cdn_client.pyr   CdnClient.__init__,   s    %%..t<    c                 @    U R                  [        R                  SUS9$ )z
get domain list

:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
z/domainr   _send_requestr	   GETr   s     r   list_domainsCdnClient.list_domains/   s+     !! "  	r   c                 \    0 nXS'   Ub  X$S'   U R                  [        R                  SUUS9$ )a  
get user domain list

:param status: Specify the domain whose return 'status' is status
:type status: string
:param rule: domain Fuzzy Matching
:type rule: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
statusrulez/user/domainsparamsr   r   )r   r$   r%   r   r'   s        r   list_user_domainsCdnClient.list_user_domains>   sG     !x!6N!!o "  	r   c                 L    U R                  [        R                  SU-   S-   US9$ )z
query if a domain can be create

:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
/domain/z/validr   r   r   domainr   s      r   valid_domainCdnClient.valid_domainW   s5     !!(* "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get cache full url of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   /configcacheFullUrl r&   r   r,   s      r   get_domain_cache_full_url#CdnClient.get_domain_cache_full_urlh   <     !!j61I="B' "  	r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a"  
update cacheShare of the domain
:param domain: the domain name
:type domain: string
:param cache_share: detailed configuration of cacheShare
:type cache_share: dictionary
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   
cacheSharer3   r'   bodyr   r   r	   PUTjsondumps)r   r-   cache_sharer   s       r   set_domain_cache_share CdnClient.set_domain_cache_sharey   N     !!)+ "%\;78 "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get cacheShare configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r8   r3   r&   r   r,   s      r   get_domain_cache_share CdnClient.get_domain_cache_share   <     !!j61I= "% "  	r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a*  
update trafficLimit of the domain
:param domain: the domain name
:type domain: string
:param traffic_limit: detailed configuration of trafficLimit
:type traffic_limit: dictionary
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   trafficLimitr3   r9   r;   )r   r-   traffic_limitr   s       r   set_domain_traffic_limit"CdnClient.set_domain_traffic_limit   N     !!)+"B'^];< "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get trafficLimit configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   rH   r3   r&   r   r,   s      r   get_domain_traffic_limit"CdnClient.get_domain_traffic_limit   r6   r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a  
update uaAcl of the domain
:param domain: the domain name
:type domain: string
:param ua_acl: detailed configuration of uaAcl
:type ua_acl: dictionary
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   uaAclr3   r9   r;   )r   r-   ua_aclr   s       r   set_domain_ua_aclCdnClient.set_domain_ua_acl   sM     !!)+R=Wf-. "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get uaAcl configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   rQ   r3   r&   r   r,   s      r   get_domain_ua_aclCdnClient.get_domain_ua_acl   ;     !!j61I=R= "  	r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a2  
update originProtocol of the domain
:param domain: the domain name
:type domain: string
:param origin_protocol: detailed configuration of originProtocol
:type origin_protocol: dictionary
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   originProtocolr3   r9   r;   )r   r-   origin_protocolr   s       r   set_domain_origin_protocol$CdnClient.set_domain_origin_protocol   sO     !!)+$b)-?@ "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get originProtocol configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   rZ   r3   r&   r   r,   s      r   get_domain_origin_protocol$CdnClient.get_domain_origin_protocol   s<     !!j61I=$b) "  	r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a&  
update retryOrigin of the domain
:param domain: the domain name
:type domain: string
:param retry_origin: detailed configuration of retryOrigin
:type retry_origin: dictionary
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   retryOriginr3   r9   r;   )r   r-   retry_originr   s       r   set_domain_retry_origin!CdnClient.set_domain_retry_origin  N     !!)+!2&]L9: "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get retryOrigin configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   rb   r3   r&   r   r,   s      r   get_domain_retry_origin!CdnClient.get_domain_retry_origin&  <     !!j61I=!2& "  	r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )aA  
update ipv6Dispatch of the domain
:param domain: the domain name
:type domain: string
:param ipv6_dispatch: detailed configuration of IPv6 access and IPv6 back to source
:type ipv6_dispatch: IPv6Config
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   ipv6Dispatchr3   r9   r;   )r   r-   ipv6_dispatchr   s       r   set_domain_ipv6_dispatch"CdnClient.set_domain_ipv6_dispatch7  rL   r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get ipv6Dispatch configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   rl   r3   r&   r   r,   s      r   get_domain_ipv6_dispatch"CdnClient.get_domain_ipv6_dispatchL  r6   r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a  
update QUIC of the domain
:param domain: the domain name
:type domain: string
:param quic: detailed configuration of Quick UDP Internet Connection
:type quic: bool
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   quicr3   r9   r;   )r   r-   rt   r   s       r   set_domain_quicCdnClient.set_domain_quic]  L     !!)+B<VTN+ "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get quic configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   rt   r3   r&   r   r,   s      r   get_domain_quicCdnClient.get_domain_quicr  ;     !!j61I=B< "  	r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a   
update offlineMode of the domain
:param domain: the domain name
:type domain: string
:param offline_mode: detailed configuration of offlineMode
:type offline_mode: bool
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   offlineModer3   r9   r;   )r   r-   offline_moder   s       r   set_domain_offline_mode!CdnClient.set_domain_offline_mode  rf   r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get offlineMode configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r}   r3   r&   r   r,   s      r   get_domain_offline_mode!CdnClient.get_domain_offline_mode  rj   r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a.  
update OCSP configuration of the domain
:param domain: the domain name
:type domain: string
:param ocsp: detailed configuration of Online Certificate Status Protocol
:type ocsp: bool
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   ocspr3   r9   r;   )r   r-   r   r   s       r   set_domain_ocspCdnClient.set_domain_ocsp  rw   r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get ocsp configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r   r3   r&   r   r,   s      r   get_domain_ocspCdnClient.get_domain_ocsp  r{   r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a2  
update error_page of the domain
:param domain: the domain name
:type domain: string
:param error_page: Detailed configuration of custom error jump pages
:type error_page: list<ErrorPage>
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   	errorPager3   r9   r;   )r   r-   
error_pager   s       r   set_domain_error_pageCdnClient.set_domain_error_page  sN     !!)+$[*56 "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get error page configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r   r3   r&   r   r,   s      r   get_domain_error_pageCdnClient.get_domain_error_page  <     !!j61I=$ "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get referer acl configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   
refererACLr3   r&   r   r,   s      r   get_domain_referer_acl CdnClient.get_domain_referer_acl  rF   r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get ip acl configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   ipACLr3   r&   r   r,   s      r   get_domain_ip_aclCdnClient.get_domain_ip_acl  rX   r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a  
update cors of the domain
:param domain: the domain name
:type domain: string
:param cors: Accelerating Cross-domain Settings for Domain Names
:type cors
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   corsr3   r9   r;   )r   r-   r   r   s       r   set_domain_corsCdnClient.set_domain_cors  rw   r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get cors configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r   r3   r&   r   r,   s      r   get_domain_corsCdnClient.get_domain_cors*  r{   r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a  
update access limit of the domain
:param domain: the domain name
:type domain: string
:param access_limit: Setting IP Access Limitation
:type AccessLimit
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   accessLimitr3   r9   r;   )r   r-   access_limitr   s       r   set_domain_access_limit!CdnClient.set_domain_access_limit:  rf   r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get access limit configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r   r3   r&   r   r,   s      r   get_domain_access_limit!CdnClient.get_domain_access_limitN  rj   r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a  
update Getting Real User IP Settings
:param domain: the domain name
:type domain: string
:param client_ip: Getting Real User IP Settings
:type ClientIp
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   clientIpr3   r9   r;   )r   r-   	client_ipr   s       r   set_domain_client_ipCdnClient.set_domain_client_ip^  N     !!)+#Z34 "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get client ip configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r   r3   r&   r   r,   s      r   get_domain_client_ipCdnClient.get_domain_client_ipr  <     !!j61I=# "  	r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a  
update range backsource Settings
:param domain: the domain name
:type domain: string
:param range_switch: rangre backsource settings
:type bool
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   rangeSwitchr3   r9   r;   )r   r-   range_switchr   s       r   set_domain_range_switch!CdnClient.set_domain_range_switch  rf   r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )
get range switch configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r   r3   r&   r   r,   s      r   get_domain_range_switch!CdnClient.get_domain_range_switch  rj   r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a	  
update mobile access Settings
:param domain: the domain name
:type domain: string
:param mobile_access: mobile access settings
:type MobileAccess
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   mobileAccessr3   r9   r;   )r   r-   mobile_accessr   s       r   set_domain_mobile_access"CdnClient.set_domain_mobile_access  rL   r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get mobile access configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r   r3   r&   r   r,   s      r   get_domain_mobile_access"CdnClient.get_domain_mobile_access  r6   r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a  
update http header Settings
:param domain: the domain name
:type domain: string
:param http_header: http header settings
:type HttpHeader
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   
httpHeaderr3   r9   r;   )r   r-   http_headerr   s       r   set_domain_http_header CdnClient.set_domain_http_header  rB   r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get http header configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r   r3   r&   r   r,   s      r   get_domain_http_header CdnClient.get_domain_http_header  rF   r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )z
update file trim Settings
:param domain: the domain name
:type domain: string
:param file_trim: file trim settings
:type bool
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   fileTrimr3   r9   r;   )r   r-   	file_trimr   s       r   set_domain_file_trimCdnClient.set_domain_file_trim  r   r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get file trim configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r   r3   r&   r   r,   s      r   get_domain_file_trimCdnClient.get_domain_file_trim  r   r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a  
update media drag Settings
:param domain: the domain name
:type domain: string
:param media_drag: media drag settings
:type MediaDragConf
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   	mediaDragr3   mediaDragConfr9   r;   )r   r-   
media_dragr   s       r   set_domain_media_dragCdnClient.set_domain_media_drag  sN     !!)+$_j9: "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )r   r+   r1   r   r3   r&   r   r,   s      r   get_domain_media_dragCdnClient.get_domain_media_drag&  r   r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )z
update compress Settings
:param domain: the domain name
:type domain: string
:param compress: media drag settings
:type compress
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   compressr3   r9   r;   )r   r-   r   r   s       r   set_domain_compressCdnClient.set_domain_compress6  sN     !!)+#Z23 "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get compress configuration of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r   r3   r&   r   r,   s      r   get_domain_compressCdnClient.get_domain_compressJ  r   r   c                     0 nUb  XS'   Ub  X'S'   Ub  X7S'   Ub  XGS'   Ub  XWS'   Uc  0 nU R                  [        R                  SUUS9$ )aE  
Query refresh and preload records
:param Type: None
:type string
:param start_time: None
:type Timestamp
:param end_time: None
:type Timestamp
:param url: None
:type string
:param marker: None
:type string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
type	startTimeendTimeurlmarkerz/cache/recordsr&   r   )r   Type
start_timeend_timer   r   r   r'   s           r   get_domain_recordsCdnClient.get_domain_recordsZ  s    * !6N!",; (9?5M%8>F!!. "  	r   c                 n    U R                  [        R                  S[        R                  " SU05      US9$ )z
set das enable
:param action: dsa enable
:type string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
z/dsaactionr:   r   r;   )r   r   r   s      r   set_dsaCdnClient.set_dsa  s<     !!Xv./	 "  	r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )z
update domain dsa Settings
:param domain: the domain name
:type domain: string
:param dsa: domain dsa settings
:type DSA
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   dsar3   r9   r;   )r   r-   r   r   s       r   set_domain_dsaCdnClient.set_domain_dsa  sL     !!)+2;UCL) "  	r   c                 @    U R                  [        R                  SUS9$ )z
get dsa domain list
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
z/dsa/domainr   r   r   s     r   get_dsa_domainsCdnClient.get_dsa_domains  s+     !! "  	r   c                 j    U R                  [        R                  S[        R                  " U5      US9$ )z
get log list
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
z	/log/listr   r   r	   POSTr=   r>   )r   logr   s      r   get_log_listCdnClient.get_log_list  s6     !!C	 "  	r   c                     SU0nUb  UR                  U5        U R                  [        R                  SU-   [        R
                  " U5      US9$ )a8  
create domain
:param domain: the domain name
:type domain: string
:param origin: the origin address list
:type origin: list<OriginPeer>
:param other: the other config
:type other: list<CONFIG>
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
originr+   r   updater   r	   r<   r=   r>   r   r-   r  otherr   r:   s         r   create_domainCdnClient.create_domain  sX     &!KK!!D!	 "  	r   c                 F    U R                  [        R                  SU-   US9$ )z
delete a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r   )r   r	   DELETEr,   s      r   delete_domainCdnClient.delete_domain  s0     !! "  	r   c                 L    U R                  [        R                  SU-   SS0US9$ )z
enable a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   enabler3   r&   r   r	   r   r,   s      r   enable_domainCdnClient.enable_domain  s7     !!b>	 "  	r   c                 L    U R                  [        R                  SU-   SS0US9$ )z
disable a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   disabler3   r&   r  r,   s      r   disable_domainCdnClient.disable_domain  s7     !!r?	 "  	r   c                 n    US   S:X  a  SUSS -   nU R                  [        R                  SU-   S-   US9$ )	z
get configuration of the domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r   *z%2A   Nr+   r1   r   r   r,   s      r   get_domain_configCdnClient.get_domain_config  sQ     !9VABZ'F!!)+ "  	r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a  
update multiConfigs of the domain
:param domain: the domain name
:type domain: string
:param multi_configs: the domain config list
:type multi_configs: list<config>
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   multiConfigsr3   r9   r;   )r   r-   multi_configsr   s       r   set_domain_multi_configs"CdnClient.set_domain_multi_configs(  rL   r   c                     SU0nUb  UR                  U5        U R                  [        R                  SU-   S-   SS0[        R
                  " U5      US9$ )aZ  
update origin address of the domain
:param domain: the domain name
:type domain: string
:param origin: the origin address list
:type origin: list<OriginPeer>
:param other: origin extension configuration
:type other: dictionary
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r  r+   r1   r3   r9   r  r  s         r   set_domain_originCdnClient.set_domain_origin<  sd     &!KK!!)+b>D! "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get cache rules of a domain
:param domain: the domain name
:type domain: string
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   cacheTTLr3   r&   r   r,   s      r   get_domain_cache_ttlCdnClient.get_domain_cache_ttlV  r   r   )r-   rulesc           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )z
set cache rules of a domain
:param domain: the domain name
:type domain: string
:param rules: cache rules
:type rules: list
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r&  r3   r9   r;   )r   r-   r)  r   s       r   set_domain_cache_ttlCdnClient.set_domain_cache_ttlf  sN     !!)+#Z/0 "  	r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )z
set if use the full url as cache key
:param domain: the domain name
:type domain: string
:param flag: 
:type flag: bool
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r2   r3   r9   r;   )r   r-   flagr   s       r   set_domain_cache_full_url#CdnClient.set_domain_cache_full_url{  sN     !!)+"B'^T23 "  	r   )r-   c           	          0 nXFS'   Ub  X&S'   Ub  X6S'   U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )	a  
set request referer access control
:param domain: the domain name
:type domain: string
:param blackList: referer blackList
:type blackList: list
:param whitelist: referer whitelist
:type whitelist: list
:param allowempty: allow empty referer?
:type allowempty: bool
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse

allowEmpty	blackList	whiteListr+   r1   r   r3   r9   r;   )r   r-   r3  r4  r2  r   acls          r   set_domain_referer_acl CdnClient.set_domain_referer_acl  sv    ( &L ( (!!j61I= "%\3/0	 "  	r   c           	          0 nUb  X%S'   Ub  X5S'   U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )a3  
set request ip access control
:param domain: the domain name
:type domain: string
:param blackList: ip blackList
:type blackList: list
:param whitelist: ip whitelist
:type whitelist: list
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r3  r4  r+   r1   r   r3   r9   r;   )r   r-   r3  r4  r   r5  s         r   set_domain_ip_aclCdnClient.set_domain_ip_acl  sl       ( (!!j61I=R=WcN+	 "  	r   )r-   httpsc           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )z
set request ip access control
:param domain: the domain name
:type domain: string
:param https: https config
:type https: dict
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r;  r3   r9   r;   )r   r-   r;  r   s       r   set_domain_httpsCdnClient.set_domain_https  sL     !!j61I=R=We,-	 "  	r   )r-   	limitRatec           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )z
set limit rate
:param domain: the domain name
:type domain: string
:param limitRate: limit rate value (Byte/s)
:type limitRate: int
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r?  r3   r9   r;   )r   r-   r?  r   s       r   set_domain_limit_rateCdnClient.set_domain_limit_rate  sM     !!j61I=$[)45	 "  	r   )r-   request_authc           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )z
set request auth
:param domain: the domain
:type domain: string
:param requestAuth: request auth config
:type requestAuth: dict
:param config: None
:type config: baidubce.BceClientConfiguration
:return:
:rtype: baidubce.bce_response.BceResponse

r+   r1   requestAuthr3   r9   r;   )r   r-   rE  r   s       r   set_domain_request_auth!CdnClient.set_domain_request_auth  sM     !!j61I=!2&]K89	 "  	r   )paramc                 ~    U R                  [        R                  S[        R                  " UR
                  5      US9$ )z
query stats of the domain or uid or tagId, eg : flow pv
:param param: the stats query param
:type param: cdn_stats_param.CdnStatsParam
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
z/stat/queryr   )r   r	   r   r=   r>   __dict__)r   rH  r   s      r   get_domain_statsCdnClient.get_domain_stats  s;     !!ENN+	 "  	r   c                 z    0 nXS'   Ub  X'S'   Ub  X7S'   XGS'   XWS'   U R                  [        R                  SUUS9$ )a  
query pv and qps of the domain
:param domain: the domain name
:type domain: string
:param startTime: query start time
:type startTime: Timestamp
:param endTime: query end time
:type endTime: Timestamp
:param period: time interval of query result
:type period: int
:param withRegion: if need client region distribution
:type withRegion: any
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r-   r   r   period
withRegionz/stat/pvr&   r   r   r-   r   r   rN  rO  r   r'   s           r   get_domain_pv_statCdnClient.get_domain_pv_stat  sf    * !x "+; '9!x)|!!j "  	r   c                 z    0 nXS'   Ub  X'S'   Ub  X7S'   XGS'   XWS'   U R                  [        R                  SUUS9$ )a  
query bandwidth of the domain
:param domain: the domain name
:type domain: string
:param startTime: query start time
:type startTime: Timestamp
:param endTime: query end time
:type endTime: Timestamp
:param period: time interval of query result
:type period: int
:param withRegion: if need client region distribution
:type withRegion: any
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r-   r   r   rN  rO  z
/stat/flowr&   r   rP  s           r   get_domain_flow_statCdnClient.get_domain_flow_statA  sf    * !x "+; '9!x)|!!l "  	r   c                 r    0 nXS'   Ub  X&S'   Ub  X6S'   XFS'   U R                  [        R                  SUUS9$ )a  
query origin bandwidth of the domain
:param domain: the domain name
:type domain: string
:param startTime: query start time
:type startTime: Timestamp
:param endTime: query end time
:type endTime: Timestamp
:param period: time interval of query result
:type period: int
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r-   r   r   rN  z/stat/srcflowr&   r   r   r-   r   r   rN  r   r'   s          r   get_domain_src_flow_stat"CdnClient.get_domain_src_flow_statf  s^    & !x "+; '9!x!!o "  	r   c                 r    0 nXS'   Ub  X&S'   Ub  X6S'   XFS'   U R                  [        R                  SUUS9$ )a}  
query hit rate of the domain
:param domain: the domain name
:type domain: string
:param startTime: query start time
:type startTime: Timestamp
:param endTime: query end time
:type endTime: Timestamp
:param period: time interval of query result
:type period: int
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r-   r   r   rN  z/stat/hitrater&   r   rW  s          r   get_domain_hitrate_stat!CdnClient.get_domain_hitrate_stat  s^    & !x "+; '9!x!!o "  	r   c                 z    0 nXS'   Ub  X'S'   Ub  X7S'   XGS'   XWS'   U R                  [        R                  SUUS9$ )a  
query http response code of a domain or all domains of the user
:param domain: the domain name
:type domain: string
:param startTime: query start time
:type startTime: Timestamp
:param endTime: query end time
:type endTime: Timestamp
:param period: time interval of query result
:type period: int
:param withRegion: if need client region distribution
:type withRegion: any
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r-   r   r   rN  rO  z/stat/httpcoder&   r   rP  s           r   get_domain_httpcode_stat"CdnClient.get_domain_httpcode_stat  sg    * !x "+; '9!x)|!!. "  	r   c                 r    0 nXS'   Ub  X&S'   Ub  X6S'   XFS'   U R                  [        R                  SUUS9$ )a  
query top n url of the domain or all domains of the user
:param domain: the domain name
:type domain: string
:param startTime: query start time
:type startTime: Timestamp
:param endTime: query end time
:type endTime: Timestamp
:param period: time interval of query result
:type period: int
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r-   r   r   rN  z/stat/topn/urlr&   r   rW  s          r   get_domain_topn_url_stat"CdnClient.get_domain_topn_url_stat  _    & !x "+; '9!x!!. "  	r   c                 r    0 nXS'   Ub  X&S'   Ub  X6S'   XFS'   U R                  [        R                  SUUS9$ )a  
query top n referer of the domain or all domains of the user
:param domain: the domain name
:type domain: string
:param startTime: query start time
:type startTime: Timestamp
:param endTime: query end time
:type endTime: Timestamp
:param period: time interval of query result
:type period: int
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r-   r   r   rN  z/stat/topn/refererr&   r   rW  s          r   get_domain_topn_referer_stat&CdnClient.get_domain_topn_referer_stat  s_    & !x "+; '9!x!!2 "  	r   c                 r    0 nXS'   Ub  X&S'   Ub  X6S'   XFS'   U R                  [        R                  SUUS9$ )a  
query the total number of client of a domain or all domains of the user
:param domain: the domain name
:type domain: string
:param startTime: query start time
:type startTime: Timestamp
:param endTime: query end time
:type endTime: Timestamp
:param period: time interval of query result
:type period: int
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r-   r   r   rN  z/stat/uvr&   r   rW  s          r   get_domain_uv_statCdnClient.get_domain_uv_stat  s^    & !x "+; '9!x!!j "  	r   c                 r    0 nXS'   Ub  X&S'   Ub  X6S'   XFS'   U R                  [        R                  SUUS9$ )a  
query average of the domain or all domains of the user
:param domain: the domain name
:type domain: string
:param startTime: query start time
:type startTime: Timestamp
:param endTime: query end time
:type endTime: Timestamp
:param period: time interval of query result
:type period: int
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r-   r   r   rN  z/stat/avgspeedr&   r   rW  s          r   get_domain_avg_speed_stat#CdnClient.get_domain_avg_speed_stat3  rc  r   )tasksc                 v    0 nXS'   U R                  [        R                  SU[        R                  " U5      S9$ )z
purge the cache of specified url or directory
:param tasks: url or directory list to purge
:type tasks: list
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
rm  /cache/purger   r:   r   r   rm  r   r:   s       r   purgeCdnClient.purgeU  sA     W!!~

4 0 " 2 	2r   c                 z    0 nXS'   X'S'   Ub  X7S'   Ub  XGS'   XWS'   U R                  [        R                  SUUS9$ )a  
query the status of purge tasks
:param id: purge task id to query
:type id: string
:param url: purge url to query
:type url: string
:param startTime: query start time
:type startTime: Timestamp
:param endTime: query end time
:type endTime: Timestamp
:param marker: 'nextMarker' get from last query
:type marker: int
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
idr   r   r   r   ro  r&   r   r   ru  r   r   r   r   r   r'   s           r   list_purge_tasksCdnClient.list_purge_tasksg  sd    * tu "+; '9!x!!n "  	r   c                 v    0 nXS'   U R                  [        R                  SU[        R                  " U5      S9$ )z
prefetch the source of specified url from origin
:param tasks: url or directory list need prefetch
:type tasks: list
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
rm  /cache/prefetchrp  r   rq  s       r   prefetchCdnClient.prefetch  sB     W!!

4 0 " 2 	2r   c                 z    0 nXS'   X'S'   Ub  X7S'   Ub  XGS'   XWS'   U R                  [        R                  SUUS9$ )a  
query the status of prefetch tasks
:param id: prefetch task id to query
:type id: string
:param url: prefetch url to query
:type url: string
:param startTime: query start time
:type startTime: Timestamp
:param endTime: query end time
:type endTime: Timestamp
:param marker: 'nextMarker' get from last query
:type marker: int
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
ru  r   r   r   r   rz  r&   r   rv  s           r   list_prefetch_tasksCdnClient.list_prefetch_tasks  se    * tu "+; '9!x!!/ "  	r   c                 @    U R                  [        R                  SUS9$ )z
query purge quota of the user
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
z/cache/quotar   r   r   s     r   
list_quotaCdnClient.list_quota  s*     !!,"2"2 .'- " / 	/r   c                 n    0 nUb  X%S'   Ub  X5S'   U R                  [        R                  SU-   S-   UUS9$ )aS  
get log of the domain in specified period of time
:param domain: the domain name
:type domain: string
:param startTime: query start time
:type startTime: Timestamp
:param endTime: query end time
:type endTime: Timestamp
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
r   r   z/log/z/logr&   r   )r   r-   r   r   r   r'   s         r   get_domain_logCdnClient.get_domain_log  sY      "+; '9!!fv%	 "  	r   c                 `    0 nXS'   X$S'   Uc  0 nU R                  [        R                  SUUS9$ )z
check specified ip whether belongs to Baidu CDN
:param action: 'describeIp'
:type action: string
:param ip: specified ip
:type ip: string
r   ipz/utilsr&   r   )r   r   r  r   r'   s        r   ip_queryCdnClient.ip_query  sK     !xt>F!!h "  	r   c                 B    U R                  [        R                  S0 US9$ )z`
Baidu back source IP address segment query

:return:
:rtype: baidubce.bce_response.BceResponse
z/nodes/listr&   r   r   s     r   
list_nodesCdnClient.list_nodes  s-     !!m "  	r   c           	          [        5       nU(       a  SOSUS'   U(       a  SOSUS'   U R                  [        R                  SU-   S-   SS0[        R
                  " SU05      US	9$ )
a0  
set seo
:param domain: the domain name
:type domain: string
:param push_record: push record to baidu or not
:type param: boolean
:param directory_origin: directory access origin or not
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
ONOFF
pushRecorddiretlyOriginr+   r1   	seoSwitchr3   r9   )dictr   r	   r<   r=   r>   )r   r-   push_recorddirectory_originr   r:   s         r   set_seoCdnClient.set_seo  sq     v%0Te\(8e_!!)+$[$/0 "  	r   c                 R    U R                  [        R                  SU-   S-   SS0US9$ )z
get seo configuration.
:param domain: the domain name
:type domain: string

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   r  r3   r&   r   r,   s      r   get_seoCdnClient.get_seo%  s=     !!)+$	 "  	r   c           	          U R                  [        R                  SU-   S-   SS0[        R                  " SU05      US9$ )z
set follow protocol.
:param domain: the domain name
:type domain: string
:param follow: follow protocol or not
:type follow: boolean

:return:
:rtype: baidubce.bce_response.BceResponse
r+   r1   followProtocolr3   r9   r;   )r   r-   followr   s       r   set_follow_protocolCdnClient.set_follow_protocol5  sO     !!)+$b)-v67 "  	r   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CdnClient._merge_configH  s7    >;;4;;/J,,V4r   c           
         U R                  X5      nUc  [        R                  n[        R                  " U[
        R                  [        R                  U/U[        R                  " [        R                  U5      X4U5      $ r   )r  r   
parse_jsonr   send_requestr   signparse_errorr   
append_urir   prefix)r   http_methodpathr:   headersr'   r   body_parsers           r   r   CdnClient._send_requestQ  so    
 ##D1!,,K++M&&)<)<k(J)))*:*:DA4RXZ 	Zr    r   )NN)NNNNNN)NNTN)NNN)NNN,  NN)NNNr  N)NNNi  N)FFN)NNNNN)f__name__
__module____qualname____firstlineno____doc__r  r   r!   r(   r.   r4   r@   rD   rJ   rN   rS   rV   r\   r_   rd   rh   rn   rq   ru   ry   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   strlistr+  r/  r6  r9  r  r=  intrA  rF  r   rK  rQ  rT  rX  r[  r^  ra  re  rh  rk  rr  rw  r{  r~  r  r  r  r  r  r  r  staticmethodr  r   __static_attributes__r  r   r   r   r   &   so    F=2""*"*"*"*"*"*"*"*"*"("""( ( ( ( ( ( ( ( (  GK*.,\"(2 ""&(4  S% &(( S6:48 B S 8 S% &( SC( )& St, -& M" #" )-04<@"H +/04<@#J /304+/ D .204+/B /38<DH"H /38<37 D 37<@7; D )-04,0 D 048<37 D D2 2" -104,0#J D2 2$ 044804#J/8$
 S 2 S  S $   -1	Zr   r   )r  r  r=   loggingbaidubcer   baidubce.authr   baidubce.httpr   r   r   r   r	   baidubce.exceptionr
   r   baidubce.utilsr   r   %baidubce.services.cdn.cdn_stats_paramr   	getLoggerr  _loggerr   r   r  r   r   <module>r     sb        $ ' ) ! , & & - - #  ?


H
%vZ-- vZr   