bce-python-sdk 0.9.39__py3-none-any.whl → 0.9.42__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
baidubce/__init__.py CHANGED
@@ -18,7 +18,7 @@ from builtins import bytes
18
18
  from . import protocol
19
19
 
20
20
 
21
- SDK_VERSION = b'0.9.39'
21
+ SDK_VERSION = b'0.9.42'
22
22
  DEFAULT_SERVICE_DOMAIN = b'bcebos.com'
23
23
  URL_PREFIX = b'/v1'
24
24
  DEFAULT_ENCODING = 'UTF-8'
@@ -76,7 +76,7 @@ BCE_USER_METADATA_PREFIX = b"x-bce-meta-"
76
76
 
77
77
  BCE_REQUEST_ID = b"x-bce-request-id"
78
78
 
79
- # BOS HTTP Headers
79
+ # BOS HTTP Headers START
80
80
 
81
81
  BOS_DEBUG_ID = b"x-bce-bos-debug-id"
82
82
 
@@ -110,13 +110,19 @@ BOS_TRAFFIC_LIMIT = b"x-bce-traffic-limit"
110
110
 
111
111
  BOS_VERSIONING = b"x-bce-versioning"
112
112
 
113
- # STS HTTP Headers
114
-
115
- STS_SECURITY_TOKEN = b"x-bce-security-token"
113
+ BOS_OBJECT_EXPIRES = b"x-bce-object-expires"
116
114
 
117
115
  BOS_TAGGING = b"x-bce-tagging"
118
116
 
119
117
  BOS_PROCESS = b"x-bce-process"
120
118
 
119
+ BOS_BASE_ALLOW_HEADERS = set([BOS_TRAFFIC_LIMIT, BOS_VERSIONING, BOS_TAGGING, BOS_PROCESS, BOS_OBJECT_EXPIRES])
120
+
121
+ # BOS HTTP Headers END
122
+
123
+ # STS HTTP Headers
124
+
125
+ STS_SECURITY_TOKEN = b"x-bce-security-token"
126
+
121
127
  # BTS HTTP Headers
122
128
  BTS_METHOD_HEADER = b"x-bce-bts-method"
@@ -553,6 +553,8 @@ class BlbClient(bce_base_client.BceBaseClient):
553
553
  health_check_string=(bytes, str))
554
554
  def create_udp_listener(self, blb_id, listener_port, backend_port,
555
555
  scheduler, health_check_string,
556
+ health_check_type=None,
557
+ health_check_port=None,
556
558
  health_check_timeout_in_second=None,
557
559
  health_check_interval=None,
558
560
  unhealthy_threshold=None,
@@ -585,6 +587,15 @@ class BlbClient(bce_base_client.BceBaseClient):
585
587
  the backend server needs to respond after receiving it.
586
588
  :type health_check_string: string
587
589
 
590
+ :param health_check_type
591
+ Health check protocol
592
+ :value 'UDP' or 'ICMP'
593
+ :type health_check_type: string
594
+
595
+ :param health_check_port
596
+ Health check port, the default is the same as backend_port.
597
+ :type health_check_port: int
598
+
588
599
  :param health_check_timeout_in_second
589
600
  Health check timeout
590
601
  :value 1-60, default: 3, unit: seconds
@@ -635,6 +646,10 @@ class BlbClient(bce_base_client.BceBaseClient):
635
646
  'healthCheckString': compat.convert_to_string(health_check_string)
636
647
  }
637
648
 
649
+ if health_check_type is not None:
650
+ body['healthCheckType'] = health_check_type
651
+ if health_check_port is not None:
652
+ body['healthCheckPort'] = health_check_port
638
653
  if health_check_timeout_in_second is not None:
639
654
  body['healthCheckTimeoutInSecond'] = \
640
655
  health_check_timeout_in_second
@@ -1515,7 +1530,10 @@ class BlbClient(bce_base_client.BceBaseClient):
1515
1530
  listener_port=int,
1516
1531
  backend_port=int)
1517
1532
  def update_udp_listener(self, blb_id, listener_port, backend_port=None,
1518
- scheduler=None, health_check_string=None,
1533
+ scheduler=None,
1534
+ health_check_type=None,
1535
+ health_check_port=None,
1536
+ health_check_string=None,
1519
1537
  health_check_timeout_in_second=None,
1520
1538
  health_check_interval=None,
1521
1539
  unhealth_threshold=None,
@@ -1543,6 +1561,16 @@ class BlbClient(bce_base_client.BceBaseClient):
1543
1561
  :value 'RoundRobin'or'LeastConnection'or'Hash'
1544
1562
  :type scheduler:string
1545
1563
 
1564
+ :param health_check_type
1565
+ Health check protocol
1566
+ :value 'UDP' or 'ICMP'
1567
+ :type health_check_type:string
1568
+
1569
+ :param health_check_port
1570
+ Health check port, the default is the same as backend_port.
1571
+ This field can only be updated if health_check_type is UDP.
1572
+ :type health_check_port:int
1573
+
1546
1574
  :param health_check_string
1547
1575
  The request string sent by the health,
1548
1576
  the backend server needs to respond after receiving it,
@@ -1589,6 +1617,11 @@ class BlbClient(bce_base_client.BceBaseClient):
1589
1617
  body['backendPort'] = backend_port
1590
1618
  if scheduler is not None:
1591
1619
  body['scheduler'] = compat.convert_to_string(scheduler)
1620
+ if health_check_type is not None:
1621
+ body['healthCheckType'] = \
1622
+ compat.convert_to_string(health_check_type)
1623
+ if health_check_port is not None:
1624
+ body['healthCheckPort'] = health_check_port
1592
1625
  if health_check_string is not None:
1593
1626
  body['healthCheckString'] = \
1594
1627
  compat.convert_to_string(health_check_string)
@@ -1803,6 +1803,7 @@ class BosClient(BceBaseClient):
1803
1803
  def complete_multipart_upload(self, bucket_name, key,
1804
1804
  upload_id, part_list,
1805
1805
  user_metadata=None,
1806
+ user_headers=None,
1806
1807
  config=None):
1807
1808
  """
1808
1809
  After finish all the task, complete multi_upload_file.
@@ -1825,7 +1826,8 @@ class BosClient(BceBaseClient):
1825
1826
  key = compat.convert_to_bytes(key)
1826
1827
  headers = self._prepare_object_headers(
1827
1828
  content_type=http_content_types.JSON,
1828
- user_metadata=user_metadata)
1829
+ user_metadata=user_metadata,
1830
+ user_headers=user_headers)
1829
1831
 
1830
1832
  return self._send_request(
1831
1833
  http_methods.POST,
@@ -2693,21 +2695,24 @@ class BosClient(BceBaseClient):
2693
2695
  def _get_user_header(headers, user_headers, is_copy=False):
2694
2696
  if not isinstance(user_headers, dict):
2695
2697
  raise TypeError('user_headers should be of type dict.')
2698
+
2699
+ bos_headers = http_headers.BOS_BASE_ALLOW_HEADERS
2696
2700
 
2697
2701
  if not is_copy:
2698
- user_headers_set = set([http_headers.CACHE_CONTROL,
2702
+ user_headers_set = bos_headers.union(set([http_headers.CACHE_CONTROL,
2699
2703
  http_headers.CONTENT_ENCODING,
2700
2704
  http_headers.CONTENT_DISPOSITION,
2701
2705
  http_headers.EXPIRES,
2702
- http_headers.BOS_PROCESS])
2706
+ http_headers.BOS_PROCESS]))
2703
2707
  else:
2704
- user_headers_set = set([http_headers.BCE_COPY_SOURCE_IF_NONE_MATCH,
2708
+ user_headers_set = bos_headers.union(set([http_headers.BCE_COPY_SOURCE_IF_NONE_MATCH,
2705
2709
  http_headers.BCE_COPY_SOURCE_IF_UNMODIFIED_SINCE,
2706
- http_headers.BCE_COPY_SOURCE_IF_MODIFIED_SINCE])
2710
+ http_headers.BCE_COPY_SOURCE_IF_MODIFIED_SINCE]))
2707
2711
 
2708
2712
  for k, v in iteritems(user_headers):
2709
2713
  k = utils.convert_to_standard_string(k)
2710
- v = utils.convert_to_standard_string(v)
2714
+ if k != http_headers.BOS_OBJECT_EXPIRES:
2715
+ v = utils.convert_to_standard_string(v)
2711
2716
  if k in user_headers_set:
2712
2717
  headers[k] = v
2713
2718
  return headers
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bce-python-sdk
3
- Version: 0.9.39
3
+ Version: 0.9.42
4
4
  Summary: BCE SDK for python
5
5
  Home-page: http://bce.baidu.com
6
6
  Author:
@@ -1,4 +1,4 @@
1
- baidubce/__init__.py,sha256=QtDSqQw9O42rSEfn2RX9oUzBCj4MOzOHD6JwwR__vQw,813
1
+ baidubce/__init__.py,sha256=6xNhfAPwq4YiFtC7rsfQFvXuxxr4dUaFh7pI-7UF7W0,813
2
2
  baidubce/bce_base_client.py,sha256=7gjkRy_YlTTb6TXHYHyZRYMjdVO7FTtHMdwXx8bPgsE,3428
3
3
  baidubce/bce_client_configuration.py,sha256=84xv1Hsi_6ddqZlU8Mde7JQHOl-zWNWX7CObPsorDbQ,3157
4
4
  baidubce/bce_response.py,sha256=V5a3bgRj04cM3Ml3s1OByLyZZSGDUy9PL52JSugmCgM,1655
@@ -14,7 +14,7 @@ baidubce/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  baidubce/http/bce_http_client.py,sha256=Kg7bKhSSaIckFC7KT7wqUQ6srnTmOe95S6j3OREMZqg,11321
15
15
  baidubce/http/handler.py,sha256=FGotEXyM24t93E2Z4n9dJV9XD34im-gdmq8JDyncZA8,2930
16
16
  baidubce/http/http_content_types.py,sha256=tHTGDR9nK5beD9HmJ4Iwj42fc9avsMpJELbb6UdKtkQ,722
17
- baidubce/http/http_headers.py,sha256=Dq2ZFNFawaaUUGL9V32NFZC9Qxv-D7x92_ps8Wqqfyw,2788
17
+ baidubce/http/http_headers.py,sha256=fHZUEbzvTW9-JUAhBXXeag4mj7NbvMnwnRkyrxiFBUA,2978
18
18
  baidubce/http/http_methods.py,sha256=Hn-A2fKoZiqmrtWVlHhk1cGxEoGDrbLfNykZuo1zDZc,782
19
19
  baidubce/retry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  baidubce/retry/retry_policy.py,sha256=A7cPvKxkVmd8PGA6_60sQU9hBzGbjXHVW0-QofP7-5E,4926
@@ -40,7 +40,7 @@ baidubce/services/bes/bes_client.py,sha256=6tzfb7bUE-NLv-snTfYPwFyuhuYInvzJb8ut1
40
40
  baidubce/services/bes/bes_model.py,sha256=CKMJYKixE7bf3WVYt2Q4igpBM4g15v7pfaufIjvGE8U,1784
41
41
  baidubce/services/blb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  baidubce/services/blb/app_blb_client.py,sha256=35NkkWIwoeAtld6GpTM-rZuR1hrFytrKxsJyKqK2ks8,129274
43
- baidubce/services/blb/blb_client.py,sha256=iP_cmxc9RV2heqO1fdqMfKfMBc6JLNmUcUkAOPnabMk,99349
43
+ baidubce/services/blb/blb_client.py,sha256=WncDH8NL-8srschCXkoUgzYwfhAGgbLTkNcRz0eQuyI,100662
44
44
  baidubce/services/blb/user_service_client.py,sha256=bS8SKQKslvoSefVVl76A6cgvqyZnQoiU-tIPjTgAxDk,17046
45
45
  baidubce/services/bls/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
46
  baidubce/services/bls/bls_client.py,sha256=8s-AADWx7jNojHiCQo8qf69YcwUgQuFRJNouAfgEbHs,10123
@@ -49,7 +49,7 @@ baidubce/services/bls/bls_model.py,sha256=A4kLRQo0aOlh2t4IFjd0aJbju-CmhZdryuXESu
49
49
  baidubce/services/bmr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
50
  baidubce/services/bmr/bmr_client.py,sha256=ntJie-R6qFxdd6znpfCj25RSoJ6gOV0o2Tn9asJThQg,20565
51
51
  baidubce/services/bos/__init__.py,sha256=bRvJAiFjUIBF64HeoZ7bkTjGfqkKJAvxYWBSEvbUOIc,813
52
- baidubce/services/bos/bos_client.py,sha256=FHRScfUV1VycabKKhvBEriSk8b19WETRpo2va1jg9Lw,103192
52
+ baidubce/services/bos/bos_client.py,sha256=H1fmD0dkXTjspcS4QtLsZmyhUMJLGdNhuf8vtVDJJJQ,103446
53
53
  baidubce/services/bos/bos_handler.py,sha256=ZWVjezraJsdNy0tsX8fZkWPmSBYLSlGolKqZ1CcWE7A,1832
54
54
  baidubce/services/bos/canned_acl.py,sha256=Y2qvU81OI_nT0uu96MyTemXyR2EnNVVYrJxfPS1rhBA,723
55
55
  baidubce/services/bos/common.py,sha256=X2_PDLRR3Lpr7i2mzzyMBI2jCQ779hIx3XwBDTQAXhE,138
@@ -174,7 +174,7 @@ baidubce/services/vpc/vpc_client.py,sha256=xmW-m7IIYrnvvH0epwvJ1JgG52AMA5-YIvKjx
174
174
  baidubce/services/vpn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
175
175
  baidubce/services/vpn/vpn_client.py,sha256=rrnQElD-LTttsqMbbIHoHK0Jdc7FrVVTZIdu-0Zthr8,31352
176
176
  baidubce/services/vpn/vpn_model.py,sha256=C9rEBYyFIDjrqvqJG4WEin6qVzEIvbhPvT5KwDYm1qA,3365
177
- bce_python_sdk-0.9.39.dist-info/METADATA,sha256=8PKBVYEOlZNFmuK-MYyzRbQXgrdl1kYFjydcFu6-qbw,416
178
- bce_python_sdk-0.9.39.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
179
- bce_python_sdk-0.9.39.dist-info/top_level.txt,sha256=Oh6eo_-T_AuEDpIaR54biUUPThxsoQiYMVHLBTaweQs,9
180
- bce_python_sdk-0.9.39.dist-info/RECORD,,
177
+ bce_python_sdk-0.9.42.dist-info/METADATA,sha256=2Xl1N8HB1Lz0B6eSVckaNOnu1rp_kC42kSx79cPwB74,416
178
+ bce_python_sdk-0.9.42.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
179
+ bce_python_sdk-0.9.42.dist-info/top_level.txt,sha256=Oh6eo_-T_AuEDpIaR54biUUPThxsoQiYMVHLBTaweQs,9
180
+ bce_python_sdk-0.9.42.dist-info/RECORD,,