kingsoftcloud-sdk-python 1.1.1__py2.py3-none-any.whl → 1.5.8.49__py2.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.
- kingsoftcloud_sdk_python-1.5.8.49.dist-info/METADATA +71 -0
- kingsoftcloud_sdk_python-1.5.8.49.dist-info/RECORD +337 -0
- {kingsoftcloud_sdk_python-1.1.1.dist-info → kingsoftcloud_sdk_python-1.5.8.49.dist-info}/WHEEL +1 -1
- ksyun/__init__.py +1 -1
- ksyun/client/actiontrail/v20190401/client.py +2 -4
- ksyun/client/aicp/v20240612/client.py +1344 -0
- ksyun/client/aicp/v20240612/models.py +1963 -0
- ksyun/client/aicp/v20251212/__init__.py +0 -0
- ksyun/client/aicp/v20251212/client.py +56 -0
- ksyun/client/aicp/v20251212/models.py +114 -0
- ksyun/client/bill/v20180601/client.py +6 -77
- ksyun/client/bill/v20180601/models.py +29 -41
- ksyun/client/bill/v20220601/__init__.py +0 -0
- ksyun/client/bill/v20220601/client.py +54 -0
- ksyun/client/bill/v20220601/models.py +54 -0
- ksyun/client/bill_union/v20200101/client.py +81 -14
- ksyun/client/bill_union/v20200101/models.py +119 -3
- ksyun/client/bill_union/v20221222/__init__.py +0 -0
- ksyun/client/bill_union/v20221222/client.py +146 -0
- ksyun/client/bill_union/v20221222/models.py +193 -0
- ksyun/client/bill_union/v20250801/__init__.py +0 -0
- ksyun/client/bill_union/v20250801/client.py +54 -0
- ksyun/client/bill_union/v20250801/models.py +64 -0
- ksyun/client/bws/v20160304/client.py +33 -12
- ksyun/client/bws/v20160304/models.py +51 -0
- ksyun/client/cdn/__init__.py +0 -0
- ksyun/client/cdn/v20160901/__init__.py +0 -0
- ksyun/client/cdn/v20160901/client.py +77 -0
- ksyun/client/cdn/v20160901/models.py +51 -0
- ksyun/client/cdn/v20200630/__init__.py +0 -0
- ksyun/client/cdn/v20200630/client.py +399 -0
- ksyun/client/cdn/v20200630/models.py +826 -0
- ksyun/client/cdn/v20200901/__init__.py +0 -0
- ksyun/client/cdn/v20200901/client.py +169 -0
- ksyun/client/cdn/v20200901/models.py +224 -0
- ksyun/client/cdn/v20211201/__init__.py +0 -0
- ksyun/client/cdn/v20211201/client.py +31 -0
- ksyun/client/cdn/v20211201/models.py +23 -0
- ksyun/client/cdn/v3/__init__.py +0 -0
- ksyun/client/cdn/v3/client.py +997 -0
- ksyun/client/cdn/v3/models.py +1323 -0
- ksyun/client/cen/__init__.py +0 -0
- ksyun/client/cen/v20160304/__init__.py +0 -0
- ksyun/client/cen/v20160304/client.py +606 -0
- ksyun/client/cen/v20160304/models.py +718 -0
- ksyun/client/clickhouse/__init__.py +0 -0
- ksyun/client/clickhouse/v20210101/__init__.py +0 -0
- ksyun/client/clickhouse/v20210101/client.py +905 -0
- ksyun/client/clickhouse/v20210101/models.py +1127 -0
- ksyun/client/cloud_advisor/__init__.py +0 -0
- ksyun/client/cloud_advisor/v20250610/__init__.py +0 -0
- ksyun/client/cloud_advisor/v20250610/client.py +77 -0
- ksyun/client/cloud_advisor/v20250610/models.py +80 -0
- ksyun/client/dmp/__init__.py +0 -0
- ksyun/client/dmp/v20240101/__init__.py +0 -0
- ksyun/client/dmp/v20240101/client.py +468 -0
- ksyun/client/dmp/v20240101/models.py +423 -0
- ksyun/client/dts/__init__.py +0 -0
- ksyun/client/dts/v20180108/__init__.py +0 -0
- ksyun/client/dts/v20180108/client.py +445 -0
- ksyun/client/dts/v20180108/models.py +734 -0
- ksyun/client/ebs/v20160304/client.py +260 -55
- ksyun/client/ebs/v20160304/models.py +320 -66
- ksyun/client/eip/v20160304/client.py +127 -14
- ksyun/client/eip/v20160304/models.py +95 -1
- ksyun/client/epc/v20151101/client.py +1309 -184
- ksyun/client/epc/v20151101/models.py +2623 -137
- ksyun/client/iam/v20151101/client.py +325 -120
- ksyun/client/iam/v20151101/models.py +284 -28
- ksyun/client/iam/v20240513/__init__.py +0 -0
- ksyun/client/iam/v20240513/client.py +31 -0
- ksyun/client/iam/v20240513/models.py +33 -0
- ksyun/client/iam/v20240703/__init__.py +0 -0
- ksyun/client/iam/v20240703/client.py +31 -0
- ksyun/client/iam/v20240703/models.py +18 -0
- ksyun/client/influxdb/__init__.py +0 -0
- ksyun/client/influxdb/v20191010/__init__.py +0 -0
- ksyun/client/influxdb/v20191010/client.py +629 -0
- ksyun/client/influxdb/v20191010/models.py +655 -0
- ksyun/client/kad/v20161122/client.py +56 -12
- ksyun/client/kad/v20161122/models.py +38 -0
- ksyun/client/kce/__init__.py +0 -0
- ksyun/client/kce/v20180314/__init__.py +0 -0
- ksyun/client/kce/v20180314/client.py +399 -0
- ksyun/client/kce/v20180314/models.py +374 -0
- ksyun/client/kce/v20190806/__init__.py +0 -0
- ksyun/client/kce/v20190806/client.py +790 -0
- ksyun/client/kce/v20190806/models.py +1099 -0
- ksyun/client/kce/v20201231/__init__.py +0 -0
- ksyun/client/{slb/v20171210 → kce/v20201231}/client.py +10 -12
- ksyun/client/kce/v20201231/models.py +137 -0
- ksyun/client/kce/v20230101/__init__.py +0 -0
- ksyun/client/kce/v20230101/client.py +215 -0
- ksyun/client/kce/v20230101/models.py +259 -0
- ksyun/client/kce/v20230306/__init__.py +0 -0
- ksyun/client/kce/v20230306/client.py +514 -0
- ksyun/client/kce/v20230306/models.py +655 -0
- ksyun/client/kce/v20231115/__init__.py +0 -0
- ksyun/client/kce/v20231115/client.py +54 -0
- ksyun/client/kce/v20231115/models.py +59 -0
- ksyun/client/kce2/__init__.py +0 -0
- ksyun/client/kce2/v20230101/__init__.py +0 -0
- ksyun/client/kce2/v20230101/client.py +353 -0
- ksyun/client/kce2/v20230101/models.py +483 -0
- ksyun/client/kcf/__init__.py +0 -0
- ksyun/client/kcf/v20211215/__init__.py +0 -0
- ksyun/client/kcf/v20211215/client.py +215 -0
- ksyun/client/kcf/v20211215/models.py +313 -0
- ksyun/client/kci/__init__.py +0 -0
- ksyun/client/kci/v20200702/__init__.py +0 -0
- ksyun/client/kci/v20200702/client.py +353 -0
- ksyun/client/kci/v20200702/models.py +614 -0
- ksyun/client/kcm/__init__.py +0 -0
- ksyun/client/kcm/v20160304/__init__.py +0 -0
- ksyun/client/kcm/v20160304/client.py +238 -0
- ksyun/client/kcm/v20160304/models.py +394 -0
- ksyun/client/kcrs/__init__.py +0 -0
- ksyun/client/kcrs/v20211109/__init__.py +0 -0
- ksyun/client/kcrs/v20211109/client.py +1020 -0
- ksyun/client/kcrs/v20211109/models.py +1282 -0
- ksyun/client/kcs/__init__.py +0 -0
- ksyun/client/kcs/v20160701/__init__.py +0 -0
- ksyun/client/kcs/v20160701/client.py +1526 -0
- ksyun/client/kcs/v20160701/models.py +1917 -0
- ksyun/client/kcs/v20170401/__init__.py +0 -0
- ksyun/client/kcs/v20170401/client.py +31 -0
- ksyun/client/kcs/v20170401/models.py +28 -0
- ksyun/client/kcs/v20240701/__init__.py +0 -0
- ksyun/client/kcs/v20240701/client.py +31 -0
- ksyun/client/kcs/v20240701/models.py +23 -0
- ksyun/client/kead/v20200101/client.py +48 -4
- ksyun/client/kead/v20200101/models.py +52 -42
- ksyun/client/kec/v20160304/client.py +890 -223
- ksyun/client/kec/v20160304/models.py +1377 -140
- ksyun/client/ked/__init__.py +0 -0
- ksyun/client/ked/v1/__init__.py +0 -0
- ksyun/client/ked/v1/client.py +1020 -0
- ksyun/client/ked/v1/models.py +1132 -0
- ksyun/client/kes/__init__.py +0 -0
- ksyun/client/kes/v20201215/__init__.py +0 -0
- ksyun/client/kes/v20201215/client.py +192 -0
- ksyun/client/kes/v20201215/models.py +252 -0
- ksyun/client/ket/__init__.py +0 -0
- ksyun/client/ket/v20170101/__init__.py +0 -0
- ksyun/client/ket/v20170101/client.py +192 -0
- ksyun/client/ket/v20170101/models.py +265 -0
- ksyun/client/kfw/__init__.py +0 -0
- ksyun/client/kfw/v20160304/__init__.py +0 -0
- ksyun/client/kfw/v20160304/client.py +692 -0
- ksyun/client/kfw/v20160304/models.py +1029 -0
- ksyun/client/kingpay/__init__.py +0 -0
- ksyun/client/kingpay/v1/__init__.py +0 -0
- ksyun/client/kingpay/v1/client.py +31 -0
- ksyun/client/kingpay/v1/models.py +18 -0
- ksyun/client/kkms/__init__.py +0 -0
- ksyun/client/kkms/v20160304/__init__.py +0 -0
- ksyun/client/kkms/v20160304/client.py +192 -0
- ksyun/client/kkms/v20160304/models.py +185 -0
- ksyun/client/klog/__init__.py +0 -0
- ksyun/client/klog/v20200731/__init__.py +0 -0
- ksyun/client/klog/v20200731/client.py +376 -0
- ksyun/client/klog/v20200731/models.py +508 -0
- ksyun/client/kls/__init__.py +0 -0
- ksyun/client/kls/v20170101/__init__.py +0 -0
- ksyun/client/kls/v20170101/client.py +192 -0
- ksyun/client/kls/v20170101/models.py +320 -0
- ksyun/client/kmr/__init__.py +0 -0
- ksyun/client/kmr/v20210902/__init__.py +0 -0
- ksyun/client/kmr/v20210902/client.py +537 -0
- ksyun/client/kmr/v20210902/models.py +536 -0
- ksyun/client/kmr/v20231231/__init__.py +0 -0
- ksyun/client/kmr/v20231231/client.py +169 -0
- ksyun/client/kmr/v20231231/models.py +201 -0
- ksyun/client/kmr/v20240814/__init__.py +0 -0
- ksyun/client/kmr/v20240814/client.py +445 -0
- ksyun/client/kmr/v20240814/models.py +523 -0
- ksyun/client/knad/__init__.py +0 -0
- ksyun/client/knad/v20230323/__init__.py +0 -0
- ksyun/client/knad/v20230323/client.py +399 -0
- ksyun/client/knad/v20230323/models.py +470 -0
- ksyun/client/kpfs/__init__.py +0 -0
- ksyun/client/kpfs/v20240930/__init__.py +0 -0
- ksyun/client/kpfs/v20240930/client.py +217 -0
- ksyun/client/kpfs/v20240930/models.py +396 -0
- ksyun/client/krds/__init__.py +0 -0
- ksyun/client/krds/v20160701/__init__.py +0 -0
- ksyun/client/krds/v20160701/client.py +2101 -0
- ksyun/client/krds/v20160701/models.py +2722 -0
- ksyun/client/krds/v20200825/__init__.py +0 -0
- ksyun/client/krds/v20200825/client.py +238 -0
- ksyun/client/krds/v20200825/models.py +336 -0
- ksyun/client/memcached/__init__.py +0 -0
- ksyun/client/memcached/v20180627/__init__.py +0 -0
- ksyun/client/memcached/v20180627/client.py +307 -0
- ksyun/client/memcached/v20180627/models.py +317 -0
- ksyun/client/milvus/__init__.py +0 -0
- ksyun/client/milvus/v20231010/__init__.py +0 -0
- ksyun/client/milvus/v20231010/client.py +445 -0
- ksyun/client/milvus/v20231010/models.py +520 -0
- ksyun/client/mongodb/v20170101/client.py +312 -84
- ksyun/client/mongodb/v20170101/models.py +251 -34
- ksyun/client/mongodb/v20250101/__init__.py +0 -0
- ksyun/client/mongodb/v20250101/client.py +31 -0
- ksyun/client/mongodb/v20250101/models.py +18 -0
- ksyun/client/monitor/__init__.py +0 -0
- ksyun/client/monitor/v20100525/__init__.py +0 -0
- ksyun/client/monitor/v20100525/client.py +54 -0
- ksyun/client/monitor/v20100525/models.py +108 -0
- ksyun/client/monitor/v20181114/__init__.py +0 -0
- ksyun/client/monitor/v20181114/client.py +31 -0
- ksyun/client/monitor/v20181114/models.py +59 -0
- ksyun/client/monitor/v20210101/__init__.py +0 -0
- ksyun/client/monitor/v20210101/client.py +284 -0
- ksyun/client/monitor/v20210101/models.py +330 -0
- ksyun/client/monitor/v20220101/__init__.py +0 -0
- ksyun/client/monitor/v20220101/client.py +54 -0
- ksyun/client/monitor/v20220101/models.py +32 -0
- ksyun/client/monitor/v20250101/__init__.py +0 -0
- ksyun/client/monitor/v20250101/client.py +121 -0
- ksyun/client/monitor/v20250101/models.py +188 -0
- ksyun/client/pdns/__init__.py +0 -0
- ksyun/client/pdns/v20160304/__init__.py +0 -0
- ksyun/client/pdns/v20160304/client.py +813 -0
- ksyun/client/pdns/v20160304/models.py +805 -0
- ksyun/client/postgresql/__init__.py +0 -0
- ksyun/client/postgresql/v20181225/__init__.py +0 -0
- ksyun/client/postgresql/v20181225/client.py +1158 -0
- ksyun/client/postgresql/v20181225/models.py +1629 -0
- ksyun/client/rabbitmq/__init__.py +0 -0
- ksyun/client/rabbitmq/v20191017/__init__.py +0 -0
- ksyun/client/rabbitmq/v20191017/client.py +445 -0
- ksyun/client/rabbitmq/v20191017/models.py +413 -0
- ksyun/client/relyt/__init__.py +0 -0
- ksyun/client/relyt/v20240117/__init__.py +0 -0
- ksyun/client/{bill_union/v20211209 → relyt/v20240117}/client.py +10 -12
- ksyun/client/relyt/v20240117/models.py +23 -0
- ksyun/client/resourcemanager/v20210320/client.py +16 -18
- ksyun/client/sks/v20151101/client.py +11 -13
- ksyun/client/sks/v20151101/models.py +28 -2
- ksyun/client/slb/v20160304/client.py +1099 -112
- ksyun/client/slb/v20160304/models.py +1697 -24
- ksyun/client/slb/v20250430/__init__.py +0 -0
- ksyun/client/slb/v20250430/client.py +813 -0
- ksyun/client/slb/v20250430/models.py +1372 -0
- ksyun/client/sqlserver/__init__.py +0 -0
- ksyun/client/sqlserver/v20190425/__init__.py +0 -0
- ksyun/client/sqlserver/v20190425/client.py +1066 -0
- ksyun/client/sqlserver/v20190425/models.py +1528 -0
- ksyun/client/sts/v20151101/client.py +23 -2
- ksyun/client/sts/v20151101/models.py +54 -1
- ksyun/client/tagv2/v20200901/client.py +60 -16
- ksyun/client/tagv2/v20200901/models.py +56 -4
- ksyun/client/ter/__init__.py +0 -0
- ksyun/client/ter/v20240415/__init__.py +0 -0
- ksyun/client/ter/v20240415/client.py +123 -0
- ksyun/client/ter/v20240415/models.py +115 -0
- ksyun/client/tidb/__init__.py +0 -0
- ksyun/client/tidb/v20210520/__init__.py +0 -0
- ksyun/client/tidb/v20210520/client.py +928 -0
- ksyun/client/tidb/v20210520/models.py +1162 -0
- ksyun/client/trade/v20200114/client.py +2 -4
- ksyun/client/trade/v20200831/client.py +2 -4
- ksyun/client/trade/v20250220/__init__.py +0 -0
- ksyun/client/trade/v20250220/client.py +100 -0
- ksyun/client/trade/v20250220/models.py +91 -0
- ksyun/client/trade/v20250321/__init__.py +0 -0
- ksyun/client/trade/v20250321/client.py +100 -0
- ksyun/client/trade/v20250321/models.py +71 -0
- ksyun/client/trade/v20250828/__init__.py +0 -0
- ksyun/client/trade/v20250828/client.py +31 -0
- ksyun/client/trade/v20250828/models.py +81 -0
- ksyun/client/vpc/v20160304/client.py +1377 -229
- ksyun/client/vpc/v20160304/models.py +1540 -138
- ksyun/client/waf/__init__.py +0 -0
- ksyun/client/waf/v20200707/__init__.py +0 -0
- ksyun/client/waf/v20200707/client.py +468 -0
- ksyun/client/waf/v20200707/models.py +738 -0
- ksyun/common/abstract_client.py +57 -21
- ksyun/common/abstract_model.py +3 -3
- ksyun/common/common_client.py +2 -0
- ksyun/common/credential.py +2 -0
- ksyun/common/exception/ksyun_sdk_exception.py +11 -7
- ksyun/common/http/request.py +45 -6
- ksyun/common/profile/client_profile.py +3 -0
- ksyun/common/profile/http_profile.py +28 -1
- kingsoftcloud_sdk_python-1.1.1.dist-info/METADATA +0 -47
- kingsoftcloud_sdk_python-1.1.1.dist-info/RECORD +0 -105
- ksyun/client/bill_union/v20211209/models.py +0 -38
- ksyun/client/slb/v20171210/models.py +0 -33
- ksyun/common/sign.py +0 -33
- {kingsoftcloud_sdk_python-1.1.1.dist-info → kingsoftcloud_sdk_python-1.5.8.49.dist-info/licenses}/LICENSE +0 -0
- {kingsoftcloud_sdk_python-1.1.1.dist-info → kingsoftcloud_sdk_python-1.5.8.49.dist-info}/top_level.txt +0 -0
- /ksyun/client/{bill_union/v20211209 → aicp}/__init__.py +0 -0
- /ksyun/client/{slb/v20171210 → aicp/v20240612}/__init__.py +0 -0
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
from ksyun.common.exception.ksyun_sdk_exception import KsyunSDKException
|
|
4
|
+
from ksyun.common.abstract_client import AbstractClient
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class KesClient(AbstractClient):
|
|
8
|
+
_apiVersion = '2020-12-15'
|
|
9
|
+
_endpoint = 'kes.api.ksyun.com'
|
|
10
|
+
_service = 'kes'
|
|
11
|
+
def DescribeCluster(self, request):
|
|
12
|
+
"""查询集群详情V2
|
|
13
|
+
:param request: Request instance for DescribeCluster.
|
|
14
|
+
:type request: :class:`ksyun.client.kes.v20201215.models.DescribeClusterRequest`
|
|
15
|
+
"""
|
|
16
|
+
try:
|
|
17
|
+
params = request._serialize()
|
|
18
|
+
body = self.call_judge("DescribeCluster", params, "application/json")
|
|
19
|
+
response = json.loads(body)
|
|
20
|
+
if "Error" not in response:
|
|
21
|
+
return body
|
|
22
|
+
else:
|
|
23
|
+
code = response["Error"]["Code"]
|
|
24
|
+
message = response["Error"]["Message"]
|
|
25
|
+
req_id = response["RequestId"]
|
|
26
|
+
raise KsyunSDKException(code, message, req_id)
|
|
27
|
+
except Exception as e:
|
|
28
|
+
if isinstance(e, KsyunSDKException):
|
|
29
|
+
raise
|
|
30
|
+
else:
|
|
31
|
+
raise KsyunSDKException(message=str(e))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def ListClusters(self, request):
|
|
35
|
+
"""查看集群列表V2
|
|
36
|
+
:param request: Request instance for ListClusters.
|
|
37
|
+
:type request: :class:`ksyun.client.kes.v20201215.models.ListClustersRequest`
|
|
38
|
+
"""
|
|
39
|
+
try:
|
|
40
|
+
params = request._serialize()
|
|
41
|
+
body = self.call_judge("ListClusters", params, "application/json")
|
|
42
|
+
response = json.loads(body)
|
|
43
|
+
if "Error" not in response:
|
|
44
|
+
return body
|
|
45
|
+
else:
|
|
46
|
+
code = response["Error"]["Code"]
|
|
47
|
+
message = response["Error"]["Message"]
|
|
48
|
+
req_id = response["RequestId"]
|
|
49
|
+
raise KsyunSDKException(code, message, req_id)
|
|
50
|
+
except Exception as e:
|
|
51
|
+
if isinstance(e, KsyunSDKException):
|
|
52
|
+
raise
|
|
53
|
+
else:
|
|
54
|
+
raise KsyunSDKException(message=str(e))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def ModifyClusterName(self, request):
|
|
58
|
+
"""修改集群名称V2
|
|
59
|
+
:param request: Request instance for ModifyClusterName.
|
|
60
|
+
:type request: :class:`ksyun.client.kes.v20201215.models.ModifyClusterNameRequest`
|
|
61
|
+
"""
|
|
62
|
+
try:
|
|
63
|
+
params = request._serialize()
|
|
64
|
+
body = self.call_judge("ModifyClusterName", params, "application/json")
|
|
65
|
+
response = json.loads(body)
|
|
66
|
+
if "Error" not in response:
|
|
67
|
+
return body
|
|
68
|
+
else:
|
|
69
|
+
code = response["Error"]["Code"]
|
|
70
|
+
message = response["Error"]["Message"]
|
|
71
|
+
req_id = response["RequestId"]
|
|
72
|
+
raise KsyunSDKException(code, message, req_id)
|
|
73
|
+
except Exception as e:
|
|
74
|
+
if isinstance(e, KsyunSDKException):
|
|
75
|
+
raise
|
|
76
|
+
else:
|
|
77
|
+
raise KsyunSDKException(message=str(e))
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def LaunchCluster(self, request):
|
|
81
|
+
"""创建集群V2
|
|
82
|
+
:param request: Request instance for LaunchCluster.
|
|
83
|
+
:type request: :class:`ksyun.client.kes.v20201215.models.LaunchClusterRequest`
|
|
84
|
+
"""
|
|
85
|
+
try:
|
|
86
|
+
params = request._serialize()
|
|
87
|
+
body = self.call_judge("LaunchCluster", params, "application/json")
|
|
88
|
+
response = json.loads(body)
|
|
89
|
+
if "Error" not in response:
|
|
90
|
+
return body
|
|
91
|
+
else:
|
|
92
|
+
code = response["Error"]["Code"]
|
|
93
|
+
message = response["Error"]["Message"]
|
|
94
|
+
req_id = response["RequestId"]
|
|
95
|
+
raise KsyunSDKException(code, message, req_id)
|
|
96
|
+
except Exception as e:
|
|
97
|
+
if isinstance(e, KsyunSDKException):
|
|
98
|
+
raise
|
|
99
|
+
else:
|
|
100
|
+
raise KsyunSDKException(message=str(e))
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def ListInstanceGroups(self, request):
|
|
104
|
+
"""查询节点组详情V2
|
|
105
|
+
:param request: Request instance for ListInstanceGroups.
|
|
106
|
+
:type request: :class:`ksyun.client.kes.v20201215.models.ListInstanceGroupsRequest`
|
|
107
|
+
"""
|
|
108
|
+
try:
|
|
109
|
+
params = request._serialize()
|
|
110
|
+
body = self.call_judge("ListInstanceGroups", params, "application/json")
|
|
111
|
+
response = json.loads(body)
|
|
112
|
+
if "Error" not in response:
|
|
113
|
+
return body
|
|
114
|
+
else:
|
|
115
|
+
code = response["Error"]["Code"]
|
|
116
|
+
message = response["Error"]["Message"]
|
|
117
|
+
req_id = response["RequestId"]
|
|
118
|
+
raise KsyunSDKException(code, message, req_id)
|
|
119
|
+
except Exception as e:
|
|
120
|
+
if isinstance(e, KsyunSDKException):
|
|
121
|
+
raise
|
|
122
|
+
else:
|
|
123
|
+
raise KsyunSDKException(message=str(e))
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def ServiceControl(self, request):
|
|
127
|
+
"""重启集群V2
|
|
128
|
+
:param request: Request instance for ServiceControl.
|
|
129
|
+
:type request: :class:`ksyun.client.kes.v20201215.models.ServiceControlRequest`
|
|
130
|
+
"""
|
|
131
|
+
try:
|
|
132
|
+
params = request._serialize()
|
|
133
|
+
body = self.call_judge("ServiceControl", params, "application/json")
|
|
134
|
+
response = json.loads(body)
|
|
135
|
+
if "Error" not in response:
|
|
136
|
+
return body
|
|
137
|
+
else:
|
|
138
|
+
code = response["Error"]["Code"]
|
|
139
|
+
message = response["Error"]["Message"]
|
|
140
|
+
req_id = response["RequestId"]
|
|
141
|
+
raise KsyunSDKException(code, message, req_id)
|
|
142
|
+
except Exception as e:
|
|
143
|
+
if isinstance(e, KsyunSDKException):
|
|
144
|
+
raise
|
|
145
|
+
else:
|
|
146
|
+
raise KsyunSDKException(message=str(e))
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def ClusterHealthStatistic(self, request):
|
|
150
|
+
"""查看诊断报告V2
|
|
151
|
+
:param request: Request instance for ClusterHealthStatistic.
|
|
152
|
+
:type request: :class:`ksyun.client.kes.v20201215.models.ClusterHealthStatisticRequest`
|
|
153
|
+
"""
|
|
154
|
+
try:
|
|
155
|
+
params = request._serialize()
|
|
156
|
+
body = self.call_judge("ClusterHealthStatistic", params, "application/json")
|
|
157
|
+
response = json.loads(body)
|
|
158
|
+
if "Error" not in response:
|
|
159
|
+
return body
|
|
160
|
+
else:
|
|
161
|
+
code = response["Error"]["Code"]
|
|
162
|
+
message = response["Error"]["Message"]
|
|
163
|
+
req_id = response["RequestId"]
|
|
164
|
+
raise KsyunSDKException(code, message, req_id)
|
|
165
|
+
except Exception as e:
|
|
166
|
+
if isinstance(e, KsyunSDKException):
|
|
167
|
+
raise
|
|
168
|
+
else:
|
|
169
|
+
raise KsyunSDKException(message=str(e))
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def CheckClusterHealth(self, request):
|
|
173
|
+
"""立即诊断V2
|
|
174
|
+
:param request: Request instance for CheckClusterHealth.
|
|
175
|
+
:type request: :class:`ksyun.client.kes.v20201215.models.CheckClusterHealthRequest`
|
|
176
|
+
"""
|
|
177
|
+
try:
|
|
178
|
+
params = request._serialize()
|
|
179
|
+
body = self.call_judge("CheckClusterHealth", params, "application/json")
|
|
180
|
+
response = json.loads(body)
|
|
181
|
+
if "Error" not in response:
|
|
182
|
+
return body
|
|
183
|
+
else:
|
|
184
|
+
code = response["Error"]["Code"]
|
|
185
|
+
message = response["Error"]["Message"]
|
|
186
|
+
req_id = response["RequestId"]
|
|
187
|
+
raise KsyunSDKException(code, message, req_id)
|
|
188
|
+
except Exception as e:
|
|
189
|
+
if isinstance(e, KsyunSDKException):
|
|
190
|
+
raise
|
|
191
|
+
else:
|
|
192
|
+
raise KsyunSDKException(message=str(e))
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
from ksyun.common.abstract_model import AbstractModel
|
|
2
|
+
|
|
3
|
+
class DescribeClusterRequest(AbstractModel):
|
|
4
|
+
"""DescribeCluster请求参数结构体
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
def __init__(self):
|
|
8
|
+
r"""查询集群详情V2
|
|
9
|
+
:param ClusterId: 集群ID
|
|
10
|
+
:type PathPrefix: String
|
|
11
|
+
"""
|
|
12
|
+
self.ClusterId = None
|
|
13
|
+
|
|
14
|
+
def _deserialize(self, params):
|
|
15
|
+
if params.get("ClusterId"):
|
|
16
|
+
self.ClusterId = params.get("ClusterId")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ListClustersRequest(AbstractModel):
|
|
20
|
+
"""ListClusters请求参数结构体
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(self):
|
|
24
|
+
r"""查看集群列表V2
|
|
25
|
+
:param Marker: 分页信息:
|
|
26
|
+
limit:指定返回的记录数
|
|
27
|
+
offset:指定查询起始位置
|
|
28
|
+
示例值:
|
|
29
|
+
limit=2&offset=0
|
|
30
|
+
:type PathPrefix: String
|
|
31
|
+
"""
|
|
32
|
+
self.Marker = None
|
|
33
|
+
|
|
34
|
+
def _deserialize(self, params):
|
|
35
|
+
if params.get("Marker"):
|
|
36
|
+
self.Marker = params.get("Marker")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class ModifyClusterNameRequest(AbstractModel):
|
|
40
|
+
"""ModifyClusterName请求参数结构体
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
def __init__(self):
|
|
44
|
+
r"""修改集群名称V2
|
|
45
|
+
:param ClusterId: 集群ID
|
|
46
|
+
:type PathPrefix: String
|
|
47
|
+
:param ClusterName: 集群名称
|
|
48
|
+
:type PathPrefix: String
|
|
49
|
+
"""
|
|
50
|
+
self.ClusterId = None
|
|
51
|
+
self.ClusterName = None
|
|
52
|
+
|
|
53
|
+
def _deserialize(self, params):
|
|
54
|
+
if params.get("ClusterId"):
|
|
55
|
+
self.ClusterId = params.get("ClusterId")
|
|
56
|
+
if params.get("ClusterName"):
|
|
57
|
+
self.ClusterName = params.get("ClusterName")
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class LaunchClusterRequest(AbstractModel):
|
|
61
|
+
"""LaunchCluster请求参数结构体
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
def __init__(self):
|
|
65
|
+
r"""创建集群V2
|
|
66
|
+
:param ClusterName: 集群名称(1-25个字符,支持数字、大小写字母、减号、下划线)
|
|
67
|
+
:type PathPrefix: String
|
|
68
|
+
:param MainVersion: ES版本
|
|
69
|
+
有效值:
|
|
70
|
+
|
|
71
|
+
7.10.0
|
|
72
|
+
7.4.2
|
|
73
|
+
6.8.4
|
|
74
|
+
5.6.16
|
|
75
|
+
:type PathPrefix: String
|
|
76
|
+
:param Scenario: 场景化配置模板
|
|
77
|
+
有效值:
|
|
78
|
+
General
|
|
79
|
+
Analysis
|
|
80
|
+
Log
|
|
81
|
+
Search
|
|
82
|
+
:type PathPrefix: String
|
|
83
|
+
:param AvailabilityZone: 集群数据中心及可用区
|
|
84
|
+
有效值:
|
|
85
|
+
cn-beijing-6a: 华北1(北京),
|
|
86
|
+
cn-beijing-6b: 华北1(北京),
|
|
87
|
+
cn-beijing-6c: 华北1(北京),
|
|
88
|
+
cn-beijing-6d: 华北1(北京),
|
|
89
|
+
cn-beijing-6e: 华北1(北京),
|
|
90
|
+
cn-shanghai-2a: 华东1(上海),
|
|
91
|
+
cn-shanghai-2b: 华东1(上海),
|
|
92
|
+
cn-shanghai-3a: 华东2(上海),
|
|
93
|
+
cn-shanghai-3b: 华东2(上海),
|
|
94
|
+
cn-qingyangtest-1a: 华南1(广州),
|
|
95
|
+
cn-qingyangtest-1b: 华南1(广州),
|
|
96
|
+
ap-singapore-1a: 新加坡,
|
|
97
|
+
ap-singapore-1b: 新加坡,
|
|
98
|
+
eu-east-1a: 俄罗斯(莫斯科),
|
|
99
|
+
eu-east-1b: 俄罗斯(莫斯科),
|
|
100
|
+
cn-taipei-1a: 台北,
|
|
101
|
+
cn-beijing-fin-a: 华北金融1(北京),
|
|
102
|
+
cn-northwest-1a: 西北1区(庆阳),
|
|
103
|
+
cn-northwest-4a: 西北4区(海东),
|
|
104
|
+
cn-northwest-3a: 西北3区(宁夏),
|
|
105
|
+
:type PathPrefix: String
|
|
106
|
+
:param ChargeType: 计费方式
|
|
107
|
+
有效值:
|
|
108
|
+
Monthly:包年包月
|
|
109
|
+
Minutely:按量付费
|
|
110
|
+
Daily:按量付费按日月结
|
|
111
|
+
:type PathPrefix: String
|
|
112
|
+
:param PurchaseTime: 包年包月购买时长,计费类型为Monthly时必填
|
|
113
|
+
:type PathPrefix: Int
|
|
114
|
+
:param ProjectId: 项目ID
|
|
115
|
+
:type PathPrefix: Int
|
|
116
|
+
:param VpcDomainId: 账号下同数据中心可用VPC网络ID
|
|
117
|
+
:type PathPrefix: String
|
|
118
|
+
:param VpcSubnetId: 账号下同数据中心同可用区可用云服务器子网ID
|
|
119
|
+
节点资源有KEC资源则必填
|
|
120
|
+
:type PathPrefix: String
|
|
121
|
+
:param VpcEpcSubnetId: 账号下同数据中心同可用区可用裸金属服务器子网ID
|
|
122
|
+
节点资源有裸金属资源则必填
|
|
123
|
+
:type PathPrefix: String
|
|
124
|
+
:param SecurityGroupId: 安全组ID
|
|
125
|
+
:type PathPrefix: String
|
|
126
|
+
:param InstanceGroups: 节点组信息
|
|
127
|
+
:type PathPrefix: Array
|
|
128
|
+
"""
|
|
129
|
+
self.ClusterName = None
|
|
130
|
+
self.MainVersion = None
|
|
131
|
+
self.Scenario = None
|
|
132
|
+
self.AvailabilityZone = None
|
|
133
|
+
self.ChargeType = None
|
|
134
|
+
self.PurchaseTime = None
|
|
135
|
+
self.ProjectId = None
|
|
136
|
+
self.VpcDomainId = None
|
|
137
|
+
self.VpcSubnetId = None
|
|
138
|
+
self.VpcEpcSubnetId = None
|
|
139
|
+
self.SecurityGroupId = None
|
|
140
|
+
self.InstanceGroups = None
|
|
141
|
+
|
|
142
|
+
def _deserialize(self, params):
|
|
143
|
+
if params.get("ClusterName"):
|
|
144
|
+
self.ClusterName = params.get("ClusterName")
|
|
145
|
+
if params.get("MainVersion"):
|
|
146
|
+
self.MainVersion = params.get("MainVersion")
|
|
147
|
+
if params.get("Scenario"):
|
|
148
|
+
self.Scenario = params.get("Scenario")
|
|
149
|
+
if params.get("AvailabilityZone"):
|
|
150
|
+
self.AvailabilityZone = params.get("AvailabilityZone")
|
|
151
|
+
if params.get("ChargeType"):
|
|
152
|
+
self.ChargeType = params.get("ChargeType")
|
|
153
|
+
if params.get("PurchaseTime"):
|
|
154
|
+
self.PurchaseTime = params.get("PurchaseTime")
|
|
155
|
+
if params.get("ProjectId"):
|
|
156
|
+
self.ProjectId = params.get("ProjectId")
|
|
157
|
+
if params.get("VpcDomainId"):
|
|
158
|
+
self.VpcDomainId = params.get("VpcDomainId")
|
|
159
|
+
if params.get("VpcSubnetId"):
|
|
160
|
+
self.VpcSubnetId = params.get("VpcSubnetId")
|
|
161
|
+
if params.get("VpcEpcSubnetId"):
|
|
162
|
+
self.VpcEpcSubnetId = params.get("VpcEpcSubnetId")
|
|
163
|
+
if params.get("SecurityGroupId"):
|
|
164
|
+
self.SecurityGroupId = params.get("SecurityGroupId")
|
|
165
|
+
if params.get("InstanceGroups"):
|
|
166
|
+
self.InstanceGroups = params.get("InstanceGroups")
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
class ListInstanceGroupsRequest(AbstractModel):
|
|
170
|
+
"""ListInstanceGroups请求参数结构体
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
def __init__(self):
|
|
174
|
+
r"""查询节点组详情V2
|
|
175
|
+
:param ClusterId: 集群ID
|
|
176
|
+
:type PathPrefix: String
|
|
177
|
+
"""
|
|
178
|
+
self.ClusterId = None
|
|
179
|
+
|
|
180
|
+
def _deserialize(self, params):
|
|
181
|
+
if params.get("ClusterId"):
|
|
182
|
+
self.ClusterId = params.get("ClusterId")
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
class ServiceControlRequest(AbstractModel):
|
|
186
|
+
"""ServiceControl请求参数结构体
|
|
187
|
+
"""
|
|
188
|
+
|
|
189
|
+
def __init__(self):
|
|
190
|
+
r"""重启集群V2
|
|
191
|
+
:param ClusterId: 集群ID
|
|
192
|
+
:type PathPrefix: String
|
|
193
|
+
:param ControlType: 操作类型:
|
|
194
|
+
restart:重启
|
|
195
|
+
:type PathPrefix: String
|
|
196
|
+
:param Rolling: 重启方式:
|
|
197
|
+
True(默认):滚动重启
|
|
198
|
+
False:强制重启
|
|
199
|
+
:type PathPrefix: String
|
|
200
|
+
"""
|
|
201
|
+
self.ClusterId = None
|
|
202
|
+
self.ControlType = None
|
|
203
|
+
self.Rolling = None
|
|
204
|
+
|
|
205
|
+
def _deserialize(self, params):
|
|
206
|
+
if params.get("ClusterId"):
|
|
207
|
+
self.ClusterId = params.get("ClusterId")
|
|
208
|
+
if params.get("ControlType"):
|
|
209
|
+
self.ControlType = params.get("ControlType")
|
|
210
|
+
if params.get("Rolling"):
|
|
211
|
+
self.Rolling = params.get("Rolling")
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
class ClusterHealthStatisticRequest(AbstractModel):
|
|
215
|
+
"""ClusterHealthStatistic请求参数结构体
|
|
216
|
+
"""
|
|
217
|
+
|
|
218
|
+
def __init__(self):
|
|
219
|
+
r"""查看诊断报告V2
|
|
220
|
+
:param ClusterId: 集群ID
|
|
221
|
+
:type PathPrefix: String
|
|
222
|
+
"""
|
|
223
|
+
self.ClusterId = None
|
|
224
|
+
|
|
225
|
+
def _deserialize(self, params):
|
|
226
|
+
if params.get("ClusterId"):
|
|
227
|
+
self.ClusterId = params.get("ClusterId")
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
class CheckClusterHealthRequest(AbstractModel):
|
|
231
|
+
"""CheckClusterHealth请求参数结构体
|
|
232
|
+
"""
|
|
233
|
+
|
|
234
|
+
def __init__(self):
|
|
235
|
+
r"""立即诊断V2
|
|
236
|
+
:param cluster_id: 集群ID
|
|
237
|
+
:type PathPrefix: String
|
|
238
|
+
:param check_list: 检查范围:
|
|
239
|
+
目前仅支持对集群所有节点组进行诊断,请填写:all
|
|
240
|
+
|
|
241
|
+
:type PathPrefix: Array
|
|
242
|
+
"""
|
|
243
|
+
self.cluster_id = None
|
|
244
|
+
self.check_list = None
|
|
245
|
+
|
|
246
|
+
def _deserialize(self, params):
|
|
247
|
+
if params.get("cluster_id"):
|
|
248
|
+
self.cluster_id = params.get("cluster_id")
|
|
249
|
+
if params.get("check_list"):
|
|
250
|
+
self.check_list = params.get("check_list")
|
|
251
|
+
|
|
252
|
+
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
from ksyun.common.exception.ksyun_sdk_exception import KsyunSDKException
|
|
4
|
+
from ksyun.common.abstract_client import AbstractClient
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class KetClient(AbstractClient):
|
|
8
|
+
_apiVersion = '2017-01-01'
|
|
9
|
+
_endpoint = 'ket.api.ksyun.com'
|
|
10
|
+
_service = 'ket'
|
|
11
|
+
def Preset(self, request):
|
|
12
|
+
"""add preset
|
|
13
|
+
:param request: Request instance for Preset.
|
|
14
|
+
:type request: :class:`ksyun.client.ket.v20170101.models.PresetRequest`
|
|
15
|
+
"""
|
|
16
|
+
try:
|
|
17
|
+
params = request._serialize()
|
|
18
|
+
body = self.call_judge("Preset", params, "application/json")
|
|
19
|
+
response = json.loads(body)
|
|
20
|
+
if "Error" not in response:
|
|
21
|
+
return body
|
|
22
|
+
else:
|
|
23
|
+
code = response["Error"]["Code"]
|
|
24
|
+
message = response["Error"]["Message"]
|
|
25
|
+
req_id = response["RequestId"]
|
|
26
|
+
raise KsyunSDKException(code, message, req_id)
|
|
27
|
+
except Exception as e:
|
|
28
|
+
if isinstance(e, KsyunSDKException):
|
|
29
|
+
raise
|
|
30
|
+
else:
|
|
31
|
+
raise KsyunSDKException(message=str(e))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def UpdatePreset(self, request):
|
|
35
|
+
"""update preset
|
|
36
|
+
:param request: Request instance for UpdatePreset.
|
|
37
|
+
:type request: :class:`ksyun.client.ket.v20170101.models.UpdatePresetRequest`
|
|
38
|
+
"""
|
|
39
|
+
try:
|
|
40
|
+
params = request._serialize()
|
|
41
|
+
body = self.call_judge("UpdatePreset", params, "application/x-www-form-urlencoded")
|
|
42
|
+
response = json.loads(body)
|
|
43
|
+
if "Error" not in response:
|
|
44
|
+
return body
|
|
45
|
+
else:
|
|
46
|
+
code = response["Error"]["Code"]
|
|
47
|
+
message = response["Error"]["Message"]
|
|
48
|
+
req_id = response["RequestId"]
|
|
49
|
+
raise KsyunSDKException(code, message, req_id)
|
|
50
|
+
except Exception as e:
|
|
51
|
+
if isinstance(e, KsyunSDKException):
|
|
52
|
+
raise
|
|
53
|
+
else:
|
|
54
|
+
raise KsyunSDKException(message=str(e))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def DelPreset(self, request):
|
|
58
|
+
"""delete preset
|
|
59
|
+
:param request: Request instance for DelPreset.
|
|
60
|
+
:type request: :class:`ksyun.client.ket.v20170101.models.DelPresetRequest`
|
|
61
|
+
"""
|
|
62
|
+
try:
|
|
63
|
+
params = request._serialize()
|
|
64
|
+
body = self.call_judge("DelPreset", params, "application/json")
|
|
65
|
+
response = json.loads(body)
|
|
66
|
+
if "Error" not in response:
|
|
67
|
+
return body
|
|
68
|
+
else:
|
|
69
|
+
code = response["Error"]["Code"]
|
|
70
|
+
message = response["Error"]["Message"]
|
|
71
|
+
req_id = response["RequestId"]
|
|
72
|
+
raise KsyunSDKException(code, message, req_id)
|
|
73
|
+
except Exception as e:
|
|
74
|
+
if isinstance(e, KsyunSDKException):
|
|
75
|
+
raise
|
|
76
|
+
else:
|
|
77
|
+
raise KsyunSDKException(message=str(e))
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def GetPresetList(self, request):
|
|
81
|
+
"""get preset list
|
|
82
|
+
:param request: Request instance for GetPresetList.
|
|
83
|
+
:type request: :class:`ksyun.client.ket.v20170101.models.GetPresetListRequest`
|
|
84
|
+
"""
|
|
85
|
+
try:
|
|
86
|
+
params = request._serialize()
|
|
87
|
+
body = self.call_judge("GetPresetList", params, "application/x-www-form-urlencoded")
|
|
88
|
+
response = json.loads(body)
|
|
89
|
+
if "Error" not in response:
|
|
90
|
+
return body
|
|
91
|
+
else:
|
|
92
|
+
code = response["Error"]["Code"]
|
|
93
|
+
message = response["Error"]["Message"]
|
|
94
|
+
req_id = response["RequestId"]
|
|
95
|
+
raise KsyunSDKException(code, message, req_id)
|
|
96
|
+
except Exception as e:
|
|
97
|
+
if isinstance(e, KsyunSDKException):
|
|
98
|
+
raise
|
|
99
|
+
else:
|
|
100
|
+
raise KsyunSDKException(message=str(e))
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def GetPresetDetail(self, request):
|
|
104
|
+
"""get preset detail
|
|
105
|
+
:param request: Request instance for GetPresetDetail.
|
|
106
|
+
:type request: :class:`ksyun.client.ket.v20170101.models.GetPresetDetailRequest`
|
|
107
|
+
"""
|
|
108
|
+
try:
|
|
109
|
+
params = request._serialize()
|
|
110
|
+
body = self.call_judge("GetPresetDetail", params, "application/x-www-form-urlencoded")
|
|
111
|
+
response = json.loads(body)
|
|
112
|
+
if "Error" not in response:
|
|
113
|
+
return body
|
|
114
|
+
else:
|
|
115
|
+
code = response["Error"]["Code"]
|
|
116
|
+
message = response["Error"]["Message"]
|
|
117
|
+
req_id = response["RequestId"]
|
|
118
|
+
raise KsyunSDKException(code, message, req_id)
|
|
119
|
+
except Exception as e:
|
|
120
|
+
if isinstance(e, KsyunSDKException):
|
|
121
|
+
raise
|
|
122
|
+
else:
|
|
123
|
+
raise KsyunSDKException(message=str(e))
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def GetStreamTranList(self, request):
|
|
127
|
+
"""get stream tran list
|
|
128
|
+
:param request: Request instance for GetStreamTranList.
|
|
129
|
+
:type request: :class:`ksyun.client.ket.v20170101.models.GetStreamTranListRequest`
|
|
130
|
+
"""
|
|
131
|
+
try:
|
|
132
|
+
params = request._serialize()
|
|
133
|
+
body = self.call_judge("GetStreamTranList", params, "application/x-www-form-urlencoded")
|
|
134
|
+
response = json.loads(body)
|
|
135
|
+
if "Error" not in response:
|
|
136
|
+
return body
|
|
137
|
+
else:
|
|
138
|
+
code = response["Error"]["Code"]
|
|
139
|
+
message = response["Error"]["Message"]
|
|
140
|
+
req_id = response["RequestId"]
|
|
141
|
+
raise KsyunSDKException(code, message, req_id)
|
|
142
|
+
except Exception as e:
|
|
143
|
+
if isinstance(e, KsyunSDKException):
|
|
144
|
+
raise
|
|
145
|
+
else:
|
|
146
|
+
raise KsyunSDKException(message=str(e))
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def StartLoop(self, request):
|
|
150
|
+
"""start loop tran
|
|
151
|
+
:param request: Request instance for StartLoop.
|
|
152
|
+
:type request: :class:`ksyun.client.ket.v20170101.models.StartLoopRequest`
|
|
153
|
+
"""
|
|
154
|
+
try:
|
|
155
|
+
params = request._serialize()
|
|
156
|
+
body = self.call_judge("StartLoop", params, "application/json")
|
|
157
|
+
response = json.loads(body)
|
|
158
|
+
if "Error" not in response:
|
|
159
|
+
return body
|
|
160
|
+
else:
|
|
161
|
+
code = response["Error"]["Code"]
|
|
162
|
+
message = response["Error"]["Message"]
|
|
163
|
+
req_id = response["RequestId"]
|
|
164
|
+
raise KsyunSDKException(code, message, req_id)
|
|
165
|
+
except Exception as e:
|
|
166
|
+
if isinstance(e, KsyunSDKException):
|
|
167
|
+
raise
|
|
168
|
+
else:
|
|
169
|
+
raise KsyunSDKException(message=str(e))
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def StopLoop(self, request):
|
|
173
|
+
"""stop loop tran
|
|
174
|
+
:param request: Request instance for StopLoop.
|
|
175
|
+
:type request: :class:`ksyun.client.ket.v20170101.models.StopLoopRequest`
|
|
176
|
+
"""
|
|
177
|
+
try:
|
|
178
|
+
params = request._serialize()
|
|
179
|
+
body = self.call_judge("StopLoop", params, "application/json")
|
|
180
|
+
response = json.loads(body)
|
|
181
|
+
if "Error" not in response:
|
|
182
|
+
return body
|
|
183
|
+
else:
|
|
184
|
+
code = response["Error"]["Code"]
|
|
185
|
+
message = response["Error"]["Message"]
|
|
186
|
+
req_id = response["RequestId"]
|
|
187
|
+
raise KsyunSDKException(code, message, req_id)
|
|
188
|
+
except Exception as e:
|
|
189
|
+
if isinstance(e, KsyunSDKException):
|
|
190
|
+
raise
|
|
191
|
+
else:
|
|
192
|
+
raise KsyunSDKException(message=str(e))
|