kingsoftcloud-sdk-python 1.1.1__py2.py3-none-any.whl → 1.5.8.44__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.1.1.dist-info → kingsoftcloud_sdk_python-1.5.8.44.dist-info}/METADATA +17 -4
- kingsoftcloud_sdk_python-1.5.8.44.dist-info/RECORD +337 -0
- {kingsoftcloud_sdk_python-1.1.1.dist-info → kingsoftcloud_sdk_python-1.5.8.44.dist-info}/WHEEL +1 -1
- ksyun/__init__.py +1 -1
- ksyun/client/actiontrail/v20190401/client.py +1 -1
- ksyun/client/aicp/v20240612/client.py +1229 -0
- ksyun/client/aicp/v20240612/models.py +1778 -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 +3 -72
- ksyun/client/bill/v20180601/models.py +29 -41
- ksyun/client/bill/v20220601/__init__.py +0 -0
- ksyun/client/bill/v20220601/client.py +56 -0
- ksyun/client/bill/v20220601/models.py +54 -0
- ksyun/client/bill_union/v20200101/client.py +77 -8
- ksyun/client/bill_union/v20200101/models.py +118 -2
- ksyun/client/bill_union/v20221222/__init__.py +0 -0
- ksyun/client/bill_union/v20221222/client.py +148 -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 +56 -0
- ksyun/client/bill_union/v20250801/models.py +64 -0
- ksyun/client/bws/v20160304/client.py +29 -6
- 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 +79 -0
- ksyun/client/cdn/v20160901/models.py +51 -0
- ksyun/client/cdn/v20200630/__init__.py +0 -0
- ksyun/client/cdn/v20200630/client.py +401 -0
- ksyun/client/cdn/v20200630/models.py +826 -0
- ksyun/client/cdn/v20200901/__init__.py +0 -0
- ksyun/client/cdn/v20200901/client.py +171 -0
- ksyun/client/cdn/v20200901/models.py +224 -0
- ksyun/client/cdn/v20211201/__init__.py +0 -0
- ksyun/client/cdn/v20211201/client.py +33 -0
- ksyun/client/cdn/v20211201/models.py +23 -0
- ksyun/client/cdn/v3/__init__.py +0 -0
- ksyun/client/cdn/v3/client.py +999 -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 +608 -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 +907 -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 +79 -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 +470 -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 +447 -0
- ksyun/client/dts/v20180108/models.py +734 -0
- ksyun/client/ebs/v20160304/client.py +243 -36
- ksyun/client/ebs/v20160304/models.py +320 -66
- ksyun/client/eip/v20160304/client.py +122 -7
- ksyun/client/eip/v20160304/models.py +95 -1
- ksyun/client/epc/v20151101/client.py +1258 -131
- ksyun/client/epc/v20151101/models.py +2605 -134
- ksyun/client/iam/v20151101/client.py +271 -64
- ksyun/client/iam/v20151101/models.py +284 -28
- ksyun/client/iam/v20240513/__init__.py +0 -0
- ksyun/client/iam/v20240513/client.py +33 -0
- ksyun/client/iam/v20240513/models.py +33 -0
- ksyun/client/iam/v20240703/__init__.py +0 -0
- ksyun/client/iam/v20240703/client.py +33 -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 +631 -0
- ksyun/client/influxdb/v20191010/models.py +655 -0
- ksyun/client/kad/v20161122/client.py +52 -6
- 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 +401 -0
- ksyun/client/kce/v20180314/models.py +374 -0
- ksyun/client/kce/v20190806/__init__.py +0 -0
- ksyun/client/kce/v20190806/client.py +792 -0
- ksyun/client/kce/v20190806/models.py +1099 -0
- ksyun/client/kce/v20201231/__init__.py +0 -0
- ksyun/client/{bill_union/v20211209 → kce/v20201231}/client.py +9 -9
- ksyun/client/kce/v20201231/models.py +137 -0
- ksyun/client/kce/v20230101/__init__.py +0 -0
- ksyun/client/kce/v20230101/client.py +217 -0
- ksyun/client/kce/v20230101/models.py +259 -0
- ksyun/client/kce/v20230306/__init__.py +0 -0
- ksyun/client/kce/v20230306/client.py +516 -0
- ksyun/client/kce/v20230306/models.py +655 -0
- ksyun/client/kce/v20231115/__init__.py +0 -0
- ksyun/client/kce/v20231115/client.py +56 -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 +355 -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 +217 -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 +355 -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 +240 -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 +1022 -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 +1528 -0
- ksyun/client/kcs/v20160701/models.py +1917 -0
- ksyun/client/kcs/v20170401/__init__.py +0 -0
- ksyun/client/kcs/v20170401/client.py +33 -0
- ksyun/client/kcs/v20170401/models.py +28 -0
- ksyun/client/kcs/v20240701/__init__.py +0 -0
- ksyun/client/kcs/v20240701/client.py +33 -0
- ksyun/client/kcs/v20240701/models.py +23 -0
- ksyun/client/kead/v20200101/client.py +47 -1
- ksyun/client/kead/v20200101/models.py +52 -42
- ksyun/client/kec/v20160304/client.py +334 -127
- ksyun/client/kec/v20160304/models.py +701 -131
- ksyun/client/ked/__init__.py +0 -0
- ksyun/client/ked/v1/__init__.py +0 -0
- ksyun/client/ked/v1/client.py +1022 -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 +194 -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 +194 -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 +56 -0
- ksyun/client/kfw/v20160304/models.py +35 -0
- ksyun/client/kingpay/__init__.py +0 -0
- ksyun/client/kingpay/v1/__init__.py +0 -0
- ksyun/client/kingpay/v1/client.py +33 -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 +194 -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 +378 -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 +194 -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 +539 -0
- ksyun/client/kmr/v20210902/models.py +536 -0
- ksyun/client/kmr/v20231231/__init__.py +0 -0
- ksyun/client/kmr/v20231231/client.py +171 -0
- ksyun/client/kmr/v20231231/models.py +201 -0
- ksyun/client/kmr/v20240814/__init__.py +0 -0
- ksyun/client/kmr/v20240814/client.py +447 -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 +401 -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 +191 -0
- ksyun/client/krds/__init__.py +0 -0
- ksyun/client/krds/v20160701/__init__.py +0 -0
- ksyun/client/krds/v20160701/client.py +2103 -0
- ksyun/client/krds/v20160701/models.py +2722 -0
- ksyun/client/krds/v20200825/__init__.py +0 -0
- ksyun/client/krds/v20200825/client.py +240 -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 +309 -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 +447 -0
- ksyun/client/milvus/v20231010/models.py +520 -0
- ksyun/client/mongodb/v20170101/client.py +280 -50
- ksyun/client/mongodb/v20170101/models.py +251 -34
- ksyun/client/mongodb/v20250101/__init__.py +0 -0
- ksyun/client/mongodb/v20250101/client.py +33 -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 +56 -0
- ksyun/client/monitor/v20100525/models.py +108 -0
- ksyun/client/monitor/v20181114/__init__.py +0 -0
- ksyun/client/monitor/v20181114/client.py +33 -0
- ksyun/client/monitor/v20181114/models.py +59 -0
- ksyun/client/monitor/v20210101/__init__.py +0 -0
- ksyun/client/monitor/v20210101/client.py +286 -0
- ksyun/client/monitor/v20210101/models.py +330 -0
- ksyun/client/monitor/v20220101/__init__.py +0 -0
- ksyun/client/monitor/v20220101/client.py +56 -0
- ksyun/client/monitor/v20220101/models.py +32 -0
- ksyun/client/monitor/v20250101/__init__.py +0 -0
- ksyun/client/monitor/v20250101/client.py +79 -0
- ksyun/client/monitor/v20250101/models.py +156 -0
- ksyun/client/pdns/__init__.py +0 -0
- ksyun/client/pdns/v20160304/__init__.py +0 -0
- ksyun/client/pdns/v20160304/client.py +815 -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 +1160 -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 +447 -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/{slb/v20171210 → relyt/v20240117}/client.py +9 -9
- ksyun/client/relyt/v20240117/models.py +23 -0
- ksyun/client/resourcemanager/v20210320/client.py +8 -8
- ksyun/client/sks/v20151101/client.py +5 -5
- ksyun/client/sks/v20151101/models.py +7 -0
- ksyun/client/slb/v20160304/client.py +1051 -62
- ksyun/client/slb/v20160304/models.py +1692 -19
- ksyun/client/slb/v20250430/__init__.py +0 -0
- ksyun/client/slb/v20250430/client.py +815 -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 +1068 -0
- ksyun/client/sqlserver/v20190425/models.py +1528 -0
- ksyun/client/sts/v20151101/client.py +24 -1
- ksyun/client/sts/v20151101/models.py +54 -1
- ksyun/client/tagv2/v20200901/client.py +54 -8
- 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 +125 -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 +930 -0
- ksyun/client/tidb/v20210520/models.py +1162 -0
- ksyun/client/trade/v20200114/client.py +1 -1
- ksyun/client/trade/v20200831/client.py +1 -1
- ksyun/client/trade/v20250220/__init__.py +0 -0
- ksyun/client/trade/v20250220/client.py +102 -0
- ksyun/client/trade/v20250220/models.py +91 -0
- ksyun/client/trade/v20250321/__init__.py +0 -0
- ksyun/client/trade/v20250321/client.py +102 -0
- ksyun/client/trade/v20250321/models.py +71 -0
- ksyun/client/trade/v20250828/__init__.py +0 -0
- ksyun/client/trade/v20250828/client.py +33 -0
- ksyun/client/trade/v20250828/models.py +81 -0
- ksyun/client/vpc/v20160304/client.py +1297 -147
- ksyun/client/vpc/v20160304/models.py +1536 -139
- ksyun/client/waf/__init__.py +0 -0
- ksyun/client/waf/v20200707/__init__.py +0 -0
- ksyun/client/waf/v20200707/client.py +470 -0
- ksyun/client/waf/v20200707/models.py +738 -0
- ksyun/common/abstract_client.py +42 -18
- ksyun/common/http/request.py +43 -6
- ksyun/common/profile/http_profile.py +26 -1
- 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.44.dist-info/licenses}/LICENSE +0 -0
- {kingsoftcloud_sdk_python-1.1.1.dist-info → kingsoftcloud_sdk_python-1.5.8.44.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
|
@@ -33,8 +33,7 @@ from ksyun.common.exception import KsyunSDKException as SDKError
|
|
|
33
33
|
from ksyun.common.http.request import ApiRequest
|
|
34
34
|
from ksyun.common.http.request import RequestInternal
|
|
35
35
|
from ksyun.common.profile.client_profile import ClientProfile
|
|
36
|
-
from
|
|
37
|
-
from datetime import datetime, timedelta
|
|
36
|
+
from requests_aws4auth import AWS4Auth
|
|
38
37
|
|
|
39
38
|
warnings.filterwarnings("ignore")
|
|
40
39
|
|
|
@@ -63,6 +62,7 @@ class AbstractClient(object):
|
|
|
63
62
|
_service = ''
|
|
64
63
|
_sdkVersion = 'SDK_PYTHON_%s' % ksyun.__version__
|
|
65
64
|
_default_content_type = _form_urlencoded_content
|
|
65
|
+
paramsFormat = True
|
|
66
66
|
FMT = '%(asctime)s %(process)d %(filename)s L%(lineno)s %(levelname)s %(message)s'
|
|
67
67
|
|
|
68
68
|
def __init__(self, credential, region, profile=None):
|
|
@@ -86,6 +86,9 @@ class AbstractClient(object):
|
|
|
86
86
|
def _fix_params(self, params):
|
|
87
87
|
if not isinstance(params, (dict,)):
|
|
88
88
|
return params
|
|
89
|
+
if not self.paramsFormat:
|
|
90
|
+
return params
|
|
91
|
+
|
|
89
92
|
return self._format_params(None, params)
|
|
90
93
|
|
|
91
94
|
def _format_params(self, prefix, params):
|
|
@@ -118,36 +121,32 @@ class AbstractClient(object):
|
|
|
118
121
|
raise KsyunSDKException("ClientParamsError", "some params type error")
|
|
119
122
|
|
|
120
123
|
def _build_req_inter(self, action, params, req_inter, options=None):
|
|
121
|
-
if self.profile.signMethod in ("HMAC-SHA1", "HMAC-SHA256"):
|
|
124
|
+
if self.profile.signMethod in ("HMAC-SHA1", "HMAC-SHA256", "AWS4-HMAC-SHA256"):
|
|
122
125
|
self._build_req_with_signature(action, params, req_inter, options)
|
|
123
126
|
else:
|
|
124
127
|
raise KsyunSDKException("ClientError", "Invalid signature method.")
|
|
125
128
|
|
|
126
129
|
def _build_req_with_signature(self, action, params, req, options=None):
|
|
127
|
-
|
|
130
|
+
uri_params = dict()
|
|
131
|
+
if not (options and options.get("IsPostJson")):
|
|
132
|
+
params = copy.deepcopy(self._fix_params(params))
|
|
133
|
+
else:
|
|
134
|
+
uri_params['Action'] = action[0].upper() + action[1:]
|
|
135
|
+
uri_params['Version'] = self._apiVersion
|
|
136
|
+
|
|
137
|
+
|
|
128
138
|
params['Service'] = self._service
|
|
129
139
|
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
140
|
params['Version'] = self._apiVersion
|
|
141
|
+
params['SdkVersion'] = self._sdkVersion
|
|
136
142
|
|
|
137
143
|
if self.region:
|
|
138
144
|
params['Region'] = self.region
|
|
139
|
-
if self.credential.token:
|
|
140
|
-
params['SecurityToken'] = self.credential.token
|
|
141
145
|
if self.credential.secret_id:
|
|
142
146
|
params['Accesskey'] = self.credential.secret_id
|
|
143
|
-
if self.profile.signMethod:
|
|
144
|
-
params['SignatureMethod'] = self.profile.signMethod
|
|
145
147
|
if self.profile.language:
|
|
146
148
|
params['Language'] = self.profile.language
|
|
147
149
|
|
|
148
|
-
# 组装签名
|
|
149
|
-
params['Signature'] = Sign.sign(params, str(self.credential.secret_key), str(self.profile.signMethod))
|
|
150
|
-
|
|
151
150
|
# 请求头
|
|
152
151
|
req.header["Accept"] = _json_content
|
|
153
152
|
content_type = self._default_content_type
|
|
@@ -164,9 +163,17 @@ class AbstractClient(object):
|
|
|
164
163
|
content_type = _x_protobuf
|
|
165
164
|
req.header["Content-Type"] = content_type
|
|
166
165
|
|
|
166
|
+
# 支持自定义 header
|
|
167
|
+
if options.get("CustomHeaders"):
|
|
168
|
+
for key, value in options["CustomHeaders"].items():
|
|
169
|
+
req.header[key] = value
|
|
170
|
+
|
|
167
171
|
# GET上传文件报错
|
|
168
172
|
if req.method == "GET" and content_type == _multipart_content:
|
|
169
173
|
raise SDKError("ClientError", "Invalid request method GET for multipart.")
|
|
174
|
+
# 非get请求在url添加 Action、Version
|
|
175
|
+
if req.method != "GET":
|
|
176
|
+
params
|
|
170
177
|
|
|
171
178
|
# 请求数据转换
|
|
172
179
|
if content_type == _form_urlencoded_content:
|
|
@@ -179,6 +186,12 @@ class AbstractClient(object):
|
|
|
179
186
|
req.header["Content-Type"] = content_type + "; boundary=" + boundary
|
|
180
187
|
req.data = self._get_multipart_body(params, boundary, options)
|
|
181
188
|
|
|
189
|
+
req.uri_params = urlencode(uri_params)
|
|
190
|
+
|
|
191
|
+
# 组装签名
|
|
192
|
+
auth = AWS4Auth(str(self.credential.secret_id), str(self.credential.secret_key), self.region, self._service)
|
|
193
|
+
req.auth = auth
|
|
194
|
+
|
|
182
195
|
# it must return bytes instead of string
|
|
183
196
|
def _get_multipart_body(self, params, boundary, options=None):
|
|
184
197
|
if options is None:
|
|
@@ -219,8 +232,11 @@ class AbstractClient(object):
|
|
|
219
232
|
endpoint = self._get_service_domain()
|
|
220
233
|
return endpoint
|
|
221
234
|
|
|
235
|
+
|
|
222
236
|
def call(self, action, params, options=None):
|
|
223
|
-
|
|
237
|
+
# Use custom path from HttpProfile if available, otherwise use default _requestPath
|
|
238
|
+
request_path = self.profile.httpProfile.path if self.profile.httpProfile.path else self._requestPath
|
|
239
|
+
req = RequestInternal(self._get_endpoint(), self.profile.httpProfile.reqMethod, request_path)
|
|
224
240
|
self._build_req_inter(action, params, req, options)
|
|
225
241
|
resp_inter = self.request.send_request(req)
|
|
226
242
|
self._check_status(resp_inter)
|
|
@@ -243,9 +259,11 @@ class AbstractClient(object):
|
|
|
243
259
|
if self.profile.httpProfile.reqMethod != "POST":
|
|
244
260
|
raise SDKError("ClientError", "Invalid request method.")
|
|
245
261
|
|
|
262
|
+
# Use custom path from HttpProfile if available, otherwise use default _requestPath
|
|
263
|
+
request_path = self.profile.httpProfile.path if self.profile.httpProfile.path else self._requestPath
|
|
246
264
|
req = RequestInternal(self._get_endpoint(),
|
|
247
265
|
self.profile.httpProfile.reqMethod,
|
|
248
|
-
|
|
266
|
+
request_path)
|
|
249
267
|
for key in headers:
|
|
250
268
|
req.header[key] = headers[key]
|
|
251
269
|
req.data = body
|
|
@@ -282,6 +300,12 @@ class AbstractClient(object):
|
|
|
282
300
|
message = response["Error"]["Message"]
|
|
283
301
|
reqid = response["RequestId"]
|
|
284
302
|
raise KsyunSDKException(code, message, reqid)
|
|
303
|
+
def call_judge(self, action, params, content_type,options=None):
|
|
304
|
+
method = self.profile.httpProfile.reqMethod
|
|
305
|
+
if method and method == "POST" and 'application/json' in content_type:
|
|
306
|
+
return self.call_json(action, params)
|
|
307
|
+
else:
|
|
308
|
+
return self.call(action, params, options)
|
|
285
309
|
|
|
286
310
|
def set_stream_logger(self, stream=None, level=logging.DEBUG, log_format=None):
|
|
287
311
|
"""
|
ksyun/common/http/request.py
CHANGED
|
@@ -42,7 +42,7 @@ class ProxyConnection(object):
|
|
|
42
42
|
self.proxy = {"https": proxy}
|
|
43
43
|
self.request_length = 0
|
|
44
44
|
|
|
45
|
-
def request(self, method, url, body=None, headers={}):
|
|
45
|
+
def request(self, method, url, body=None, headers={}, auth=None):
|
|
46
46
|
self.request_length = 0
|
|
47
47
|
headers.setdefault("Host", self.request_host)
|
|
48
48
|
return requests.request(method=method,
|
|
@@ -51,7 +51,8 @@ class ProxyConnection(object):
|
|
|
51
51
|
headers=headers,
|
|
52
52
|
proxies=self.proxy,
|
|
53
53
|
verify=self.certification,
|
|
54
|
-
timeout=self.timeout
|
|
54
|
+
timeout=self.timeout,
|
|
55
|
+
auth=auth)
|
|
55
56
|
|
|
56
57
|
|
|
57
58
|
class ApiRequest(object):
|
|
@@ -71,6 +72,36 @@ class ApiRequest(object):
|
|
|
71
72
|
self.request_size = 0
|
|
72
73
|
self.response_size = 0
|
|
73
74
|
|
|
75
|
+
def _build_url(self, base_url, path=None, query_params=None):
|
|
76
|
+
"""Build complete URL from base_url, path and query parameters.
|
|
77
|
+
|
|
78
|
+
Ensures no double slashes between domain and path.
|
|
79
|
+
|
|
80
|
+
:param base_url: Base URL (scheme + domain)
|
|
81
|
+
:type base_url: str
|
|
82
|
+
:param path: URL path
|
|
83
|
+
:type path: str
|
|
84
|
+
:param query_params: Query parameters
|
|
85
|
+
:type query_params: str
|
|
86
|
+
:return: Complete URL
|
|
87
|
+
:rtype: str
|
|
88
|
+
"""
|
|
89
|
+
# Start with base URL, remove trailing slash if present
|
|
90
|
+
url = base_url.rstrip('/')
|
|
91
|
+
|
|
92
|
+
# Add path if provided
|
|
93
|
+
if path:
|
|
94
|
+
# Ensure path starts with /
|
|
95
|
+
if not path.startswith('/'):
|
|
96
|
+
path = '/' + path
|
|
97
|
+
url += path
|
|
98
|
+
|
|
99
|
+
# Add query parameters if provided
|
|
100
|
+
if query_params:
|
|
101
|
+
url += '?' + query_params
|
|
102
|
+
|
|
103
|
+
return url
|
|
104
|
+
|
|
74
105
|
def set_req_timeout(self, req_timeout):
|
|
75
106
|
self.req_timeout = req_timeout
|
|
76
107
|
|
|
@@ -88,11 +119,15 @@ class ApiRequest(object):
|
|
|
88
119
|
req_inter.header["Connection"] = "Keep-Alive"
|
|
89
120
|
if self.debug:
|
|
90
121
|
logger.debug("SendRequest %s" % req_inter)
|
|
122
|
+
|
|
91
123
|
if req_inter.method == 'GET':
|
|
92
|
-
|
|
93
|
-
|
|
124
|
+
# For GET requests, parameters are in the query string (req_inter.data)
|
|
125
|
+
req_inter_url = self._build_url(self.host, req_inter.uri, req_inter.data)
|
|
126
|
+
return self.conn.request(req_inter.method, req_inter_url, None, req_inter.header, req_inter.auth)
|
|
94
127
|
elif req_inter.method == 'POST' or req_inter.method == 'PUT' or req_inter.method == 'DELETE':
|
|
95
|
-
|
|
128
|
+
# For POST/PUT/DELETE, use uri_params for query string if present
|
|
129
|
+
req_inter_url = self._build_url(self.host, req_inter.uri, req_inter.uri_params if req_inter.uri_params else None)
|
|
130
|
+
return self.conn.request(req_inter.method, req_inter_url, req_inter.data, req_inter.header, req_inter.auth)
|
|
96
131
|
else:
|
|
97
132
|
raise KsyunSDKException("ClientParamsError", 'Method only support (GET, POST, PUT, DELETE)')
|
|
98
133
|
|
|
@@ -110,7 +145,7 @@ class ApiRequest(object):
|
|
|
110
145
|
|
|
111
146
|
|
|
112
147
|
class RequestInternal(object):
|
|
113
|
-
def __init__(self, host="", method="", uri="", header=None, data=""):
|
|
148
|
+
def __init__(self, host="", method="", uri="", header=None, data="", auth=None):
|
|
114
149
|
if header is None:
|
|
115
150
|
header = {}
|
|
116
151
|
self.host = host
|
|
@@ -118,6 +153,8 @@ class RequestInternal(object):
|
|
|
118
153
|
self.uri = uri
|
|
119
154
|
self.header = header
|
|
120
155
|
self.data = data
|
|
156
|
+
self.auth = auth
|
|
157
|
+
self.uri_params = None # Query parameters for POST/PUT/DELETE requests
|
|
121
158
|
|
|
122
159
|
def __str__(self):
|
|
123
160
|
headers = "\n".join("%s: %s" % (k, v) for k, v in self.header.items())
|
|
@@ -17,7 +17,7 @@ class HttpProfile(object):
|
|
|
17
17
|
scheme = "https"
|
|
18
18
|
|
|
19
19
|
def __init__(self, protocol=None, endpoint=None, reqMethod="POST", reqTimeout=60,
|
|
20
|
-
keepAlive=False, proxy=None, rootDomain=None, certification=None):
|
|
20
|
+
keepAlive=False, proxy=None, rootDomain=None, certification=None, path=None):
|
|
21
21
|
"""HTTP profile.
|
|
22
22
|
:param protocol: http or https, default is https.
|
|
23
23
|
:type protocol: str
|
|
@@ -29,6 +29,8 @@ class HttpProfile(object):
|
|
|
29
29
|
:type reqTimeout: int
|
|
30
30
|
:param rootDomain: The root domain to access, like: api.ksyun.com.
|
|
31
31
|
:type rootDomain: str
|
|
32
|
+
:param path: Custom URL path like /api/xxx/xxx. Query parameters will be automatically removed.
|
|
33
|
+
:type path: str
|
|
32
34
|
"""
|
|
33
35
|
self.endpoint = endpoint
|
|
34
36
|
self.reqTimeout = 60 if reqTimeout is None else reqTimeout
|
|
@@ -40,3 +42,26 @@ class HttpProfile(object):
|
|
|
40
42
|
self.proxy = proxy
|
|
41
43
|
self.rootDomain = "api.ksyun.com" if rootDomain is None else rootDomain
|
|
42
44
|
self.certification = certification
|
|
45
|
+
# Clean path: remove query parameters if present
|
|
46
|
+
self.path = self._clean_path(path) if path else None
|
|
47
|
+
|
|
48
|
+
def _clean_path(self, path):
|
|
49
|
+
"""Clean path by removing query parameters and normalizing slashes.
|
|
50
|
+
|
|
51
|
+
:param path: The path to clean
|
|
52
|
+
:type path: str
|
|
53
|
+
:return: Cleaned path
|
|
54
|
+
:rtype: str
|
|
55
|
+
"""
|
|
56
|
+
if not path:
|
|
57
|
+
return None
|
|
58
|
+
|
|
59
|
+
# Remove query parameters (everything after ?)
|
|
60
|
+
if '?' in path:
|
|
61
|
+
path = path.split('?')[0]
|
|
62
|
+
|
|
63
|
+
# Ensure path starts with /
|
|
64
|
+
if not path.startswith('/'):
|
|
65
|
+
path = '/' + path
|
|
66
|
+
|
|
67
|
+
return path
|
|
@@ -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
|
-
|
ksyun/common/sign.py
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
|
-
import hashlib
|
|
4
|
-
import hmac
|
|
5
|
-
|
|
6
|
-
try:
|
|
7
|
-
from urllib.request import quote
|
|
8
|
-
except ImportError:
|
|
9
|
-
from urllib import quote
|
|
10
|
-
|
|
11
|
-
from ksyun.common.exception.ksyun_sdk_exception import KsyunSDKException
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class Sign(object):
|
|
15
|
-
|
|
16
|
-
@staticmethod
|
|
17
|
-
# generate sign
|
|
18
|
-
def sign(params, secret_key, sign_method):
|
|
19
|
-
if sign_method == 'HMAC-SHA256':
|
|
20
|
-
digestmod = hashlib.sha256
|
|
21
|
-
elif sign_method == 'HMAC-SHA1':
|
|
22
|
-
digestmod = hashlib.sha1
|
|
23
|
-
else:
|
|
24
|
-
raise KsyunSDKException("signMethod invalid", "signMethod only support (HMAC-SHA1, HMAC-SHA256)")
|
|
25
|
-
|
|
26
|
-
# 加密
|
|
27
|
-
str_encode = ''
|
|
28
|
-
param_keys = sorted(params.keys())
|
|
29
|
-
for key in param_keys:
|
|
30
|
-
str_encode += quote(key, '~') + '=' + quote(str(params[key]), '~') + '&'
|
|
31
|
-
str_encode = str_encode[:-1]
|
|
32
|
-
# print(str_encode)
|
|
33
|
-
return hmac.new(secret_key.encode('utf-8'), str_encode.encode('utf-8'), digestmod).hexdigest()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|