kingsoftcloud-sdk-python 1.5.8.44__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.
Files changed (118) hide show
  1. {kingsoftcloud_sdk_python-1.5.8.44.dist-info → kingsoftcloud_sdk_python-1.5.8.49.dist-info}/METADATA +24 -13
  2. {kingsoftcloud_sdk_python-1.5.8.44.dist-info → kingsoftcloud_sdk_python-1.5.8.49.dist-info}/RECORD +118 -118
  3. {kingsoftcloud_sdk_python-1.5.8.44.dist-info → kingsoftcloud_sdk_python-1.5.8.49.dist-info}/WHEEL +1 -1
  4. ksyun/__init__.py +1 -1
  5. ksyun/client/actiontrail/v20190401/client.py +1 -3
  6. ksyun/client/aicp/v20240612/client.py +168 -53
  7. ksyun/client/aicp/v20240612/models.py +192 -7
  8. ksyun/client/aicp/v20251212/client.py +2 -2
  9. ksyun/client/aicp/v20251212/models.py +1 -1
  10. ksyun/client/bill/v20180601/client.py +3 -5
  11. ksyun/client/bill/v20220601/client.py +2 -4
  12. ksyun/client/bill_union/v20200101/client.py +9 -11
  13. ksyun/client/bill_union/v20200101/models.py +5 -5
  14. ksyun/client/bill_union/v20221222/client.py +6 -8
  15. ksyun/client/bill_union/v20250801/client.py +2 -4
  16. ksyun/client/bill_union/v20250801/models.py +1 -1
  17. ksyun/client/bws/v20160304/client.py +7 -9
  18. ksyun/client/cdn/v20160901/client.py +3 -5
  19. ksyun/client/cdn/v20200630/client.py +17 -19
  20. ksyun/client/cdn/v20200901/client.py +7 -9
  21. ksyun/client/cdn/v20211201/client.py +1 -3
  22. ksyun/client/cdn/v3/client.py +43 -45
  23. ksyun/client/cdn/v3/models.py +11 -11
  24. ksyun/client/cen/v20160304/client.py +26 -28
  25. ksyun/client/clickhouse/v20210101/client.py +39 -41
  26. ksyun/client/cloud_advisor/v20250610/client.py +3 -5
  27. ksyun/client/dmp/v20240101/client.py +20 -22
  28. ksyun/client/dts/v20180108/client.py +19 -21
  29. ksyun/client/ebs/v20160304/client.py +28 -30
  30. ksyun/client/ebs/v20160304/models.py +1 -1
  31. ksyun/client/eip/v20160304/client.py +12 -14
  32. ksyun/client/epc/v20151101/client.py +105 -107
  33. ksyun/client/epc/v20151101/models.py +19 -4
  34. ksyun/client/iam/v20151101/client.py +65 -67
  35. ksyun/client/iam/v20240513/client.py +1 -3
  36. ksyun/client/iam/v20240703/client.py +1 -3
  37. ksyun/client/influxdb/v20191010/client.py +27 -29
  38. ksyun/client/kad/v20161122/client.py +8 -10
  39. ksyun/client/kce/v20180314/client.py +17 -19
  40. ksyun/client/kce/v20190806/client.py +34 -36
  41. ksyun/client/kce/v20201231/client.py +1 -3
  42. ksyun/client/kce/v20230101/client.py +9 -11
  43. ksyun/client/kce/v20230306/client.py +22 -24
  44. ksyun/client/kce/v20231115/client.py +2 -4
  45. ksyun/client/kce2/v20230101/client.py +15 -17
  46. ksyun/client/kcf/v20211215/client.py +9 -11
  47. ksyun/client/kci/v20200702/client.py +15 -17
  48. ksyun/client/kci/v20200702/models.py +1 -1
  49. ksyun/client/kcm/v20160304/client.py +10 -12
  50. ksyun/client/kcrs/v20211109/client.py +44 -46
  51. ksyun/client/kcs/v20160701/client.py +66 -68
  52. ksyun/client/kcs/v20170401/client.py +1 -3
  53. ksyun/client/kcs/v20240701/client.py +1 -3
  54. ksyun/client/kead/v20200101/client.py +3 -5
  55. ksyun/client/kec/v20160304/client.py +565 -105
  56. ksyun/client/kec/v20160304/models.py +689 -22
  57. ksyun/client/ked/v1/client.py +44 -46
  58. ksyun/client/kes/v20201215/client.py +8 -10
  59. ksyun/client/ket/v20170101/client.py +8 -10
  60. ksyun/client/kfw/v20160304/client.py +648 -12
  61. ksyun/client/kfw/v20160304/models.py +1003 -9
  62. ksyun/client/kingpay/v1/client.py +1 -3
  63. ksyun/client/kkms/v20160304/client.py +8 -10
  64. ksyun/client/klog/v20200731/client.py +16 -18
  65. ksyun/client/kls/v20170101/client.py +8 -10
  66. ksyun/client/kmr/v20210902/client.py +23 -25
  67. ksyun/client/kmr/v20231231/client.py +7 -9
  68. ksyun/client/kmr/v20240814/client.py +19 -21
  69. ksyun/client/knad/v20230323/client.py +17 -19
  70. ksyun/client/kpfs/v20240930/client.py +54 -54
  71. ksyun/client/kpfs/v20240930/models.py +286 -81
  72. ksyun/client/krds/v20160701/client.py +91 -93
  73. ksyun/client/krds/v20200825/client.py +10 -12
  74. ksyun/client/memcached/v20180627/client.py +13 -15
  75. ksyun/client/milvus/v20231010/client.py +19 -21
  76. ksyun/client/mongodb/v20170101/client.py +44 -46
  77. ksyun/client/mongodb/v20250101/client.py +1 -3
  78. ksyun/client/monitor/v20100525/client.py +2 -4
  79. ksyun/client/monitor/v20181114/client.py +1 -3
  80. ksyun/client/monitor/v20210101/client.py +12 -14
  81. ksyun/client/monitor/v20220101/client.py +2 -4
  82. ksyun/client/monitor/v20250101/client.py +45 -3
  83. ksyun/client/monitor/v20250101/models.py +34 -2
  84. ksyun/client/pdns/v20160304/client.py +35 -37
  85. ksyun/client/postgresql/v20181225/client.py +50 -52
  86. ksyun/client/postgresql/v20181225/models.py +1 -1
  87. ksyun/client/rabbitmq/v20191017/client.py +19 -21
  88. ksyun/client/relyt/v20240117/client.py +1 -3
  89. ksyun/client/resourcemanager/v20210320/client.py +8 -10
  90. ksyun/client/sks/v20151101/client.py +6 -8
  91. ksyun/client/sks/v20151101/models.py +21 -2
  92. ksyun/client/slb/v20160304/client.py +93 -95
  93. ksyun/client/slb/v20160304/models.py +5 -5
  94. ksyun/client/slb/v20250430/client.py +35 -37
  95. ksyun/client/sqlserver/v20190425/client.py +46 -48
  96. ksyun/client/sts/v20151101/client.py +2 -4
  97. ksyun/client/tagv2/v20200901/client.py +10 -12
  98. ksyun/client/ter/v20240415/client.py +5 -7
  99. ksyun/client/tidb/v20210520/client.py +40 -42
  100. ksyun/client/trade/v20200114/client.py +1 -3
  101. ksyun/client/trade/v20200831/client.py +1 -3
  102. ksyun/client/trade/v20250220/client.py +4 -6
  103. ksyun/client/trade/v20250321/client.py +4 -6
  104. ksyun/client/trade/v20250828/client.py +1 -3
  105. ksyun/client/trade/v20250828/models.py +1 -1
  106. ksyun/client/vpc/v20160304/client.py +132 -134
  107. ksyun/client/vpc/v20160304/models.py +5 -0
  108. ksyun/client/waf/v20200707/client.py +20 -22
  109. ksyun/common/abstract_client.py +15 -3
  110. ksyun/common/abstract_model.py +3 -3
  111. ksyun/common/common_client.py +2 -0
  112. ksyun/common/credential.py +2 -0
  113. ksyun/common/exception/ksyun_sdk_exception.py +11 -7
  114. ksyun/common/http/request.py +2 -0
  115. ksyun/common/profile/client_profile.py +3 -0
  116. ksyun/common/profile/http_profile.py +2 -0
  117. {kingsoftcloud_sdk_python-1.5.8.44.dist-info → kingsoftcloud_sdk_python-1.5.8.49.dist-info}/licenses/LICENSE +0 -0
  118. {kingsoftcloud_sdk_python-1.5.8.44.dist-info → kingsoftcloud_sdk_python-1.5.8.49.dist-info}/top_level.txt +0 -0
@@ -12,10 +12,13 @@ class CreateVpcRequest(AbstractModel):
12
12
  :type PathPrefix: String
13
13
  :param ProvidedIpv6CidrBlock: 是否支持IPv6网段,目前只支持部分机房
14
14
  :type PathPrefix: Boolean
15
+ :param Ipv6CidrBlock: Ipv6CidrBlock指定ipv6网段创建vpc,只有当ProvidedIpv6CidrBlock = true时生效,该参数可不传,不传则随机分配ipv6网段
16
+ :type PathPrefix: String
15
17
  """
16
18
  self.VpcName = None
17
19
  self.CidrBlock = None
18
20
  self.ProvidedIpv6CidrBlock = None
21
+ self.Ipv6CidrBlock = None
19
22
 
20
23
  def _deserialize(self, params):
21
24
  if params.get("VpcName"):
@@ -24,6 +27,8 @@ class CreateVpcRequest(AbstractModel):
24
27
  self.CidrBlock = params.get("CidrBlock")
25
28
  if params.get("ProvidedIpv6CidrBlock"):
26
29
  self.ProvidedIpv6CidrBlock = params.get("ProvidedIpv6CidrBlock")
30
+ if params.get("Ipv6CidrBlock"):
31
+ self.Ipv6CidrBlock = params.get("Ipv6CidrBlock")
27
32
 
28
33
 
29
34
  class DeleteVpcRequest(AbstractModel):
@@ -28,7 +28,7 @@ class WafClient(AbstractClient):
28
28
  if isinstance(e, KsyunSDKException):
29
29
  raise
30
30
  else:
31
- raise KsyunSDKException(e.message, e.message)
31
+ raise KsyunSDKException(message=str(e))
32
32
 
33
33
 
34
34
  def DeleteWaf(self, request):
@@ -51,7 +51,7 @@ class WafClient(AbstractClient):
51
51
  if isinstance(e, KsyunSDKException):
52
52
  raise
53
53
  else:
54
- raise KsyunSDKException(e.message, e.message)
54
+ raise KsyunSDKException(message=str(e))
55
55
 
56
56
 
57
57
  def CreateDomain(self, request):
@@ -74,7 +74,7 @@ class WafClient(AbstractClient):
74
74
  if isinstance(e, KsyunSDKException):
75
75
  raise
76
76
  else:
77
- raise KsyunSDKException(e.message, e.message)
77
+ raise KsyunSDKException(message=str(e))
78
78
 
79
79
 
80
80
  def DescribeDomains(self, request):
@@ -97,7 +97,7 @@ class WafClient(AbstractClient):
97
97
  if isinstance(e, KsyunSDKException):
98
98
  raise
99
99
  else:
100
- raise KsyunSDKException(e.message, e.message)
100
+ raise KsyunSDKException(message=str(e))
101
101
 
102
102
 
103
103
  def ModifyDomain(self, request):
@@ -120,7 +120,7 @@ class WafClient(AbstractClient):
120
120
  if isinstance(e, KsyunSDKException):
121
121
  raise
122
122
  else:
123
- raise KsyunSDKException(e.message, e.message)
123
+ raise KsyunSDKException(message=str(e))
124
124
 
125
125
 
126
126
  def DeleteDomain(self, request):
@@ -143,7 +143,7 @@ class WafClient(AbstractClient):
143
143
  if isinstance(e, KsyunSDKException):
144
144
  raise
145
145
  else:
146
- raise KsyunSDKException(e.message, e.message)
146
+ raise KsyunSDKException(message=str(e))
147
147
 
148
148
 
149
149
  def CreateAccessControlRule(self, request):
@@ -166,7 +166,7 @@ class WafClient(AbstractClient):
166
166
  if isinstance(e, KsyunSDKException):
167
167
  raise
168
168
  else:
169
- raise KsyunSDKException(e.message, e.message)
169
+ raise KsyunSDKException(message=str(e))
170
170
 
171
171
 
172
172
  def DescribeAccessControlRules(self, request):
@@ -189,7 +189,7 @@ class WafClient(AbstractClient):
189
189
  if isinstance(e, KsyunSDKException):
190
190
  raise
191
191
  else:
192
- raise KsyunSDKException(e.message, e.message)
192
+ raise KsyunSDKException(message=str(e))
193
193
 
194
194
 
195
195
  def ModifyAccessControlRule(self, request):
@@ -212,7 +212,7 @@ class WafClient(AbstractClient):
212
212
  if isinstance(e, KsyunSDKException):
213
213
  raise
214
214
  else:
215
- raise KsyunSDKException(e.message, e.message)
215
+ raise KsyunSDKException(message=str(e))
216
216
 
217
217
 
218
218
  def DeleteAccessControlRule(self, request):
@@ -235,7 +235,7 @@ class WafClient(AbstractClient):
235
235
  if isinstance(e, KsyunSDKException):
236
236
  raise
237
237
  else:
238
- raise KsyunSDKException(e.message, e.message)
238
+ raise KsyunSDKException(message=str(e))
239
239
 
240
240
 
241
241
  def DescribeCertificates(self, request):
@@ -258,7 +258,7 @@ class WafClient(AbstractClient):
258
258
  if isinstance(e, KsyunSDKException):
259
259
  raise
260
260
  else:
261
- raise KsyunSDKException(e.message, e.message)
261
+ raise KsyunSDKException(message=str(e))
262
262
 
263
263
 
264
264
  def CreateIpv6Protection(self, request):
@@ -281,7 +281,7 @@ class WafClient(AbstractClient):
281
281
  if isinstance(e, KsyunSDKException):
282
282
  raise
283
283
  else:
284
- raise KsyunSDKException(e.message, e.message)
284
+ raise KsyunSDKException(message=str(e))
285
285
 
286
286
 
287
287
  def DeleteIpv6Protection(self, request):
@@ -304,7 +304,7 @@ class WafClient(AbstractClient):
304
304
  if isinstance(e, KsyunSDKException):
305
305
  raise
306
306
  else:
307
- raise KsyunSDKException(e.message, e.message)
307
+ raise KsyunSDKException(message=str(e))
308
308
 
309
309
 
310
310
  def ModifyStorageTime(self, request):
@@ -327,7 +327,7 @@ class WafClient(AbstractClient):
327
327
  if isinstance(e, KsyunSDKException):
328
328
  raise
329
329
  else:
330
- raise KsyunSDKException(e.message, e.message)
330
+ raise KsyunSDKException(message=str(e))
331
331
 
332
332
 
333
333
  def CreateAlbDomain(self, request):
@@ -350,7 +350,7 @@ class WafClient(AbstractClient):
350
350
  if isinstance(e, KsyunSDKException):
351
351
  raise
352
352
  else:
353
- raise KsyunSDKException(e.message, e.message)
353
+ raise KsyunSDKException(message=str(e))
354
354
 
355
355
 
356
356
  def ModifyAlbDomain(self, request):
@@ -373,7 +373,7 @@ class WafClient(AbstractClient):
373
373
  if isinstance(e, KsyunSDKException):
374
374
  raise
375
375
  else:
376
- raise KsyunSDKException(e.message, e.message)
376
+ raise KsyunSDKException(message=str(e))
377
377
 
378
378
 
379
379
  def DeleteAlbDomain(self, request):
@@ -396,7 +396,7 @@ class WafClient(AbstractClient):
396
396
  if isinstance(e, KsyunSDKException):
397
397
  raise
398
398
  else:
399
- raise KsyunSDKException(e.message, e.message)
399
+ raise KsyunSDKException(message=str(e))
400
400
 
401
401
 
402
402
  def CreateAlbWaf(self, request):
@@ -419,7 +419,7 @@ class WafClient(AbstractClient):
419
419
  if isinstance(e, KsyunSDKException):
420
420
  raise
421
421
  else:
422
- raise KsyunSDKException(e.message, e.message)
422
+ raise KsyunSDKException(message=str(e))
423
423
 
424
424
 
425
425
  def ModifyAlbWaf(self, request):
@@ -442,7 +442,7 @@ class WafClient(AbstractClient):
442
442
  if isinstance(e, KsyunSDKException):
443
443
  raise
444
444
  else:
445
- raise KsyunSDKException(e.message, e.message)
445
+ raise KsyunSDKException(message=str(e))
446
446
 
447
447
 
448
448
  def DescribeAlbDomains(self, request):
@@ -465,6 +465,4 @@ class WafClient(AbstractClient):
465
465
  if isinstance(e, KsyunSDKException):
466
466
  raise
467
467
  else:
468
- raise KsyunSDKException(e.message, e.message)
469
-
470
-
468
+ raise KsyunSDKException(message=str(e))
@@ -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
@@ -211,9 +213,19 @@ class AbstractClient(object):
211
213
  if isinstance(v, list) or isinstance(v, dict):
212
214
  v = json.dumps(v)
213
215
  body += b'Content-Type: application/json\r\n'
214
- if sys.version_info[0] == 3 and isinstance(v, type("")):
215
- v = v.encode()
216
- body += b'\r\n%s\r\n' % v
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'
217
229
  if body != b'':
218
230
  body += b'--%s--\r\n' % boundary
219
231
  return body
@@ -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].encode("UTF-8") if isinstance(d[k], type(u"")) and sys.version_info[0] == 2 else 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
@@ -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
 
@@ -13,6 +13,8 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
+ from __future__ import unicode_literals
17
+
16
18
  try:
17
19
  # py3
18
20
  import configparser
@@ -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
- s = "[KsyunSDKException] code:%s message:%s requestId:%s" % (
16
- self.code, self.message, self.requestId)
17
- if sys.version_info[0] < 3 and isinstance(s, unicode):
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
 
@@ -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
@@ -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,6 +12,8 @@
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"