bce-python-sdk 0.9.56__py3-none-any.whl → 0.9.57__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.56'
21
+ SDK_VERSION = b'0.9.57'
22
22
  DEFAULT_SERVICE_DOMAIN = b'bcebos.com'
23
23
  URL_PREFIX = b'/v1'
24
24
  DEFAULT_ENCODING = 'UTF-8'
@@ -1516,7 +1516,9 @@ class BccClient(bce_base_client.BceBaseClient):
1516
1516
  @required(instance_id=(bytes, str), # ***Unicode***
1517
1517
  image_id=(bytes, str)) # ***Unicode***
1518
1518
  def rebuild_instance(self, instance_id, image_id, admin_pass=None, key_pair_id=None, is_keep_image_login=None,
1519
- config=None):
1519
+ config=None, user_data=None, clean_last_user_data=None, is_open_hostEye=None,
1520
+ sys_root_size=None, is_preserve_data=None, raid_id=None, data_partition_type=None,
1521
+ root_partition_type=None):
1520
1522
  """
1521
1523
  Rebuilding the instance owned by the user.
1522
1524
  After rebuilding the instance,
@@ -1545,6 +1547,40 @@ class BccClient(bce_base_client.BceBaseClient):
1545
1547
  key_pair_id or admin_pass is required for rebuild instance.
1546
1548
  :type key_pair_id: string
1547
1549
 
1550
+ :param user_data:
1551
+ User data to pass to the instance at launch time.
1552
+ :type user_data: string
1553
+
1554
+ :param clean_last_user_data:
1555
+ Indicates whether to clean the user data after the instance has been rebuilded.
1556
+ Default value is False.
1557
+ :type clean_user_data: boolean
1558
+
1559
+ :param is_open_hostEye:
1560
+ Indicates whether to open host eye.
1561
+ :type is_open_hostEye: boolean
1562
+
1563
+ :param sys_root_size:
1564
+ System partition size (unit: GB).
1565
+ :type sys_root_size: int
1566
+
1567
+ :param is_preserve_data:
1568
+ Indicates whether to preserve data during the instance rebuilding process.
1569
+ Default value is False.
1570
+ :type is_preserve_data: boolean
1571
+
1572
+ :param raid_id:
1573
+ RAID ID.
1574
+ :type raid_id: string
1575
+
1576
+ :param data_partition_type:
1577
+ Data partition type.
1578
+ :type data_partition_type: string
1579
+
1580
+ :param root_partition_type:
1581
+ Root partition type.
1582
+ :type root_partition_type: string
1583
+
1548
1584
  :return:
1549
1585
  :rtype baidubce.bce_response.BceResponse
1550
1586
  """
@@ -1561,6 +1597,22 @@ class BccClient(bce_base_client.BceBaseClient):
1561
1597
  secret_access_key = self.config.credentials.secret_access_key
1562
1598
  cipher_admin_pass = aes128_encrypt_16char_key(admin_pass, secret_access_key)
1563
1599
  body['adminPass'] = cipher_admin_pass
1600
+ if user_data is not None:
1601
+ body['userData'] = user_data
1602
+ if clean_last_user_data is not None:
1603
+ body['cleanLastUserData'] = clean_last_user_data
1604
+ if is_open_hostEye is not None:
1605
+ body['isOpenHostEye'] = is_open_hostEye
1606
+ if sys_root_size is not None:
1607
+ body['sysRootSize'] = sys_root_size
1608
+ if is_preserve_data is not None:
1609
+ body['isPreserveData'] = is_preserve_data
1610
+ if raid_id is not None:
1611
+ body['raidId'] = raid_id
1612
+ if data_partition_type is not None:
1613
+ body['dataPartitionType'] = data_partition_type
1614
+ if root_partition_type is not None:
1615
+ body['rootPartitionType'] = root_partition_type
1564
1616
  params = {
1565
1617
  'rebuild': None
1566
1618
  }
@@ -2602,12 +2654,17 @@ class BccClient(bce_base_client.BceBaseClient):
2602
2654
  def modify_volume_charge_type(self,
2603
2655
  volume_id,
2604
2656
  billing=None,
2657
+ effective_type=None,
2605
2658
  config=None):
2606
2659
  """
2607
2660
  :param volume_id: volume id
2608
2661
  :type volume_id: string
2609
2662
  :param billing: payment information
2610
2663
  :type billing: bcc_model.Billing
2664
+ :param effective_type: Optional parameters:
2665
+ AtOnce (switch to pay-as-you-go immediately),
2666
+ AfterExpiration (switch to pay-as-you-go after expiration).
2667
+ Defaults to AfterExpiration if not provided.
2611
2668
  :param config:
2612
2669
 
2613
2670
  :return:
@@ -2619,6 +2676,7 @@ class BccClient(bce_base_client.BceBaseClient):
2619
2676
  if billing is None:
2620
2677
  billing = default_billing_to_purchase_reserved
2621
2678
  body = {
2679
+ 'effectiveType': effective_type,
2622
2680
  'billing': billing.__dict__
2623
2681
  }
2624
2682
 
@@ -3999,7 +4057,8 @@ class BccClient(bce_base_client.BceBaseClient):
3999
4057
  user_data=None, spec_id=None, deletion_protection=None, is_open_hosteye=None,
4000
4058
  hosteye_type=None, res_group_id=None, enable_ht=None, data_partition_type=None,
4001
4059
  root_partition_type=None, file_systems=None, disable_root_disk_serial=None,
4002
- internal_ips=None, network_purchase_type=None, is_keep_image_login=None):
4060
+ internal_ips=None, network_purchase_type=None, is_keep_image_login=None,
4061
+ reserved_instance=None):
4003
4062
  """
4004
4063
  Create a bcc Instance with the specified options.
4005
4064
  You must fill the field of clientToken,which is especially for keeping idempotent.
@@ -4385,7 +4444,8 @@ class BccClient(bce_base_client.BceBaseClient):
4385
4444
  body['networkPurchaseType'] = network_purchase_type
4386
4445
  if is_keep_image_login is not None:
4387
4446
  body['keepImageLogin'] = is_keep_image_login
4388
-
4447
+ if reserved_instance is not None:
4448
+ body['reservedInstance'] = reserved_instance
4389
4449
  return self._send_request(http_methods.POST, path, json.dumps(body),
4390
4450
  params=params, config=config)
4391
4451
 
@@ -4432,7 +4492,8 @@ class BccClient(bce_base_client.BceBaseClient):
4432
4492
  @required(instance_id=(bytes, str)) # ***Unicode***
4433
4493
  def release_instance_with_related_resources(self, instance_id, related_release_flag=None,
4434
4494
  delete_cds_snapshot_flag=None, delete_related_enis_flag=None,
4435
- bcc_recycle_flag=None, client_token=None, config=None):
4495
+ bcc_recycle_flag=None, cds_attribute_active=None,
4496
+ client_token=None, config=None):
4436
4497
  """
4437
4498
  Releasing the instance owned by the user.
4438
4499
  Only the Postpaid instance or Prepaid which is expired can be released.
@@ -4481,6 +4542,8 @@ class BccClient(bce_base_client.BceBaseClient):
4481
4542
  body['deleteRelatedEnisFlag'] = delete_related_enis_flag
4482
4543
  if bcc_recycle_flag is not None:
4483
4544
  body['bccRecycleFlag'] = bcc_recycle_flag
4545
+ if bcc_recycle_flag is not None:
4546
+ body['cdsAttributeActive'] = cds_attribute_active
4484
4547
  return self._send_request(http_methods.POST, path, body=json.dumps(body), params=params, config=config)
4485
4548
 
4486
4549
  @required(instance_id=(bytes, str)) # ***Unicode***
@@ -5608,7 +5671,9 @@ class BccClient(bce_base_client.BceBaseClient):
5608
5671
  return self._send_request(http_methods.PUT, path, body=json.dumps(body), params=params, config=config)
5609
5672
 
5610
5673
  def batch_rebuild_instances(self, image_id, admin_pass, instance_ids, keypair_id=None, is_keep_image_login=None,
5611
- client_token=None, config=None):
5674
+ client_token=None, config=None, user_data=None, use_last_user_data=None,
5675
+ is_open_hostEye=None, sys_root_size=None, is_preserve_data=None, raid_id=None,
5676
+ data_partition_type=None, root_partition_type=None):
5612
5677
  """
5613
5678
  Batch rebuild instances.
5614
5679
 
@@ -5628,6 +5693,30 @@ class BccClient(bce_base_client.BceBaseClient):
5628
5693
  Set the id of the keypair to be bound. (optional param)
5629
5694
  :type keypair_id: string
5630
5695
 
5696
+ :param user_data:
5697
+ UserData of the instance.
5698
+
5699
+ :param use_last_user_data:
5700
+ Use last user data.
5701
+
5702
+ :param is_open_hostEye:
5703
+ Is open host eye.
5704
+
5705
+ :param sys_root_size:
5706
+ System disk size.
5707
+
5708
+ :param is_preserve_data:
5709
+ Preserve data.
5710
+
5711
+ :param raid_id:
5712
+ Raid id.
5713
+
5714
+ :param data_partition_type:
5715
+ Data partition type.
5716
+
5717
+ :param root_partition_type:
5718
+ Root partition type.
5719
+
5631
5720
  :return:
5632
5721
  :rtype baidubce.bce_response.BceResponse
5633
5722
  """
@@ -5649,6 +5738,22 @@ class BccClient(bce_base_client.BceBaseClient):
5649
5738
  body['keypairId'] = keypair_id
5650
5739
  if is_keep_image_login is not None:
5651
5740
  body['keepImageLogin'] = is_keep_image_login
5741
+ if user_data is not None:
5742
+ body['userData'] = user_data
5743
+ if use_last_user_data is not None:
5744
+ body['useLastUserData'] = use_last_user_data
5745
+ if is_open_hostEye is not None:
5746
+ body['isOpenHostEye'] = is_open_hostEye
5747
+ if sys_root_size is not None:
5748
+ body['sysRootSize'] = sys_root_size
5749
+ if is_preserve_data is not None:
5750
+ body['isPreserveData'] = is_preserve_data
5751
+ if raid_id is not None:
5752
+ body['raidId'] = raid_id
5753
+ if data_partition_type is not None:
5754
+ body['dataPartitionType'] = data_partition_type
5755
+ if root_partition_type is not None:
5756
+ body['rootPartitionType'] = root_partition_type
5652
5757
  return self._send_request(http_methods.PUT, path, body=json.dumps(body), params=params, config=config)
5653
5758
 
5654
5759
  def change_to_prepaid(self, instance_id, duration, relation_cds, auto_renew, auto_renew_period=None,
@@ -5929,7 +6034,8 @@ class BccClient(bce_base_client.BceBaseClient):
5929
6034
 
5930
6035
  def batch_delete_instance_with_related_resource(self, instance_ids, related_release_flag=None,
5931
6036
  delete_cds_snapshot_flag=None, delete_related_enis_flag=None,
5932
- bcc_recycle_flag=None, client_token=None, config=None):
6037
+ bcc_recycle_flag=None, cds_attribute_active=None,
6038
+ client_token=None, config=None):
5933
6039
  """
5934
6040
  batch delete instance with related resource
5935
6041
 
@@ -5974,6 +6080,8 @@ class BccClient(bce_base_client.BceBaseClient):
5974
6080
  body['deleteRelatedEnisFlag'] = delete_related_enis_flag
5975
6081
  if bcc_recycle_flag is not None:
5976
6082
  body['bccRecycleFlag'] = bcc_recycle_flag
6083
+ if bcc_recycle_flag is not None:
6084
+ body['cdsAttributeActive'] = cds_attribute_active
5977
6085
  return self._send_request(http_methods.POST, path, body=json.dumps(body), params=params, config=config)
5978
6086
 
5979
6087
  def batch_start_instance(self, instance_ids, client_token=None, config=None):
@@ -70,11 +70,12 @@ class CreateCdsModel(object):
70
70
  param: encryptKey
71
71
  """
72
72
 
73
- def __init__(self, cdsSizeInGB=None, storageType='hp1', snapshotId=None, encryptKey=None):
73
+ def __init__(self, cdsSizeInGB=None, storageType='hp1', snapshotId=None, encryptKey=None, deleteWithInstance=None):
74
74
  self.cdsSizeInGB = cdsSizeInGB
75
75
  self.storageType = storageType
76
76
  self.snapshotId = snapshotId
77
77
  self.encryptKey = encryptKey
78
+ self.deleteWithInstance = deleteWithInstance
78
79
 
79
80
 
80
81
  class SecurityGroupRuleModel(object):
@@ -263,7 +263,6 @@ class EsgClient(bce_base_client.BceBaseClient):
263
263
  enterprise_security_group_rule_id = compat.convert_to_bytes(enterprise_security_group_rule_id)
264
264
  path = b'/enterprise/security/rule/%s' % enterprise_security_group_rule_id
265
265
  body = {
266
- 'enterpriseSecurityGroupRuleId': enterprise_security_group_rule_id,
267
266
  'remark': remark,
268
267
  'protocol': protocol,
269
268
  'portRange': portrange,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bce-python-sdk
3
- Version: 0.9.56
3
+ Version: 0.9.57
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=kixuhoe_lgi7nLAcTII5P-f4D7QkQq59WQ4cELdLVmw,813
1
+ baidubce/__init__.py,sha256=66DG7uYOPC5u0nJ383X0SiLTg2IrEMkeaoYGcUI6Svo,813
2
2
  baidubce/bce_base_client.py,sha256=7gjkRy_YlTTb6TXHYHyZRYMjdVO7FTtHMdwXx8bPgsE,3428
3
3
  baidubce/bce_client_configuration.py,sha256=i9z5wVXaRSlJxE0LD1odexza35KQyFy7m1Az5XclD_I,3252
4
4
  baidubce/bce_response.py,sha256=gOj48U6iurYJsChzFdrB7Rj3RpkU-fUdhtftrIj9o8U,1985
@@ -51,8 +51,8 @@ baidubce/services/bbc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
51
51
  baidubce/services/bbc/bbc_client.py,sha256=6x2fWmjyKSZ02WvsmQ1pryE0c_mtXHCjI0Ev80MfzbY,38951
52
52
  baidubce/services/bbc/bbc_model.py,sha256=Dy80LZ4ro_iS3UejJ_CL9kI7OyMSBoDitTE4J1XAC_g,1790
53
53
  baidubce/services/bcc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
- baidubce/services/bcc/bcc_client.py,sha256=cOC9ZC9sIjXyfmdBl7BAJGMPNjuVQjZak5x0uGybCv0,295590
55
- baidubce/services/bcc/bcc_model.py,sha256=iUDhNKMw0b_efjeIHEkvLMIph9MmVODOAdgmAzKL2ns,6710
54
+ baidubce/services/bcc/bcc_client.py,sha256=1XTHkkhgd59F6tEMNiniqTop0TytZiKW8lGsiTbdwlc,299976
55
+ baidubce/services/bcc/bcc_model.py,sha256=xKYC4Z-gxWjFhe8b1AmMBEN_wYhnwcqAmer29ysS17k,6788
56
56
  baidubce/services/bcc/fpga_card_type.py,sha256=n6goqnapIgAC9_sciA_2he5HFqPRbRv109qitO7qpd8,948
57
57
  baidubce/services/bcc/gpu_card_type.py,sha256=HEfMzne-UC5F295JPrPUu7V9F5g-hbXF2TNBontEFes,1054
58
58
  baidubce/services/bcm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -122,7 +122,7 @@ baidubce/services/eni/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
122
122
  baidubce/services/eni/eni_client.py,sha256=6V7uKaJxO0oPXpOwPzJ2oR9J_6pP-PxfBMp5tB1tfpE,27573
123
123
  baidubce/services/eni/eni_model.py,sha256=YQzPCcUdf6AkAEkHwShC9lYC0uVRweC7_s5b6BVuySg,1165
124
124
  baidubce/services/esg/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
125
- baidubce/services/esg/esg_client.py,sha256=zzXu4g9Fk9Y5t4dgxKCYgR8oY_uyuOhhpOxcHQwr7Sg,13202
125
+ baidubce/services/esg/esg_client.py,sha256=3yZ2V98mc0QxTYRtmMxERl9NjmRilF8c3-feOfB3AGY,13122
126
126
  baidubce/services/esg/esg_model.py,sha256=TNf5J7ZdDBa4fKD40qA8mHewxXK6YvvPqYkZth4sEJw,3646
127
127
  baidubce/services/et/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
128
128
  baidubce/services/et/et_client.py,sha256=skz620Hdk8c8mS1hkDbWAekvfWVytqkgb5AMeK0sDFw,34426
@@ -198,7 +198,7 @@ baidubce/services/vpc/vpc_client.py,sha256=Cdg009gZdI1gPgGy08-kIOxT3_VvuQoPqI_82
198
198
  baidubce/services/vpn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
199
199
  baidubce/services/vpn/vpn_client.py,sha256=rrnQElD-LTttsqMbbIHoHK0Jdc7FrVVTZIdu-0Zthr8,31352
200
200
  baidubce/services/vpn/vpn_model.py,sha256=C9rEBYyFIDjrqvqJG4WEin6qVzEIvbhPvT5KwDYm1qA,3365
201
- bce_python_sdk-0.9.56.dist-info/METADATA,sha256=O-sRg16kAXYjNcbrqzGWDLFPifXYsBWdR5Szn0mBkRI,416
202
- bce_python_sdk-0.9.56.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
203
- bce_python_sdk-0.9.56.dist-info/top_level.txt,sha256=Oh6eo_-T_AuEDpIaR54biUUPThxsoQiYMVHLBTaweQs,9
204
- bce_python_sdk-0.9.56.dist-info/RECORD,,
201
+ bce_python_sdk-0.9.57.dist-info/METADATA,sha256=jH5Rp2qmBgTU2wbZe5IiIuPtks8vv74AvqZfhT-yp_M,416
202
+ bce_python_sdk-0.9.57.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
203
+ bce_python_sdk-0.9.57.dist-info/top_level.txt,sha256=Oh6eo_-T_AuEDpIaR54biUUPThxsoQiYMVHLBTaweQs,9
204
+ bce_python_sdk-0.9.57.dist-info/RECORD,,