bce-python-sdk 0.9.60__py3-none-any.whl → 0.9.64__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/auth/bce_v1_signer.py +3 -0
- baidubce/services/aihc/modules/job/job_client.py +3 -0
- baidubce/services/bcc/bcc_client.py +268 -55
- baidubce/services/blb/app_blb_client.py +400 -67
- baidubce/services/blb/blb_client.py +237 -34
- baidubce/services/blb/user_service_client.py +13 -48
- baidubce/services/eip/eip_bp_client.py +10 -1
- baidubce/services/eip/eip_client.py +369 -9
- baidubce/services/eip/eip_group_client.py +59 -15
- baidubce/services/eip/eip_tp_client.py +54 -0
- baidubce/services/eni/eni_client.py +20 -48
- baidubce/services/esg/esg_client.py +72 -16
- baidubce/services/esg/esg_model.py +14 -1
- baidubce/services/ipv6gateway/ipv6gateway_client.py +62 -1
- baidubce/services/lbdc/lbdc_client.py +2 -4
- baidubce/services/route/route_client.py +5 -5
- baidubce/services/vpc/vpc_client.py +61 -11
- {bce_python_sdk-0.9.60.dist-info → bce_python_sdk-0.9.64.dist-info}/METADATA +1 -1
- {bce_python_sdk-0.9.60.dist-info → bce_python_sdk-0.9.64.dist-info}/RECORD +22 -22
- {bce_python_sdk-0.9.60.dist-info → bce_python_sdk-0.9.64.dist-info}/WHEEL +1 -1
- {bce_python_sdk-0.9.60.dist-info → bce_python_sdk-0.9.64.dist-info}/top_level.txt +0 -0
baidubce/__init__.py
CHANGED
baidubce/auth/bce_v1_signer.py
CHANGED
|
@@ -38,6 +38,9 @@ def _get_canonical_headers(headers, headers_to_sign=None):
|
|
|
38
38
|
for k in headers:
|
|
39
39
|
k_lower = k.strip().lower()
|
|
40
40
|
value = utils.convert_to_standard_string(headers[k]).strip()
|
|
41
|
+
# 值为空字符的header不参与签名计算
|
|
42
|
+
if not value:
|
|
43
|
+
continue
|
|
41
44
|
if k_lower.startswith(http_headers.BCE_PREFIX) \
|
|
42
45
|
or k_lower in headers_to_sign:
|
|
43
46
|
str_tmp = b"%s:%s" % (utils.normalize_string(k_lower), utils.normalize_string(value))
|
|
@@ -536,6 +536,7 @@ class JobClient(AIHCBaseClient):
|
|
|
536
536
|
def DescribeJobMetrics(
|
|
537
537
|
self,
|
|
538
538
|
resourcePoolId,
|
|
539
|
+
queueID,
|
|
539
540
|
jobId,
|
|
540
541
|
metricType,
|
|
541
542
|
startTime=None,
|
|
@@ -550,6 +551,7 @@ class JobClient(AIHCBaseClient):
|
|
|
550
551
|
|
|
551
552
|
Args:
|
|
552
553
|
resourcePoolId: 注意区分资源池类型,自运维资源池传递资源池唯一标识(示例:cce-1uji3ib5),托管资源池固定传递 aihc-serverless(必填)
|
|
554
|
+
queueID: 任务所属队列,通用资源池须填入队列名称,托管资源池须填入队列Id(必填,Query参数)
|
|
553
555
|
jobId: 任务ID(必填,Body参数)
|
|
554
556
|
metricType: 查询监控数据的指标类型(必填,Body参数)
|
|
555
557
|
startTime: 开始时间,Unix时间格式(可选,Body参数)
|
|
@@ -568,6 +570,7 @@ class JobClient(AIHCBaseClient):
|
|
|
568
570
|
params = {
|
|
569
571
|
'action': 'DescribeJobMetrics',
|
|
570
572
|
'resourcePoolId': resourcePoolId,
|
|
573
|
+
'queueID': queueID,
|
|
571
574
|
}
|
|
572
575
|
|
|
573
576
|
body = {
|
|
@@ -1875,10 +1875,11 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
1875
1875
|
|
|
1876
1876
|
@required(instance_id=(bytes, str),
|
|
1877
1877
|
tags=list)
|
|
1878
|
-
def bind_instance_to_tags(self, instance_id, tags, config=None):
|
|
1878
|
+
def bind_instance_to_tags(self, instance_id, tags, attachRelatedResourceTag, config=None):
|
|
1879
1879
|
"""
|
|
1880
1880
|
:param instance_id:
|
|
1881
1881
|
:param tags:
|
|
1882
|
+
:param attachRelatedResourceTag
|
|
1882
1883
|
:param config:
|
|
1883
1884
|
:return:
|
|
1884
1885
|
"""
|
|
@@ -1886,7 +1887,8 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
1886
1887
|
path = b'/instance/%s/tag' % instance_id
|
|
1887
1888
|
tag_list = [tag.__dict__ for tag in tags]
|
|
1888
1889
|
body = {
|
|
1889
|
-
'changeTags': tag_list
|
|
1890
|
+
'changeTags': tag_list,
|
|
1891
|
+
'attachRelatedResourceTag': attachRelatedResourceTag
|
|
1890
1892
|
}
|
|
1891
1893
|
params = {
|
|
1892
1894
|
'bind': None
|
|
@@ -1896,10 +1898,11 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
1896
1898
|
|
|
1897
1899
|
@required(instance_id=(bytes, str),
|
|
1898
1900
|
tags=list)
|
|
1899
|
-
def unbind_instance_from_tags(self, instance_id, tags, config=None):
|
|
1901
|
+
def unbind_instance_from_tags(self, instance_id, tags, attachRelatedResourceTag, config=None):
|
|
1900
1902
|
"""
|
|
1901
1903
|
:param instance_id:
|
|
1902
1904
|
:param tags:
|
|
1905
|
+
:param attachRelatedResourceTag
|
|
1903
1906
|
:param config:
|
|
1904
1907
|
:return:
|
|
1905
1908
|
"""
|
|
@@ -1907,7 +1910,8 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
1907
1910
|
path = b'/instance/%s/tag' % instance_id
|
|
1908
1911
|
tag_list = [tag.__dict__ for tag in tags]
|
|
1909
1912
|
body = {
|
|
1910
|
-
'changeTags': tag_list
|
|
1913
|
+
'changeTags': tag_list,
|
|
1914
|
+
'attachRelatedResourceTag': attachRelatedResourceTag
|
|
1911
1915
|
}
|
|
1912
1916
|
params = {
|
|
1913
1917
|
'unbind': None
|
|
@@ -2469,7 +2473,7 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
2469
2473
|
@required(volume_id=(bytes, str), # ***Unicode***
|
|
2470
2474
|
new_cds_size=int)
|
|
2471
2475
|
def resize_volume(self, volume_id, new_cds_size, new_volume_type,
|
|
2472
|
-
client_token=None, config=None):
|
|
2476
|
+
client_token=None, config=None, new_extra_io=None):
|
|
2473
2477
|
"""
|
|
2474
2478
|
Resizing the specified volume with newly size.
|
|
2475
2479
|
You can resize the specified volume only when the volume is Available,
|
|
@@ -2499,6 +2503,10 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
2499
2503
|
https://bce.baidu.com/doc/BCC/API.html#.E5.B9.82.E7.AD.89.E6.80.A7
|
|
2500
2504
|
:type client_token: string
|
|
2501
2505
|
|
|
2506
|
+
:param new_extra_io:
|
|
2507
|
+
The number of adjusted additional IOPS, supporting configuration upgrade and downgrade.
|
|
2508
|
+
:type new_extra_io: int
|
|
2509
|
+
|
|
2502
2510
|
:return:
|
|
2503
2511
|
:rtype baidubce.bce_response.BceResponse
|
|
2504
2512
|
"""
|
|
@@ -2509,6 +2517,8 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
2509
2517
|
}
|
|
2510
2518
|
if new_volume_type is not None:
|
|
2511
2519
|
body['newVolumeType'] = new_volume_type
|
|
2520
|
+
if new_extra_io is not None:
|
|
2521
|
+
body['newExtraIO'] = new_extra_io
|
|
2512
2522
|
params = None
|
|
2513
2523
|
if client_token is None:
|
|
2514
2524
|
params = {
|
|
@@ -3253,8 +3263,8 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
3253
3263
|
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
3254
3264
|
params=params, config=config)
|
|
3255
3265
|
|
|
3256
|
-
def list_security_groups(self, instance_id=None, vpc_id=None,
|
|
3257
|
-
config=None):
|
|
3266
|
+
def list_security_groups(self, instance_id=None, vpc_id=None, security_group_id=None, security_group_ids=None,
|
|
3267
|
+
marker=None, max_keys=None, config=None):
|
|
3258
3268
|
"""
|
|
3259
3269
|
Listing SecurityGroup owned by the authenticated user.
|
|
3260
3270
|
|
|
@@ -3267,6 +3277,10 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
3267
3277
|
filter by vpcId, optional parameter
|
|
3268
3278
|
:type vpc_id: string
|
|
3269
3279
|
|
|
3280
|
+
:param security_group_id:
|
|
3281
|
+
filter by securityGroupId, optional parameter
|
|
3282
|
+
:type security_group_id: string
|
|
3283
|
+
|
|
3270
3284
|
:param security_group_ids:
|
|
3271
3285
|
filter by securityGroupIds, optional parameter
|
|
3272
3286
|
:type security_group_ids: string
|
|
@@ -3298,6 +3312,8 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
3298
3312
|
params['marker'] = marker
|
|
3299
3313
|
if max_keys is not None:
|
|
3300
3314
|
params['maxKeys'] = max_keys
|
|
3315
|
+
if security_group_id is not None:
|
|
3316
|
+
params['securityGroupId'] = security_group_id
|
|
3301
3317
|
|
|
3302
3318
|
return self._send_request(http_methods.GET, path,
|
|
3303
3319
|
params=params, config=config)
|
|
@@ -3321,7 +3337,7 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
3321
3337
|
@required(security_group_id=(bytes, str), # ***Unicode***
|
|
3322
3338
|
rule=bcc_model.SecurityGroupRuleModel)
|
|
3323
3339
|
def authorize_security_group_rule(self, security_group_id, rule, client_token=None,
|
|
3324
|
-
config=None):
|
|
3340
|
+
sg_version=None, config=None):
|
|
3325
3341
|
"""
|
|
3326
3342
|
authorize a security group rule to the specified security group
|
|
3327
3343
|
|
|
@@ -3343,6 +3359,10 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
3343
3359
|
https://bce.baidu.com/doc/BCC/API.html#.E5.B9.82.E7.AD.89.E6.80.A7
|
|
3344
3360
|
:type client_token: string
|
|
3345
3361
|
|
|
3362
|
+
:param sg_version:
|
|
3363
|
+
Security group version number for optimistic locking.
|
|
3364
|
+
:type sg_version: int
|
|
3365
|
+
|
|
3346
3366
|
:return:
|
|
3347
3367
|
:rtype baidubce.bce_response.BceResponse
|
|
3348
3368
|
"""
|
|
@@ -3353,6 +3373,8 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
3353
3373
|
params['clientToken'] = generate_client_token()
|
|
3354
3374
|
else:
|
|
3355
3375
|
params['clientToken'] = client_token
|
|
3376
|
+
if sg_version is not None:
|
|
3377
|
+
params['sgVersion'] = sg_version
|
|
3356
3378
|
body = {
|
|
3357
3379
|
'rule': rule.__dict__
|
|
3358
3380
|
}
|
|
@@ -3362,7 +3384,7 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
3362
3384
|
|
|
3363
3385
|
@required(security_group_id=(bytes, str), # ***Unicode***
|
|
3364
3386
|
rule=bcc_model.SecurityGroupRuleModel)
|
|
3365
|
-
def revoke_security_group_rule(self, security_group_id, rule, client_token=None, config=None):
|
|
3387
|
+
def revoke_security_group_rule(self, security_group_id, rule, client_token=None, sg_version=None, config=None):
|
|
3366
3388
|
"""
|
|
3367
3389
|
revoke a security group rule from the specified security group
|
|
3368
3390
|
:param security_group_id:
|
|
@@ -3380,6 +3402,9 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
3380
3402
|
See more detail at
|
|
3381
3403
|
https://bce.baidu.com/doc/BCC/API.html#.E5.B9.82.E7.AD.89.E6.80.A7
|
|
3382
3404
|
:type client_token: string
|
|
3405
|
+
:param sg_version:
|
|
3406
|
+
Security group version number for optimistic locking.
|
|
3407
|
+
:type sg_version: int
|
|
3383
3408
|
:return:
|
|
3384
3409
|
:rtype baidubce.bce_response.BceResponse
|
|
3385
3410
|
"""
|
|
@@ -3390,6 +3415,8 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
3390
3415
|
params['clientToken'] = generate_client_token()
|
|
3391
3416
|
else:
|
|
3392
3417
|
params['clientToken'] = client_token
|
|
3418
|
+
if sg_version is not None:
|
|
3419
|
+
params['sgVersion'] = sg_version
|
|
3393
3420
|
body = {
|
|
3394
3421
|
'rule': rule.__dict__
|
|
3395
3422
|
}
|
|
@@ -3399,16 +3426,17 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
3399
3426
|
|
|
3400
3427
|
def update_security_group_rule(self, security_group_rule_id,
|
|
3401
3428
|
remark=None,
|
|
3402
|
-
direction=None,
|
|
3403
3429
|
protocol=None,
|
|
3404
3430
|
portrange=None,
|
|
3405
3431
|
source_ip=None,
|
|
3406
3432
|
sourcegroup_id=None,
|
|
3407
3433
|
dest_ip=None,
|
|
3408
3434
|
destgroup_id=None,
|
|
3409
|
-
|
|
3435
|
+
sg_version=None,
|
|
3436
|
+
client_token=None,
|
|
3437
|
+
config=None,):
|
|
3410
3438
|
"""
|
|
3411
|
-
|
|
3439
|
+
update a security group rule from the specified security group
|
|
3412
3440
|
:param security_group_rule_id:
|
|
3413
3441
|
security group rule id.
|
|
3414
3442
|
:param: remark:
|
|
@@ -3431,35 +3459,60 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
3431
3459
|
Only works for direction = "egress".
|
|
3432
3460
|
:param: destgroup_id:
|
|
3433
3461
|
The destination security group id. Cannot coexist with destIP.
|
|
3434
|
-
:param
|
|
3435
|
-
|
|
3462
|
+
:param sg_version:
|
|
3463
|
+
Security group version number for optimistic locking.
|
|
3464
|
+
:type sg_version: int
|
|
3465
|
+
:param client_token:
|
|
3466
|
+
An ASCII string whose length is less than 64.
|
|
3467
|
+
The request will be idempotent if client token is provided.
|
|
3468
|
+
:type client_token: string
|
|
3436
3469
|
:param config:
|
|
3437
3470
|
:type config: baidubce.BceClientConfiguration
|
|
3438
3471
|
:return:
|
|
3439
3472
|
:rtype baidubce.bce_response.BceResponse
|
|
3440
3473
|
"""
|
|
3441
3474
|
path = b'/securityGroup/rule/update'
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
'
|
|
3445
|
-
|
|
3446
|
-
'
|
|
3447
|
-
|
|
3448
|
-
'
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3475
|
+
params = {}
|
|
3476
|
+
if sg_version is not None:
|
|
3477
|
+
params['sgVersion'] = sg_version
|
|
3478
|
+
if client_token is None:
|
|
3479
|
+
params['clientToken'] = generate_client_token()
|
|
3480
|
+
else:
|
|
3481
|
+
params['clientToken'] = client_token
|
|
3482
|
+
|
|
3483
|
+
body = {'securityGroupRuleId': security_group_rule_id}
|
|
3484
|
+
if remark is not None:
|
|
3485
|
+
body['remark'] = remark
|
|
3486
|
+
if protocol is not None:
|
|
3487
|
+
body['protocol'] = protocol
|
|
3488
|
+
if portrange is not None:
|
|
3489
|
+
body['portRange'] = portrange
|
|
3490
|
+
if source_ip is not None:
|
|
3491
|
+
body['sourceIp'] = source_ip
|
|
3492
|
+
if sourcegroup_id is not None:
|
|
3493
|
+
body['sourceGroupId'] = sourcegroup_id
|
|
3494
|
+
if dest_ip is not None:
|
|
3495
|
+
body['destIp'] = dest_ip
|
|
3496
|
+
if destgroup_id is not None:
|
|
3497
|
+
body['destGroupId'] = destgroup_id
|
|
3498
|
+
|
|
3453
3499
|
return self._send_request(http_methods.PUT, path, json.dumps(body),
|
|
3454
|
-
params=None, config=config)
|
|
3500
|
+
params=params if params else None, config=config)
|
|
3455
3501
|
|
|
3456
3502
|
@required(security_group_rule_id=(bytes, str)) # ***Unicode***
|
|
3457
|
-
def delete_security_group_rule(self, security_group_rule_id, config=None):
|
|
3503
|
+
def delete_security_group_rule(self, security_group_rule_id, sg_version=None, client_token=None, config=None):
|
|
3458
3504
|
"""
|
|
3459
3505
|
delete a security group rule from the specified security group
|
|
3460
3506
|
:param security_group_rule_id:
|
|
3461
3507
|
The id of SecurityGroupRule that will be deleted.
|
|
3462
|
-
:type
|
|
3508
|
+
:type security_group_rule_id: string
|
|
3509
|
+
:param sg_version:
|
|
3510
|
+
Security group version number for optimistic locking.
|
|
3511
|
+
:type sg_version: int
|
|
3512
|
+
:param client_token:
|
|
3513
|
+
An ASCII string whose length is less than 64.
|
|
3514
|
+
The request will be idempotent if client token is provided.
|
|
3515
|
+
:type client_token: string
|
|
3463
3516
|
:param config:
|
|
3464
3517
|
:type config: baidubce.BceClientConfiguration
|
|
3465
3518
|
:return:
|
|
@@ -3467,7 +3520,14 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
3467
3520
|
"""
|
|
3468
3521
|
security_group_rule_id = compat.convert_to_bytes(security_group_rule_id)
|
|
3469
3522
|
path = b'/securityGroup/rule/%s' % security_group_rule_id
|
|
3470
|
-
|
|
3523
|
+
params = {}
|
|
3524
|
+
if sg_version is not None:
|
|
3525
|
+
params['sgVersion'] = sg_version
|
|
3526
|
+
if client_token is None:
|
|
3527
|
+
params['clientToken'] = generate_client_token()
|
|
3528
|
+
else:
|
|
3529
|
+
params['clientToken'] = client_token
|
|
3530
|
+
return self._send_request(http_methods.DELETE, path, params=params if params else None, config=config)
|
|
3471
3531
|
|
|
3472
3532
|
@required(security_group_id=(bytes, str)) # ***Unicode***
|
|
3473
3533
|
def get_security_group_detail(self, security_group_id, config=None):
|
|
@@ -7136,6 +7196,95 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
7136
7196
|
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
7137
7197
|
params=params, config=config)
|
|
7138
7198
|
|
|
7199
|
+
def create_snapshot_share(self, snapshot_id, account_ids, client_token=None, config=None):
|
|
7200
|
+
"""
|
|
7201
|
+
Create a share link for the specified snapshot.
|
|
7202
|
+
|
|
7203
|
+
:param snapshot_id:
|
|
7204
|
+
Snapshot id.
|
|
7205
|
+
:type snapshot_id: string
|
|
7206
|
+
|
|
7207
|
+
:param account_ids:
|
|
7208
|
+
Account ids that can access the snapshot.
|
|
7209
|
+
:type account_ids: list
|
|
7210
|
+
|
|
7211
|
+
:return:
|
|
7212
|
+
:rtype baidubce.bce_response.BceResponse
|
|
7213
|
+
"""
|
|
7214
|
+
path = b'/snapshot/share'
|
|
7215
|
+
params = {}
|
|
7216
|
+
if client_token is None:
|
|
7217
|
+
params['clientToken'] = generate_client_token()
|
|
7218
|
+
else:
|
|
7219
|
+
params['clientToken'] = client_token
|
|
7220
|
+
body = {
|
|
7221
|
+
'snapshotId': snapshot_id,
|
|
7222
|
+
'accountIds': account_ids
|
|
7223
|
+
}
|
|
7224
|
+
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
7225
|
+
params=params, config=config)
|
|
7226
|
+
|
|
7227
|
+
def cancel_snapshot_share(self, source_snapshot_id, account_ids, share_snapshot_id, client_token=None, config=None):
|
|
7228
|
+
"""
|
|
7229
|
+
Cancel a share link for the specified snapshot.
|
|
7230
|
+
|
|
7231
|
+
:param source_snapshot_id:
|
|
7232
|
+
Source snapshot id.
|
|
7233
|
+
:type source_snapshot_id: string
|
|
7234
|
+
|
|
7235
|
+
:param account_ids:
|
|
7236
|
+
Account ids that can access the snapshot.
|
|
7237
|
+
:type account_ids: list
|
|
7238
|
+
|
|
7239
|
+
:param share_snapshot_id:
|
|
7240
|
+
Share snapshot id.
|
|
7241
|
+
:type share_snapshot_id: string
|
|
7242
|
+
|
|
7243
|
+
:return:
|
|
7244
|
+
:rtype baidubce.bce_response.BceResponse
|
|
7245
|
+
"""
|
|
7246
|
+
path = b'/snapshot/unShare'
|
|
7247
|
+
params = {}
|
|
7248
|
+
if client_token is None:
|
|
7249
|
+
params['clientToken'] = generate_client_token()
|
|
7250
|
+
else:
|
|
7251
|
+
params['clientToken'] = client_token
|
|
7252
|
+
body = {
|
|
7253
|
+
'sourceSnapshotId': source_snapshot_id,
|
|
7254
|
+
'accountIds': account_ids,
|
|
7255
|
+
'shareSnapshotId': share_snapshot_id
|
|
7256
|
+
}
|
|
7257
|
+
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
7258
|
+
params=params, config=config)
|
|
7259
|
+
|
|
7260
|
+
def list_snapshot_share(self, marker, max_keys, client_token=None, config=None):
|
|
7261
|
+
"""
|
|
7262
|
+
List all snapshots shared with you.
|
|
7263
|
+
|
|
7264
|
+
:param marker:
|
|
7265
|
+
The marker used for pagination.
|
|
7266
|
+
:type marker: string
|
|
7267
|
+
|
|
7268
|
+
:param max_keys:
|
|
7269
|
+
Maximum number of results returned per request.
|
|
7270
|
+
:type max_keys: int
|
|
7271
|
+
|
|
7272
|
+
:return:
|
|
7273
|
+
:rtype baidubce.bce_response.BceResponse
|
|
7274
|
+
"""
|
|
7275
|
+
path = b'/snapshot/snapshotShare/list'
|
|
7276
|
+
params = {}
|
|
7277
|
+
if client_token is None:
|
|
7278
|
+
params['clientToken'] = generate_client_token()
|
|
7279
|
+
else:
|
|
7280
|
+
params['clientToken'] = client_token
|
|
7281
|
+
body = {
|
|
7282
|
+
'marker': marker,
|
|
7283
|
+
'maxKeys': max_keys
|
|
7284
|
+
}
|
|
7285
|
+
return self._send_request(http_methods.POST, path, json.dumps(body), params=params, config=config)
|
|
7286
|
+
|
|
7287
|
+
|
|
7139
7288
|
def enter_rescue_mode(self, instance_id, force_stop, password, client_token=None, config=None):
|
|
7140
7289
|
"""
|
|
7141
7290
|
进入救援模式。
|
|
@@ -7873,6 +8022,96 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
7873
8022
|
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
7874
8023
|
params=params, config=config)
|
|
7875
8024
|
|
|
8025
|
+
def get_cds_price(self, purchase_length, payment_timing, storage_type, cds_size_in_gb, purchase_count, zone_name,
|
|
8026
|
+
encrypt_key=None, client_token=None, config=None):
|
|
8027
|
+
"""
|
|
8028
|
+
get_deploy_set
|
|
8029
|
+
"""
|
|
8030
|
+
path = b'/volume/getPrice'
|
|
8031
|
+
params = {}
|
|
8032
|
+
if client_token is None:
|
|
8033
|
+
params['clientToken'] = generate_client_token()
|
|
8034
|
+
else:
|
|
8035
|
+
params['clientToken'] = client_token
|
|
8036
|
+
body = {
|
|
8037
|
+
'purchaseLength': purchase_length,
|
|
8038
|
+
'paymentTiming': payment_timing,
|
|
8039
|
+
'storageType': storage_type,
|
|
8040
|
+
'cdsSizeInGB': cds_size_in_gb,
|
|
8041
|
+
'purchaseCount': purchase_count,
|
|
8042
|
+
'zoneName': zone_name
|
|
8043
|
+
}
|
|
8044
|
+
if encrypt_key is not None:
|
|
8045
|
+
body['encryptKey'] = encrypt_key
|
|
8046
|
+
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
8047
|
+
params=params, config=config)
|
|
8048
|
+
|
|
8049
|
+
def get_diagnostic_schemas(self, config=None):
|
|
8050
|
+
"""
|
|
8051
|
+
get_deploy_set
|
|
8052
|
+
"""
|
|
8053
|
+
path = b'/instance/diagnosticReport/schemas'
|
|
8054
|
+
return self._send_request(http_methods.GET, path, config=config)
|
|
8055
|
+
|
|
8056
|
+
def list_diagnostic_report(self, report_id, instance_id, status,
|
|
8057
|
+
severity, instance_type="bcc", max_keys=100, client_token=None, config=None):
|
|
8058
|
+
"""
|
|
8059
|
+
list_diagnostic_report
|
|
8060
|
+
"""
|
|
8061
|
+
path = b'/instance/diagnosticReport/list'
|
|
8062
|
+
params = {}
|
|
8063
|
+
if client_token is None:
|
|
8064
|
+
params['clientToken'] = generate_client_token()
|
|
8065
|
+
else:
|
|
8066
|
+
params['clientToken'] = client_token
|
|
8067
|
+
body = {
|
|
8068
|
+
'maxKeys': max_keys,
|
|
8069
|
+
'reportId': report_id,
|
|
8070
|
+
'instanceType': instance_type,
|
|
8071
|
+
'instanceId': instance_id,
|
|
8072
|
+
'status': status,
|
|
8073
|
+
'severity': severity
|
|
8074
|
+
}
|
|
8075
|
+
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
8076
|
+
params=params, config=config)
|
|
8077
|
+
|
|
8078
|
+
def create_diagnostic(self, metric_set_id, instance_id, pid, instance_type="bcc", duration=180,
|
|
8079
|
+
client_token=None, config=None):
|
|
8080
|
+
"""
|
|
8081
|
+
create_diagnostic
|
|
8082
|
+
"""
|
|
8083
|
+
path = b'/instance/diagnosticReport/create'
|
|
8084
|
+
params = {}
|
|
8085
|
+
if client_token is None:
|
|
8086
|
+
params['clientToken'] = generate_client_token()
|
|
8087
|
+
else:
|
|
8088
|
+
params['clientToken'] = client_token
|
|
8089
|
+
body = {
|
|
8090
|
+
'metricSetId': metric_set_id,
|
|
8091
|
+
'instanceType': instance_type,
|
|
8092
|
+
'instanceId': instance_id,
|
|
8093
|
+
'pid': pid,
|
|
8094
|
+
'duration': duration
|
|
8095
|
+
}
|
|
8096
|
+
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
8097
|
+
params=params, config=config)
|
|
8098
|
+
|
|
8099
|
+
def delete_diagnostic_report(self, report_ids, client_token=None, config=None):
|
|
8100
|
+
"""
|
|
8101
|
+
delete_diagnostic_report
|
|
8102
|
+
"""
|
|
8103
|
+
path = b'/instance/diagnosticReport/delete'
|
|
8104
|
+
params = {}
|
|
8105
|
+
if client_token is None:
|
|
8106
|
+
params['clientToken'] = generate_client_token()
|
|
8107
|
+
else:
|
|
8108
|
+
params['clientToken'] = client_token
|
|
8109
|
+
body = {
|
|
8110
|
+
'reportIds': report_ids
|
|
8111
|
+
}
|
|
8112
|
+
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
8113
|
+
params=params, config=config)
|
|
8114
|
+
|
|
7876
8115
|
|
|
7877
8116
|
def generate_client_token_by_uuid():
|
|
7878
8117
|
"""
|
|
@@ -7894,30 +8133,4 @@ def generate_client_token_by_random():
|
|
|
7894
8133
|
client_token = ''.join(random.sample(string.ascii_letters + string.digits, 36))
|
|
7895
8134
|
return client_token
|
|
7896
8135
|
|
|
7897
|
-
|
|
7898
|
-
def get_cds_price(self, purchase_length, payment_timing, storage_type, cds_size_in_gb, purchase_count, zone_name,
|
|
7899
|
-
encrypt_key=None, client_token=None, config=None):
|
|
7900
|
-
"""
|
|
7901
|
-
get_deploy_set
|
|
7902
|
-
"""
|
|
7903
|
-
path = b'/volume/getPrice'
|
|
7904
|
-
params = {}
|
|
7905
|
-
if client_token is None:
|
|
7906
|
-
params['clientToken'] = generate_client_token()
|
|
7907
|
-
else:
|
|
7908
|
-
params['clientToken'] = client_token
|
|
7909
|
-
body = {
|
|
7910
|
-
'purchaseLength': purchase_length,
|
|
7911
|
-
'paymentTiming': payment_timing,
|
|
7912
|
-
'storageType': storage_type,
|
|
7913
|
-
'cdsSizeInGB': cds_size_in_gb,
|
|
7914
|
-
'purchaseCount': purchase_count,
|
|
7915
|
-
'zoneName': zone_name
|
|
7916
|
-
}
|
|
7917
|
-
if encrypt_key is not None:
|
|
7918
|
-
body['encryptKey'] = encrypt_key
|
|
7919
|
-
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
7920
|
-
params=params, config=config)
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
8136
|
generate_client_token = generate_client_token_by_uuid
|