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
|
@@ -15,7 +15,7 @@ class TradeClient(AbstractClient):
|
|
|
15
15
|
"""
|
|
16
16
|
try:
|
|
17
17
|
params = request._serialize()
|
|
18
|
-
body = self.
|
|
18
|
+
body = self.call_judge("DescribeInstances", params, "application/x-www-form-urlencoded")
|
|
19
19
|
response = json.loads(body)
|
|
20
20
|
if "Error" not in response:
|
|
21
21
|
return body
|
|
@@ -28,6 +28,4 @@ class TradeClient(AbstractClient):
|
|
|
28
28
|
if isinstance(e, KsyunSDKException):
|
|
29
29
|
raise
|
|
30
30
|
else:
|
|
31
|
-
raise KsyunSDKException(
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
raise KsyunSDKException(message=str(e))
|
|
@@ -15,7 +15,7 @@ class TradeClient(AbstractClient):
|
|
|
15
15
|
"""
|
|
16
16
|
try:
|
|
17
17
|
params = request._serialize()
|
|
18
|
-
body = self.
|
|
18
|
+
body = self.call_judge("SetRenewal", params, "application/x-www-form-urlencoded")
|
|
19
19
|
response = json.loads(body)
|
|
20
20
|
if "Error" not in response:
|
|
21
21
|
return body
|
|
@@ -28,6 +28,4 @@ class TradeClient(AbstractClient):
|
|
|
28
28
|
if isinstance(e, KsyunSDKException):
|
|
29
29
|
raise
|
|
30
30
|
else:
|
|
31
|
-
raise KsyunSDKException(
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
raise KsyunSDKException(message=str(e))
|
|
File without changes
|
|
@@ -0,0 +1,100 @@
|
|
|
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 TradeClient(AbstractClient):
|
|
8
|
+
_apiVersion = '2025-02-20'
|
|
9
|
+
_endpoint = 'trade.api.ksyun.com'
|
|
10
|
+
_service = 'trade'
|
|
11
|
+
def ListInstanceSupportBillTypes(self, request):
|
|
12
|
+
"""实例转正,支持重新指定正式实例的计费方式,实例获取支持的计费方式列表
|
|
13
|
+
:param request: Request instance for ListInstanceSupportBillTypes.
|
|
14
|
+
:type request: :class:`ksyun.client.trade.v20250220.models.ListInstanceSupportBillTypesRequest`
|
|
15
|
+
"""
|
|
16
|
+
try:
|
|
17
|
+
params = request._serialize()
|
|
18
|
+
body = self.call_judge("ListInstanceSupportBillTypes", 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 AddTrialToBuyTask(self, request):
|
|
35
|
+
"""添加定时转正的任务,支持到期转正和指定时间点转正。 可重复提交,最后一次提交会覆盖之前的提交,相当于更新。
|
|
36
|
+
:param request: Request instance for AddTrialToBuyTask.
|
|
37
|
+
:type request: :class:`ksyun.client.trade.v20250220.models.AddTrialToBuyTaskRequest`
|
|
38
|
+
"""
|
|
39
|
+
try:
|
|
40
|
+
params = request._serialize()
|
|
41
|
+
body = self.call_judge("AddTrialToBuyTask", 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 DeleteTrialToBuyTask(self, request):
|
|
58
|
+
"""取消已经提交的转正任务。
|
|
59
|
+
:param request: Request instance for DeleteTrialToBuyTask.
|
|
60
|
+
:type request: :class:`ksyun.client.trade.v20250220.models.DeleteTrialToBuyTaskRequest`
|
|
61
|
+
"""
|
|
62
|
+
try:
|
|
63
|
+
params = request._serialize()
|
|
64
|
+
body = self.call_judge("DeleteTrialToBuyTask", 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 CreateTrialToBuyNow(self, request):
|
|
81
|
+
"""创建转正订单,立即将实例转成正式实例。
|
|
82
|
+
:param request: Request instance for CreateTrialToBuyNow.
|
|
83
|
+
:type request: :class:`ksyun.client.trade.v20250220.models.CreateTrialToBuyNowRequest`
|
|
84
|
+
"""
|
|
85
|
+
try:
|
|
86
|
+
params = request._serialize()
|
|
87
|
+
body = self.call_judge("CreateTrialToBuyNow", 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))
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
from ksyun.common.abstract_model import AbstractModel
|
|
2
|
+
|
|
3
|
+
class ListInstanceSupportBillTypesRequest(AbstractModel):
|
|
4
|
+
"""ListInstanceSupportBillTypes请求参数结构体
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
def __init__(self):
|
|
8
|
+
r"""实例转正,支持重新指定正式实例的计费方式,实例获取支持的计费方式列表
|
|
9
|
+
:param instanceId: 实例ID
|
|
10
|
+
:type PathPrefix: String
|
|
11
|
+
"""
|
|
12
|
+
self.instanceId = None
|
|
13
|
+
|
|
14
|
+
def _deserialize(self, params):
|
|
15
|
+
if params.get("instanceId"):
|
|
16
|
+
self.instanceId = params.get("instanceId")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class AddTrialToBuyTaskRequest(AbstractModel):
|
|
20
|
+
"""AddTrialToBuyTask请求参数结构体
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(self):
|
|
24
|
+
r"""添加定时转正的任务,支持到期转正和指定时间点转正。 可重复提交,最后一次提交会覆盖之前的提交,相当于更新。
|
|
25
|
+
:param instanceId: 实例id
|
|
26
|
+
:type PathPrefix: String
|
|
27
|
+
:param billType: 计费方式。默认按照当前实例的计费方式进行转正。支持的计费方式列表通过ListInstanceSupportBillTypes接口获取
|
|
28
|
+
:type PathPrefix: Int
|
|
29
|
+
:param duration: 转正为包年包月时,必须填写正式实例购买时长,单位月
|
|
30
|
+
:type PathPrefix: Int
|
|
31
|
+
:param autoTrialToBuyDate: 指定转正日期,格式为yyyy-MM-dd HH:mm:ss。默认是到期时间点转正。
|
|
32
|
+
:type PathPrefix: String
|
|
33
|
+
"""
|
|
34
|
+
self.instanceId = None
|
|
35
|
+
self.billType = None
|
|
36
|
+
self.duration = None
|
|
37
|
+
self.autoTrialToBuyDate = None
|
|
38
|
+
|
|
39
|
+
def _deserialize(self, params):
|
|
40
|
+
if params.get("instanceId"):
|
|
41
|
+
self.instanceId = params.get("instanceId")
|
|
42
|
+
if params.get("billType"):
|
|
43
|
+
self.billType = params.get("billType")
|
|
44
|
+
if params.get("duration"):
|
|
45
|
+
self.duration = params.get("duration")
|
|
46
|
+
if params.get("autoTrialToBuyDate"):
|
|
47
|
+
self.autoTrialToBuyDate = params.get("autoTrialToBuyDate")
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class DeleteTrialToBuyTaskRequest(AbstractModel):
|
|
51
|
+
"""DeleteTrialToBuyTask请求参数结构体
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
def __init__(self):
|
|
55
|
+
r"""取消已经提交的转正任务。
|
|
56
|
+
:param instanceId: 实例id
|
|
57
|
+
:type PathPrefix: String
|
|
58
|
+
"""
|
|
59
|
+
self.instanceId = None
|
|
60
|
+
|
|
61
|
+
def _deserialize(self, params):
|
|
62
|
+
if params.get("instanceId"):
|
|
63
|
+
self.instanceId = params.get("instanceId")
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class CreateTrialToBuyNowRequest(AbstractModel):
|
|
67
|
+
"""CreateTrialToBuyNow请求参数结构体
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
def __init__(self):
|
|
71
|
+
r"""创建转正订单,立即将实例转成正式实例。
|
|
72
|
+
:param instanceId: 实例ID
|
|
73
|
+
:type PathPrefix: String
|
|
74
|
+
:param billType: 计费方式。默认按照当前实例的计费方式进行转正。支持的计费方式列表通过ListInstanceSupportBillTypes接口获取
|
|
75
|
+
:type PathPrefix: Int
|
|
76
|
+
:param duration: 转正为包年包月时,必须填写正式实例购买时长,单位月
|
|
77
|
+
:type PathPrefix: Int
|
|
78
|
+
"""
|
|
79
|
+
self.instanceId = None
|
|
80
|
+
self.billType = None
|
|
81
|
+
self.duration = None
|
|
82
|
+
|
|
83
|
+
def _deserialize(self, params):
|
|
84
|
+
if params.get("instanceId"):
|
|
85
|
+
self.instanceId = params.get("instanceId")
|
|
86
|
+
if params.get("billType"):
|
|
87
|
+
self.billType = params.get("billType")
|
|
88
|
+
if params.get("duration"):
|
|
89
|
+
self.duration = params.get("duration")
|
|
90
|
+
|
|
91
|
+
|
|
File without changes
|
|
@@ -0,0 +1,100 @@
|
|
|
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 TradeClient(AbstractClient):
|
|
8
|
+
_apiVersion = '2025-03-21'
|
|
9
|
+
_endpoint = 'trade.api.ksyun.com'
|
|
10
|
+
_service = 'trade'
|
|
11
|
+
def QueryUnPayOrders(self, request):
|
|
12
|
+
"""查询主账号待支付的订单列表
|
|
13
|
+
:param request: Request instance for QueryUnPayOrders.
|
|
14
|
+
:type request: :class:`ksyun.client.trade.v20250321.models.QueryUnPayOrdersRequest`
|
|
15
|
+
"""
|
|
16
|
+
try:
|
|
17
|
+
params = request._serialize()
|
|
18
|
+
body = self.call_judge("QueryUnPayOrders", params, "application/x-www-form-urlencoded")
|
|
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 QueryOrderInfo(self, request):
|
|
35
|
+
"""根据订单ID查询订单信息
|
|
36
|
+
:param request: Request instance for QueryOrderInfo.
|
|
37
|
+
:type request: :class:`ksyun.client.trade.v20250321.models.QueryOrderInfoRequest`
|
|
38
|
+
"""
|
|
39
|
+
try:
|
|
40
|
+
params = request._serialize()
|
|
41
|
+
body = self.call_judge("QueryOrderInfo", 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 CancelOrder(self, request):
|
|
58
|
+
"""取消还未支付的订单,取消后不能再支付
|
|
59
|
+
:param request: Request instance for CancelOrder.
|
|
60
|
+
:type request: :class:`ksyun.client.trade.v20250321.models.CancelOrderRequest`
|
|
61
|
+
"""
|
|
62
|
+
try:
|
|
63
|
+
params = request._serialize()
|
|
64
|
+
body = self.call_judge("CancelOrder", params, "application/x-www-form-urlencoded")
|
|
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 LaunchPayOrder(self, request):
|
|
81
|
+
"""通过订单ID支付订单,会自动扣余额的金额
|
|
82
|
+
:param request: Request instance for LaunchPayOrder.
|
|
83
|
+
:type request: :class:`ksyun.client.trade.v20250321.models.LaunchPayOrderRequest`
|
|
84
|
+
"""
|
|
85
|
+
try:
|
|
86
|
+
params = request._serialize()
|
|
87
|
+
body = self.call_judge("LaunchPayOrder", 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))
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
from ksyun.common.abstract_model import AbstractModel
|
|
2
|
+
|
|
3
|
+
class QueryUnPayOrdersRequest(AbstractModel):
|
|
4
|
+
"""QueryUnPayOrders请求参数结构体
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
def __init__(self):
|
|
8
|
+
r"""查询主账号待支付的订单列表
|
|
9
|
+
:param page: 页码,从1开始
|
|
10
|
+
:type PathPrefix: Int
|
|
11
|
+
:param size: 每页大小
|
|
12
|
+
:type PathPrefix: Int
|
|
13
|
+
"""
|
|
14
|
+
self.page = None
|
|
15
|
+
self.size = None
|
|
16
|
+
|
|
17
|
+
def _deserialize(self, params):
|
|
18
|
+
if params.get("page"):
|
|
19
|
+
self.page = params.get("page")
|
|
20
|
+
if params.get("size"):
|
|
21
|
+
self.size = params.get("size")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class QueryOrderInfoRequest(AbstractModel):
|
|
25
|
+
"""QueryOrderInfo请求参数结构体
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
def __init__(self):
|
|
29
|
+
r"""根据订单ID查询订单信息
|
|
30
|
+
:param orderId: 订单ID
|
|
31
|
+
:type PathPrefix: String
|
|
32
|
+
"""
|
|
33
|
+
self.orderId = None
|
|
34
|
+
|
|
35
|
+
def _deserialize(self, params):
|
|
36
|
+
if params.get("orderId"):
|
|
37
|
+
self.orderId = params.get("orderId")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class CancelOrderRequest(AbstractModel):
|
|
41
|
+
"""CancelOrder请求参数结构体
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
def __init__(self):
|
|
45
|
+
r"""取消还未支付的订单,取消后不能再支付
|
|
46
|
+
:param orderId: 订单ID
|
|
47
|
+
:type PathPrefix: String
|
|
48
|
+
"""
|
|
49
|
+
self.orderId = None
|
|
50
|
+
|
|
51
|
+
def _deserialize(self, params):
|
|
52
|
+
if params.get("orderId"):
|
|
53
|
+
self.orderId = params.get("orderId")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class LaunchPayOrderRequest(AbstractModel):
|
|
57
|
+
"""LaunchPayOrder请求参数结构体
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
def __init__(self):
|
|
61
|
+
r"""通过订单ID支付订单,会自动扣余额的金额
|
|
62
|
+
:param OrderId: 订单ID
|
|
63
|
+
:type PathPrefix: String
|
|
64
|
+
"""
|
|
65
|
+
self.OrderId = None
|
|
66
|
+
|
|
67
|
+
def _deserialize(self, params):
|
|
68
|
+
if params.get("OrderId"):
|
|
69
|
+
self.OrderId = params.get("OrderId")
|
|
70
|
+
|
|
71
|
+
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
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 TradeClient(AbstractClient):
|
|
8
|
+
_apiVersion = '2025-08-28'
|
|
9
|
+
_endpoint = 'trade.api.ksyun.com'
|
|
10
|
+
_service = 'trade'
|
|
11
|
+
def QueryInstances(self, request):
|
|
12
|
+
"""根据搜索条件查询实例列表
|
|
13
|
+
:param request: Request instance for QueryInstances.
|
|
14
|
+
:type request: :class:`ksyun.client.trade.v20250828.models.QueryInstancesRequest`
|
|
15
|
+
"""
|
|
16
|
+
try:
|
|
17
|
+
params = request._serialize()
|
|
18
|
+
body = self.call_judge("QueryInstances", 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))
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
from ksyun.common.abstract_model import AbstractModel
|
|
2
|
+
|
|
3
|
+
class QueryInstancesRequest(AbstractModel):
|
|
4
|
+
"""QueryInstances请求参数结构体
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
def __init__(self):
|
|
8
|
+
r"""根据搜索条件查询实例列表
|
|
9
|
+
:param associatedUserId: 企业账号中心关联用户ID。如果空,则会返回企业账号中心有查看权限的用户ID下的实例。
|
|
10
|
+
:type PathPrefix: Long
|
|
11
|
+
:param instanceIds: 实例ID列表
|
|
12
|
+
:type PathPrefix: Array
|
|
13
|
+
:param status: 实例状态,默认值为2.
|
|
14
|
+
枚举值如下:1-创建中,2-已开通,3-开通失败,4-已过期,5-已回收,6-已退订,7-已删除,8-已欠费,9-欠费回收,10-一键关停,11-一键回收,12-退订中
|
|
15
|
+
:type PathPrefix: Int
|
|
16
|
+
:param productGroup: 产品线ID,ID可以通过“价格体系”的QueryProductTypes接口查询
|
|
17
|
+
:type PathPrefix: Int
|
|
18
|
+
:param renewStrategy: 续费策略:0 手动续费,1 自动续费
|
|
19
|
+
:type PathPrefix: Int
|
|
20
|
+
:param billingBeginTimeFrom: 计费开始时间起始,格式:yyyy-MM-dd HH:mm:ss
|
|
21
|
+
:type PathPrefix: String
|
|
22
|
+
:param billingBeginTimeTo: 计费开始时间结束,格式:yyyy-MM-dd HH:mm:ss
|
|
23
|
+
:type PathPrefix: String
|
|
24
|
+
:param billingEndTimeFrom: 计费结束时间起始,格式:yyyy-MM-dd HH:mm:ss
|
|
25
|
+
:type PathPrefix: String
|
|
26
|
+
:param billingEndTimeTo: 计费结束时间结束,格式:yyyy-MM-dd HH:mm:ss
|
|
27
|
+
:type PathPrefix: String
|
|
28
|
+
:param serviceBeginTimeFrom: 服务开始时间起始,格式:yyyy-MM-dd HH:mm:ss
|
|
29
|
+
和计费开始时间的区别是因为有试用,所以服务时间不等于计费时间。
|
|
30
|
+
:type PathPrefix: String
|
|
31
|
+
:param serviceBeginTimeTo: 服务开始时间结束,格式:yyyy-MM-dd HH:mm:ss
|
|
32
|
+
和计费开始时间的区别是因为有试用,所以服务时间不等于计费时间。
|
|
33
|
+
:type PathPrefix: String
|
|
34
|
+
:param page: 页数,从1开始,默认1
|
|
35
|
+
:type PathPrefix: Int
|
|
36
|
+
:param size: 页大小,默认10
|
|
37
|
+
:type PathPrefix: Int
|
|
38
|
+
"""
|
|
39
|
+
self.associatedUserId = None
|
|
40
|
+
self.instanceIds = None
|
|
41
|
+
self.status = None
|
|
42
|
+
self.productGroup = None
|
|
43
|
+
self.renewStrategy = None
|
|
44
|
+
self.billingBeginTimeFrom = None
|
|
45
|
+
self.billingBeginTimeTo = None
|
|
46
|
+
self.billingEndTimeFrom = None
|
|
47
|
+
self.billingEndTimeTo = None
|
|
48
|
+
self.serviceBeginTimeFrom = None
|
|
49
|
+
self.serviceBeginTimeTo = None
|
|
50
|
+
self.page = None
|
|
51
|
+
self.size = None
|
|
52
|
+
|
|
53
|
+
def _deserialize(self, params):
|
|
54
|
+
if params.get("associatedUserId"):
|
|
55
|
+
self.associatedUserId = params.get("associatedUserId")
|
|
56
|
+
if params.get("instanceIds"):
|
|
57
|
+
self.instanceIds = params.get("instanceIds")
|
|
58
|
+
if params.get("status"):
|
|
59
|
+
self.status = params.get("status")
|
|
60
|
+
if params.get("productGroup"):
|
|
61
|
+
self.productGroup = params.get("productGroup")
|
|
62
|
+
if params.get("renewStrategy"):
|
|
63
|
+
self.renewStrategy = params.get("renewStrategy")
|
|
64
|
+
if params.get("billingBeginTimeFrom"):
|
|
65
|
+
self.billingBeginTimeFrom = params.get("billingBeginTimeFrom")
|
|
66
|
+
if params.get("billingBeginTimeTo"):
|
|
67
|
+
self.billingBeginTimeTo = params.get("billingBeginTimeTo")
|
|
68
|
+
if params.get("billingEndTimeFrom"):
|
|
69
|
+
self.billingEndTimeFrom = params.get("billingEndTimeFrom")
|
|
70
|
+
if params.get("billingEndTimeTo"):
|
|
71
|
+
self.billingEndTimeTo = params.get("billingEndTimeTo")
|
|
72
|
+
if params.get("serviceBeginTimeFrom"):
|
|
73
|
+
self.serviceBeginTimeFrom = params.get("serviceBeginTimeFrom")
|
|
74
|
+
if params.get("serviceBeginTimeTo"):
|
|
75
|
+
self.serviceBeginTimeTo = params.get("serviceBeginTimeTo")
|
|
76
|
+
if params.get("page"):
|
|
77
|
+
self.page = params.get("page")
|
|
78
|
+
if params.get("size"):
|
|
79
|
+
self.size = params.get("size")
|
|
80
|
+
|
|
81
|
+
|