tccli 3.0.1158.1__py2.py3-none-any.whl → 3.0.1160.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 (59) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/aiart/v20221229/api.json +11 -14
  3. tccli/services/ams/v20201229/api.json +314 -56
  4. tccli/services/ams/v20201229/examples.json +2 -2
  5. tccli/services/bi/v20220105/api.json +1 -1
  6. tccli/services/cat/v20180409/api.json +9 -0
  7. tccli/services/cdb/v20170320/api.json +33 -4
  8. tccli/services/cdn/v20180606/api.json +86 -0
  9. tccli/services/cfg/cfg_client.py +224 -12
  10. tccli/services/cfg/v20210820/api.json +897 -32
  11. tccli/services/cfg/v20210820/examples.json +32 -0
  12. tccli/services/cfw/cfw_client.py +53 -0
  13. tccli/services/cfw/v20190904/api.json +255 -2
  14. tccli/services/cfw/v20190904/examples.json +8 -0
  15. tccli/services/cls/v20201016/api.json +11 -1
  16. tccli/services/cme/v20191029/api.json +9 -9
  17. tccli/services/cme/v20191029/examples.json +1 -1
  18. tccli/services/csip/csip_client.py +53 -0
  19. tccli/services/csip/v20221121/api.json +134 -0
  20. tccli/services/csip/v20221121/examples.json +8 -0
  21. tccli/services/cwp/v20180228/api.json +66 -46
  22. tccli/services/cwp/v20180228/examples.json +1 -1
  23. tccli/services/cynosdb/v20190107/api.json +91 -0
  24. tccli/services/dnspod/v20210323/api.json +1 -1
  25. tccli/services/ecm/v20190719/api.json +23 -5
  26. tccli/services/emr/emr_client.py +53 -0
  27. tccli/services/emr/v20190103/api.json +351 -98
  28. tccli/services/emr/v20190103/examples.json +11 -3
  29. tccli/services/ess/v20201111/api.json +1 -1
  30. tccli/services/ess/v20201111/examples.json +6 -6
  31. tccli/services/essbasic/v20210526/api.json +10 -1
  32. tccli/services/essbasic/v20210526/examples.json +7 -1
  33. tccli/services/hunyuan/v20230901/api.json +114 -3
  34. tccli/services/iotexplorer/v20190423/api.json +25 -25
  35. tccli/services/iotexplorer/v20190423/examples.json +10 -4
  36. tccli/services/lcic/lcic_client.py +57 -4
  37. tccli/services/lcic/v20220817/api.json +52 -0
  38. tccli/services/lcic/v20220817/examples.json +8 -0
  39. tccli/services/live/v20180801/api.json +1 -1
  40. tccli/services/lke/v20231130/api.json +7 -7
  41. tccli/services/ocr/v20181119/api.json +10 -0
  42. tccli/services/tke/tke_client.py +53 -0
  43. tccli/services/tke/v20180525/api.json +188 -0
  44. tccli/services/tke/v20180525/examples.json +8 -0
  45. tccli/services/trtc/trtc_client.py +53 -0
  46. tccli/services/trtc/v20190722/api.json +76 -0
  47. tccli/services/trtc/v20190722/examples.json +8 -0
  48. tccli/services/vclm/v20240523/api.json +136 -0
  49. tccli/services/vclm/v20240523/examples.json +46 -0
  50. tccli/services/vclm/vclm_client.py +106 -0
  51. tccli/services/vm/v20201229/api.json +209 -45
  52. tccli/services/vm/v20201229/examples.json +1 -1
  53. tccli/services/vm/v20210922/api.json +25 -25
  54. tccli/services/vpc/v20170312/api.json +1 -1
  55. {tccli-3.0.1158.1.dist-info → tccli-3.0.1160.1.dist-info}/METADATA +2 -2
  56. {tccli-3.0.1158.1.dist-info → tccli-3.0.1160.1.dist-info}/RECORD +59 -59
  57. {tccli-3.0.1158.1.dist-info → tccli-3.0.1160.1.dist-info}/WHEEL +0 -0
  58. {tccli-3.0.1158.1.dist-info → tccli-3.0.1160.1.dist-info}/entry_points.txt +0 -0
  59. {tccli-3.0.1158.1.dist-info → tccli-3.0.1160.1.dist-info}/license_files/LICENSE +0 -0
@@ -1,5 +1,12 @@
1
1
  {
2
2
  "actions": {
3
+ "ControlAIConversation": {
4
+ "document": "提供服务端控制机器人的功能",
5
+ "input": "ControlAIConversationRequest",
6
+ "name": "控制AI对话",
7
+ "output": "ControlAIConversationResponse",
8
+ "status": "online"
9
+ },
3
10
  "CreateCloudRecording": {
4
11
  "document": "接口说明:\n启动云端录制功能,完成房间内的音视频录制,并上传到指定的云存储。您可以通过此 API 接口把TRTC 房间中的每一路音视频流做单独的录制又或者多路视频画面合流混成一路。\n\n您可以通过此接口实现如下目标:\n* 指定订阅流参数(RecordParams)来指定需要录制的主播的黑名单或者白名单。\n* 指定录制存储参数(StorageParams)来指定上传到您希望的云存储,目前支持腾讯云(云点播VOD、对象存储COS)和第三方AWS\n* 指定合流模式下的音视频转码详细参数(MixTranscodeParams),包括视频分辨率、视频码率、视频帧率、以及声音质量等\n* 指定合流模式各路画面的位置和布局或者也可以指定自动模板的方式来配置。\n\n关键名词:\n* 单流录制:分别录制房间的订阅UserId的音频和视频,录制服务会实时将录制文件上传至您指定的云存储。\n* 合流录制:将房间内订阅UserId的音视频混录成一个视频文件,并将录制文件上传至您指定的云存储。(录制结束后可前往云点播控制台https://console.cloud.tencent.com/vod/media 或 对象存储COS控制台https://console.cloud.tencent.com/cos/bucket查看文件)。",
5
12
  "input": "CreateCloudRecordingRequest",
@@ -744,6 +751,51 @@
744
751
  ],
745
752
  "usage": "in"
746
753
  },
754
+ "ControlAIConversationRequest": {
755
+ "document": "ControlAIConversation请求参数结构体",
756
+ "members": [
757
+ {
758
+ "disabled": false,
759
+ "document": "任务唯一标识",
760
+ "example": "无",
761
+ "member": "string",
762
+ "name": "TaskId",
763
+ "required": true,
764
+ "type": "string"
765
+ },
766
+ {
767
+ "disabled": false,
768
+ "document": "控制命令,目前支持命令如下:\n\n- ServerPushText,服务端发送文本给AI机器人,AI机器人会播报该文本",
769
+ "example": "无",
770
+ "member": "string",
771
+ "name": "Command",
772
+ "required": true,
773
+ "type": "string"
774
+ },
775
+ {
776
+ "disabled": false,
777
+ "document": "服务端发送播报文本命令,当Command为ServerPushText时必填",
778
+ "example": "无",
779
+ "member": "ServerPushText",
780
+ "name": "ServerPushText",
781
+ "required": false,
782
+ "type": "object"
783
+ }
784
+ ],
785
+ "type": "object"
786
+ },
787
+ "ControlAIConversationResponse": {
788
+ "document": "ControlAIConversation返回参数结构体",
789
+ "members": [
790
+ {
791
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
792
+ "member": "string",
793
+ "name": "RequestId",
794
+ "type": "string"
795
+ }
796
+ ],
797
+ "type": "object"
798
+ },
747
799
  "CreateCloudRecordingRequest": {
748
800
  "document": "CreateCloudRecording请求参数结构体",
749
801
  "members": [
@@ -5440,6 +5492,30 @@
5440
5492
  ],
5441
5493
  "usage": "out"
5442
5494
  },
5495
+ "ServerPushText": {
5496
+ "document": "服务端控制AI对话机器人播报指定文本",
5497
+ "members": [
5498
+ {
5499
+ "disabled": false,
5500
+ "document": "服务端推送播报文本",
5501
+ "example": "无",
5502
+ "member": "string",
5503
+ "name": "Text",
5504
+ "required": false,
5505
+ "type": "string"
5506
+ },
5507
+ {
5508
+ "disabled": false,
5509
+ "document": "是否允许该文本打断机器人说话",
5510
+ "example": "无",
5511
+ "member": "bool",
5512
+ "name": "Interrupt",
5513
+ "required": false,
5514
+ "type": "bool"
5515
+ }
5516
+ ],
5517
+ "usage": "in"
5518
+ },
5443
5519
  "SingleSubscribeParams": {
5444
5520
  "document": "单流旁路转推的用户上行信息。",
5445
5521
  "members": [
@@ -1,5 +1,13 @@
1
1
  {
2
2
  "actions": {
3
+ "ControlAIConversation": [
4
+ {
5
+ "document": "当您想让机器人主动播报文本的时候,可以使用该接口",
6
+ "input": "POST / HTTP/1.1\nHost: trtc.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ControlAIConversation\n<公共请求参数>\n\n{\n \"TaskId\": \"your-taskid\",\n \"Command\": \"ServerPushText\",\n \"ServerPushText\": {\n \"Text\": \"你好很高兴为您服务\",\n \"Interrupt\": true\n }\n}",
7
+ "output": "{\n \"Response\": {\n \"RequestId\": \"xxx-xxx\"\n }\n}",
8
+ "title": "发送播报文本"
9
+ }
10
+ ],
3
11
  "CreateCloudRecording": [
4
12
  {
5
13
  "document": "启动SdkAppId 为 1234 指定房间(房间号为3560)的云端录制。\n\n房间空闲等待时间设置为1分钟。\n录制模式为合流模式。\n录制的流类型为音视频。\n默认订阅所有用户的流。\n录制视频的宽度360,录制视频的高度640,帧率15,比特率500,000bps,默认背景色。\n录制视频布局模式为九宫格布局。\n存储至腾讯云点播VOD",
@@ -14,6 +14,13 @@
14
14
  "output": "DescribeImageAnimateJobResponse",
15
15
  "status": "online"
16
16
  },
17
+ "DescribePortraitSingJob": {
18
+ "document": "用于查询图片唱演任务。\n支持提交音频和图片生成唱演视频,满足社交娱乐、互动营销等场景的需求。",
19
+ "input": "DescribePortraitSingJobRequest",
20
+ "name": "查询图片唱演任务",
21
+ "output": "DescribePortraitSingJobResponse",
22
+ "status": "online"
23
+ },
17
24
  "DescribeVideoStylizationJob": {
18
25
  "document": "用于查询视频风格化任务。视频风格化支持将输入视频生成特定风格的视频。生成后的视频画面风格多样、流畅自然,能够满足社交娱乐、互动营销、视频素材制作等场景的需求。",
19
26
  "input": "DescribeVideoStylizationJobRequest",
@@ -35,6 +42,13 @@
35
42
  "output": "SubmitImageAnimateJobResponse",
36
43
  "status": "online"
37
44
  },
45
+ "SubmitPortraitSingJob": {
46
+ "document": "用于提交图片唱演任务。\n支持提交音频和图片生成唱演视频,满足社交娱乐、互动营销等场景的需求。",
47
+ "input": "SubmitPortraitSingJobRequest",
48
+ "name": "提交图片唱演任务",
49
+ "output": "SubmitPortraitSingJobResponse",
50
+ "status": "online"
51
+ },
38
52
  "SubmitVideoStylizationJob": {
39
53
  "document": "用于提交视频风格化任务。支持将输入视频生成特定风格的视频。生成后的视频画面风格多样、流畅自然,能够满足社交娱乐、互动营销、视频素材制作等场景的需求。",
40
54
  "input": "SubmitVideoStylizationJobRequest",
@@ -246,6 +260,73 @@
246
260
  ],
247
261
  "type": "object"
248
262
  },
263
+ "DescribePortraitSingJobRequest": {
264
+ "document": "DescribePortraitSingJob请求参数结构体",
265
+ "members": [
266
+ {
267
+ "disabled": false,
268
+ "document": "任务ID",
269
+ "example": "1199999431088685056",
270
+ "member": "string",
271
+ "name": "JobId",
272
+ "required": true,
273
+ "type": "string"
274
+ }
275
+ ],
276
+ "type": "object"
277
+ },
278
+ "DescribePortraitSingJobResponse": {
279
+ "document": "DescribePortraitSingJob返回参数结构体",
280
+ "members": [
281
+ {
282
+ "disabled": false,
283
+ "document": "任务ID",
284
+ "example": "1199999431088685056",
285
+ "member": "string",
286
+ "name": "JobId",
287
+ "output_required": false,
288
+ "type": "string",
289
+ "value_allowed_null": false
290
+ },
291
+ {
292
+ "disabled": false,
293
+ "document": "任务状态码\n—RUN:处理中\n—FAIL:处理失败\n—STOP:处理终止\n—DONE:处理完成",
294
+ "example": "[\"RUN\",\"FAIL\",\"STOP\",\"DONE\"]",
295
+ "member": "string",
296
+ "name": "StatusCode",
297
+ "output_required": false,
298
+ "type": "string",
299
+ "value_allowed_null": false
300
+ },
301
+ {
302
+ "disabled": false,
303
+ "document": "任务状态信息",
304
+ "example": "[\"处理中\",\"处理失败\",\"处理中止\",\"处理完成\"]",
305
+ "member": "string",
306
+ "name": "StatusMsg",
307
+ "output_required": false,
308
+ "type": "string",
309
+ "value_allowed_null": false
310
+ },
311
+ {
312
+ "disabled": false,
313
+ "document": "生成视频的URL地址\n有效期24小时",
314
+ "example": "https://***/video.mp4",
315
+ "member": "string",
316
+ "name": "ResultVideoUrl",
317
+ "output_required": false,
318
+ "type": "string",
319
+ "value_allowed_null": false
320
+ },
321
+ {
322
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
323
+ "member": "string",
324
+ "name": "RequestId",
325
+ "type": "string"
326
+ }
327
+ ],
328
+ "type": "object"
329
+ },
249
330
  "DescribeVideoStylizationJobRequest": {
250
331
  "document": "DescribeVideoStylizationJob请求参数结构体",
251
332
  "members": [
@@ -534,6 +615,61 @@
534
615
  ],
535
616
  "type": "object"
536
617
  },
618
+ "SubmitPortraitSingJobRequest": {
619
+ "document": "SubmitPortraitSingJob请求参数结构体",
620
+ "members": [
621
+ {
622
+ "disabled": false,
623
+ "document": "传入音频URL地址。音频要求:\n—音频时长:不超过60秒\n—音频格式:mp3、wav、m4a",
624
+ "example": "https://***/audio.mp3",
625
+ "member": "string",
626
+ "name": "AudioUrl",
627
+ "required": true,
628
+ "type": "string"
629
+ },
630
+ {
631
+ "disabled": false,
632
+ "document": "传入图片URL地址,图片要求:\n—图片格式:jpg、jpeg、png\n—图片分辨率:长边不超过2560\n—图片大小:不超过6M\n—图片宽高比:图片【宽:高】在1:2到2:1范围内",
633
+ "example": "https://***/image.jpg",
634
+ "member": "string",
635
+ "name": "ImageUrl",
636
+ "required": false,
637
+ "type": "string"
638
+ },
639
+ {
640
+ "disabled": false,
641
+ "document": "传入图片Base64编码。\n—图片Base64编码与URL地址必传其一",
642
+ "example": "MIIHNjCCBh6gAwIBAgIQCVe4E0h49mzI0NcSqMy1+jANBgkqhkiG9w0BAQsFADB1 MQswCQYDVQQGEwJVUzEVMBMG",
643
+ "member": "string",
644
+ "name": "ImageBase64",
645
+ "required": false,
646
+ "type": "string"
647
+ }
648
+ ],
649
+ "type": "object"
650
+ },
651
+ "SubmitPortraitSingJobResponse": {
652
+ "document": "SubmitPortraitSingJob返回参数结构体",
653
+ "members": [
654
+ {
655
+ "disabled": false,
656
+ "document": "任务ID",
657
+ "example": "1199999431088685056",
658
+ "member": "string",
659
+ "name": "JobId",
660
+ "output_required": false,
661
+ "type": "string",
662
+ "value_allowed_null": false
663
+ },
664
+ {
665
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
666
+ "member": "string",
667
+ "name": "RequestId",
668
+ "type": "string"
669
+ }
670
+ ],
671
+ "type": "object"
672
+ },
537
673
  "SubmitVideoStylizationJobRequest": {
538
674
  "document": "SubmitVideoStylizationJob请求参数结构体",
539
675
  "members": [
@@ -16,6 +16,20 @@
16
16
  "title": "调用成功示例"
17
17
  }
18
18
  ],
19
+ "DescribePortraitSingJob": [
20
+ {
21
+ "document": "处理中",
22
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribePortraitSingJob\n<公共请求参数>\n\n{\n \"JobId\": \"1199964964965990400\"\n}",
23
+ "output": "{\n \"Response\": {\n \"JobId\": \"1199964964965990400\",\n \"RequestId\": \"0819265a-1bd7-4e0a-94a6-18463ae9b20e\",\n \"ResultVideoUrl\": \"\",\n \"StatusCode\": \"RUN\",\n \"StatusMsg\": \"处理中\"\n }\n}",
24
+ "title": "调用示例-处理中"
25
+ },
26
+ {
27
+ "document": "任务完成",
28
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribePortraitSingJob\n<公共请求参数>\n\n{\n \"JobId\": \"1199964964965990400\"\n}",
29
+ "output": "{\n \"Response\": {\n \"JobId\": \"1199964964965990400\",\n \"RequestId\": \"2564192f-1af0-4d1d-ac92-fac0f5844f73\",\n \"ResultVideoUrl\": \"https://***.mp4\",\n \"StatusCode\": \"DONE\",\n \"StatusMsg\": \"处理完成\"\n }\n}",
30
+ "title": "调用成功-任务完成"
31
+ }
32
+ ],
19
33
  "DescribeVideoStylizationJob": [
20
34
  {
21
35
  "document": "成功调用",
@@ -46,6 +60,38 @@
46
60
  "title": "调用成功示例"
47
61
  }
48
62
  ],
63
+ "SubmitPortraitSingJob": [
64
+ {
65
+ "document": "调用成功",
66
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: SubmitPortraitSingJob\n<公共请求参数>\n\n{\n \"AudioUrl\": \"https://***/test.mp3\",\n \"ImageUrl\": \"https://***/test.png\"\n}",
67
+ "output": "{\n \"Response\": {\n \"JobId\": \"1199964964965990400\",\n \"RequestId\": \"79655032-c347-4f05-af23-ae80f7ff47eb\"\n }\n}",
68
+ "title": "调用成功-图片url地址"
69
+ },
70
+ {
71
+ "document": "音频时长超限",
72
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: SubmitPortraitSingJob\n<公共请求参数>\n\n{\n \"AudioUrl\": \"https://***/durationInvalid.m4a\",\n \"ImageUrl\": \"https://***/aj.jpg\"\n}",
73
+ "output": "{\n \"Response\": {\n \"Error\": {\n \"Code\": \"InvalidParameterValue.InvalidAudioDuration\",\n \"Message\": \"音频时长超出限定范围。上传音频的时长要求:在1秒到60秒范围内\"\n },\n \"RequestId\": \"9d314f18-3670-4793-bf4b-619b43494ac7\"\n }\n}",
74
+ "title": "调用失败-音频时长超限"
75
+ },
76
+ {
77
+ "document": "图片分辨率超限",
78
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: SubmitPortraitSingJob\n<公共请求参数>\n\n{\n \"AudioUrl\": \"https://***/test.mp3\",\n \"ImageUrl\": \"https://***/resolutionInvalid.jpg\"\n}",
79
+ "output": "{\n \"Response\": {\n \"Error\": {\n \"Code\": \"InvalidParameterValue.InvalidImageResolution\",\n \"Message\": \"图片分辨率超出限定范围。上传图片的长边分辨率要求:在0到2560范围内\"\n },\n \"RequestId\": \"29498231-20eb-43d1-bb3b-cc9e07978699\"\n }\n}",
80
+ "title": "调用失败-图片分辨率超限"
81
+ },
82
+ {
83
+ "document": "图片宽高比超限",
84
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: SubmitPortraitSingJob\n<公共请求参数>\n\n{\n \"AudioUrl\": \"https://***/test.mp3\",\n \"ImageUrl\": \"https://***/ratioInvalid.jpg\"\n}",
85
+ "output": "{\n \"Response\": {\n \"Error\": {\n \"Code\": \"InvalidParameterValue.InvalidImageAspectRatio\",\n \"Message\": \"图片宽高比超出限定范围。上传图片的宽高比要求:在0.5到2.0范围内\"\n },\n \"RequestId\": \"3c9cb9bd-5b2a-4b18-a890-73f7712ca2ce\"\n }\n}",
86
+ "title": "调用失败-图片宽高比超限"
87
+ },
88
+ {
89
+ "document": "图片大小超限",
90
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: SubmitPortraitSingJob\n<公共请求参数>\n\n{\n \"AudioUrl\": \"https://***/test.mp3\",\n \"ImageUrl\": \"https://***/storageInvalid.jpg\"\n}",
91
+ "output": "{\n \"Response\": {\n \"Error\": {\n \"Code\": \"InvalidParameterValue.InvalidImageSize\",\n \"Message\": \"图片大小超出限定范围。上传图片的大小要求:在0MB到10MB范围内\"\n },\n \"RequestId\": \"cd17e6bb-afdb-4bed-8a15-55c461333104\"\n }\n}",
92
+ "title": "调用失败-图片大小超限"
93
+ }
94
+ ],
49
95
  "SubmitVideoStylizationJob": [
50
96
  {
51
97
  "document": "成功调用",
@@ -173,6 +173,58 @@ def doSubmitVideoStylizationJob(args, parsed_globals):
173
173
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
174
174
 
175
175
 
176
+ def doSubmitPortraitSingJob(args, parsed_globals):
177
+ g_param = parse_global_arg(parsed_globals)
178
+
179
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
180
+ cred = credential.CVMRoleCredential()
181
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
182
+ cred = credential.STSAssumeRoleCredential(
183
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
184
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
185
+ )
186
+ 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):
187
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
188
+ else:
189
+ cred = credential.Credential(
190
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
191
+ )
192
+ http_profile = HttpProfile(
193
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
194
+ reqMethod="POST",
195
+ endpoint=g_param[OptionsDefine.Endpoint],
196
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
197
+ )
198
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
199
+ if g_param[OptionsDefine.Language]:
200
+ profile.language = g_param[OptionsDefine.Language]
201
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
202
+ client = mod.VclmClient(cred, g_param[OptionsDefine.Region], profile)
203
+ client._sdkVersion += ("_CLI_" + __version__)
204
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
205
+ model = models.SubmitPortraitSingJobRequest()
206
+ model.from_json_string(json.dumps(args))
207
+ start_time = time.time()
208
+ while True:
209
+ rsp = client.SubmitPortraitSingJob(model)
210
+ result = rsp.to_json_string()
211
+ try:
212
+ json_obj = json.loads(result)
213
+ except TypeError as e:
214
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
215
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
216
+ break
217
+ cur_time = time.time()
218
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
219
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
220
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
221
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
222
+ else:
223
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
224
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
225
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
226
+
227
+
176
228
  def doConfirmVideoTranslateJob(args, parsed_globals):
177
229
  g_param = parse_global_arg(parsed_globals)
178
230
 
@@ -225,6 +277,58 @@ def doConfirmVideoTranslateJob(args, parsed_globals):
225
277
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
226
278
 
227
279
 
280
+ def doDescribePortraitSingJob(args, parsed_globals):
281
+ g_param = parse_global_arg(parsed_globals)
282
+
283
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
284
+ cred = credential.CVMRoleCredential()
285
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
286
+ cred = credential.STSAssumeRoleCredential(
287
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
288
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
289
+ )
290
+ 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):
291
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
292
+ else:
293
+ cred = credential.Credential(
294
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
295
+ )
296
+ http_profile = HttpProfile(
297
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
298
+ reqMethod="POST",
299
+ endpoint=g_param[OptionsDefine.Endpoint],
300
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
301
+ )
302
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
303
+ if g_param[OptionsDefine.Language]:
304
+ profile.language = g_param[OptionsDefine.Language]
305
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
306
+ client = mod.VclmClient(cred, g_param[OptionsDefine.Region], profile)
307
+ client._sdkVersion += ("_CLI_" + __version__)
308
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
309
+ model = models.DescribePortraitSingJobRequest()
310
+ model.from_json_string(json.dumps(args))
311
+ start_time = time.time()
312
+ while True:
313
+ rsp = client.DescribePortraitSingJob(model)
314
+ result = rsp.to_json_string()
315
+ try:
316
+ json_obj = json.loads(result)
317
+ except TypeError as e:
318
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
319
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
320
+ break
321
+ cur_time = time.time()
322
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
323
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
324
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
325
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
326
+ else:
327
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
328
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
329
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
330
+
331
+
228
332
  def doDescribeImageAnimateJob(args, parsed_globals):
229
333
  g_param = parse_global_arg(parsed_globals)
230
334
 
@@ -395,7 +499,9 @@ ACTION_MAP = {
395
499
  "SubmitVideoTranslateJob": doSubmitVideoTranslateJob,
396
500
  "DescribeVideoTranslateJob": doDescribeVideoTranslateJob,
397
501
  "SubmitVideoStylizationJob": doSubmitVideoStylizationJob,
502
+ "SubmitPortraitSingJob": doSubmitPortraitSingJob,
398
503
  "ConfirmVideoTranslateJob": doConfirmVideoTranslateJob,
504
+ "DescribePortraitSingJob": doDescribePortraitSingJob,
399
505
  "DescribeImageAnimateJob": doDescribeImageAnimateJob,
400
506
  "SubmitImageAnimateJob": doSubmitImageAnimateJob,
401
507
  "DescribeVideoStylizationJob": doDescribeVideoStylizationJob,