tccli 3.0.1229.1__py2.py3-none-any.whl → 3.0.1230.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/aiart/aiart_client.py +57 -4
  3. tccli/services/aiart/v20221229/api.json +99 -10
  4. tccli/services/aiart/v20221229/examples.json +8 -0
  5. tccli/services/batch/v20170312/api.json +15 -8
  6. tccli/services/cfw/v20190904/api.json +1 -1
  7. tccli/services/cwp/v20180228/api.json +1 -1
  8. tccli/services/cynosdb/cynosdb_client.py +110 -57
  9. tccli/services/cynosdb/v20190107/api.json +166 -18
  10. tccli/services/cynosdb/v20190107/examples.json +14 -0
  11. tccli/services/dbbrain/v20210527/api.json +3 -1
  12. tccli/services/emr/emr_client.py +110 -4
  13. tccli/services/emr/v20190103/api.json +645 -0
  14. tccli/services/emr/v20190103/examples.json +16 -0
  15. tccli/services/iotexplorer/v20190423/api.json +10 -0
  16. tccli/services/ivld/v20210903/api.json +25 -25
  17. tccli/services/ivld/v20210903/examples.json +1 -1
  18. tccli/services/lcic/v20220817/api.json +2 -2
  19. tccli/services/lke/v20231130/api.json +4 -4
  20. tccli/services/mps/v20190612/api.json +54 -1
  21. tccli/services/ocr/v20181119/api.json +108 -28
  22. tccli/services/postgres/v20170312/api.json +221 -219
  23. tccli/services/postgres/v20170312/examples.json +36 -36
  24. tccli/services/tdmq/v20200217/api.json +2 -2
  25. tccli/services/trtc/v20190722/api.json +4 -8
  26. tccli/services/vclm/v20240523/api.json +3 -3
  27. tccli/services/vod/v20180717/api.json +17 -17
  28. tccli/services/vpc/v20170312/api.json +493 -27
  29. tccli/services/vpc/v20170312/examples.json +67 -11
  30. tccli/services/vpc/vpc_client.py +475 -104
  31. {tccli-3.0.1229.1.dist-info → tccli-3.0.1230.1.dist-info}/METADATA +2 -2
  32. {tccli-3.0.1229.1.dist-info → tccli-3.0.1230.1.dist-info}/RECORD +35 -35
  33. {tccli-3.0.1229.1.dist-info → tccli-3.0.1230.1.dist-info}/WHEEL +0 -0
  34. {tccli-3.0.1229.1.dist-info → tccli-3.0.1230.1.dist-info}/entry_points.txt +0 -0
  35. {tccli-3.0.1229.1.dist-info → tccli-3.0.1230.1.dist-info}/license_files/LICENSE +0 -0
tccli/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '3.0.1229.1'
1
+ __version__ = '3.0.1230.1'
@@ -225,7 +225,7 @@ def doSubmitTrainPortraitModelJob(args, parsed_globals):
225
225
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
226
226
 
227
227
 
228
- def doQueryTextToImageProJob(args, parsed_globals):
228
+ def doImageOutpainting(args, parsed_globals):
229
229
  g_param = parse_global_arg(parsed_globals)
230
230
 
231
231
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -254,11 +254,11 @@ def doQueryTextToImageProJob(args, parsed_globals):
254
254
  client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
255
255
  client._sdkVersion += ("_CLI_" + __version__)
256
256
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
257
- model = models.QueryTextToImageProJobRequest()
257
+ model = models.ImageOutpaintingRequest()
258
258
  model.from_json_string(json.dumps(args))
259
259
  start_time = time.time()
260
260
  while True:
261
- rsp = client.QueryTextToImageProJob(model)
261
+ rsp = client.ImageOutpainting(model)
262
262
  result = rsp.to_json_string()
263
263
  try:
264
264
  json_obj = json.loads(result)
@@ -537,6 +537,58 @@ def doTextToImage(args, parsed_globals):
537
537
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
538
538
 
539
539
 
540
+ def doQueryTextToImageProJob(args, parsed_globals):
541
+ g_param = parse_global_arg(parsed_globals)
542
+
543
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
544
+ cred = credential.CVMRoleCredential()
545
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
546
+ cred = credential.STSAssumeRoleCredential(
547
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
548
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
549
+ )
550
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
551
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
552
+ else:
553
+ cred = credential.Credential(
554
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
555
+ )
556
+ http_profile = HttpProfile(
557
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
558
+ reqMethod="POST",
559
+ endpoint=g_param[OptionsDefine.Endpoint],
560
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
561
+ )
562
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
563
+ if g_param[OptionsDefine.Language]:
564
+ profile.language = g_param[OptionsDefine.Language]
565
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
566
+ client = mod.AiartClient(cred, g_param[OptionsDefine.Region], profile)
567
+ client._sdkVersion += ("_CLI_" + __version__)
568
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
569
+ model = models.QueryTextToImageProJobRequest()
570
+ model.from_json_string(json.dumps(args))
571
+ start_time = time.time()
572
+ while True:
573
+ rsp = client.QueryTextToImageProJob(model)
574
+ result = rsp.to_json_string()
575
+ try:
576
+ json_obj = json.loads(result)
577
+ except TypeError as e:
578
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
579
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
580
+ break
581
+ cur_time = time.time()
582
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
583
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
584
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
585
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
586
+ else:
587
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
588
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
589
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
590
+
591
+
540
592
  def doChangeClothes(args, parsed_globals):
541
593
  g_param = parse_global_arg(parsed_globals)
542
594
 
@@ -708,12 +760,13 @@ ACTION_MAP = {
708
760
  "SubmitTextToImageProJob": doSubmitTextToImageProJob,
709
761
  "ReplaceBackground": doReplaceBackground,
710
762
  "SubmitTrainPortraitModelJob": doSubmitTrainPortraitModelJob,
711
- "QueryTextToImageProJob": doQueryTextToImageProJob,
763
+ "ImageOutpainting": doImageOutpainting,
712
764
  "GenerateAvatar": doGenerateAvatar,
713
765
  "QueryTrainPortraitModelJob": doQueryTrainPortraitModelJob,
714
766
  "UploadTrainPortraitImages": doUploadTrainPortraitImages,
715
767
  "QueryDrawPortraitJob": doQueryDrawPortraitJob,
716
768
  "TextToImage": doTextToImage,
769
+ "QueryTextToImageProJob": doQueryTextToImageProJob,
717
770
  "ChangeClothes": doChangeClothes,
718
771
  "SubmitDrawPortraitJob": doSubmitDrawPortraitJob,
719
772
  "ImageToImage": doImageToImage,
@@ -14,6 +14,13 @@
14
14
  "output": "GenerateAvatarResponse",
15
15
  "status": "online"
16
16
  },
17
+ "ImageOutpainting": {
18
+ "document": "扩图接口支持对输入图像按指定宽高比实现智能扩图。\n默认提供1个并发,代表最多能同时处理1个已提交的任务。",
19
+ "input": "ImageOutpaintingRequest",
20
+ "name": "扩图",
21
+ "output": "ImageOutpaintingResponse",
22
+ "status": "online"
23
+ },
17
24
  "ImageToImage": {
18
25
  "document": "图像风格化(图生图)接口提供生成式的图生图风格转化能力,将根据输入的图像及文本描述,智能生成风格转化后的图像。建议避免输入人像过小、姿势复杂、人数较多的人像图片。\n图像风格化(图生图)默认提供3个并发任务数,代表最多能同时处理3个已提交的任务,上一个任务处理完毕后才能开始处理下一个任务。",
19
26
  "input": "ImageToImageRequest",
@@ -219,7 +226,16 @@
219
226
  "members": [
220
227
  {
221
228
  "disabled": false,
222
- "document": "头像风格,仅在人像模式下生效。\n请在 [百变头像风格列表](https://cloud.tencent.com/document/product/1668/107741) 中选择期望的风格,传入风格编号,不传默认使用 flower 风格。\n若使用萌宠贴纸模式,无需选择风格,该参数不生效。",
229
+ "document": "图像类型,默认为人像。\nhuman:人像头像,仅支持人像图片输入,建议避免上传无人、多人、人像过小的图片。\npet:萌宠贴纸,仅支持动物图片输入,建议避免上传无动物、多动物、动物过小的图片。",
230
+ "example": "human",
231
+ "member": "string",
232
+ "name": "Type",
233
+ "required": false,
234
+ "type": "string"
235
+ },
236
+ {
237
+ "disabled": false,
238
+ "document": "头像风格,仅在人像模式下生效。\n若使用人像模式,请在 [百变头像风格列表](https://cloud.tencent.com/document/product/1668/107741) 中选择期望的风格,传入风格编号,不传默认使用 flower 风格。\n若使用萌宠贴纸模式,无需选择风格,该参数不生效。",
223
239
  "example": "flower",
224
240
  "member": "string",
225
241
  "name": "Style",
@@ -244,15 +260,6 @@
244
260
  "required": false,
245
261
  "type": "string"
246
262
  },
247
- {
248
- "disabled": false,
249
- "document": "图像类型,默认为人像。\nhuman:人像头像,仅支持人像图片输入,建议避免上传无人、多人、人像过小的图片。\npet:萌宠贴纸,仅支持动物图片输入,建议避免上传无动物、多动物、动物过小的图片。",
250
- "example": "human",
251
- "member": "string",
252
- "name": "Type",
253
- "required": false,
254
- "type": "string"
255
- },
256
263
  {
257
264
  "disabled": false,
258
265
  "document": "输入人像图的质量检测开关,默认开启,仅在人像模式下生效。\n1:开启\n0:关闭\n建议开启检测,可提升生成效果,关闭检测可能因输入图像质量较差导致生成效果受损。\n开启后,将增强对输入图像的质量要求,如果输入图像单边分辨率<500、图像中人脸占比较小、存在多人、没有检测到人脸、人脸不完整、人脸遮挡等,将被拦截。\n关闭后,将降低对输入图像的质量要求,如果图像中没有检测到人脸或人脸占比过小等,将被拦截。",
@@ -314,6 +321,88 @@
314
321
  ],
315
322
  "type": "object"
316
323
  },
324
+ "ImageOutpaintingRequest": {
325
+ "document": "ImageOutpainting请求参数结构体",
326
+ "members": [
327
+ {
328
+ "disabled": false,
329
+ "document": "扩展后的比例(宽:高),需要不等于原图比例。\n支持:1:1、4:3、3:4、16:9、9:16",
330
+ "example": "4:3",
331
+ "member": "string",
332
+ "name": "Ratio",
333
+ "required": true,
334
+ "type": "string"
335
+ },
336
+ {
337
+ "disabled": false,
338
+ "document": "输入图 Base64 数据。\nBase64 和 Url 必须提供一个,如果都提供以 Url 为准。\n图片限制:单边分辨率小于5000,转成 Base64 字符串后小于 6MB,格式支持 jpg、jpeg、png、bmp、tiff、webp。",
339
+ "example": "9j/4QlQaHR0c...N6a2M5ZCI",
340
+ "member": "string",
341
+ "name": "InputImage",
342
+ "required": false,
343
+ "type": "string"
344
+ },
345
+ {
346
+ "disabled": false,
347
+ "document": "输入图 Url。\nBase64 和 Url 必须提供一个,如果都提供以 Url 为准。\n图片限制:单边分辨率小于5000,转成 Base64 字符串后小于 6MB,格式支持 jpg、jpeg、png、bmp、tiff、webp。",
348
+ "example": "https://xxx.com/image.jpg",
349
+ "member": "string",
350
+ "name": "InputUrl",
351
+ "required": false,
352
+ "type": "string"
353
+ },
354
+ {
355
+ "disabled": false,
356
+ "document": "返回图像方式(base64 或 url) ,二选一,默认为 base64。url 有效期为1小时。",
357
+ "example": "url",
358
+ "member": "string",
359
+ "name": "RspImgType",
360
+ "required": false,
361
+ "type": "string"
362
+ },
363
+ {
364
+ "disabled": false,
365
+ "document": "为生成结果图添加标识的开关,默认为1。\n1:添加标识。\n0:不添加标识。\n其他数值:默认按1处理。\n建议您使用显著标识来提示结果图使用了 AI 绘画技术,是 AI 生成的图片。",
366
+ "example": "1",
367
+ "member": "int64",
368
+ "name": "LogoAdd",
369
+ "required": false,
370
+ "type": "int"
371
+ },
372
+ {
373
+ "disabled": false,
374
+ "document": "标识内容设置。\n默认在生成结果图右下角添加“图片由 AI 生成”字样,您可根据自身需要替换为其他的标识图片。",
375
+ "example": "{\"LogoUrl\": \"https://xxx.com/logo.jpg\", \"LogoRect\": {\"X\": 10, \"Y\": 10, \"Width\": 20, \"Height\": 20}}",
376
+ "member": "LogoParam",
377
+ "name": "LogoParam",
378
+ "required": false,
379
+ "type": "object"
380
+ }
381
+ ],
382
+ "type": "object"
383
+ },
384
+ "ImageOutpaintingResponse": {
385
+ "document": "ImageOutpainting返回参数结构体",
386
+ "members": [
387
+ {
388
+ "disabled": false,
389
+ "document": "根据入参 RspImgType 填入不同,返回不同的内容。\n如果传入 base64 则返回生成图 Base64 编码。\n如果传入 url 则返回的生成图 URL , 有效期1小时,请及时保存。",
390
+ "example": "https://aiart-xxx.cos.ap-guangzhou.myqcloud.com/xxx.jpg?q-sign-algorithm=sha1&q-ak=xxxxx&q-sign-time=1731574045;1731577645&q-key-time=1731574045;1731577645&q-header-list=host&q-url-param-list=&q-signature=31fe75c1c18c3d91db59508961209dd37aaf41c7",
391
+ "member": "string",
392
+ "name": "ResultImage",
393
+ "output_required": false,
394
+ "type": "string",
395
+ "value_allowed_null": false
396
+ },
397
+ {
398
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
399
+ "member": "string",
400
+ "name": "RequestId",
401
+ "type": "string"
402
+ }
403
+ ],
404
+ "type": "object"
405
+ },
317
406
  "ImageToImageRequest": {
318
407
  "document": "ImageToImage请求参数结构体",
319
408
  "members": [
@@ -16,6 +16,14 @@
16
16
  "title": "调用成功示例"
17
17
  }
18
18
  ],
19
+ "ImageOutpainting": [
20
+ {
21
+ "document": "",
22
+ "input": "POST / HTTP/1.1\nHost: aiart.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ImageOutpainting\n<公共请求参数>\n\n{\n \"InputUrl\": \"https://xxx.com/image.jpg\",\n \"Ratio\": \"4:3\",\n \"RspImgType\": \"url\"\n}",
23
+ "output": "{\n \"Response\": {\n \"ResultImage\": \"https://aiart-xxx.cos.ap-guangzhou.myqcloud.com/xxx.jpg?q-sign-algorithm=sha1&q-ak=xxxxx&q-sign-time=1731574045;1731577645&q-key-time=1731574045;1731577645&q-header-list=host&q-url-param-list=&q-signature=31fe75c1c18c3d91db59508961209dd37aaf41c7\",\n \"RequestId\": \"301bfc25-61ca-4ece-b03e-f6aefb547969\"\n }\n}",
24
+ "title": "调用示例"
25
+ }
26
+ ],
19
27
  "ImageToImage": [
20
28
  {
21
29
  "document": "调用成功示例",
@@ -2762,31 +2762,34 @@
2762
2762
  "members": [
2763
2763
  {
2764
2764
  "disabled": false,
2765
- "document": "Docker Hub 用户名或 Tencent Registry 用户名",
2765
+ "document": "Docker Hub填写“[user/repo]:[tag]”,Tencent Registry填写“ccr.ccs.tencentyun.com/[namespace/repo]:[tag]”",
2766
2766
  "example": "无",
2767
2767
  "member": "string",
2768
- "name": "User",
2768
+ "name": "Image",
2769
+ "output_required": true,
2769
2770
  "required": true,
2770
2771
  "type": "string",
2771
2772
  "value_allowed_null": false
2772
2773
  },
2773
2774
  {
2774
2775
  "disabled": false,
2775
- "document": "Docker Hub 密码或 Tencent Registry 密码",
2776
+ "document": "Docker Hub 用户名或 Tencent Registry 用户名;公共镜像可不填写此参数。",
2776
2777
  "example": "无",
2777
2778
  "member": "string",
2778
- "name": "Password",
2779
- "required": true,
2779
+ "name": "User",
2780
+ "output_required": true,
2781
+ "required": false,
2780
2782
  "type": "string",
2781
2783
  "value_allowed_null": false
2782
2784
  },
2783
2785
  {
2784
2786
  "disabled": false,
2785
- "document": "Docker Hub填写“[user/repo]:[tag]”,Tencent Registry填写“ccr.ccs.tencentyun.com/[namespace/repo]:[tag]”",
2787
+ "document": "Docker Hub 密码或 Tencent Registry 密码;公共镜像可不填写此参数。",
2786
2788
  "example": "无",
2787
2789
  "member": "string",
2788
- "name": "Image",
2789
- "required": true,
2790
+ "name": "Password",
2791
+ "output_required": true,
2792
+ "required": false,
2790
2793
  "type": "string",
2791
2794
  "value_allowed_null": false
2792
2795
  },
@@ -2796,6 +2799,7 @@
2796
2799
  "example": "无",
2797
2800
  "member": "string",
2798
2801
  "name": "Server",
2802
+ "output_required": true,
2799
2803
  "required": false,
2800
2804
  "type": "string",
2801
2805
  "value_allowed_null": false
@@ -2806,6 +2810,7 @@
2806
2810
  "example": "0",
2807
2811
  "member": "uint64",
2808
2812
  "name": "MaxRetryCount",
2813
+ "output_required": true,
2809
2814
  "required": false,
2810
2815
  "type": "int",
2811
2816
  "value_allowed_null": false
@@ -2816,6 +2821,7 @@
2816
2821
  "example": "1",
2817
2822
  "member": "uint64",
2818
2823
  "name": "DelayOnRetry",
2824
+ "output_required": true,
2819
2825
  "required": false,
2820
2826
  "type": "int",
2821
2827
  "value_allowed_null": false
@@ -2826,6 +2832,7 @@
2826
2832
  "example": "-u root",
2827
2833
  "member": "string",
2828
2834
  "name": "DockerRunOption",
2835
+ "output_required": true,
2829
2836
  "required": false,
2830
2837
  "type": "string",
2831
2838
  "value_allowed_null": true
@@ -5565,7 +5565,7 @@
5565
5565
  "members": [
5566
5566
  {
5567
5567
  "disabled": false,
5568
- "document": "",
5568
+ "document": "查询结果",
5569
5569
  "example": "[{\"Address\":\"beijing\",\"InsID\":\"ins-cvmid\",\"InsName\":\"cvmname\",\"Ip\":\"141.98.11.67\",\"Num\":39,\"Port\":\"22\"}]",
5570
5570
  "member": "StaticInfo",
5571
5571
  "name": "Data",
@@ -22481,7 +22481,7 @@
22481
22481
  {
22482
22482
  "disabled": false,
22483
22483
  "document": "基线信息列表",
22484
- "example": "[ { \"Name\": \"基线名1\", \"Level\": 1, \"RuleCount\": 11, \"HostCount\": 12, \"Status\": 0, \"CategoryId\": 2, \"LastScanTime\": \"2024-11-04 03:43:26\", \"MaxStatus\": 2, \"BaselineFailCount\": 29 } ]",
22484
+ "example": "[ { \"Name\": \"基线名A\", \"Level\": 1, \"RuleCount\": 11, \"HostCount\": 12, \"Status\": 0, \"CategoryId\": 2, \"LastScanTime\": \"2024-11-04 03:43:26\", \"MaxStatus\": 2, \"BaselineFailCount\": 29 } ]",
22485
22485
  "member": "BaselineInfo",
22486
22486
  "name": "BaselineList",
22487
22487
  "output_required": true,
@@ -901,7 +901,7 @@ def doCloseProxy(args, parsed_globals):
901
901
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
902
902
 
903
903
 
904
- def doExportResourcePackageDeductDetails(args, parsed_globals):
904
+ def doDescribeProxySpecs(args, parsed_globals):
905
905
  g_param = parse_global_arg(parsed_globals)
906
906
 
907
907
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -930,11 +930,11 @@ def doExportResourcePackageDeductDetails(args, parsed_globals):
930
930
  client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
931
931
  client._sdkVersion += ("_CLI_" + __version__)
932
932
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
933
- model = models.ExportResourcePackageDeductDetailsRequest()
933
+ model = models.DescribeProxySpecsRequest()
934
934
  model.from_json_string(json.dumps(args))
935
935
  start_time = time.time()
936
936
  while True:
937
- rsp = client.ExportResourcePackageDeductDetails(model)
937
+ rsp = client.DescribeProxySpecs(model)
938
938
  result = rsp.to_json_string()
939
939
  try:
940
940
  json_obj = json.loads(result)
@@ -1265,6 +1265,58 @@ def doDescribeResourcesByDealName(args, parsed_globals):
1265
1265
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1266
1266
 
1267
1267
 
1268
+ def doExportResourcePackageDeductDetails(args, parsed_globals):
1269
+ g_param = parse_global_arg(parsed_globals)
1270
+
1271
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1272
+ cred = credential.CVMRoleCredential()
1273
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1274
+ cred = credential.STSAssumeRoleCredential(
1275
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1276
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1277
+ )
1278
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
1279
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1280
+ else:
1281
+ cred = credential.Credential(
1282
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1283
+ )
1284
+ http_profile = HttpProfile(
1285
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1286
+ reqMethod="POST",
1287
+ endpoint=g_param[OptionsDefine.Endpoint],
1288
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1289
+ )
1290
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1291
+ if g_param[OptionsDefine.Language]:
1292
+ profile.language = g_param[OptionsDefine.Language]
1293
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1294
+ client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
1295
+ client._sdkVersion += ("_CLI_" + __version__)
1296
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1297
+ model = models.ExportResourcePackageDeductDetailsRequest()
1298
+ model.from_json_string(json.dumps(args))
1299
+ start_time = time.time()
1300
+ while True:
1301
+ rsp = client.ExportResourcePackageDeductDetails(model)
1302
+ result = rsp.to_json_string()
1303
+ try:
1304
+ json_obj = json.loads(result)
1305
+ except TypeError as e:
1306
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1307
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1308
+ break
1309
+ cur_time = time.time()
1310
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1311
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1312
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1313
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1314
+ else:
1315
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1316
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1317
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1318
+
1319
+
1268
1320
  def doModifyClusterStorage(args, parsed_globals):
1269
1321
  g_param = parse_global_arg(parsed_globals)
1270
1322
 
@@ -3761,58 +3813,6 @@ def doAddInstances(args, parsed_globals):
3761
3813
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3762
3814
 
3763
3815
 
3764
- def doDescribeProxySpecs(args, parsed_globals):
3765
- g_param = parse_global_arg(parsed_globals)
3766
-
3767
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3768
- cred = credential.CVMRoleCredential()
3769
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3770
- cred = credential.STSAssumeRoleCredential(
3771
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3772
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3773
- )
3774
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
3775
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3776
- else:
3777
- cred = credential.Credential(
3778
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3779
- )
3780
- http_profile = HttpProfile(
3781
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3782
- reqMethod="POST",
3783
- endpoint=g_param[OptionsDefine.Endpoint],
3784
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3785
- )
3786
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3787
- if g_param[OptionsDefine.Language]:
3788
- profile.language = g_param[OptionsDefine.Language]
3789
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3790
- client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
3791
- client._sdkVersion += ("_CLI_" + __version__)
3792
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3793
- model = models.DescribeProxySpecsRequest()
3794
- model.from_json_string(json.dumps(args))
3795
- start_time = time.time()
3796
- while True:
3797
- rsp = client.DescribeProxySpecs(model)
3798
- result = rsp.to_json_string()
3799
- try:
3800
- json_obj = json.loads(result)
3801
- except TypeError as e:
3802
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3803
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3804
- break
3805
- cur_time = time.time()
3806
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3807
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3808
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3809
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3810
- else:
3811
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3812
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3813
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3814
-
3815
-
3816
3816
  def doModifyInstanceUpgradeLimitDays(args, parsed_globals):
3817
3817
  g_param = parse_global_arg(parsed_globals)
3818
3818
 
@@ -4749,6 +4749,58 @@ def doBindClusterResourcePackages(args, parsed_globals):
4749
4749
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4750
4750
 
4751
4751
 
4752
+ def doDescribeServerlessInstanceSpecs(args, parsed_globals):
4753
+ g_param = parse_global_arg(parsed_globals)
4754
+
4755
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4756
+ cred = credential.CVMRoleCredential()
4757
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4758
+ cred = credential.STSAssumeRoleCredential(
4759
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4760
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4761
+ )
4762
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
4763
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4764
+ else:
4765
+ cred = credential.Credential(
4766
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4767
+ )
4768
+ http_profile = HttpProfile(
4769
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4770
+ reqMethod="POST",
4771
+ endpoint=g_param[OptionsDefine.Endpoint],
4772
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4773
+ )
4774
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4775
+ if g_param[OptionsDefine.Language]:
4776
+ profile.language = g_param[OptionsDefine.Language]
4777
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4778
+ client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
4779
+ client._sdkVersion += ("_CLI_" + __version__)
4780
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
4781
+ model = models.DescribeServerlessInstanceSpecsRequest()
4782
+ model.from_json_string(json.dumps(args))
4783
+ start_time = time.time()
4784
+ while True:
4785
+ rsp = client.DescribeServerlessInstanceSpecs(model)
4786
+ result = rsp.to_json_string()
4787
+ try:
4788
+ json_obj = json.loads(result)
4789
+ except TypeError as e:
4790
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
4791
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4792
+ break
4793
+ cur_time = time.time()
4794
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4795
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4796
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4797
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4798
+ else:
4799
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4800
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4801
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4802
+
4803
+
4752
4804
  def doDescribeAuditLogs(args, parsed_globals):
4753
4805
  g_param = parse_global_arg(parsed_globals)
4754
4806
 
@@ -8001,13 +8053,14 @@ ACTION_MAP = {
8001
8053
  "RenewClusters": doRenewClusters,
8002
8054
  "CloseProxyEndPoint": doCloseProxyEndPoint,
8003
8055
  "CloseProxy": doCloseProxy,
8004
- "ExportResourcePackageDeductDetails": doExportResourcePackageDeductDetails,
8056
+ "DescribeProxySpecs": doDescribeProxySpecs,
8005
8057
  "InquirePriceModify": doInquirePriceModify,
8006
8058
  "DescribeClusterDetail": doDescribeClusterDetail,
8007
8059
  "DescribeTasks": doDescribeTasks,
8008
8060
  "DescribeInstanceSpecs": doDescribeInstanceSpecs,
8009
8061
  "DescribeBinlogDownloadUrl": doDescribeBinlogDownloadUrl,
8010
8062
  "DescribeResourcesByDealName": doDescribeResourcesByDealName,
8063
+ "ExportResourcePackageDeductDetails": doExportResourcePackageDeductDetails,
8011
8064
  "ModifyClusterStorage": doModifyClusterStorage,
8012
8065
  "ActivateInstance": doActivateInstance,
8013
8066
  "DescribeProxyNodes": doDescribeProxyNodes,
@@ -8056,7 +8109,6 @@ ACTION_MAP = {
8056
8109
  "SwitchClusterZone": doSwitchClusterZone,
8057
8110
  "OpenClusterTransparentEncrypt": doOpenClusterTransparentEncrypt,
8058
8111
  "AddInstances": doAddInstances,
8059
- "DescribeProxySpecs": doDescribeProxySpecs,
8060
8112
  "ModifyInstanceUpgradeLimitDays": doModifyInstanceUpgradeLimitDays,
8061
8113
  "DeleteAccounts": doDeleteAccounts,
8062
8114
  "RevokeAccountPrivileges": doRevokeAccountPrivileges,
@@ -8075,6 +8127,7 @@ ACTION_MAP = {
8075
8127
  "ModifyInstanceParam": doModifyInstanceParam,
8076
8128
  "DescribeInstanceCLSLogDelivery": doDescribeInstanceCLSLogDelivery,
8077
8129
  "BindClusterResourcePackages": doBindClusterResourcePackages,
8130
+ "DescribeServerlessInstanceSpecs": doDescribeServerlessInstanceSpecs,
8078
8131
  "DescribeAuditLogs": doDescribeAuditLogs,
8079
8132
  "UnbindClusterResourcePackages": doUnbindClusterResourcePackages,
8080
8133
  "DescribeProxies": doDescribeProxies,