bce-python-sdk 0.9.5__py3-none-any.whl → 0.9.6__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/services/bcc/bcc_client.py +31 -5
- baidubce/services/bcm/bcm_client.py +269 -29
- {bce_python_sdk-0.9.5.dist-info → bce_python_sdk-0.9.6.dist-info}/METADATA +1 -1
- {bce_python_sdk-0.9.5.dist-info → bce_python_sdk-0.9.6.dist-info}/RECORD +7 -7
- {bce_python_sdk-0.9.5.dist-info → bce_python_sdk-0.9.6.dist-info}/WHEEL +1 -1
- {bce_python_sdk-0.9.5.dist-info → bce_python_sdk-0.9.6.dist-info}/top_level.txt +0 -0
baidubce/__init__.py
CHANGED
|
@@ -1780,7 +1780,7 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
1780
1780
|
description=None, renew_time_unit=None, renew_time=None,
|
|
1781
1781
|
cluster_id=None, relation_tag=False,
|
|
1782
1782
|
tags=None, auto_snapshot_policy=None,
|
|
1783
|
-
client_token=None, config=None):
|
|
1783
|
+
client_token=None, config=None, charge_type=None):
|
|
1784
1784
|
"""
|
|
1785
1785
|
Create a volume with the specified options.
|
|
1786
1786
|
You can use this method to create a new empty volume by specified options
|
|
@@ -1795,7 +1795,7 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
1795
1795
|
:type cds_size_in_gb: int
|
|
1796
1796
|
|
|
1797
1797
|
:param billing:
|
|
1798
|
-
Billing information.
|
|
1798
|
+
Billing information.Deprecated
|
|
1799
1799
|
:type billing: bcc_model.Billing
|
|
1800
1800
|
|
|
1801
1801
|
:param purchase_count:
|
|
@@ -1855,6 +1855,17 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
1855
1855
|
The optional auto snapshot policy to be bonded.
|
|
1856
1856
|
:type auto_snapshot_policy: bcc_model.AutoSnapshotPolicyModel
|
|
1857
1857
|
|
|
1858
|
+
:param charge_type:
|
|
1859
|
+
The optional parameter to specify the payment for the volume.
|
|
1860
|
+
The billing type and payment method, including Prepaid and Postpaid,
|
|
1861
|
+
need to be specified only when the instanceId is not empty and the corresponding instance type is prepaid.
|
|
1862
|
+
If instanceId is empty:
|
|
1863
|
+
create a post payment type CDS;
|
|
1864
|
+
If the instanceId is not empty:
|
|
1865
|
+
If the instance is prepaid, a chargeType needs to be specified;
|
|
1866
|
+
If the instance is post paid, create a post paid CDS
|
|
1867
|
+
:type charge_type: menu{'Prepaid', 'Postpaid'}
|
|
1868
|
+
|
|
1858
1869
|
:return:
|
|
1859
1870
|
:rtype baidubce.bce_response.BceResponse
|
|
1860
1871
|
"""
|
|
@@ -1897,6 +1908,8 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
1897
1908
|
body['encryptKey'] = encrypt_key
|
|
1898
1909
|
if instance_id is not None:
|
|
1899
1910
|
body['instanceId'] = instance_id
|
|
1911
|
+
if charge_type is not None:
|
|
1912
|
+
body['chargeType'] = charge_type
|
|
1900
1913
|
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
1901
1914
|
params=params, config=config)
|
|
1902
1915
|
|
|
@@ -1907,7 +1920,7 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
1907
1920
|
description=None, renew_time_unit=None, renew_time=None,
|
|
1908
1921
|
cluster_id=None, relation_tag=False,
|
|
1909
1922
|
tags=None, auto_snapshot_policy=None,
|
|
1910
|
-
config=None):
|
|
1923
|
+
config=None, charge_type=None):
|
|
1911
1924
|
"""
|
|
1912
1925
|
Create a volume with the specified options.
|
|
1913
1926
|
You can use this method to create a new empty volume by specified options
|
|
@@ -1915,14 +1928,14 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
1915
1928
|
By using the cdsSizeInGB parameter you can create a newly empty volume.
|
|
1916
1929
|
By using snapshotId parameter to create a volume form specific snapshot.
|
|
1917
1930
|
|
|
1918
|
-
:param snapshot_id:
|
|
1931
|
+
:param snapshot_id:xx
|
|
1919
1932
|
The id of snapshot.
|
|
1920
1933
|
By specifying the snapshotId,
|
|
1921
1934
|
it will create volume from the specified snapshot and the parameter cdsSizeInGB will be ignored.
|
|
1922
1935
|
:type snapshot_id: string
|
|
1923
1936
|
|
|
1924
1937
|
:param billing:
|
|
1925
|
-
Billing information.
|
|
1938
|
+
Billing information.Deprecated
|
|
1926
1939
|
:type billing: bcc_model.Billing
|
|
1927
1940
|
|
|
1928
1941
|
:param purchase_count:
|
|
@@ -1982,6 +1995,17 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
1982
1995
|
https://bce.baidu.com/doc/BCC/API.html#.E5.B9.82.E7.AD.89.E6.80.A7
|
|
1983
1996
|
:type client_token: string
|
|
1984
1997
|
|
|
1998
|
+
:param charge_type:
|
|
1999
|
+
The optional parameter to specify the payment for the volume.
|
|
2000
|
+
The billing type and payment method, including Prepaid and Postpaid,
|
|
2001
|
+
need to be specified only when the instanceId is not empty and the corresponding instance type is prepaid.
|
|
2002
|
+
If instanceId is empty:
|
|
2003
|
+
create a post payment type CDS;
|
|
2004
|
+
If the instanceId is not empty:
|
|
2005
|
+
If the instance is prepaid, a chargeType needs to be specified;
|
|
2006
|
+
If the instance is post paid, create a post paid CDS
|
|
2007
|
+
:type charge_type: menu{'Prepaid', 'Postpaid'}
|
|
2008
|
+
|
|
1985
2009
|
:return:
|
|
1986
2010
|
:rtype baidubce.bce_response.BceResponse
|
|
1987
2011
|
"""
|
|
@@ -2024,6 +2048,8 @@ class BccClient(bce_base_client.BceBaseClient):
|
|
|
2024
2048
|
body['encryptKey'] = encrypt_key
|
|
2025
2049
|
if instance_id is not None:
|
|
2026
2050
|
body['instanceId'] = instance_id
|
|
2051
|
+
if charge_type is not None:
|
|
2052
|
+
body['chargeType'] = charge_type
|
|
2027
2053
|
return self._send_request(http_methods.POST, path, json.dumps(body),
|
|
2028
2054
|
params=params, config=config)
|
|
2029
2055
|
|
|
@@ -29,6 +29,8 @@ if sys.version_info[0] == 2:
|
|
|
29
29
|
else:
|
|
30
30
|
value_type = (str, bytes)
|
|
31
31
|
|
|
32
|
+
MAX_INSTANCE_NUMBER = 100
|
|
33
|
+
|
|
32
34
|
|
|
33
35
|
class BcmClient(bce_base_client.BceBaseClient):
|
|
34
36
|
"""
|
|
@@ -2924,7 +2926,6 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
2924
2926
|
}
|
|
2925
2927
|
return self._send_csm_request(http_methods.GET, path, params=params)
|
|
2926
2928
|
|
|
2927
|
-
|
|
2928
2929
|
def push_metric_data(self, user_id=None, scope=None, metric_data=None, config=None):
|
|
2929
2930
|
|
|
2930
2931
|
"""
|
|
@@ -2945,7 +2946,6 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
2945
2946
|
|
|
2946
2947
|
return self._send_request(http_methods.POST, path, body=json.dumps(body), config=config)
|
|
2947
2948
|
|
|
2948
|
-
|
|
2949
2949
|
def get_custom_metric_data(self, user_id=None, namespaces=None, metric_name=None,
|
|
2950
2950
|
dimensions=None, statistics=None, start_time=None,
|
|
2951
2951
|
end_time=None, cycle=None, config=None):
|
|
@@ -3049,7 +3049,6 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3049
3049
|
|
|
3050
3050
|
return self._send_csm_request(http_methods.POST, path, body=json.dumps(body), config=config)
|
|
3051
3051
|
|
|
3052
|
-
|
|
3053
3052
|
def create_site_http_task_config(self, user_id=None, task_name=None, address=None,
|
|
3054
3053
|
method=None, post_content=None,
|
|
3055
3054
|
advance_config=None, cycle=None, idc=None, timeout=None, config=None):
|
|
@@ -3079,7 +3078,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3079
3078
|
|
|
3080
3079
|
user_id = compat.convert_to_bytes(user_id)
|
|
3081
3080
|
path = b'/userId/%s/site/http/create' % (user_id)
|
|
3082
|
-
body =
|
|
3081
|
+
body = {
|
|
3083
3082
|
"userId": user_id,
|
|
3084
3083
|
"taskName": task_name,
|
|
3085
3084
|
"address": address,
|
|
@@ -3124,7 +3123,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3124
3123
|
|
|
3125
3124
|
user_id = compat.convert_to_bytes(user_id)
|
|
3126
3125
|
path = b'/userId/%s/site/http/update' % (user_id)
|
|
3127
|
-
body =
|
|
3126
|
+
body = {
|
|
3128
3127
|
"userId": user_id,
|
|
3129
3128
|
"taskId": task_id,
|
|
3130
3129
|
"taskName": task_name,
|
|
@@ -3188,7 +3187,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3188
3187
|
|
|
3189
3188
|
user_id = compat.convert_to_bytes(user_id)
|
|
3190
3189
|
path = b'/userId/%s/site/https/create' % (user_id)
|
|
3191
|
-
body =
|
|
3190
|
+
body = {
|
|
3192
3191
|
"userId": user_id,
|
|
3193
3192
|
"taskName": task_name,
|
|
3194
3193
|
"address": address,
|
|
@@ -3233,7 +3232,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3233
3232
|
|
|
3234
3233
|
user_id = compat.convert_to_bytes(user_id)
|
|
3235
3234
|
path = b'/userId/%s/site/https/update' % (user_id)
|
|
3236
|
-
body =
|
|
3235
|
+
body = {
|
|
3237
3236
|
"userId": user_id,
|
|
3238
3237
|
"taskId": task_id,
|
|
3239
3238
|
"taskName": task_name,
|
|
@@ -3295,7 +3294,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3295
3294
|
|
|
3296
3295
|
user_id = compat.convert_to_bytes(user_id)
|
|
3297
3296
|
path = b'/userId/%s/site/ping/create' % (user_id)
|
|
3298
|
-
body =
|
|
3297
|
+
body = {
|
|
3299
3298
|
"userId": user_id,
|
|
3300
3299
|
"taskName": task_name,
|
|
3301
3300
|
"address": address,
|
|
@@ -3337,7 +3336,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3337
3336
|
|
|
3338
3337
|
user_id = compat.convert_to_bytes(user_id)
|
|
3339
3338
|
path = b'/userId/%s/site/ping/update' % (user_id)
|
|
3340
|
-
body =
|
|
3339
|
+
body = {
|
|
3341
3340
|
"userId": user_id,
|
|
3342
3341
|
"taskId": task_id,
|
|
3343
3342
|
"taskName": task_name,
|
|
@@ -3400,7 +3399,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3400
3399
|
|
|
3401
3400
|
user_id = compat.convert_to_bytes(user_id)
|
|
3402
3401
|
path = b'/userId/%s/site/tcp/create' % (user_id)
|
|
3403
|
-
body =
|
|
3402
|
+
body = {
|
|
3404
3403
|
"userId": user_id,
|
|
3405
3404
|
"taskName": task_name,
|
|
3406
3405
|
"address": address,
|
|
@@ -3456,7 +3455,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3456
3455
|
|
|
3457
3456
|
user_id = compat.convert_to_bytes(user_id)
|
|
3458
3457
|
path = b'/userId/%s/site/tcp/update' % (user_id)
|
|
3459
|
-
body =
|
|
3458
|
+
body = {
|
|
3460
3459
|
"userId": user_id,
|
|
3461
3460
|
"taskId": task_id,
|
|
3462
3461
|
"taskName": task_name,
|
|
@@ -3523,7 +3522,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3523
3522
|
|
|
3524
3523
|
user_id = compat.convert_to_bytes(user_id)
|
|
3525
3524
|
path = b'/userId/%s/site/udp/create' % (user_id)
|
|
3526
|
-
body =
|
|
3525
|
+
body = {
|
|
3527
3526
|
"userId": user_id,
|
|
3528
3527
|
"taskName": task_name,
|
|
3529
3528
|
"address": address,
|
|
@@ -3579,7 +3578,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3579
3578
|
|
|
3580
3579
|
user_id = compat.convert_to_bytes(user_id)
|
|
3581
3580
|
path = b'/userId/%s/site/udp/update' % (user_id)
|
|
3582
|
-
body =
|
|
3581
|
+
body = {
|
|
3583
3582
|
"userId": user_id,
|
|
3584
3583
|
"taskId": task_id,
|
|
3585
3584
|
"taskName": task_name,
|
|
@@ -3650,7 +3649,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3650
3649
|
|
|
3651
3650
|
user_id = compat.convert_to_bytes(user_id)
|
|
3652
3651
|
path = b'/userId/%s/site/ftp/create' % (user_id)
|
|
3653
|
-
body =
|
|
3652
|
+
body = {
|
|
3654
3653
|
"userId": user_id,
|
|
3655
3654
|
"taskName": task_name,
|
|
3656
3655
|
"address": address,
|
|
@@ -3700,7 +3699,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3700
3699
|
|
|
3701
3700
|
user_id = compat.convert_to_bytes(user_id)
|
|
3702
3701
|
path = b'/userId/%s/site/ftp/update' % (user_id)
|
|
3703
|
-
body =
|
|
3702
|
+
body = {
|
|
3704
3703
|
"userId": user_id,
|
|
3705
3704
|
"taskId": task_id,
|
|
3706
3705
|
"taskName": task_name,
|
|
@@ -3767,7 +3766,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3767
3766
|
|
|
3768
3767
|
user_id = compat.convert_to_bytes(user_id)
|
|
3769
3768
|
path = b'/userId/%s/site/dns/create' % (user_id)
|
|
3770
|
-
body =
|
|
3769
|
+
body = {
|
|
3771
3770
|
"userId": user_id,
|
|
3772
3771
|
"taskName": task_name,
|
|
3773
3772
|
"address": address,
|
|
@@ -3814,7 +3813,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3814
3813
|
|
|
3815
3814
|
user_id = compat.convert_to_bytes(user_id)
|
|
3816
3815
|
path = b'/userId/%s/site/dns/update' % (user_id)
|
|
3817
|
-
body =
|
|
3816
|
+
body = {
|
|
3818
3817
|
"userId": user_id,
|
|
3819
3818
|
"taskId": task_id,
|
|
3820
3819
|
"taskName": task_name,
|
|
@@ -3905,7 +3904,6 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3905
3904
|
b'taskId': task_id,
|
|
3906
3905
|
}
|
|
3907
3906
|
|
|
3908
|
-
|
|
3909
3907
|
return self._send_csm_request(http_methods.DELETE, path, params=params, config=config)
|
|
3910
3908
|
|
|
3911
3909
|
def get_site_task_config_info(self, user_id=None, task_id=None, config=None):
|
|
@@ -3924,7 +3922,6 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3924
3922
|
task_id = compat.convert_to_bytes(task_id)
|
|
3925
3923
|
path = b'/userId/%s/site/%s' % (user_id, task_id)
|
|
3926
3924
|
|
|
3927
|
-
|
|
3928
3925
|
return self._send_csm_request(http_methods.GET, path, config=config)
|
|
3929
3926
|
|
|
3930
3927
|
def create_site_alarm_config(self, user_id=None, task_id=None, comment=None, alias_name=None,
|
|
@@ -3969,7 +3966,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
3969
3966
|
|
|
3970
3967
|
user_id = compat.convert_to_bytes(user_id)
|
|
3971
3968
|
path = b'/userId/%s/site/alarm/config/create' % (user_id)
|
|
3972
|
-
body =
|
|
3969
|
+
body = {
|
|
3973
3970
|
"userId": user_id,
|
|
3974
3971
|
"taskId": task_id,
|
|
3975
3972
|
"comment": comment,
|
|
@@ -4008,7 +4005,6 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
4008
4005
|
"alarmNames": alarm_names
|
|
4009
4006
|
}
|
|
4010
4007
|
|
|
4011
|
-
|
|
4012
4008
|
return self._send_csm_request(http_methods.DELETE, path, body=json.dumps(body), config=config)
|
|
4013
4009
|
|
|
4014
4010
|
def update_site_alarm_config(self, user_id=None, task_id=None, alarm_name=None, comment=None, alias_name=None,
|
|
@@ -4055,7 +4051,7 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
4055
4051
|
|
|
4056
4052
|
user_id = compat.convert_to_bytes(user_id)
|
|
4057
4053
|
path = b'/userId/%s/site/alarm/config/update' % (user_id)
|
|
4058
|
-
body =
|
|
4054
|
+
body = {
|
|
4059
4055
|
"userId": user_id,
|
|
4060
4056
|
"taskId": task_id,
|
|
4061
4057
|
"alarmName": alarm_name,
|
|
@@ -4095,7 +4091,6 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
4095
4091
|
b'alarmName': alarm_name,
|
|
4096
4092
|
}
|
|
4097
4093
|
|
|
4098
|
-
|
|
4099
4094
|
return self._send_csm_request(http_methods.GET, path, params=params, config=config)
|
|
4100
4095
|
|
|
4101
4096
|
def get_site_alarm_config_list(self, user_id=None, task_id=None, alarm_name=None,
|
|
@@ -4122,7 +4117,6 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
4122
4117
|
path = b'/userId/%s/site/alarm/config/list' % (user_id)
|
|
4123
4118
|
params = {}
|
|
4124
4119
|
|
|
4125
|
-
|
|
4126
4120
|
if task_id is not None:
|
|
4127
4121
|
params[b'taskId'] = task_id
|
|
4128
4122
|
if alarm_name is not None:
|
|
@@ -4248,7 +4242,6 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
4248
4242
|
"taskId": task_id
|
|
4249
4243
|
}
|
|
4250
4244
|
|
|
4251
|
-
|
|
4252
4245
|
return self._send_csm_request(http_methods.GET, path, params=params,
|
|
4253
4246
|
body_parser=bcm_handler.parse_json_list, config=config)
|
|
4254
4247
|
|
|
@@ -4273,7 +4266,6 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
4273
4266
|
"isp": isp
|
|
4274
4267
|
}
|
|
4275
4268
|
|
|
4276
|
-
|
|
4277
4269
|
return self._send_csm_request(http_methods.GET, path, params=params,
|
|
4278
4270
|
body_parser=bcm_handler.parse_json_list, config=config)
|
|
4279
4271
|
|
|
@@ -4290,7 +4282,6 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
4290
4282
|
user_id = compat.convert_to_bytes(user_id)
|
|
4291
4283
|
path = b'/userId/%s/site/agent/list' % (user_id)
|
|
4292
4284
|
|
|
4293
|
-
|
|
4294
4285
|
return self._send_csm_request(http_methods.GET, path, body_parser=bcm_handler.parse_json_list, config=config)
|
|
4295
4286
|
|
|
4296
4287
|
def get_site_agent_for_task(self, user_id=None, task_id=None, config=None):
|
|
@@ -4313,7 +4304,6 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
4313
4304
|
|
|
4314
4305
|
return self._send_csm_request(http_methods.GET, path, params=params, config=config)
|
|
4315
4306
|
|
|
4316
|
-
|
|
4317
4307
|
def create_alarm_config(self, user_id, alias_name, scope, level, region, monitor_object, alarm_actions, rules,
|
|
4318
4308
|
src_type="INSTANCE", ok_actions=None, insufficient_actions=None, config_type="NORMAL",
|
|
4319
4309
|
insufficient_cycle=0, max_repeat_count=0, repeat_alarm_cycle=0, callback_url="",
|
|
@@ -5631,4 +5621,254 @@ class BcmClient(bce_base_client.BceBaseClient):
|
|
|
5631
5621
|
b'ipType': ip_type,
|
|
5632
5622
|
}
|
|
5633
5623
|
path = b'/site/once/siteAgent'
|
|
5634
|
-
return self._send_csm_request(http_methods.GET, path, params=params)
|
|
5624
|
+
return self._send_csm_request(http_methods.GET, path, params=params)
|
|
5625
|
+
|
|
5626
|
+
@required(user_id=str, scope=str, region=str, resource_type=str, dimensions=list,
|
|
5627
|
+
metric_names=list, timestamp=str, statistics=list, cycle=int)
|
|
5628
|
+
def get_multi_dimension_latest_metrics(self, user_id, scope, region=None, resource_type=None, dimensions=None,
|
|
5629
|
+
metric_names=None, timestamp=None, statistics=None, cycle=None):
|
|
5630
|
+
"""
|
|
5631
|
+
:param user_id: str
|
|
5632
|
+
:param scope: str
|
|
5633
|
+
:param region: str
|
|
5634
|
+
:param resource_type: str
|
|
5635
|
+
:param dimensions: list
|
|
5636
|
+
:param metric_names: list
|
|
5637
|
+
:param timestamp: str
|
|
5638
|
+
:param statistics: list
|
|
5639
|
+
:param cycle: int
|
|
5640
|
+
|
|
5641
|
+
:return:
|
|
5642
|
+
"""
|
|
5643
|
+
if len(user_id) <= 0:
|
|
5644
|
+
raise ValueError("user_id should not be null")
|
|
5645
|
+
if len(scope) <= 0:
|
|
5646
|
+
raise ValueError("scope should not be null")
|
|
5647
|
+
if metric_names is None:
|
|
5648
|
+
raise ValueError("metric_names should not be null")
|
|
5649
|
+
if len(dimensions) > MAX_INSTANCE_NUMBER:
|
|
5650
|
+
raise ValueError("dimensions size cannot more than " + MAX_INSTANCE_NUMBER)
|
|
5651
|
+
if cycle is None:
|
|
5652
|
+
cycle = 60
|
|
5653
|
+
body = {
|
|
5654
|
+
"userId": user_id,
|
|
5655
|
+
"scope": scope,
|
|
5656
|
+
"cycle": cycle
|
|
5657
|
+
}
|
|
5658
|
+
metric_names_req = []
|
|
5659
|
+
for res in metric_names:
|
|
5660
|
+
metric_names_req.append(res)
|
|
5661
|
+
body["metricNames"] = metric_names_req
|
|
5662
|
+
if region is not None:
|
|
5663
|
+
body["region"] = region
|
|
5664
|
+
if resource_type is not None:
|
|
5665
|
+
body["resourceType"] = resource_type
|
|
5666
|
+
if dimensions is not None:
|
|
5667
|
+
dimensions_res = []
|
|
5668
|
+
for res in dimensions:
|
|
5669
|
+
dimensions_res.append(res)
|
|
5670
|
+
body["dimensions"] = dimensions_res
|
|
5671
|
+
if timestamp is not None:
|
|
5672
|
+
body["timestamp"] = timestamp
|
|
5673
|
+
if statistics is not None:
|
|
5674
|
+
body["statistics"] = statistics
|
|
5675
|
+
user_id = compat.convert_to_bytes(user_id)
|
|
5676
|
+
scope = compat.convert_to_bytes(scope)
|
|
5677
|
+
path = b'/userId/%s/services/%s/data/metricData/latest/batch' % (user_id, scope)
|
|
5678
|
+
return self._send_csm_request(http_methods.POST, path, version=b'/v2', body=json.dumps(body))
|
|
5679
|
+
|
|
5680
|
+
|
|
5681
|
+
def get_metrics_by_partial_dimensions(self, user_id, scope, statistics, metric_name, start_time, end_time,
|
|
5682
|
+
region=None, resource_type=None, dimensions=None, cycle=None,
|
|
5683
|
+
pageNo=None, pageSize=None):
|
|
5684
|
+
"""
|
|
5685
|
+
:param user_id: str
|
|
5686
|
+
:param scope: str
|
|
5687
|
+
:param statistics: list
|
|
5688
|
+
:param metric_name: str
|
|
5689
|
+
:param start_time: str
|
|
5690
|
+
:param end_time: str
|
|
5691
|
+
:param region: str
|
|
5692
|
+
:param resource_type: str
|
|
5693
|
+
:param dimensions: list
|
|
5694
|
+
:param cycle: int
|
|
5695
|
+
:param pageNo: int
|
|
5696
|
+
:param pageSize: int
|
|
5697
|
+
|
|
5698
|
+
:return:
|
|
5699
|
+
"""
|
|
5700
|
+
if len(user_id) <= 0:
|
|
5701
|
+
raise ValueError("user_id should not be null")
|
|
5702
|
+
if len(scope) <= 0:
|
|
5703
|
+
raise ValueError("scope should not be null")
|
|
5704
|
+
if len(metric_name) <= 0:
|
|
5705
|
+
raise ValueError("metric_name should not be null")
|
|
5706
|
+
if len(start_time) <= 0:
|
|
5707
|
+
raise ValueError("start_time should not be null")
|
|
5708
|
+
if len(end_time) <= 0:
|
|
5709
|
+
raise ValueError("end_time should not be null")
|
|
5710
|
+
if len(statistics) <= 0:
|
|
5711
|
+
raise ValueError("statistics should not be null")
|
|
5712
|
+
if len(dimensions) > MAX_INSTANCE_NUMBER:
|
|
5713
|
+
raise ValueError("dimensions size cannot more than " + MAX_INSTANCE_NUMBER)
|
|
5714
|
+
body = {
|
|
5715
|
+
"userId": user_id,
|
|
5716
|
+
"scope": scope,
|
|
5717
|
+
"startTime": start_time,
|
|
5718
|
+
"endTime": end_time,
|
|
5719
|
+
"statistics": statistics,
|
|
5720
|
+
"metricName": metric_name
|
|
5721
|
+
}
|
|
5722
|
+
if region is not None:
|
|
5723
|
+
body["region"] = region
|
|
5724
|
+
if resource_type is not None:
|
|
5725
|
+
body["resourceType"] = resource_type
|
|
5726
|
+
if dimensions is not None:
|
|
5727
|
+
dimensions_res = []
|
|
5728
|
+
for res in dimensions:
|
|
5729
|
+
dimensions_res.append(res)
|
|
5730
|
+
body["dimensions"] = dimensions_res
|
|
5731
|
+
if cycle is not None:
|
|
5732
|
+
body["cycle"] = cycle
|
|
5733
|
+
if pageNo is not None:
|
|
5734
|
+
body["pageNo"] = pageNo
|
|
5735
|
+
if pageSize is not None:
|
|
5736
|
+
body["pageSize"] = pageSize
|
|
5737
|
+
user_id = compat.convert_to_bytes(user_id)
|
|
5738
|
+
scope = compat.convert_to_bytes(scope)
|
|
5739
|
+
path = b'/userId/%s/services/%s/data/metricData/PartialDimension' % (user_id, scope)
|
|
5740
|
+
return self._send_csm_request(http_methods.POST, path, version=b'/v2', body=json.dumps(body))
|
|
5741
|
+
|
|
5742
|
+
def get_all_data_metrics_v2(self, user_id, scope, region, dimensions, metric_names, statistics,
|
|
5743
|
+
start_time, end_time, type="Instance", cycle=60):
|
|
5744
|
+
|
|
5745
|
+
"""
|
|
5746
|
+
:param user_id: user_id
|
|
5747
|
+
:type string
|
|
5748
|
+
|
|
5749
|
+
:param scope: scope
|
|
5750
|
+
:type string
|
|
5751
|
+
|
|
5752
|
+
:param region: region
|
|
5753
|
+
:type string
|
|
5754
|
+
|
|
5755
|
+
:param type: resource type
|
|
5756
|
+
:type string
|
|
5757
|
+
|
|
5758
|
+
:param dimensions: dimensions
|
|
5759
|
+
:type double string array
|
|
5760
|
+
|
|
5761
|
+
:param metric_names: metric names
|
|
5762
|
+
:type string array
|
|
5763
|
+
|
|
5764
|
+
:param statistics: statistics
|
|
5765
|
+
:type string array
|
|
5766
|
+
|
|
5767
|
+
:param cycle: cycle
|
|
5768
|
+
:type int
|
|
5769
|
+
|
|
5770
|
+
:param start_time: start time
|
|
5771
|
+
:type string
|
|
5772
|
+
|
|
5773
|
+
:param end_time: end time
|
|
5774
|
+
:type string
|
|
5775
|
+
:return:
|
|
5776
|
+
"""
|
|
5777
|
+
if len(user_id) <= 0:
|
|
5778
|
+
raise ValueError("user_id should not be null")
|
|
5779
|
+
if len(scope) <= 0:
|
|
5780
|
+
raise ValueError("scope should not be null")
|
|
5781
|
+
if len(region) <= 0:
|
|
5782
|
+
raise ValueError("region should not be null")
|
|
5783
|
+
if metric_names is None:
|
|
5784
|
+
raise ValueError("metric_names should not be null")
|
|
5785
|
+
if dimensions is None:
|
|
5786
|
+
raise ValueError("dimensions should not be null")
|
|
5787
|
+
if statistics is None:
|
|
5788
|
+
raise ValueError("statistics should not be null")
|
|
5789
|
+
if len(dimensions) > MAX_INSTANCE_NUMBER:
|
|
5790
|
+
raise ValueError("dimensions size cannot more than " + MAX_INSTANCE_NUMBER)
|
|
5791
|
+
body = {
|
|
5792
|
+
"userId": user_id,
|
|
5793
|
+
"scope": scope,
|
|
5794
|
+
"cycle": cycle,
|
|
5795
|
+
"region": region,
|
|
5796
|
+
"startTime": start_time,
|
|
5797
|
+
"endTime": end_time,
|
|
5798
|
+
"metricNames": metric_names,
|
|
5799
|
+
"dimensions": dimensions,
|
|
5800
|
+
"statistics": statistics
|
|
5801
|
+
}
|
|
5802
|
+
if type is not None:
|
|
5803
|
+
body["type"] = type
|
|
5804
|
+
|
|
5805
|
+
path = b'/data/metricAllData'
|
|
5806
|
+
return self._send_csm_request(http_methods.POST, path, version=b'/v2', body=json.dumps(body))
|
|
5807
|
+
|
|
5808
|
+
def batch_get_all_data_metrics_v2(self, user_id, scope, region, dimensions, metric_names, statistics,
|
|
5809
|
+
start_time, end_time, type="Instance", cycle=60):
|
|
5810
|
+
|
|
5811
|
+
"""
|
|
5812
|
+
:param user_id: user_id
|
|
5813
|
+
:type string
|
|
5814
|
+
|
|
5815
|
+
:param scope: scope
|
|
5816
|
+
:type string
|
|
5817
|
+
|
|
5818
|
+
:param region: region
|
|
5819
|
+
:type string
|
|
5820
|
+
|
|
5821
|
+
:param dimensions: dimensions
|
|
5822
|
+
:type double dimensional dict array
|
|
5823
|
+
|
|
5824
|
+
:param metric_names: metric names
|
|
5825
|
+
:type string array
|
|
5826
|
+
|
|
5827
|
+
:param statistics: statistics
|
|
5828
|
+
:type string array
|
|
5829
|
+
|
|
5830
|
+
:param start_time: start time
|
|
5831
|
+
:type string
|
|
5832
|
+
|
|
5833
|
+
:param end_time: end time
|
|
5834
|
+
:type string
|
|
5835
|
+
|
|
5836
|
+
:param type: type
|
|
5837
|
+
:type string
|
|
5838
|
+
|
|
5839
|
+
:param cycle: cycle
|
|
5840
|
+
:type int
|
|
5841
|
+
:return:
|
|
5842
|
+
"""
|
|
5843
|
+
if len(user_id) <= 0:
|
|
5844
|
+
raise ValueError("user_id should not be null")
|
|
5845
|
+
if len(scope) <= 0:
|
|
5846
|
+
raise ValueError("scope should not be null")
|
|
5847
|
+
if len(region) <= 0:
|
|
5848
|
+
raise ValueError("region should not be null")
|
|
5849
|
+
if len(metric_names) <= 0:
|
|
5850
|
+
raise ValueError("metric_names should not be null")
|
|
5851
|
+
if len(dimensions) <= 0:
|
|
5852
|
+
raise ValueError("dimensions should not be null")
|
|
5853
|
+
if len(statistics) <= 0:
|
|
5854
|
+
raise ValueError("statistics should not be null")
|
|
5855
|
+
if len(dimensions) > MAX_INSTANCE_NUMBER:
|
|
5856
|
+
raise ValueError("dimensions size cannot more than " + MAX_INSTANCE_NUMBER)
|
|
5857
|
+
body = {
|
|
5858
|
+
"userId": user_id,
|
|
5859
|
+
"scope": scope,
|
|
5860
|
+
"cycle": cycle,
|
|
5861
|
+
"region": region,
|
|
5862
|
+
"startTime": start_time,
|
|
5863
|
+
"endTime": end_time,
|
|
5864
|
+
"metricNames": metric_names,
|
|
5865
|
+
"dimensions": dimensions,
|
|
5866
|
+
"statistics": statistics
|
|
5867
|
+
}
|
|
5868
|
+
if type is not None:
|
|
5869
|
+
body["type"] = type
|
|
5870
|
+
|
|
5871
|
+
path = b'/data/metricAllData/batch'
|
|
5872
|
+
return self._send_csm_request(http_methods.POST, path, version=b'/v2', body=json.dumps(body))
|
|
5873
|
+
|
|
5874
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
baidubce/__init__.py,sha256=
|
|
1
|
+
baidubce/__init__.py,sha256=4pnkvyMrf76aBZjNydEF6C7ykK7BcgF4sJ0epzwkj5w,813
|
|
2
2
|
baidubce/bce_base_client.py,sha256=7gjkRy_YlTTb6TXHYHyZRYMjdVO7FTtHMdwXx8bPgsE,3428
|
|
3
3
|
baidubce/bce_client_configuration.py,sha256=Wzuu9JR11hcHxgcKQIP63qIChEzVrT9ZA_fyqIfqqP4,3055
|
|
4
4
|
baidubce/bce_response.py,sha256=V5a3bgRj04cM3Ml3s1OByLyZZSGDUy9PL52JSugmCgM,1655
|
|
@@ -27,12 +27,12 @@ baidubce/services/bbc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
|
|
|
27
27
|
baidubce/services/bbc/bbc_client.py,sha256=9jcIyysPYv9iLj0qD-NSENHmNZs7Lsfb3F1khqb__2I,35864
|
|
28
28
|
baidubce/services/bbc/bbc_model.py,sha256=Dx7HoUw73Uk3I2dxBL188-3i4pbt5v-8SZe4T1K99dg,1595
|
|
29
29
|
baidubce/services/bcc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
-
baidubce/services/bcc/bcc_client.py,sha256=
|
|
30
|
+
baidubce/services/bcc/bcc_client.py,sha256=MTbQR-2KLoTnILhZYG9cMd7MPGZTtZYEkOX8XGVn71s,233985
|
|
31
31
|
baidubce/services/bcc/bcc_model.py,sha256=7v5WzqDDhl7MmI3vDdOuyM5S9isxkKoaIv5RAqzzTRI,5919
|
|
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
|
|
35
|
-
baidubce/services/bcm/bcm_client.py,sha256=
|
|
35
|
+
baidubce/services/bcm/bcm_client.py,sha256=XMlto3h2u0wxwfSeQNjqbbLgFMAnIyVK6Y_8agtr9zM,209237
|
|
36
36
|
baidubce/services/bcm/bcm_handler.py,sha256=UK_wuEykhXHIFSQr-5mcIvXf356xvPnju2XiN7U7GsM,3315
|
|
37
37
|
baidubce/services/bcm/bcm_model.py,sha256=cJKyuS9c4Lf_4j0Nl8ECjoWBLN31qDiT0eKbMcxlZtA,22095
|
|
38
38
|
baidubce/services/bes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -166,7 +166,7 @@ baidubce/services/vpc/vpc_client.py,sha256=6HD-TIxmNPujzIVc37Z9OOp_JUOoITUPzTwjm
|
|
|
166
166
|
baidubce/services/vpn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
167
167
|
baidubce/services/vpn/vpn_client.py,sha256=VGmPmnl7Il_NcbGMAgASmVK_1IF9HQ8PJ-WLij-7Axc,28554
|
|
168
168
|
baidubce/services/vpn/vpn_model.py,sha256=r9V2At9ll9cZTOryGflS9tH9DlHdeelKYuGXvTNyTgg,3364
|
|
169
|
-
bce_python_sdk-0.9.
|
|
170
|
-
bce_python_sdk-0.9.
|
|
171
|
-
bce_python_sdk-0.9.
|
|
172
|
-
bce_python_sdk-0.9.
|
|
169
|
+
bce_python_sdk-0.9.6.dist-info/METADATA,sha256=d4aQYNpBTVPTUbjz8gTDAMNu4N3Dlt-7jLNgxFzm2pw,318
|
|
170
|
+
bce_python_sdk-0.9.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
171
|
+
bce_python_sdk-0.9.6.dist-info/top_level.txt,sha256=Oh6eo_-T_AuEDpIaR54biUUPThxsoQiYMVHLBTaweQs,9
|
|
172
|
+
bce_python_sdk-0.9.6.dist-info/RECORD,,
|
|
File without changes
|