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
ksyun/common/abstract_client.py
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
# See the License for the specific language governing permissions and
|
|
15
15
|
# limitations under the License.
|
|
16
16
|
|
|
17
|
+
from __future__ import unicode_literals, print_function
|
|
17
18
|
import copy
|
|
18
19
|
import json
|
|
19
20
|
import sys
|
|
@@ -21,6 +22,7 @@ import uuid
|
|
|
21
22
|
import warnings
|
|
22
23
|
import logging
|
|
23
24
|
import logging.handlers
|
|
25
|
+
import six
|
|
24
26
|
|
|
25
27
|
try:
|
|
26
28
|
from urllib.parse import urlencode
|
|
@@ -33,8 +35,7 @@ from ksyun.common.exception import KsyunSDKException as SDKError
|
|
|
33
35
|
from ksyun.common.http.request import ApiRequest
|
|
34
36
|
from ksyun.common.http.request import RequestInternal
|
|
35
37
|
from ksyun.common.profile.client_profile import ClientProfile
|
|
36
|
-
from
|
|
37
|
-
from datetime import datetime, timedelta
|
|
38
|
+
from requests_aws4auth import AWS4Auth
|
|
38
39
|
|
|
39
40
|
warnings.filterwarnings("ignore")
|
|
40
41
|
|
|
@@ -63,6 +64,7 @@ class AbstractClient(object):
|
|
|
63
64
|
_service = ''
|
|
64
65
|
_sdkVersion = 'SDK_PYTHON_%s' % ksyun.__version__
|
|
65
66
|
_default_content_type = _form_urlencoded_content
|
|
67
|
+
paramsFormat = True
|
|
66
68
|
FMT = '%(asctime)s %(process)d %(filename)s L%(lineno)s %(levelname)s %(message)s'
|
|
67
69
|
|
|
68
70
|
def __init__(self, credential, region, profile=None):
|
|
@@ -86,6 +88,9 @@ class AbstractClient(object):
|
|
|
86
88
|
def _fix_params(self, params):
|
|
87
89
|
if not isinstance(params, (dict,)):
|
|
88
90
|
return params
|
|
91
|
+
if not self.paramsFormat:
|
|
92
|
+
return params
|
|
93
|
+
|
|
89
94
|
return self._format_params(None, params)
|
|
90
95
|
|
|
91
96
|
def _format_params(self, prefix, params):
|
|
@@ -118,36 +123,32 @@ class AbstractClient(object):
|
|
|
118
123
|
raise KsyunSDKException("ClientParamsError", "some params type error")
|
|
119
124
|
|
|
120
125
|
def _build_req_inter(self, action, params, req_inter, options=None):
|
|
121
|
-
if self.profile.signMethod in ("HMAC-SHA1", "HMAC-SHA256"):
|
|
126
|
+
if self.profile.signMethod in ("HMAC-SHA1", "HMAC-SHA256", "AWS4-HMAC-SHA256"):
|
|
122
127
|
self._build_req_with_signature(action, params, req_inter, options)
|
|
123
128
|
else:
|
|
124
129
|
raise KsyunSDKException("ClientError", "Invalid signature method.")
|
|
125
130
|
|
|
126
131
|
def _build_req_with_signature(self, action, params, req, options=None):
|
|
127
|
-
|
|
132
|
+
uri_params = dict()
|
|
133
|
+
if not (options and options.get("IsPostJson")):
|
|
134
|
+
params = copy.deepcopy(self._fix_params(params))
|
|
135
|
+
else:
|
|
136
|
+
uri_params['Action'] = action[0].upper() + action[1:]
|
|
137
|
+
uri_params['Version'] = self._apiVersion
|
|
138
|
+
|
|
139
|
+
|
|
128
140
|
params['Service'] = self._service
|
|
129
141
|
params['Action'] = action[0].upper() + action[1:]
|
|
130
|
-
params['SdkVersion'] = self._sdkVersion
|
|
131
|
-
params['SignatureVersion'] = 1.0
|
|
132
|
-
now_time = datetime.now()
|
|
133
|
-
utc_time = now_time - timedelta(hours=8)
|
|
134
|
-
params['Timestamp'] = utc_time.strftime("%Y-%m-%dT%H:%M:%SZ")
|
|
135
142
|
params['Version'] = self._apiVersion
|
|
143
|
+
params['SdkVersion'] = self._sdkVersion
|
|
136
144
|
|
|
137
145
|
if self.region:
|
|
138
146
|
params['Region'] = self.region
|
|
139
|
-
if self.credential.token:
|
|
140
|
-
params['SecurityToken'] = self.credential.token
|
|
141
147
|
if self.credential.secret_id:
|
|
142
148
|
params['Accesskey'] = self.credential.secret_id
|
|
143
|
-
if self.profile.signMethod:
|
|
144
|
-
params['SignatureMethod'] = self.profile.signMethod
|
|
145
149
|
if self.profile.language:
|
|
146
150
|
params['Language'] = self.profile.language
|
|
147
151
|
|
|
148
|
-
# 组装签名
|
|
149
|
-
params['Signature'] = Sign.sign(params, str(self.credential.secret_key), str(self.profile.signMethod))
|
|
150
|
-
|
|
151
152
|
# 请求头
|
|
152
153
|
req.header["Accept"] = _json_content
|
|
153
154
|
content_type = self._default_content_type
|
|
@@ -164,9 +165,17 @@ class AbstractClient(object):
|
|
|
164
165
|
content_type = _x_protobuf
|
|
165
166
|
req.header["Content-Type"] = content_type
|
|
166
167
|
|
|
168
|
+
# 支持自定义 header
|
|
169
|
+
if options.get("CustomHeaders"):
|
|
170
|
+
for key, value in options["CustomHeaders"].items():
|
|
171
|
+
req.header[key] = value
|
|
172
|
+
|
|
167
173
|
# GET上传文件报错
|
|
168
174
|
if req.method == "GET" and content_type == _multipart_content:
|
|
169
175
|
raise SDKError("ClientError", "Invalid request method GET for multipart.")
|
|
176
|
+
# 非get请求在url添加 Action、Version
|
|
177
|
+
if req.method != "GET":
|
|
178
|
+
params
|
|
170
179
|
|
|
171
180
|
# 请求数据转换
|
|
172
181
|
if content_type == _form_urlencoded_content:
|
|
@@ -179,6 +188,12 @@ class AbstractClient(object):
|
|
|
179
188
|
req.header["Content-Type"] = content_type + "; boundary=" + boundary
|
|
180
189
|
req.data = self._get_multipart_body(params, boundary, options)
|
|
181
190
|
|
|
191
|
+
req.uri_params = urlencode(uri_params)
|
|
192
|
+
|
|
193
|
+
# 组装签名
|
|
194
|
+
auth = AWS4Auth(str(self.credential.secret_id), str(self.credential.secret_key), self.region, self._service)
|
|
195
|
+
req.auth = auth
|
|
196
|
+
|
|
182
197
|
# it must return bytes instead of string
|
|
183
198
|
def _get_multipart_body(self, params, boundary, options=None):
|
|
184
199
|
if options is None:
|
|
@@ -198,9 +213,19 @@ class AbstractClient(object):
|
|
|
198
213
|
if isinstance(v, list) or isinstance(v, dict):
|
|
199
214
|
v = json.dumps(v)
|
|
200
215
|
body += b'Content-Type: application/json\r\n'
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
216
|
+
# Python 2/3 compatible: convert any non-bytes value to bytes
|
|
217
|
+
if isinstance(v, six.binary_type):
|
|
218
|
+
# Already bytes
|
|
219
|
+
pass
|
|
220
|
+
elif isinstance(v, six.text_type):
|
|
221
|
+
# Unicode/str text -> bytes
|
|
222
|
+
v = v.encode('utf-8')
|
|
223
|
+
else:
|
|
224
|
+
# Numbers, None, etc. -> str -> bytes
|
|
225
|
+
v = str(v).encode('utf-8')
|
|
226
|
+
# Concatenate bytes
|
|
227
|
+
body += v
|
|
228
|
+
body += b'\r\n'
|
|
204
229
|
if body != b'':
|
|
205
230
|
body += b'--%s--\r\n' % boundary
|
|
206
231
|
return body
|
|
@@ -219,8 +244,11 @@ class AbstractClient(object):
|
|
|
219
244
|
endpoint = self._get_service_domain()
|
|
220
245
|
return endpoint
|
|
221
246
|
|
|
247
|
+
|
|
222
248
|
def call(self, action, params, options=None):
|
|
223
|
-
|
|
249
|
+
# Use custom path from HttpProfile if available, otherwise use default _requestPath
|
|
250
|
+
request_path = self.profile.httpProfile.path if self.profile.httpProfile.path else self._requestPath
|
|
251
|
+
req = RequestInternal(self._get_endpoint(), self.profile.httpProfile.reqMethod, request_path)
|
|
224
252
|
self._build_req_inter(action, params, req, options)
|
|
225
253
|
resp_inter = self.request.send_request(req)
|
|
226
254
|
self._check_status(resp_inter)
|
|
@@ -243,9 +271,11 @@ class AbstractClient(object):
|
|
|
243
271
|
if self.profile.httpProfile.reqMethod != "POST":
|
|
244
272
|
raise SDKError("ClientError", "Invalid request method.")
|
|
245
273
|
|
|
274
|
+
# Use custom path from HttpProfile if available, otherwise use default _requestPath
|
|
275
|
+
request_path = self.profile.httpProfile.path if self.profile.httpProfile.path else self._requestPath
|
|
246
276
|
req = RequestInternal(self._get_endpoint(),
|
|
247
277
|
self.profile.httpProfile.reqMethod,
|
|
248
|
-
|
|
278
|
+
request_path)
|
|
249
279
|
for key in headers:
|
|
250
280
|
req.header[key] = headers[key]
|
|
251
281
|
req.data = body
|
|
@@ -282,6 +312,12 @@ class AbstractClient(object):
|
|
|
282
312
|
message = response["Error"]["Message"]
|
|
283
313
|
reqid = response["RequestId"]
|
|
284
314
|
raise KsyunSDKException(code, message, reqid)
|
|
315
|
+
def call_judge(self, action, params, content_type,options=None):
|
|
316
|
+
method = self.profile.httpProfile.reqMethod
|
|
317
|
+
if method and method == "POST" and 'application/json' in content_type:
|
|
318
|
+
return self.call_json(action, params)
|
|
319
|
+
else:
|
|
320
|
+
return self.call(action, params, options)
|
|
285
321
|
|
|
286
322
|
def set_stream_logger(self, stream=None, level=logging.DEBUG, log_format=None):
|
|
287
323
|
"""
|
ksyun/common/abstract_model.py
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
+
from __future__ import unicode_literals
|
|
15
16
|
import json
|
|
16
17
|
import sys
|
|
17
18
|
|
|
@@ -31,10 +32,9 @@ class AbstractModel(object):
|
|
|
31
32
|
if isinstance(tem, AbstractModel):
|
|
32
33
|
r.append(tem._serialize(allow_none))
|
|
33
34
|
else:
|
|
34
|
-
r.append(
|
|
35
|
-
tem.encode("UTF-8") if isinstance(tem, type(u"")) and sys.version_info[0] == 2 else tem)
|
|
35
|
+
r.append(tem)
|
|
36
36
|
else:
|
|
37
|
-
r = d[k]
|
|
37
|
+
r = d[k]
|
|
38
38
|
if allow_none or r is not None:
|
|
39
39
|
ret[k[0].upper() + k[1:]] = r
|
|
40
40
|
return ret
|
ksyun/common/common_client.py
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
# See the License for the specific language governing permissions and
|
|
15
15
|
# limitations under the License.
|
|
16
16
|
|
|
17
|
+
from __future__ import unicode_literals
|
|
18
|
+
|
|
17
19
|
from ksyun.common.abstract_client import AbstractClient
|
|
18
20
|
from ksyun.common.exception.ksyun_sdk_exception import KsyunSDKException
|
|
19
21
|
|
ksyun/common/credential.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
|
|
3
|
+
from __future__ import unicode_literals
|
|
3
4
|
import sys
|
|
4
5
|
|
|
5
6
|
|
|
@@ -8,17 +9,20 @@ class KsyunSDKException(Exception):
|
|
|
8
9
|
|
|
9
10
|
def __init__(self, code=None, message=None, requestId=None):
|
|
10
11
|
self.code = code
|
|
11
|
-
self.message = message
|
|
12
|
+
self.message = message or str(code)
|
|
12
13
|
self.requestId = requestId
|
|
14
|
+
# Python 2/3 compatible super() call
|
|
15
|
+
if sys.version_info[0] >= 3:
|
|
16
|
+
super().__init__(self.message)
|
|
17
|
+
else:
|
|
18
|
+
super(KsyunSDKException, self).__init__(self.message)
|
|
13
19
|
|
|
14
20
|
def __str__(self):
|
|
15
|
-
|
|
16
|
-
self.code, self.message, self.requestId
|
|
17
|
-
|
|
18
|
-
return s.encode("utf8")
|
|
19
|
-
else:
|
|
20
|
-
return s
|
|
21
|
+
return "[KsyunSDKException] code:%s message:%s requestId:%s" % (
|
|
22
|
+
self.code, self.message, self.requestId
|
|
23
|
+
)
|
|
21
24
|
|
|
25
|
+
# 保证与旧版本代码兼容,保留原有方法名
|
|
22
26
|
def get_code(self):
|
|
23
27
|
return self.code
|
|
24
28
|
|
ksyun/common/http/request.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
|
|
4
|
+
from __future__ import unicode_literals
|
|
5
|
+
|
|
4
6
|
import os
|
|
5
7
|
import logging
|
|
6
8
|
import requests
|
|
@@ -42,7 +44,7 @@ class ProxyConnection(object):
|
|
|
42
44
|
self.proxy = {"https": proxy}
|
|
43
45
|
self.request_length = 0
|
|
44
46
|
|
|
45
|
-
def request(self, method, url, body=None, headers={}):
|
|
47
|
+
def request(self, method, url, body=None, headers={}, auth=None):
|
|
46
48
|
self.request_length = 0
|
|
47
49
|
headers.setdefault("Host", self.request_host)
|
|
48
50
|
return requests.request(method=method,
|
|
@@ -51,7 +53,8 @@ class ProxyConnection(object):
|
|
|
51
53
|
headers=headers,
|
|
52
54
|
proxies=self.proxy,
|
|
53
55
|
verify=self.certification,
|
|
54
|
-
timeout=self.timeout
|
|
56
|
+
timeout=self.timeout,
|
|
57
|
+
auth=auth)
|
|
55
58
|
|
|
56
59
|
|
|
57
60
|
class ApiRequest(object):
|
|
@@ -71,6 +74,36 @@ class ApiRequest(object):
|
|
|
71
74
|
self.request_size = 0
|
|
72
75
|
self.response_size = 0
|
|
73
76
|
|
|
77
|
+
def _build_url(self, base_url, path=None, query_params=None):
|
|
78
|
+
"""Build complete URL from base_url, path and query parameters.
|
|
79
|
+
|
|
80
|
+
Ensures no double slashes between domain and path.
|
|
81
|
+
|
|
82
|
+
:param base_url: Base URL (scheme + domain)
|
|
83
|
+
:type base_url: str
|
|
84
|
+
:param path: URL path
|
|
85
|
+
:type path: str
|
|
86
|
+
:param query_params: Query parameters
|
|
87
|
+
:type query_params: str
|
|
88
|
+
:return: Complete URL
|
|
89
|
+
:rtype: str
|
|
90
|
+
"""
|
|
91
|
+
# Start with base URL, remove trailing slash if present
|
|
92
|
+
url = base_url.rstrip('/')
|
|
93
|
+
|
|
94
|
+
# Add path if provided
|
|
95
|
+
if path:
|
|
96
|
+
# Ensure path starts with /
|
|
97
|
+
if not path.startswith('/'):
|
|
98
|
+
path = '/' + path
|
|
99
|
+
url += path
|
|
100
|
+
|
|
101
|
+
# Add query parameters if provided
|
|
102
|
+
if query_params:
|
|
103
|
+
url += '?' + query_params
|
|
104
|
+
|
|
105
|
+
return url
|
|
106
|
+
|
|
74
107
|
def set_req_timeout(self, req_timeout):
|
|
75
108
|
self.req_timeout = req_timeout
|
|
76
109
|
|
|
@@ -88,11 +121,15 @@ class ApiRequest(object):
|
|
|
88
121
|
req_inter.header["Connection"] = "Keep-Alive"
|
|
89
122
|
if self.debug:
|
|
90
123
|
logger.debug("SendRequest %s" % req_inter)
|
|
124
|
+
|
|
91
125
|
if req_inter.method == 'GET':
|
|
92
|
-
|
|
93
|
-
|
|
126
|
+
# For GET requests, parameters are in the query string (req_inter.data)
|
|
127
|
+
req_inter_url = self._build_url(self.host, req_inter.uri, req_inter.data)
|
|
128
|
+
return self.conn.request(req_inter.method, req_inter_url, None, req_inter.header, req_inter.auth)
|
|
94
129
|
elif req_inter.method == 'POST' or req_inter.method == 'PUT' or req_inter.method == 'DELETE':
|
|
95
|
-
|
|
130
|
+
# For POST/PUT/DELETE, use uri_params for query string if present
|
|
131
|
+
req_inter_url = self._build_url(self.host, req_inter.uri, req_inter.uri_params if req_inter.uri_params else None)
|
|
132
|
+
return self.conn.request(req_inter.method, req_inter_url, req_inter.data, req_inter.header, req_inter.auth)
|
|
96
133
|
else:
|
|
97
134
|
raise KsyunSDKException("ClientParamsError", 'Method only support (GET, POST, PUT, DELETE)')
|
|
98
135
|
|
|
@@ -110,7 +147,7 @@ class ApiRequest(object):
|
|
|
110
147
|
|
|
111
148
|
|
|
112
149
|
class RequestInternal(object):
|
|
113
|
-
def __init__(self, host="", method="", uri="", header=None, data=""):
|
|
150
|
+
def __init__(self, host="", method="", uri="", header=None, data="", auth=None):
|
|
114
151
|
if header is None:
|
|
115
152
|
header = {}
|
|
116
153
|
self.host = host
|
|
@@ -118,6 +155,8 @@ class RequestInternal(object):
|
|
|
118
155
|
self.uri = uri
|
|
119
156
|
self.header = header
|
|
120
157
|
self.data = data
|
|
158
|
+
self.auth = auth
|
|
159
|
+
self.uri_params = None # Query parameters for POST/PUT/DELETE requests
|
|
121
160
|
|
|
122
161
|
def __str__(self):
|
|
123
162
|
headers = "\n".join("%s: %s" % (k, v) for k, v in self.header.items())
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from __future__ import unicode_literals
|
|
16
|
+
|
|
14
17
|
from ksyun.common.exception.ksyun_sdk_exception import KsyunSDKException
|
|
15
18
|
from ksyun.common.profile.http_profile import HttpProfile
|
|
16
19
|
|
|
@@ -12,12 +12,14 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
+
from __future__ import unicode_literals
|
|
16
|
+
|
|
15
17
|
|
|
16
18
|
class HttpProfile(object):
|
|
17
19
|
scheme = "https"
|
|
18
20
|
|
|
19
21
|
def __init__(self, protocol=None, endpoint=None, reqMethod="POST", reqTimeout=60,
|
|
20
|
-
keepAlive=False, proxy=None, rootDomain=None, certification=None):
|
|
22
|
+
keepAlive=False, proxy=None, rootDomain=None, certification=None, path=None):
|
|
21
23
|
"""HTTP profile.
|
|
22
24
|
:param protocol: http or https, default is https.
|
|
23
25
|
:type protocol: str
|
|
@@ -29,6 +31,8 @@ class HttpProfile(object):
|
|
|
29
31
|
:type reqTimeout: int
|
|
30
32
|
:param rootDomain: The root domain to access, like: api.ksyun.com.
|
|
31
33
|
:type rootDomain: str
|
|
34
|
+
:param path: Custom URL path like /api/xxx/xxx. Query parameters will be automatically removed.
|
|
35
|
+
:type path: str
|
|
32
36
|
"""
|
|
33
37
|
self.endpoint = endpoint
|
|
34
38
|
self.reqTimeout = 60 if reqTimeout is None else reqTimeout
|
|
@@ -40,3 +44,26 @@ class HttpProfile(object):
|
|
|
40
44
|
self.proxy = proxy
|
|
41
45
|
self.rootDomain = "api.ksyun.com" if rootDomain is None else rootDomain
|
|
42
46
|
self.certification = certification
|
|
47
|
+
# Clean path: remove query parameters if present
|
|
48
|
+
self.path = self._clean_path(path) if path else None
|
|
49
|
+
|
|
50
|
+
def _clean_path(self, path):
|
|
51
|
+
"""Clean path by removing query parameters and normalizing slashes.
|
|
52
|
+
|
|
53
|
+
:param path: The path to clean
|
|
54
|
+
:type path: str
|
|
55
|
+
:return: Cleaned path
|
|
56
|
+
:rtype: str
|
|
57
|
+
"""
|
|
58
|
+
if not path:
|
|
59
|
+
return None
|
|
60
|
+
|
|
61
|
+
# Remove query parameters (everything after ?)
|
|
62
|
+
if '?' in path:
|
|
63
|
+
path = path.split('?')[0]
|
|
64
|
+
|
|
65
|
+
# Ensure path starts with /
|
|
66
|
+
if not path.startswith('/'):
|
|
67
|
+
path = '/' + path
|
|
68
|
+
|
|
69
|
+
return path
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: kingsoftcloud-sdk-python
|
|
3
|
-
Version: 1.1.1
|
|
4
|
-
Summary: Kingsoft Cloud SDK for Python
|
|
5
|
-
Home-page: https://github.com/ksyun/ksyun-sdk-python
|
|
6
|
-
Author: Kingsoft Cloud
|
|
7
|
-
Maintainer-email: liuhuicheng1@kingsoft.com
|
|
8
|
-
License: Apache License 2.0
|
|
9
|
-
Platform: any
|
|
10
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
-
Classifier: Programming Language :: Python
|
|
14
|
-
Classifier: Programming Language :: Python :: 2.7
|
|
15
|
-
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
-
License-File: LICENSE
|
|
21
|
-
Requires-Dist: requests (==2.27.1)
|
|
22
|
-
|
|
23
|
-
============================
|
|
24
|
-
Ksyun Cloud SDK for Python
|
|
25
|
-
============================
|
|
26
|
-
|
|
27
|
-
Ksyun Cloud Python SDK is the official software development kit, which allows Python developers to write software that makes use of ksyun Cloud services.
|
|
28
|
-
|
|
29
|
-
The SDK works on Python versions:
|
|
30
|
-
|
|
31
|
-
* 2.7 and greater, including 3.x
|
|
32
|
-
|
|
33
|
-
Quick Start
|
|
34
|
-
-----------
|
|
35
|
-
First, install the library:
|
|
36
|
-
|
|
37
|
-
.. code-block:: sh
|
|
38
|
-
|
|
39
|
-
$ pip install kingsoftcloud-sdk-python
|
|
40
|
-
|
|
41
|
-
or download source code from github and install:
|
|
42
|
-
|
|
43
|
-
.. code-block:: sh
|
|
44
|
-
|
|
45
|
-
$ git clone https://github.com/kingsoftcloud/sdk-python
|
|
46
|
-
$ cd kingsoftcloud-sdk-python
|
|
47
|
-
$ python setup.py install
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
ksyun/__init__.py,sha256=V19fFvQQB4qWAsDiolLrqJM1nka3Gtu-jecsIFYvFeE,621
|
|
2
|
-
ksyun/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
ksyun/client/actiontrail/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
ksyun/client/actiontrail/v20190401/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
ksyun/client/actiontrail/v20190401/client.py,sha256=w3g3Tpx4_okKJP2oIKePPRdvJYYRrmyc1j9hBCMy_ek,1171
|
|
6
|
-
ksyun/client/actiontrail/v20190401/models.py,sha256=Gp8mcXLF9_DN3fq-Posjl4pNfta5d5TK2DSyF8a32zo,2959
|
|
7
|
-
ksyun/client/bill/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
ksyun/client/bill/v20180601/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
ksyun/client/bill/v20180601/client.py,sha256=hmX-5mqF_qB7woQQw9QDJMIBl8bL_tPvSIBdcLAYzhs,5559
|
|
10
|
-
ksyun/client/bill/v20180601/models.py,sha256=goF64n3WgFbFbXZ9MiSKhTAlKe0I9e7dwzLeYMNhTF0,1573
|
|
11
|
-
ksyun/client/bill_union/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
ksyun/client/bill_union/v20200101/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
ksyun/client/bill_union/v20200101/client.py,sha256=grJzysl2flGCkPYiGiscSWp9CUdxosfpklbiD9Kuh7c,5895
|
|
14
|
-
ksyun/client/bill_union/v20200101/models.py,sha256=aAhIsezUmUbIzQ7uzzqfvc3egubm2oVJM1K49HJDVqI,4994
|
|
15
|
-
ksyun/client/bill_union/v20211209/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
-
ksyun/client/bill_union/v20211209/client.py,sha256=3xRZVkXYpHMlNM3XCIdBm4XklJPjbWZMK-IwCl3G8DU,1174
|
|
17
|
-
ksyun/client/bill_union/v20211209/models.py,sha256=TlDTrhn33nzEmWuPbY4Id7kF8pZlOwAqoV9BmErZe5U,1300
|
|
18
|
-
ksyun/client/bws/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
-
ksyun/client/bws/v20160304/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
ksyun/client/bws/v20160304/client.py,sha256=M0dm_6-UXpTpncedl0rl4wNm1QXgfFd5C_T2vUN5W84,5647
|
|
21
|
-
ksyun/client/bws/v20160304/models.py,sha256=wSgzfKr4c9o4vM6IxUhH4RAZBR7DdHhnTh9-mlpcPoI,5408
|
|
22
|
-
ksyun/client/ebs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
|
-
ksyun/client/ebs/v20160304/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
-
ksyun/client/ebs/v20160304/client.py,sha256=5PThHmn8Vo9G1PWE3V8odhVvF7IHlaStlxSVkXM05to,16760
|
|
25
|
-
ksyun/client/ebs/v20160304/models.py,sha256=cF7xjp-9nqg5AxGtv6a7iCuLr-S3BPbMxOFQTMCJEcU,21288
|
|
26
|
-
ksyun/client/eip/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
|
-
ksyun/client/eip/v20160304/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
|
-
ksyun/client/eip/v20160304/client.py,sha256=SrBhCOyrrVLs5JbVhz8Nukzgglc6wdQ6p2-rjUWolT4,6308
|
|
29
|
-
ksyun/client/eip/v20160304/models.py,sha256=K45fTgKe5mLFv-30EU-BRdTik2HYeaFwX2WTh3yIopw,6695
|
|
30
|
-
ksyun/client/epc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
-
ksyun/client/epc/v20151101/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
|
-
ksyun/client/epc/v20151101/client.py,sha256=rrScuToNIrvKKxI_6TwWe6ONTTZuQ7CKEJR_i_rV8Pc,48112
|
|
33
|
-
ksyun/client/epc/v20151101/models.py,sha256=-yC1rdp4Orzjt82Y1MHomzLGYq84w9vllyzRz_DCc5s,58267
|
|
34
|
-
ksyun/client/iam/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
|
-
ksyun/client/iam/v20151101/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
|
-
ksyun/client/iam/v20151101/client.py,sha256=nWTPhEnVMeWQx6NIXr3dDP42a0M8AhlGtaPEf_vktgU,49208
|
|
37
|
-
ksyun/client/iam/v20151101/models.py,sha256=XuHHiQrobkLSKEuygLsHdZvOkfmwMulovDlxxa81fEc,42904
|
|
38
|
-
ksyun/client/kad/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
|
-
ksyun/client/kad/v20161122/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
|
-
ksyun/client/kad/v20161122/client.py,sha256=S6s2WjrCQOVUUhSZPwUWCaNifc6WZ0_NdXTOUiwjB_s,5615
|
|
41
|
-
ksyun/client/kad/v20161122/models.py,sha256=JpQNDYiJtWS-5wRSdm_W8jFxGQ0X6XKpn09z635Sx4U,3948
|
|
42
|
-
ksyun/client/kead/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
|
-
ksyun/client/kead/v20200101/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
|
-
ksyun/client/kead/v20200101/client.py,sha256=2aW-JAwRz-UQ8VV1RG3q_AO6CmFoTZTm_dSnubeO2iE,1133
|
|
45
|
-
ksyun/client/kead/v20200101/models.py,sha256=l-MD85U1JyaTbZyqIF2XhCwoJ4fbxDiGqTt_lJ61lWc,1785
|
|
46
|
-
ksyun/client/kec/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
|
-
ksyun/client/kec/v20160304/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
|
-
ksyun/client/kec/v20160304/client.py,sha256=hiwIwaz1u00QoCVM-08tZcnKaV13eMW_ybIC8HE8b0o,85700
|
|
49
|
-
ksyun/client/kec/v20160304/models.py,sha256=X8ix2Ms4g3qBsP7me3YYhdaY7QpPwQONySzk33DypD8,122915
|
|
50
|
-
ksyun/client/mongodb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
|
-
ksyun/client/mongodb/v20170101/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
|
-
ksyun/client/mongodb/v20170101/client.py,sha256=ZZ0XaRVEqt2iSD9C8TV0ZzuxJt3HthFDjIx_Ns0fErA,30975
|
|
53
|
-
ksyun/client/mongodb/v20170101/models.py,sha256=t5Ml5CweyKBcPvpf2kD8imGnhW-tPh_xqcrndLWmYXg,36775
|
|
54
|
-
ksyun/client/resourcemanager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
|
-
ksyun/client/resourcemanager/v20210320/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
|
-
ksyun/client/resourcemanager/v20210320/client.py,sha256=0f-hfoUZ-gmenC--l-u06Y9qCsCHdFvE94NjLiyayJA,7310
|
|
57
|
-
ksyun/client/resourcemanager/v20210320/models.py,sha256=m09Nu_8_W7W1yx-1NXg3VeiRI3fxplFg4VJVQt_d6zM,5717
|
|
58
|
-
ksyun/client/sks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
|
-
ksyun/client/sks/v20151101/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
|
-
ksyun/client/sks/v20151101/client.py,sha256=M-ErIkxhZ377-AC6KaCB5PcruJW2Da7Zp1z6Xd0nZzA,4485
|
|
61
|
-
ksyun/client/sks/v20151101/models.py,sha256=Vor6L7LzOqoXucOYSFBzgmpMRSMxTIhQ6SJ4WGHtPos,2888
|
|
62
|
-
ksyun/client/slb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
|
-
ksyun/client/slb/v20160304/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
|
-
ksyun/client/slb/v20160304/client.py,sha256=0ym7aEZYBVtQLAu67EgzuasddvPb9k04Qhy2eR7TAfU,43349
|
|
65
|
-
ksyun/client/slb/v20160304/models.py,sha256=M9-8hHsnNkkXOKbaxwc54vSfu2Z56dHFJ2SHa0KE-7o,59990
|
|
66
|
-
ksyun/client/slb/v20171210/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
67
|
-
ksyun/client/slb/v20171210/client.py,sha256=HSruX2dIqASoQRkeJiD-HJPtb2VXCOcKtVu6lF_fBkI,1166
|
|
68
|
-
ksyun/client/slb/v20171210/models.py,sha256=W6yOX-5Mr4418aOmHz8kBVdDlaY7IrIWV57jTlXPDN4,1094
|
|
69
|
-
ksyun/client/sts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
70
|
-
ksyun/client/sts/v20151101/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
|
-
ksyun/client/sts/v20151101/client.py,sha256=KJSWZKxUOnntJBOvFcZ8JapU6_slT9f59bUmMKUrB10,1134
|
|
72
|
-
ksyun/client/sts/v20151101/models.py,sha256=NXQmEtz8pNHBEzH4ExK1Q_5G3aNQi1dH5c5IkQrwkqU,1961
|
|
73
|
-
ksyun/client/tagv2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
|
-
ksyun/client/tagv2/v20200901/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
75
|
-
ksyun/client/tagv2/v20200901/client.py,sha256=6QCuvzIZovFfgl-U6IQvJiR4kOdkrtd9n18hobDpuZM,7170
|
|
76
|
-
ksyun/client/tagv2/v20200901/models.py,sha256=h4ZmlWQH5XDkrAuRyDCxbxwgxJEYs4W49sXbqkwve60,6682
|
|
77
|
-
ksyun/client/trade/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
78
|
-
ksyun/client/trade/v20200114/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
79
|
-
ksyun/client/trade/v20200114/client.py,sha256=w7SRlIAXs8vZ2KLef7hSzvuKalKha-0AH9js9kAVpjw,1149
|
|
80
|
-
ksyun/client/trade/v20200114/models.py,sha256=E9GpKHdGZBocPzyKdQBTIlSvvBYfjf26XzH4KI2eKWg,490
|
|
81
|
-
ksyun/client/trade/v20200831/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
82
|
-
ksyun/client/trade/v20200831/client.py,sha256=bOYbgXAN7joVOyeSWr4qt-bessyKSjpE6RaOZ7rq3fk,1133
|
|
83
|
-
ksyun/client/trade/v20200831/models.py,sha256=xbdF0dUxQ7EmvvxFjBj4qGIpdcBYVr2gLNh-uV_sFh4,1016
|
|
84
|
-
ksyun/client/vpc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
85
|
-
ksyun/client/vpc/v20160304/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
86
|
-
ksyun/client/vpc/v20160304/client.py,sha256=4ld0LLFKKWTWuCsMe5Scov2uGiAx14OnogAmtihGt7Q,72970
|
|
87
|
-
ksyun/client/vpc/v20160304/models.py,sha256=xoTi1Ob-RNOQQbe7l-k0__G2PnSlB-kNWDvK-FzWAk0,76572
|
|
88
|
-
ksyun/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
|
-
ksyun/common/abstract_client.py,sha256=bV_oPkifDDsHurR2NAA3YyCJAgJ-j-tQZz4ViRArz5s,12140
|
|
90
|
-
ksyun/common/abstract_model.py,sha256=d2do31uumLpMk7zF0UStgVdg_FV1UH5tcimtXMRih3E,2099
|
|
91
|
-
ksyun/common/common_client.py,sha256=MOmBEj_q_y8p6lPz9tPBD1m_dKmjA6MCt0B-JcktA0k,1821
|
|
92
|
-
ksyun/common/credential.py,sha256=Xk0ufU8mZ5Iy1XfPlLpr0NAY6CwkCgdnI5BiD-wwhdw,2220
|
|
93
|
-
ksyun/common/sign.py,sha256=QWAuwzrnRLLlGtAKUajW5zljHJF0S0_p5nDDui0CxpI,977
|
|
94
|
-
ksyun/common/exception/__init__.py,sha256=T4bbJX1HDxWS4sBur0FeZC01yR63zID1hJJlTaBWGZM,688
|
|
95
|
-
ksyun/common/exception/ksyun_sdk_exception.py,sha256=-0Brp02sTmAp6-VTJd-9_HOx8oWidt_83SM3h84mJ4s,709
|
|
96
|
-
ksyun/common/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
97
|
-
ksyun/common/http/request.py,sha256=ub2q9hHSn3xr3sfnE_DdeV6JgOEkMI3DMS3kBLuQzhQ,4956
|
|
98
|
-
ksyun/common/profile/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
99
|
-
ksyun/common/profile/client_profile.py,sha256=f1BWYmoiFgJKniTVHbRZjat0NiECNZaYSX6zZEp-CFM,1552
|
|
100
|
-
ksyun/common/profile/http_profile.py,sha256=oCWuy84U-_706N2uSUszixFWXGOjiupfyCrt45nmYuE,1799
|
|
101
|
-
kingsoftcloud_sdk_python-1.1.1.dist-info/LICENSE,sha256=AJyIQ6mPzTpsFn6i0cG6OPVdhJ85l_mfdoOR7J4DnRw,11351
|
|
102
|
-
kingsoftcloud_sdk_python-1.1.1.dist-info/METADATA,sha256=AuWSxtXoyub8pWkUJkvcQleWaPDE6f477jWp3H1h6yU,1455
|
|
103
|
-
kingsoftcloud_sdk_python-1.1.1.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
|
|
104
|
-
kingsoftcloud_sdk_python-1.1.1.dist-info/top_level.txt,sha256=mzM04AZwi_rRte0l5x-qpr79yKptjcaFLfIPtRA-8Dk,6
|
|
105
|
-
kingsoftcloud_sdk_python-1.1.1.dist-info/RECORD,,
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
from ksyun.common.abstract_model import AbstractModel
|
|
2
|
-
|
|
3
|
-
class DescribeCostBillRequest(AbstractModel):
|
|
4
|
-
"""DescribeCostBill请求参数结构体
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
def __init__(self):
|
|
8
|
-
r"""获取预付费成本账单
|
|
9
|
-
:param billMonth: 账单月
|
|
10
|
-
:type PathPrefix: Int
|
|
11
|
-
:param statisticalItem: 统计项,0:按实例;1:按产品
|
|
12
|
-
:type PathPrefix: Int
|
|
13
|
-
:param instanceIds: 实例id列表,仅当statisticalItem=0时有效
|
|
14
|
-
:type PathPrefix: String
|
|
15
|
-
:param pageNo: 分页page no
|
|
16
|
-
:type PathPrefix: Int
|
|
17
|
-
:param pageSize: 分页page size
|
|
18
|
-
:type PathPrefix: Int
|
|
19
|
-
"""
|
|
20
|
-
self.billMonth = None
|
|
21
|
-
self.statisticalItem = None
|
|
22
|
-
self.instanceIds = None
|
|
23
|
-
self.pageNo = None
|
|
24
|
-
self.pageSize = None
|
|
25
|
-
|
|
26
|
-
def _deserialize(self, params):
|
|
27
|
-
if params.get("billMonth"):
|
|
28
|
-
self.billMonth = params.get("billMonth")
|
|
29
|
-
if params.get("statisticalItem"):
|
|
30
|
-
self.statisticalItem = params.get("statisticalItem")
|
|
31
|
-
if params.get("instanceIds"):
|
|
32
|
-
self.instanceIds = params.get("instanceIds")
|
|
33
|
-
if params.get("pageNo"):
|
|
34
|
-
self.pageNo = params.get("pageNo")
|
|
35
|
-
if params.get("pageSize"):
|
|
36
|
-
self.pageSize = params.get("pageSize")
|
|
37
|
-
|
|
38
|
-
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
from ksyun.common.abstract_model import AbstractModel
|
|
2
|
-
|
|
3
|
-
class DescribeLoadBalancersRequest(AbstractModel):
|
|
4
|
-
"""DescribeLoadBalancers请求参数结构体
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
def __init__(self):
|
|
8
|
-
r"""获取应用型负载均衡
|
|
9
|
-
:param LoadBalancerId: 负载均衡的ID
|
|
10
|
-
:type PathPrefix: Filter
|
|
11
|
-
:param State: 负载均衡的状态,已绑定,未绑定
|
|
12
|
-
:type PathPrefix: String
|
|
13
|
-
:param ProjectId: 负载均衡所属项目的ID
|
|
14
|
-
:type PathPrefix: Filter
|
|
15
|
-
:param Filter: vpc-id,VPC的ID
|
|
16
|
-
:type PathPrefix: Filter
|
|
17
|
-
"""
|
|
18
|
-
self.LoadBalancerId = None
|
|
19
|
-
self.State = None
|
|
20
|
-
self.ProjectId = None
|
|
21
|
-
self.Filter = None
|
|
22
|
-
|
|
23
|
-
def _deserialize(self, params):
|
|
24
|
-
if params.get("LoadBalancerId"):
|
|
25
|
-
self.LoadBalancerId = params.get("LoadBalancerId")
|
|
26
|
-
if params.get("State"):
|
|
27
|
-
self.State = params.get("State")
|
|
28
|
-
if params.get("ProjectId"):
|
|
29
|
-
self.ProjectId = params.get("ProjectId")
|
|
30
|
-
if params.get("Filter"):
|
|
31
|
-
self.Filter = params.get("Filter")
|
|
32
|
-
|
|
33
|
-
|