tccli 3.0.1370.1__py2.py3-none-any.whl → 3.0.1372.1__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 (54) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/batch/v20170312/api.json +56 -56
  3. tccli/services/batch/v20170312/examples.json +3 -3
  4. tccli/services/cfg/v20210820/api.json +5 -5
  5. tccli/services/cfg/v20210820/examples.json +1 -1
  6. tccli/services/ckafka/v20190819/api.json +21 -21
  7. tccli/services/clb/v20180317/api.json +7 -7
  8. tccli/services/cls/v20201016/api.json +337 -233
  9. tccli/services/cls/v20201016/examples.json +32 -32
  10. tccli/services/csip/v20221121/examples.json +1 -1
  11. tccli/services/ctem/v20231128/api.json +112 -112
  12. tccli/services/ctem/v20231128/examples.json +10 -10
  13. tccli/services/dlc/v20210125/api.json +3 -3
  14. tccli/services/dnspod/v20210323/api.json +14 -4
  15. tccli/services/dnspod/v20210323/examples.json +2 -2
  16. tccli/services/es/v20180416/api.json +23 -4
  17. tccli/services/ess/v20201111/api.json +29 -5
  18. tccli/services/essbasic/v20210526/api.json +28 -4
  19. tccli/services/faceid/v20180301/api.json +42 -2
  20. tccli/services/faceid/v20180301/examples.json +2 -2
  21. tccli/services/iai/v20200303/api.json +9 -0
  22. tccli/services/lighthouse/lighthouse_client.py +106 -0
  23. tccli/services/lighthouse/v20200324/api.json +280 -0
  24. tccli/services/lighthouse/v20200324/examples.json +22 -0
  25. tccli/services/live/v20180801/api.json +1 -1
  26. tccli/services/lke/lke_client.py +0 -53
  27. tccli/services/lke/v20231130/api.json +32 -82
  28. tccli/services/lke/v20231130/examples.json +0 -8
  29. tccli/services/mariadb/v20170312/api.json +1 -1
  30. tccli/services/monitor/v20180724/api.json +3 -3
  31. tccli/services/ocr/v20181119/api.json +22 -2
  32. tccli/services/organization/v20210331/api.json +25 -25
  33. tccli/services/organization/v20210331/examples.json +1 -1
  34. tccli/services/sqlserver/v20180328/api.json +11 -9
  35. tccli/services/ssl/v20191205/api.json +1 -1
  36. tccli/services/teo/v20220901/api.json +12 -12
  37. tccli/services/tione/v20211111/api.json +18 -18
  38. tccli/services/tms/v20201229/api.json +6 -6
  39. tccli/services/trtc/trtc_client.py +159 -0
  40. tccli/services/trtc/v20190722/api.json +264 -0
  41. tccli/services/trtc/v20190722/examples.json +24 -0
  42. tccli/services/tse/v20201207/api.json +23 -5
  43. tccli/services/tse/v20201207/examples.json +2 -2
  44. tccli/services/tsf/v20180326/api.json +490 -490
  45. tccli/services/tsf/v20180326/examples.json +21 -21
  46. tccli/services/vod/v20180717/api.json +12 -1
  47. tccli/services/vpc/v20170312/api.json +12 -2
  48. tccli/services/vpc/v20170312/examples.json +2 -2
  49. tccli/services/wsa/v20250508/api.json +21 -3
  50. {tccli-3.0.1370.1.dist-info → tccli-3.0.1372.1.dist-info}/METADATA +2 -2
  51. {tccli-3.0.1370.1.dist-info → tccli-3.0.1372.1.dist-info}/RECORD +54 -54
  52. {tccli-3.0.1370.1.dist-info → tccli-3.0.1372.1.dist-info}/WHEEL +0 -0
  53. {tccli-3.0.1370.1.dist-info → tccli-3.0.1372.1.dist-info}/entry_points.txt +0 -0
  54. {tccli-3.0.1370.1.dist-info → tccli-3.0.1372.1.dist-info}/license_files/LICENSE +0 -0
@@ -1562,7 +1562,7 @@
1562
1562
  {
1563
1563
  "disabled": false,
1564
1564
  "document": "计算资源配置",
1565
- "example": " {\"Cpu\": 1000, \"Memory\": 1024, \"Gpu\": 0, \"InstanceType\": \"TI.S.MEDIUM.POST\"}",
1565
+ "example": "",
1566
1566
  "member": "ResourceConf",
1567
1567
  "name": "ResourceConf",
1568
1568
  "required": true,
@@ -1652,7 +1652,7 @@
1652
1652
  {
1653
1653
  "disabled": false,
1654
1654
  "document": "CFS存储的配置",
1655
- "example": "{\"id\":\"cfs-9su5kqtv\",\"path\":\"/\",\"mappingPath\":\"/data\"}",
1655
+ "example": "",
1656
1656
  "member": "CFSConfig",
1657
1657
  "name": "VolumeSourceCFS",
1658
1658
  "required": false,
@@ -1661,7 +1661,7 @@
1661
1661
  {
1662
1662
  "disabled": false,
1663
1663
  "document": "日志配置",
1664
- "example": "{\"LogsetId\": \"4dd0a097-f629-4afc-9b99-888ef99a178f\", \"TopicId\": \"ea8048db-8f97-4abb-9668-f3532b9b61f8\"}",
1664
+ "example": "",
1665
1665
  "member": "LogConfig",
1666
1666
  "name": "LogConfig",
1667
1667
  "required": false,
@@ -1706,7 +1706,7 @@
1706
1706
  {
1707
1707
  "disabled": false,
1708
1708
  "document": "标签配置",
1709
- "example": "[{\"TagKey\": \"test_key\", \"TagValue\": \"good_value\"}]",
1709
+ "example": "",
1710
1710
  "member": "Tag",
1711
1711
  "name": "Tags",
1712
1712
  "required": false,
@@ -1715,7 +1715,7 @@
1715
1715
  {
1716
1716
  "disabled": false,
1717
1717
  "document": "数据配置,只支持WEDATA_HDFS存储类型",
1718
- "example": "[ {\"DataSourceType\": \"CLOUD_PREMIUM\", \"CBSSource\": {\"VolumeSizeInGB\": 50}, \"MappingPath\": \"/home/tione/notebook\"}]",
1718
+ "example": "",
1719
1719
  "member": "DataConfig",
1720
1720
  "name": "DataConfigs",
1721
1721
  "required": false,
@@ -1724,7 +1724,7 @@
1724
1724
  {
1725
1725
  "disabled": false,
1726
1726
  "document": "镜像信息",
1727
- "example": "{\"ImageType\":\"SYSTEM\",\"ImageId\":\"35551e3c-b0e3\",\"ImageUrl\":\"tione.tencentcloudcr.com/qcloud/llm-train:1.8.0\",\"RegistryRegion\":\"\",\"RegistryId\":\"\",\"ImageName\":\"tilearn-llm0.9\"}",
1727
+ "example": "",
1728
1728
  "member": "ImageInfo",
1729
1729
  "name": "ImageInfo",
1730
1730
  "required": false,
@@ -1742,7 +1742,7 @@
1742
1742
  {
1743
1743
  "disabled": false,
1744
1744
  "document": "SSH配置信息",
1745
- "example": " {\"Enable\": false, \"PublicKey\": \"public-key\"}",
1745
+ "example": "",
1746
1746
  "member": "SSHConfig",
1747
1747
  "name": "SSHConfig",
1748
1748
  "required": false,
@@ -1751,7 +1751,7 @@
1751
1751
  {
1752
1752
  "disabled": false,
1753
1753
  "document": "GooseFS存储配置",
1754
- "example": "{\"id\":\"x-c60-v747xo7z\",\"gfsType\":\"GooseFSx\",\"path\":\"/\"}",
1754
+ "example": "",
1755
1755
  "member": "GooseFS",
1756
1756
  "name": "VolumeSourceGooseFS",
1757
1757
  "required": false,
@@ -3630,7 +3630,7 @@
3630
3630
  {
3631
3631
  "disabled": false,
3632
3632
  "document": "过滤条件\n注意: \n1. Filter.Name 只支持以下枚举值:\n InstanceId (资源组节点id)\n InstanceStatus (资源组节点状态)\n2. Filter.Values: 长度为1且Filter.Fuzzy=true时,支持模糊查询; 不为1时,精确查询\n3. 每次请求的Filters的上限为10,Filter.Values的上限为100",
3633
- "example": "[{Name: \"InstanceStatus\", Values: [\"RUNNING\"]}]",
3633
+ "example": "",
3634
3634
  "member": "Filter",
3635
3635
  "name": "Filters",
3636
3636
  "required": false,
@@ -8072,7 +8072,7 @@
8072
8072
  {
8073
8073
  "disabled": false,
8074
8074
  "document": "标签配置\n注意:此字段可能返回 null,表示取不到有效值。",
8075
- "example": "[{\"TagKey\": \"test_key\", \"TagValue\": \"good_value\"}]",
8075
+ "example": "",
8076
8076
  "member": "Tag",
8077
8077
  "name": "Tags",
8078
8078
  "output_required": true,
@@ -8112,7 +8112,7 @@
8112
8112
  {
8113
8113
  "disabled": false,
8114
8114
  "document": "资源配置",
8115
- "example": " {\"Cpu\": 1000, \"Memory\": 1024, \"Gpu\": 0, \"InstanceType\": \"TI.S.MEDIUM.POST\"}",
8115
+ "example": "",
8116
8116
  "member": "ResourceConf",
8117
8117
  "name": "ResourceConf",
8118
8118
  "output_required": true,
@@ -8152,7 +8152,7 @@
8152
8152
  {
8153
8153
  "disabled": false,
8154
8154
  "document": "日志配置\n注意:此字段可能返回 null,表示取不到有效值。",
8155
- "example": "{ \"TopicId\": \"ea8048db-8f97-4abb-9668-f3532b9b61f8\", \"LogsetId\": \"4dd0a097-f629-4afc-9b99-888ef99a178f\"}",
8155
+ "example": "",
8156
8156
  "member": "LogConfig",
8157
8157
  "name": "LogConfig",
8158
8158
  "output_required": true,
@@ -8312,7 +8312,7 @@
8312
8312
  {
8313
8313
  "disabled": false,
8314
8314
  "document": "CFS存储的配置\n注意:此字段可能返回 null,表示取不到有效值。",
8315
- "example": "{\"Id\":\"cfs-abcdefg\",\"Path\":\"/\"}",
8315
+ "example": "",
8316
8316
  "member": "CFSConfig",
8317
8317
  "name": "VolumeSourceCFS",
8318
8318
  "output_required": true,
@@ -8322,7 +8322,7 @@
8322
8322
  {
8323
8323
  "disabled": false,
8324
8324
  "document": "数据配置\n注意:此字段可能返回 null,表示取不到有效值。",
8325
- "example": "[{\"MappingPath\":\"/home/tione/notebook\",\"DataSourceType\":\"CFS\",\"WeDataHDFSSource\":{\"Id\":0,\"Path\":\"\"},\"CFSSource\":{\"Id\":\"cfs-14cpoxo5\",\"Path\":\"/\"}}]",
8325
+ "example": "",
8326
8326
  "member": "DataConfig",
8327
8327
  "name": "DataConfigs",
8328
8328
  "output_required": true,
@@ -8352,7 +8352,7 @@
8352
8352
  {
8353
8353
  "disabled": false,
8354
8354
  "document": "镜像信息",
8355
- "example": "{\"ImageType\":\"SYSTEM\",\"ImageUrl\":\"tione.tencentcloudcr.com/qcloud-ti-platform/llm-train:24.03-gpu-py310-cu124-tilearn-llm-v1.8.0\",\"ImageName\":\"tilearn-\",\"ImageId\":\"35551e3c-b0e310a5613cd3\"}",
8355
+ "example": "",
8356
8356
  "member": "ImageInfo",
8357
8357
  "name": "ImageInfo",
8358
8358
  "output_required": true,
@@ -8372,7 +8372,7 @@
8372
8372
  {
8373
8373
  "disabled": false,
8374
8374
  "document": "SSH配置\n注意:此字段可能返回 null,表示取不到有效值。",
8375
- "example": "{\"Enable\":false,\"PublicKey\":\"\",\"Port\":0,\"LoginCommand\":\"\"}",
8375
+ "example": "",
8376
8376
  "member": "SSHConfig",
8377
8377
  "name": "SSHConfig",
8378
8378
  "output_required": false,
@@ -8382,7 +8382,7 @@
8382
8382
  {
8383
8383
  "disabled": false,
8384
8384
  "document": "GooseFS存储配置\n注意:此字段可能返回 null,表示取不到有效值。",
8385
- "example": "{\"Id\":\"gs-1234\",\"Type\":\"GooseFSx\",\"Path\":\"/\", \"NameSpace\": \"test\"}",
8385
+ "example": "",
8386
8386
  "member": "GooseFS",
8387
8387
  "name": "VolumeSourceGooseFS",
8388
8388
  "output_required": false,
@@ -8432,7 +8432,7 @@
8432
8432
  {
8433
8433
  "disabled": false,
8434
8434
  "document": "Appid\n注意:此字段可能返回 null,表示取不到有效值。",
8435
- "example": "1256704107",
8435
+ "example": "1357704107",
8436
8436
  "member": "string",
8437
8437
  "name": "AppId",
8438
8438
  "output_required": false,
@@ -3,7 +3,7 @@
3
3
  "TextModeration": {
4
4
  "document": "本接口(Text Moderation)用于提交文本内容进行智能审核任务。使用前请您使用腾讯云主账号登录控制台 [开通文本内容安全服务](https://console.cloud.tencent.com/cms) 并调整好对应的业务配置。\n\n### 接口使用说明\n- 前往“[内容安全控制台-文本内容安全](https://console.cloud.tencent.com/cms)”开启使用文本内容安全服务,首次开通服务的用户可免费领用试用套餐包,包含**3000条**文本识别额度,有效期为15天。\n- 该接口为收费接口,计费方式敬请参见 [腾讯云文本内容安全定价](https://cloud.tencent.com/product/tms/pricing)。\n\n### 接口功能说明:\n- 支持对文本文件进行检测,通过深度学习技术,识别可能令人反感、不安全或不适宜的违规文本内容;\n- 支持识别多种违规场景,包括:低俗、谩骂、色情、广告等场景;\n- 支持根据不同的业务场景配置自定义的审核策略,可在控制台文本内容安全-策略管理中配置;\n- 支持用户自定义配置词库黑白名单,打击自定义识别类型的违规文本(目前仅支持黑名单配置);\n- 支持在审核文本内容时同时关联账号或设备信息,可识别违规风险账号或设备。\n\n### 接口调用说明:\n- 文本内容大小支持:文本原文长度不能超过unicode编码长度10000个字符;\n- 文本审核语言支持:目前支持中文、英文、阿拉伯数字的检测;\n- 默认接口请求频率限制:**1000次/秒**,超过该频率限制则接口会报错。",
5
5
  "input": "TextModerationRequest",
6
- "name": "文本内容安全",
6
+ "name": "文本内容安全服务",
7
7
  "output": "TextModerationResponse",
8
8
  "status": "online"
9
9
  }
@@ -421,7 +421,7 @@
421
421
  {
422
422
  "disabled": false,
423
423
  "document": "该字段表示使用的策略的具体编号,该字段需要先在[内容安全控制台](https://console.cloud.tencent.com/cms/clouds/manage)中配置,控制台访问地址:。\n备注:不同Biztype关联不同的业务场景与识别能力策略,调用前请确认正确的Biztype。",
424
- "example": "TencentCloudDefault",
424
+ "example": "TencentCloud",
425
425
  "member": "string",
426
426
  "name": "BizType",
427
427
  "required": false,
@@ -430,7 +430,7 @@
430
430
  {
431
431
  "disabled": false,
432
432
  "document": "该字段表示您为待检测对象分配的数据ID,传入后可方便您对文件进行标识和管理。<br>取值:由英文字母(大小写均可)、数字及四个特殊符号(_,-,@,#)组成,**长度不超过64个字符**",
433
- "example": "a61237dd-c2a0-43e7-a3da-d27022d39ba7",
433
+ "example": "a6127dd-c2a0-43e7-a3da-d27022d39ba7",
434
434
  "member": "string",
435
435
  "name": "DataId",
436
436
  "required": false,
@@ -481,7 +481,7 @@
481
481
  {
482
482
  "disabled": false,
483
483
  "document": "该字段用于返回请求参数中的BizType参数",
484
- "example": "TencentCloudDefault",
484
+ "example": "TencentCloud",
485
485
  "member": "string",
486
486
  "name": "BizType",
487
487
  "output_required": true,
@@ -511,7 +511,7 @@
511
511
  {
512
512
  "disabled": false,
513
513
  "document": "该字段用于返回当前标签(Label)下被检测文本命中的关键词信息,用于标注文本违规的具体原因(如:*加我微信*)。该参数可能会有多个返回值,代表命中的多个关键词;如返回值为空且Score不为空,则代表识别结果所对应的恶意标签(Label)是来自于语义模型判断的返回值\n注意:此字段可能返回 null,表示取不到有效值。",
514
- "example": "加好友",
514
+ "example": "[\"加好友\"]",
515
515
  "member": "string",
516
516
  "name": "Keywords",
517
517
  "output_required": true,
@@ -561,7 +561,7 @@
561
561
  {
562
562
  "disabled": false,
563
563
  "document": "该字段用于返回检测对象对应请求参数中的DataId,与输入的DataId字段中的内容对应",
564
- "example": "a61237dd-c2a0-43e7-a3da-d27022d39ba7",
564
+ "example": "a6127dd-c2a0-43e7-a3da-d27022d39ba7",
565
565
  "member": "string",
566
566
  "name": "DataId",
567
567
  "output_required": true,
@@ -849,6 +849,58 @@ def doDescribeRecordingUsage(args, parsed_globals):
849
849
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
850
850
 
851
851
 
852
+ def doTextToSpeech(args, parsed_globals):
853
+ g_param = parse_global_arg(parsed_globals)
854
+
855
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
856
+ cred = credential.CVMRoleCredential()
857
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
858
+ cred = credential.STSAssumeRoleCredential(
859
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
860
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
861
+ )
862
+ 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):
863
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
864
+ else:
865
+ cred = credential.Credential(
866
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
867
+ )
868
+ http_profile = HttpProfile(
869
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
870
+ reqMethod="POST",
871
+ endpoint=g_param[OptionsDefine.Endpoint],
872
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
873
+ )
874
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
875
+ if g_param[OptionsDefine.Language]:
876
+ profile.language = g_param[OptionsDefine.Language]
877
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
878
+ client = mod.TrtcClient(cred, g_param[OptionsDefine.Region], profile)
879
+ client._sdkVersion += ("_CLI_" + __version__)
880
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
881
+ model = models.TextToSpeechRequest()
882
+ model.from_json_string(json.dumps(args))
883
+ start_time = time.time()
884
+ while True:
885
+ rsp = client.TextToSpeech(model)
886
+ result = rsp.to_json_string()
887
+ try:
888
+ json_obj = json.loads(result)
889
+ except TypeError as e:
890
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
891
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
892
+ break
893
+ cur_time = time.time()
894
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
895
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
896
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
897
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
898
+ else:
899
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
900
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
901
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
902
+
903
+
852
904
  def doStartStreamIngest(args, parsed_globals):
853
905
  g_param = parse_global_arg(parsed_globals)
854
906
 
@@ -2357,6 +2409,58 @@ def doDescribeUnusualEvent(args, parsed_globals):
2357
2409
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2358
2410
 
2359
2411
 
2412
+ def doVoiceClone(args, parsed_globals):
2413
+ g_param = parse_global_arg(parsed_globals)
2414
+
2415
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2416
+ cred = credential.CVMRoleCredential()
2417
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2418
+ cred = credential.STSAssumeRoleCredential(
2419
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2420
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2421
+ )
2422
+ 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):
2423
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2424
+ else:
2425
+ cred = credential.Credential(
2426
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2427
+ )
2428
+ http_profile = HttpProfile(
2429
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2430
+ reqMethod="POST",
2431
+ endpoint=g_param[OptionsDefine.Endpoint],
2432
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2433
+ )
2434
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2435
+ if g_param[OptionsDefine.Language]:
2436
+ profile.language = g_param[OptionsDefine.Language]
2437
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2438
+ client = mod.TrtcClient(cred, g_param[OptionsDefine.Region], profile)
2439
+ client._sdkVersion += ("_CLI_" + __version__)
2440
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2441
+ model = models.VoiceCloneRequest()
2442
+ model.from_json_string(json.dumps(args))
2443
+ start_time = time.time()
2444
+ while True:
2445
+ rsp = client.VoiceClone(model)
2446
+ result = rsp.to_json_string()
2447
+ try:
2448
+ json_obj = json.loads(result)
2449
+ except TypeError as e:
2450
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2451
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2452
+ break
2453
+ cur_time = time.time()
2454
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2455
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2456
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2457
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2458
+ else:
2459
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2460
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2461
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2462
+
2463
+
2360
2464
  def doStartMCUMixTranscodeByStrRoomId(args, parsed_globals):
2361
2465
  g_param = parse_global_arg(parsed_globals)
2362
2466
 
@@ -3553,6 +3657,58 @@ def doDescribeTRTCRealTimeScaleMetricData(args, parsed_globals):
3553
3657
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3554
3658
 
3555
3659
 
3660
+ def doTextToSpeechSSE(args, parsed_globals):
3661
+ g_param = parse_global_arg(parsed_globals)
3662
+
3663
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3664
+ cred = credential.CVMRoleCredential()
3665
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3666
+ cred = credential.STSAssumeRoleCredential(
3667
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3668
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3669
+ )
3670
+ 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):
3671
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3672
+ else:
3673
+ cred = credential.Credential(
3674
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3675
+ )
3676
+ http_profile = HttpProfile(
3677
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3678
+ reqMethod="POST",
3679
+ endpoint=g_param[OptionsDefine.Endpoint],
3680
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3681
+ )
3682
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3683
+ if g_param[OptionsDefine.Language]:
3684
+ profile.language = g_param[OptionsDefine.Language]
3685
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3686
+ client = mod.TrtcClient(cred, g_param[OptionsDefine.Region], profile)
3687
+ client._sdkVersion += ("_CLI_" + __version__)
3688
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
3689
+ model = models.TextToSpeechSSERequest()
3690
+ model.from_json_string(json.dumps(args))
3691
+ start_time = time.time()
3692
+ while True:
3693
+ rsp = client.TextToSpeechSSE(model)
3694
+ result = rsp.to_json_string()
3695
+ try:
3696
+ json_obj = json.loads(result)
3697
+ except TypeError as e:
3698
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
3699
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3700
+ break
3701
+ cur_time = time.time()
3702
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3703
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3704
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3705
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3706
+ else:
3707
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3708
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3709
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3710
+
3711
+
3556
3712
  def doStopMCUMixTranscode(args, parsed_globals):
3557
3713
  g_param = parse_global_arg(parsed_globals)
3558
3714
 
@@ -3632,6 +3788,7 @@ ACTION_MAP = {
3632
3788
  "DescribeTRTCRealTimeScaleData": doDescribeTRTCRealTimeScaleData,
3633
3789
  "DescribeAIConversation": doDescribeAIConversation,
3634
3790
  "DescribeRecordingUsage": doDescribeRecordingUsage,
3791
+ "TextToSpeech": doTextToSpeech,
3635
3792
  "StartStreamIngest": doStartStreamIngest,
3636
3793
  "DescribeCloudModeration": doDescribeCloudModeration,
3637
3794
  "UpdateStreamIngest": doUpdateStreamIngest,
@@ -3661,6 +3818,7 @@ ACTION_MAP = {
3661
3818
  "StopMCUMixTranscodeByStrRoomId": doStopMCUMixTranscodeByStrRoomId,
3662
3819
  "StopStreamIngest": doStopStreamIngest,
3663
3820
  "DescribeUnusualEvent": doDescribeUnusualEvent,
3821
+ "VoiceClone": doVoiceClone,
3664
3822
  "StartMCUMixTranscodeByStrRoomId": doStartMCUMixTranscodeByStrRoomId,
3665
3823
  "RemoveUserByStrRoomId": doRemoveUserByStrRoomId,
3666
3824
  "DescribeMixTranscodingUsage": doDescribeMixTranscodingUsage,
@@ -3684,6 +3842,7 @@ ACTION_MAP = {
3684
3842
  "DeleteCloudSliceTask": doDeleteCloudSliceTask,
3685
3843
  "ModifyCloudModeration": doModifyCloudModeration,
3686
3844
  "DescribeTRTCRealTimeScaleMetricData": doDescribeTRTCRealTimeScaleMetricData,
3845
+ "TextToSpeechSSE": doTextToSpeechSSE,
3687
3846
  "StopMCUMixTranscode": doStopMCUMixTranscode,
3688
3847
 
3689
3848
  }