bce-python-sdk 0.9.22__py3-none-any.whl → 0.9.25__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 +1 -1
- baidubce/http/http_headers.py +3 -0
- baidubce/services/bcc/bcc_client.py +40 -3
- baidubce/services/bcc/bcc_model.py +4 -1
- baidubce/services/bts/bts_client.py +6 -4
- baidubce/services/vca/vca_client.py +26 -0
- {bce_python_sdk-0.9.22.dist-info → bce_python_sdk-0.9.25.dist-info}/METADATA +4 -5
- {bce_python_sdk-0.9.22.dist-info → bce_python_sdk-0.9.25.dist-info}/RECORD +10 -10
- {bce_python_sdk-0.9.22.dist-info → bce_python_sdk-0.9.25.dist-info}/WHEEL +1 -1
- {bce_python_sdk-0.9.22.dist-info → bce_python_sdk-0.9.25.dist-info}/top_level.txt +0 -0
baidubce/__init__.py
CHANGED
baidubce/http/http_headers.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
1
2
|
# Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
|
|
2
3
|
#
|
|
3
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
|
|
@@ -91,7 +92,7 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
91
92
|
security_group_ids=None, enterprise_security_group_ids=None, ehc_cluster_id=None,
|
|
92
93
|
kunlunCard=None, isomerismCard=None, file_systems=None, user_data=None, is_open_hosteye=False,
|
|
93
94
|
deletion_protection=None, res_group_id=None,
|
|
94
|
-
client_token=None, config=None, card_count=1, isomerism_card=None):
|
|
95
|
+
client_token=None, config=None, card_count=1, isomerism_card=None, is_keep_image_login=None):
|
|
95
96
|
"""
|
|
96
97
|
Create a bcc Instance with the specified options.
|
|
97
98
|
You must fill the field of clientToken,which is especially for keeping idempotent.
|
|
@@ -436,6 +437,8 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
436
437
|
if isomerism_card is not None:
|
|
437
438
|
body['isomerismCard'] = isomerism_card
|
|
438
439
|
body['cardCount'] = card_count if card_count > 1 else 1
|
|
440
|
+
if is_keep_image_login is not None:
|
|
441
|
+
body['keepImageLogin'] = is_keep_image_login
|
|
439
442
|
if auto_renew_time != 0:
|
|
440
443
|
body['autoRenewTime'] = auto_renew_time
|
|
441
444
|
if auto_renew_time_unit is None:
|
|
@@ -700,7 +703,8 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
700
703
|
spec_id=None, relation_tag=False, is_open_ipv6=False, deletion_protection=None,
|
|
701
704
|
enterprise_security_group_id=None, security_group_ids=None, res_group_id=None,
|
|
702
705
|
enterprise_security_group_ids=None, isomerismCard=None, file_systems=None,
|
|
703
|
-
card_count=1, isomerism_card=None, is_eip_auto_related_delete=False
|
|
706
|
+
card_count=1, isomerism_card=None, is_eip_auto_related_delete=False
|
|
707
|
+
, is_keep_image_login=None):
|
|
704
708
|
"""
|
|
705
709
|
Create a bcc Instance with the specified options.
|
|
706
710
|
You must fill the field of clientToken,which is especially for keeping idempotent.
|
|
@@ -1069,6 +1073,8 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
1069
1073
|
body['userData'] = user_data
|
|
1070
1074
|
if res_group_id is not None:
|
|
1071
1075
|
body['resGroupId'] = res_group_id
|
|
1076
|
+
if is_keep_image_login is not None:
|
|
1077
|
+
body['keepImageLogin'] = is_keep_image_login
|
|
1072
1078
|
body['isEipAutoRelatedDelete'] = is_eip_auto_related_delete
|
|
1073
1079
|
|
|
1074
1080
|
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
@@ -5448,7 +5454,8 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
5448
5454
|
body['keypairId'] = keypair_id
|
|
5449
5455
|
return self._send_request(http_methods.PUT, path, body=json.dumps(body), params=params, config=config)
|
|
5450
5456
|
|
|
5451
|
-
def change_to_prepaid(self, instance_id, duration, relation_cds
|
|
5457
|
+
def change_to_prepaid(self, instance_id, duration, relation_cds, auto_renew, auto_renew_period=None,
|
|
5458
|
+
client_token=None, config=None):
|
|
5452
5459
|
"""
|
|
5453
5460
|
Change instance pay timing to prepaid.
|
|
5454
5461
|
|
|
@@ -5464,6 +5471,17 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
5464
5471
|
Set whether to chagne the associated data disk. True - change; False - no change. Default is False.
|
|
5465
5472
|
:type relation_cds: bool
|
|
5466
5473
|
|
|
5474
|
+
:param auto_renew:
|
|
5475
|
+
Whether to enable automatic renewal, defaults to False.
|
|
5476
|
+
:type auto_renew: bool
|
|
5477
|
+
|
|
5478
|
+
|
|
5479
|
+
:param auto_renew_period:
|
|
5480
|
+
Duration of each automatic renewal(Unit: months).
|
|
5481
|
+
Value range: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36. If not specified, the default is 1.
|
|
5482
|
+
This parameter is effective only when auto_renew is set to true.
|
|
5483
|
+
:type auto_renew_period: int
|
|
5484
|
+
|
|
5467
5485
|
:return:
|
|
5468
5486
|
:rtype baidubce.bce_response.BceResponse
|
|
5469
5487
|
"""
|
|
@@ -5479,6 +5497,9 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
5479
5497
|
body = {
|
|
5480
5498
|
"duration": duration
|
|
5481
5499
|
}
|
|
5500
|
+
if auto_renew is not None:
|
|
5501
|
+
body['autoRenew'] = auto_renew
|
|
5502
|
+
body['autoRenewPeriod'] = auto_renew_period
|
|
5482
5503
|
if relation_cds is not None:
|
|
5483
5504
|
body['relationCds'] = relation_cds
|
|
5484
5505
|
return self._send_request(http_methods.POST, path, body=json.dumps(body), params=params, config=config)
|
|
@@ -6757,6 +6778,22 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
6757
6778
|
|
|
6758
6779
|
return self._send_request(http_methods.PUT, path, body=json.dumps(body), params=params, config=config)
|
|
6759
6780
|
|
|
6781
|
+
def get_instance_user_data(self, instance_id, client_token=None, config=None):
|
|
6782
|
+
"""
|
|
6783
|
+
get_instance_user_data
|
|
6784
|
+
"""
|
|
6785
|
+
path = b'/instance/attribute/getUserdata'
|
|
6786
|
+
params = {}
|
|
6787
|
+
if client_token is None:
|
|
6788
|
+
params['clientToken'] = generate_client_token()
|
|
6789
|
+
else:
|
|
6790
|
+
params['clientToken'] = client_token
|
|
6791
|
+
body = {
|
|
6792
|
+
"instanceId": instance_id
|
|
6793
|
+
}
|
|
6794
|
+
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
6795
|
+
params=params, config=config)
|
|
6796
|
+
|
|
6760
6797
|
|
|
6761
6798
|
def generate_client_token_by_uuid():
|
|
6762
6799
|
"""
|
|
@@ -140,12 +140,15 @@ class PayTimingChangeReqModel(object):
|
|
|
140
140
|
This class define detail of change pay timing.
|
|
141
141
|
"""
|
|
142
142
|
|
|
143
|
-
def __init__(self, instanceId, relationCds=False, cdsList=None, duration=None, autoPay=True
|
|
143
|
+
def __init__(self, instanceId, relationCds=False, cdsList=None, duration=None, autoPay=True,
|
|
144
|
+
autoRenew=None, autoRenewPeriod=None):
|
|
144
145
|
self.instanceId = instanceId
|
|
145
146
|
self.relationCds = relationCds
|
|
146
147
|
self.cdsList = cdsList
|
|
147
148
|
self.duration = duration
|
|
148
149
|
self.autoPay = autoPay
|
|
150
|
+
self.autoRenew = autoRenew
|
|
151
|
+
self.autoRenewPeriod = autoRenewPeriod
|
|
149
152
|
|
|
150
153
|
|
|
151
154
|
class DestRegionInfoModel(object):
|
|
@@ -427,9 +427,10 @@ class BtsClient(BceBaseClient):
|
|
|
427
427
|
|
|
428
428
|
body = json.dumps(get_row_data)
|
|
429
429
|
path = bts.URL_PREFIX + b"/" + instance_name + b"/table/" + table_name + b"/row"
|
|
430
|
-
response = self._send_request(http_methods.
|
|
430
|
+
response = self._send_request(http_methods.POST, path=path, config=config,
|
|
431
431
|
body=body,
|
|
432
|
-
headers={http_headers.CONTENT_TYPE: http_content_types.JSON
|
|
432
|
+
headers={http_headers.CONTENT_TYPE: http_content_types.JSON,
|
|
433
|
+
http_headers.BTS_METHOD_HEADER: http_methods.GET})
|
|
433
434
|
try:
|
|
434
435
|
if response.result is not None:
|
|
435
436
|
response.result[0].rowkey = _decode(str(response.result[0].rowkey))
|
|
@@ -483,9 +484,10 @@ class BtsClient(BceBaseClient):
|
|
|
483
484
|
|
|
484
485
|
body = json.dumps(batch_get_row_data)
|
|
485
486
|
path = bts.URL_PREFIX + b"/" + instance_name + b"/table/" + table_name + b"/rows"
|
|
486
|
-
response = self._send_request(http_methods.
|
|
487
|
+
response = self._send_request(http_methods.POST, path=path, config=config,
|
|
487
488
|
body=body,
|
|
488
|
-
headers={http_headers.CONTENT_TYPE: http_content_types.JSON
|
|
489
|
+
headers={http_headers.CONTENT_TYPE: http_content_types.JSON,
|
|
490
|
+
http_headers.BTS_METHOD_HEADER: http_methods.GET})
|
|
489
491
|
|
|
490
492
|
try:
|
|
491
493
|
if response.result is not None:
|
|
@@ -39,6 +39,32 @@ class VcaClient(BceBaseClient):
|
|
|
39
39
|
def __init__(self, config=None):
|
|
40
40
|
BceBaseClient.__init__(self, config)
|
|
41
41
|
|
|
42
|
+
@required(source=(bytes, str))
|
|
43
|
+
def get_image_abstract(self, source):
|
|
44
|
+
"""
|
|
45
|
+
Get image abstract analyze result
|
|
46
|
+
:param source: image source
|
|
47
|
+
:type source: string or unicode
|
|
48
|
+
:return: **Http Response**
|
|
49
|
+
"""
|
|
50
|
+
return self._send_request(http_methods.GET, b'/v1/abstract',
|
|
51
|
+
params={b'source': source})
|
|
52
|
+
|
|
53
|
+
@required(source=(bytes, str))
|
|
54
|
+
def put_image_abstract(self, source):
|
|
55
|
+
"""
|
|
56
|
+
Analyze a image abstract sync.
|
|
57
|
+
:param source: image source
|
|
58
|
+
:type source: string or unicode
|
|
59
|
+
:param preset: analyze preset name
|
|
60
|
+
:type preset: string or unicode
|
|
61
|
+
:return: **Http Response**
|
|
62
|
+
"""
|
|
63
|
+
body = {
|
|
64
|
+
'source': source
|
|
65
|
+
}
|
|
66
|
+
return self._send_request(http_methods.PUT, b'/v1/abstract', body=json.dumps(body))
|
|
67
|
+
|
|
42
68
|
@required(source=(bytes, str))
|
|
43
69
|
def put_image(self, source, preset=None):
|
|
44
70
|
"""
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: bce-python-sdk
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.25
|
|
4
4
|
Summary: BCE SDK for python
|
|
5
5
|
Home-page: http://bce.baidu.com
|
|
6
6
|
Author:
|
|
7
7
|
Author-email:
|
|
8
8
|
License: Apache License 2.0
|
|
9
9
|
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4
|
|
10
|
-
Requires-Dist: pycryptodome
|
|
11
|
-
Requires-Dist: future
|
|
12
|
-
Requires-Dist: six
|
|
13
|
-
|
|
10
|
+
Requires-Dist: pycryptodome>=3.8.0
|
|
11
|
+
Requires-Dist: future>=0.6.0
|
|
12
|
+
Requires-Dist: six>=1.4.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
baidubce/__init__.py,sha256
|
|
1
|
+
baidubce/__init__.py,sha256=BoGDE_KZ_y8L-HZO-4eRQtYBAmsWfc1GARwcMOVBvR8,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=zKbqSCVwVNt4ZzBmqpa_v0liJBTo_23mcVBbFIJIe04,11298
|
|
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=
|
|
17
|
+
baidubce/http/http_headers.py,sha256=Dq2ZFNFawaaUUGL9V32NFZC9Qxv-D7x92_ps8Wqqfyw,2788
|
|
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
|
|
@@ -27,8 +27,8 @@ baidubce/services/bbc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
|
|
|
27
27
|
baidubce/services/bbc/bbc_client.py,sha256=6x2fWmjyKSZ02WvsmQ1pryE0c_mtXHCjI0Ev80MfzbY,38951
|
|
28
28
|
baidubce/services/bbc/bbc_model.py,sha256=Dy80LZ4ro_iS3UejJ_CL9kI7OyMSBoDitTE4J1XAC_g,1790
|
|
29
29
|
baidubce/services/bcc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
-
baidubce/services/bcc/bcc_client.py,sha256=
|
|
31
|
-
baidubce/services/bcc/bcc_model.py,sha256=
|
|
30
|
+
baidubce/services/bcc/bcc_client.py,sha256=iLBL8E-Ju2J7qyGzHitp_58Nto-BbwVh8iucESe-N8c,257119
|
|
31
|
+
baidubce/services/bcc/bcc_model.py,sha256=Q70fMsdWIBQJiASlUGt7CcJQqgk3s3eu4cVZVzPRKNA,6444
|
|
32
32
|
baidubce/services/bcc/fpga_card_type.py,sha256=n6goqnapIgAC9_sciA_2he5HFqPRbRv109qitO7qpd8,948
|
|
33
33
|
baidubce/services/bcc/gpu_card_type.py,sha256=HEfMzne-UC5F295JPrPUu7V9F5g-hbXF2TNBontEFes,1054
|
|
34
34
|
baidubce/services/bcm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -51,7 +51,7 @@ baidubce/services/bos/canned_acl.py,sha256=Y2qvU81OI_nT0uu96MyTemXyR2EnNVVYrJxfP
|
|
|
51
51
|
baidubce/services/bos/common.py,sha256=X2_PDLRR3Lpr7i2mzzyMBI2jCQ779hIx3XwBDTQAXhE,138
|
|
52
52
|
baidubce/services/bos/storage_class.py,sha256=RiwV9b6N6dHFzNG6k4LUhjLngqfC837FWUvP-mr5BZ8,729
|
|
53
53
|
baidubce/services/bts/__init__.py,sha256=714yrJr3fupwooCvp7LBsBwS151wRo7OltVUFCkstyg,749
|
|
54
|
-
baidubce/services/bts/bts_client.py,sha256=
|
|
54
|
+
baidubce/services/bts/bts_client.py,sha256=4WtXqS8e0LDH5d61tN6Oc_F13fV-2nftAIx2VE4OyPQ,22108
|
|
55
55
|
baidubce/services/bts/model.py,sha256=venQTHnF4Yqg5TKF8uFcUrJ8TIqhkVBoJNKY54DERwg,11520
|
|
56
56
|
baidubce/services/bts/util.py,sha256=0HbqDbALL2-KTlNlnt7N7XOlG1mnhv6VLkajScDSYZY,1521
|
|
57
57
|
baidubce/services/ca/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -155,7 +155,7 @@ baidubce/services/tsdb/tsdb_admin_client.py,sha256=Gs4ltGvtm17jhc02xmVTNLghj6iQc
|
|
|
155
155
|
baidubce/services/tsdb/tsdb_client.py,sha256=Meg0mko2E5KgkZCd8vJWH7NAoMGWst3XqlxeiGIYZK4,9337
|
|
156
156
|
baidubce/services/tsdb/tsdb_handler.py,sha256=N3_4d0n_shI1AqXI7E5vVbieoPH_afFVD479Rxsi5us,1744
|
|
157
157
|
baidubce/services/vca/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
158
|
-
baidubce/services/vca/vca_client.py,sha256=
|
|
158
|
+
baidubce/services/vca/vca_client.py,sha256=9admQNqJQSrbElMYkl_4ZCjZHNgVyEjIqwXV8wtP69w,6493
|
|
159
159
|
baidubce/services/vcr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
160
160
|
baidubce/services/vcr/vcr_client.py,sha256=nOyjO-UIAz8xxoMVTEhaWhmBnRHWfrArynMVmNoJkwY,13004
|
|
161
161
|
baidubce/services/vpc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -168,7 +168,7 @@ baidubce/services/vpc/vpc_client.py,sha256=6HD-TIxmNPujzIVc37Z9OOp_JUOoITUPzTwjm
|
|
|
168
168
|
baidubce/services/vpn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
169
169
|
baidubce/services/vpn/vpn_client.py,sha256=VGmPmnl7Il_NcbGMAgASmVK_1IF9HQ8PJ-WLij-7Axc,28554
|
|
170
170
|
baidubce/services/vpn/vpn_model.py,sha256=r9V2At9ll9cZTOryGflS9tH9DlHdeelKYuGXvTNyTgg,3364
|
|
171
|
-
bce_python_sdk-0.9.
|
|
172
|
-
bce_python_sdk-0.9.
|
|
173
|
-
bce_python_sdk-0.9.
|
|
174
|
-
bce_python_sdk-0.9.
|
|
171
|
+
bce_python_sdk-0.9.25.dist-info/METADATA,sha256=Xfn1usG3itL1iHGSAHNTaPyWeRtU-Km41pg9yTboV3o,315
|
|
172
|
+
bce_python_sdk-0.9.25.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
173
|
+
bce_python_sdk-0.9.25.dist-info/top_level.txt,sha256=Oh6eo_-T_AuEDpIaR54biUUPThxsoQiYMVHLBTaweQs,9
|
|
174
|
+
bce_python_sdk-0.9.25.dist-info/RECORD,,
|
|
File without changes
|