tccli 3.0.1137.1__py2.py3-none-any.whl → 3.0.1139.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 (53) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/command.py +1 -1
  3. tccli/help_command.py +1 -1
  4. tccli/services/__init__.py +3 -0
  5. tccli/services/aiart/aiart_client.py +53 -0
  6. tccli/services/aiart/v20221229/api.json +98 -0
  7. tccli/services/aiart/v20221229/examples.json +8 -0
  8. tccli/services/asr/v20190614/api.json +9 -0
  9. tccli/services/cbs/v20170312/api.json +5 -8
  10. tccli/services/cdwch/v20200915/api.json +1 -1
  11. tccli/services/ckafka/v20190819/api.json +25 -25
  12. tccli/services/ckafka/v20190819/examples.json +18 -18
  13. tccli/services/cls/v20201016/api.json +44 -5
  14. tccli/services/cls/v20201016/examples.json +1 -1
  15. tccli/services/cwp/cwp_client.py +61 -114
  16. tccli/services/cwp/v20180228/api.json +0 -70
  17. tccli/services/cwp/v20180228/examples.json +0 -8
  18. tccli/services/domain/v20180808/api.json +36 -0
  19. tccli/services/emr/v20190103/api.json +534 -15
  20. tccli/services/emr/v20190103/examples.json +4 -4
  21. tccli/services/ess/v20201111/api.json +4 -4
  22. tccli/services/ess/v20201111/examples.json +2 -2
  23. tccli/services/essbasic/v20210526/api.json +3 -3
  24. tccli/services/essbasic/v20210526/examples.json +2 -2
  25. tccli/services/ims/v20201229/api.json +2 -2
  26. tccli/services/ioa/v20220601/api.json +132 -92
  27. tccli/services/iotexplorer/v20190423/api.json +11 -0
  28. tccli/services/mps/v20190612/api.json +163 -115
  29. tccli/services/mps/v20190612/examples.json +11 -11
  30. tccli/services/ocr/v20181119/api.json +19 -0
  31. tccli/services/redis/v20180412/api.json +23 -23
  32. tccli/services/rum/v20210622/api.json +1 -0
  33. tccli/services/scf/v20180416/examples.json +1 -1
  34. tccli/services/ssl/ssl_client.py +53 -0
  35. tccli/services/ssl/v20191205/api.json +251 -5
  36. tccli/services/ssl/v20191205/examples.json +9 -1
  37. tccli/services/tdmq/v20200217/api.json +171 -22
  38. tccli/services/tdmq/v20200217/examples.json +6 -6
  39. tccli/services/thpc/v20230321/api.json +42 -21
  40. tccli/services/tke/v20180525/api.json +149 -71
  41. tccli/services/tke/v20180525/examples.json +69 -57
  42. tccli/services/trtc/v20190722/api.json +1 -1
  43. tccli/services/tsf/v20180326/api.json +1 -1
  44. tccli/services/vclm/__init__.py +4 -0
  45. tccli/services/vclm/v20240523/api.json +695 -0
  46. tccli/services/vclm/v20240523/examples.json +73 -0
  47. tccli/services/vclm/vclm_client.py +513 -0
  48. tccli/services/vdb/v20230616/api.json +20 -0
  49. {tccli-3.0.1137.1.dist-info → tccli-3.0.1139.1.dist-info}/METADATA +2 -2
  50. {tccli-3.0.1137.1.dist-info → tccli-3.0.1139.1.dist-info}/RECORD +53 -49
  51. {tccli-3.0.1137.1.dist-info → tccli-3.0.1139.1.dist-info}/WHEEL +0 -0
  52. {tccli-3.0.1137.1.dist-info → tccli-3.0.1139.1.dist-info}/entry_points.txt +0 -0
  53. {tccli-3.0.1137.1.dist-info → tccli-3.0.1139.1.dist-info}/license_files/LICENSE +0 -0
@@ -0,0 +1,73 @@
1
+ {
2
+ "actions": {
3
+ "ConfirmVideoTranslateJob": [
4
+ {
5
+ "document": "确认视频翻译结果正例",
6
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ConfirmVideoTranslateJob\n<公共请求参数>\n\n{\n \"JobId\": \"bEOhlL4G87lFvVmN6PnG3LAH1Kdu5tgs\",\n \"TranslateResults\": [\n {\n \"SourceText\": \"当工作或学习结果不理想,\",\n \"TargetText\": \"When the result of work or study is not ideal\"\n },\n {\n \"SourceText\": \"甚至面临被全盘否定的情况时,\",\n \"TargetText\": \"Even when faced with the situation of being completely denied\"\n },\n {\n \"SourceText\": \"你会如何应对?\",\n \"TargetText\": \"How would you deal with it?\"\n },\n {\n \"SourceText\": \"可以举例说明当时你是如何处理负面情绪,\",\n \"TargetText\": \"You can give an example of how you dealt with negative emotions at that time.\"\n },\n {\n \"SourceText\": \"并找到解决办法的。\",\n \"TargetText\": \"And find a solution.\"\n }\n ]\n}",
7
+ "output": "{\n \"Response\": {\n \"JobId\": \"bEOhlL4G87lFvVmN6PnG3LAH1Kdu5tgs\",\n \"RequestId\": \"8357c7a1-d348-4306-b744-ce6625c39fa4\",\n \"SessionId\": \"0bfda02b562d4432be1176904bbcbe68\",\n \"TaskId\": \"ecaa9680e41441399b4f29759174383f\"\n }\n}",
8
+ "title": "确认视频翻译结果"
9
+ }
10
+ ],
11
+ "DescribeImageAnimateJob": [
12
+ {
13
+ "document": "调用成功示例",
14
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeImageAnimateJob\n<公共请求参数>\n\n{\n \"JobId\": \"1194931538865782784\"\n}",
15
+ "output": "{\n \"Response\": {\n \"ErrorCode\": \"\",\n \"ErrorMessage\": \"\",\n \"RequestId\": \"a06a2134-0306-4554-aa9a-232271bfda4f\",\n \"ResultVideoUrl\": \"\",\n \"Status\": \"RUN\"\n }\n}",
16
+ "title": "调用成功示例"
17
+ }
18
+ ],
19
+ "DescribeVideoStylizationJob": [
20
+ {
21
+ "document": "成功调用",
22
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeVideoStylizationJob\n<公共请求参数>\n\n{\n \"JobId\": \"c5daf8f7077d41a69c13aab31a7164f3\"\n}",
23
+ "output": "{\n \"Response\": {\n \"JobId\": \"c5daf8f7077d41a69c13aab31a7164f3\",\n \"RequestId\": \"75530f83-a534-47c6-9506-21e1f06d6c5c\",\n \"ResultVideoUrl\": \"\",\n \"StatusCode\": \"JobRunning\",\n \"StatusMsg\": \"处理中\"\n }\n}",
24
+ "title": "成功调用"
25
+ }
26
+ ],
27
+ "DescribeVideoTranslateJob": [
28
+ {
29
+ "document": "调用失败示例",
30
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeVideoTranslateJob\n<公共请求参数>\n\n{\n \"JobId\": \"111\"\n}",
31
+ "output": "{\n \"Response\": {\n \"Error\": {\n \"Code\": \"FailedOperation.JobNotExist\",\n \"Message\": \"任务不存在。\"\n },\n \"RequestId\": \"78254ad1-c184-4e9e-b5a0-9d3fc435576b\"\n }\n}",
32
+ "title": "调用失败示例"
33
+ },
34
+ {
35
+ "document": "调用成功示例",
36
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeVideoTranslateJob\n<公共请求参数>\n\n{\n \"JobId\": \"vlSYvQkMM0KwPuoakawm0tPrREwc2p7c\"\n}",
37
+ "output": "{\n \"Response\": {\n \"JobErrorCode\": \"\",\n \"JobErrorMsg\": \"\",\n \"JobStatus\": 7,\n \"RequestId\": \"a974b772-3c1d-4868-8909-b1386016b9f0\",\n \"ResultVideoUrl\": \"http://xxx.com/url/xxx.mp4\",\n \"TranslateResults\": [\n {\n \"SourceText\": \"当工作或学习结果不理想,\",\n \"TargetText\": \"When the result of work or study is not ideal\"\n },\n {\n \"SourceText\": \"甚至面临被全盘否定的情况时,\",\n \"TargetText\": \"Even when faced with the situation of being completely denied\"\n },\n {\n \"SourceText\": \"你会如何应对?\",\n \"TargetText\": \"How would you respond?\"\n },\n {\n \"SourceText\": \"可以举例说明当时你是如何处理负面情绪,\",\n \"TargetText\": \"You can give an example of how you dealt with negative emotions at that time.\"\n },\n {\n \"SourceText\": \"并找到解决办法的。\",\n \"TargetText\": \"And find a solution.\"\n }\n ]\n }\n}",
38
+ "title": "调用成功示例"
39
+ }
40
+ ],
41
+ "SubmitImageAnimateJob": [
42
+ {
43
+ "document": "调用成功示例",
44
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: SubmitImageAnimateJob\n<公共请求参数>\n\n{\n \"ImageUrl\": \"https://xxx/image-animate/user_input/1.png\",\n \"TemplateId\": \"ke3\",\n \"EnableAudio\": true\n}",
45
+ "output": "{\n \"Response\": {\n \"JobId\": \"1194931538865782784\",\n \"RequestId\": \"4e6722ba-367b-454e-add0-681a5c50fe20\"\n }\n}",
46
+ "title": "调用成功示例"
47
+ }
48
+ ],
49
+ "SubmitVideoStylizationJob": [
50
+ {
51
+ "document": "成功调用",
52
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: SubmitVideoStylizationJob\n<公共请求参数>\n\n{\n \"StyleId\": \"2d_anime\",\n \"VideoUrl\": \"http://xxxx.mp4\"\n}",
53
+ "output": "{\n \"Response\": {\n \"JobId\": \"c5daf8f7077d41a69c13aab31a7164f3\",\n \"RequestId\": \"b1990ba2-2d71-419d-8c9d-cab8e33f8352\"\n }\n}",
54
+ "title": "成功调用"
55
+ }
56
+ ],
57
+ "SubmitVideoTranslateJob": [
58
+ {
59
+ "document": "调用失败示例",
60
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: SubmitVideoTranslateJob\n<公共请求参数>\n\n\n\n{\n \"VideoUrl\": \"https://xxx.com/url/xxx.mp4\",\n \"SrcLang\": \"zh\",\n \"DstLang\": \"zh\",\n \"Confirm\": 0,\n \"LipSync\": 0\n}",
61
+ "output": "{\n \"Response\": {\n \"Error\": {\n \"Code\": \"InvalidParameterValue.ParameterValueError\",\n \"Message\": \"参数字段或者值有误。\"\n },\n \"RequestId\": \"3787745f-b446-4b39-9471-9032a4c306ee\"\n }\n}",
62
+ "title": "调用失败示例"
63
+ },
64
+ {
65
+ "document": "提交视频翻译任务",
66
+ "input": "POST / HTTP/1.1\nHost: vclm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: SubmitVideoTranslateJob\n<公共请求参数>\n\n\n\n{\n \"VideoUrl\": \"https://xxx.com/url/xxx.mp4\",\n \"SrcLang\": \"zh\",\n \"DstLang\": \"en\",\n \"Confirm\": 0,\n \"LipSync\": 0\n}",
67
+ "output": "{\n \"Response\": {\n \"JobId\": \"GLo7lni4PubX9xUwzesuKUOLJokVZ0ll\",\n \"RequestId\": \"950a5a45-7bf5-4db3-aef1-dfedda487575\"\n }\n}",
68
+ "title": "调用成功示例"
69
+ }
70
+ ]
71
+ },
72
+ "version": "1.0"
73
+ }
@@ -0,0 +1,513 @@
1
+ # -*- coding: utf-8 -*-
2
+ import os
3
+ import sys
4
+ import six
5
+ import json
6
+ import tccli.options_define as OptionsDefine
7
+ import tccli.format_output as FormatOutput
8
+ from tccli import __version__
9
+ from tccli.utils import Utils
10
+ from tccli.exceptions import ConfigurationError, ClientError, ParamError
11
+ from tencentcloud.common import credential
12
+ from tencentcloud.common.profile.http_profile import HttpProfile
13
+ from tencentcloud.common.profile.client_profile import ClientProfile
14
+ from tencentcloud.vclm.v20240523 import vclm_client as vclm_client_v20240523
15
+ from tencentcloud.vclm.v20240523 import models as models_v20240523
16
+
17
+ from jmespath import search
18
+ import time
19
+
20
+ def doSubmitVideoTranslateJob(args, parsed_globals):
21
+ g_param = parse_global_arg(parsed_globals)
22
+
23
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
24
+ cred = credential.CVMRoleCredential()
25
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
26
+ cred = credential.STSAssumeRoleCredential(
27
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
28
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
29
+ )
30
+ 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):
31
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
32
+ else:
33
+ cred = credential.Credential(
34
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
35
+ )
36
+ http_profile = HttpProfile(
37
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
38
+ reqMethod="POST",
39
+ endpoint=g_param[OptionsDefine.Endpoint],
40
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
41
+ )
42
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
43
+ if g_param[OptionsDefine.Language]:
44
+ profile.language = g_param[OptionsDefine.Language]
45
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
46
+ client = mod.VclmClient(cred, g_param[OptionsDefine.Region], profile)
47
+ client._sdkVersion += ("_CLI_" + __version__)
48
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
49
+ model = models.SubmitVideoTranslateJobRequest()
50
+ model.from_json_string(json.dumps(args))
51
+ start_time = time.time()
52
+ while True:
53
+ rsp = client.SubmitVideoTranslateJob(model)
54
+ result = rsp.to_json_string()
55
+ try:
56
+ json_obj = json.loads(result)
57
+ except TypeError as e:
58
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
59
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
60
+ break
61
+ cur_time = time.time()
62
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
63
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
64
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
65
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
66
+ else:
67
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
68
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
69
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
70
+
71
+
72
+ def doDescribeVideoTranslateJob(args, parsed_globals):
73
+ g_param = parse_global_arg(parsed_globals)
74
+
75
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
76
+ cred = credential.CVMRoleCredential()
77
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
78
+ cred = credential.STSAssumeRoleCredential(
79
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
80
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
81
+ )
82
+ 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):
83
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
84
+ else:
85
+ cred = credential.Credential(
86
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
87
+ )
88
+ http_profile = HttpProfile(
89
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
90
+ reqMethod="POST",
91
+ endpoint=g_param[OptionsDefine.Endpoint],
92
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
93
+ )
94
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
95
+ if g_param[OptionsDefine.Language]:
96
+ profile.language = g_param[OptionsDefine.Language]
97
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
98
+ client = mod.VclmClient(cred, g_param[OptionsDefine.Region], profile)
99
+ client._sdkVersion += ("_CLI_" + __version__)
100
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
101
+ model = models.DescribeVideoTranslateJobRequest()
102
+ model.from_json_string(json.dumps(args))
103
+ start_time = time.time()
104
+ while True:
105
+ rsp = client.DescribeVideoTranslateJob(model)
106
+ result = rsp.to_json_string()
107
+ try:
108
+ json_obj = json.loads(result)
109
+ except TypeError as e:
110
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
111
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
112
+ break
113
+ cur_time = time.time()
114
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
115
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
116
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
117
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
118
+ else:
119
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
120
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
121
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
122
+
123
+
124
+ def doSubmitVideoStylizationJob(args, parsed_globals):
125
+ g_param = parse_global_arg(parsed_globals)
126
+
127
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
128
+ cred = credential.CVMRoleCredential()
129
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
130
+ cred = credential.STSAssumeRoleCredential(
131
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
132
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
133
+ )
134
+ 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):
135
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
136
+ else:
137
+ cred = credential.Credential(
138
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
139
+ )
140
+ http_profile = HttpProfile(
141
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
142
+ reqMethod="POST",
143
+ endpoint=g_param[OptionsDefine.Endpoint],
144
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
145
+ )
146
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
147
+ if g_param[OptionsDefine.Language]:
148
+ profile.language = g_param[OptionsDefine.Language]
149
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
150
+ client = mod.VclmClient(cred, g_param[OptionsDefine.Region], profile)
151
+ client._sdkVersion += ("_CLI_" + __version__)
152
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
153
+ model = models.SubmitVideoStylizationJobRequest()
154
+ model.from_json_string(json.dumps(args))
155
+ start_time = time.time()
156
+ while True:
157
+ rsp = client.SubmitVideoStylizationJob(model)
158
+ result = rsp.to_json_string()
159
+ try:
160
+ json_obj = json.loads(result)
161
+ except TypeError as e:
162
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
163
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
164
+ break
165
+ cur_time = time.time()
166
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
167
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
168
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
169
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
170
+ else:
171
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
172
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
173
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
174
+
175
+
176
+ def doConfirmVideoTranslateJob(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.ConfirmVideoTranslateJobRequest()
206
+ model.from_json_string(json.dumps(args))
207
+ start_time = time.time()
208
+ while True:
209
+ rsp = client.ConfirmVideoTranslateJob(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
+
228
+ def doDescribeImageAnimateJob(args, parsed_globals):
229
+ g_param = parse_global_arg(parsed_globals)
230
+
231
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
232
+ cred = credential.CVMRoleCredential()
233
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
234
+ cred = credential.STSAssumeRoleCredential(
235
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
236
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
237
+ )
238
+ 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):
239
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
240
+ else:
241
+ cred = credential.Credential(
242
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
243
+ )
244
+ http_profile = HttpProfile(
245
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
246
+ reqMethod="POST",
247
+ endpoint=g_param[OptionsDefine.Endpoint],
248
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
249
+ )
250
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
251
+ if g_param[OptionsDefine.Language]:
252
+ profile.language = g_param[OptionsDefine.Language]
253
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
254
+ client = mod.VclmClient(cred, g_param[OptionsDefine.Region], profile)
255
+ client._sdkVersion += ("_CLI_" + __version__)
256
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
257
+ model = models.DescribeImageAnimateJobRequest()
258
+ model.from_json_string(json.dumps(args))
259
+ start_time = time.time()
260
+ while True:
261
+ rsp = client.DescribeImageAnimateJob(model)
262
+ result = rsp.to_json_string()
263
+ try:
264
+ json_obj = json.loads(result)
265
+ except TypeError as e:
266
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
267
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
268
+ break
269
+ cur_time = time.time()
270
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
271
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
272
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
273
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
274
+ else:
275
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
276
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
277
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
278
+
279
+
280
+ def doSubmitImageAnimateJob(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.SubmitImageAnimateJobRequest()
310
+ model.from_json_string(json.dumps(args))
311
+ start_time = time.time()
312
+ while True:
313
+ rsp = client.SubmitImageAnimateJob(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
+
332
+ def doDescribeVideoStylizationJob(args, parsed_globals):
333
+ g_param = parse_global_arg(parsed_globals)
334
+
335
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
336
+ cred = credential.CVMRoleCredential()
337
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
338
+ cred = credential.STSAssumeRoleCredential(
339
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
340
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
341
+ )
342
+ 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):
343
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
344
+ else:
345
+ cred = credential.Credential(
346
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
347
+ )
348
+ http_profile = HttpProfile(
349
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
350
+ reqMethod="POST",
351
+ endpoint=g_param[OptionsDefine.Endpoint],
352
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
353
+ )
354
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
355
+ if g_param[OptionsDefine.Language]:
356
+ profile.language = g_param[OptionsDefine.Language]
357
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
358
+ client = mod.VclmClient(cred, g_param[OptionsDefine.Region], profile)
359
+ client._sdkVersion += ("_CLI_" + __version__)
360
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
361
+ model = models.DescribeVideoStylizationJobRequest()
362
+ model.from_json_string(json.dumps(args))
363
+ start_time = time.time()
364
+ while True:
365
+ rsp = client.DescribeVideoStylizationJob(model)
366
+ result = rsp.to_json_string()
367
+ try:
368
+ json_obj = json.loads(result)
369
+ except TypeError as e:
370
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
371
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
372
+ break
373
+ cur_time = time.time()
374
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
375
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
376
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
377
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
378
+ else:
379
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
380
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
381
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
382
+
383
+
384
+ CLIENT_MAP = {
385
+ "v20240523": vclm_client_v20240523,
386
+
387
+ }
388
+
389
+ MODELS_MAP = {
390
+ "v20240523": models_v20240523,
391
+
392
+ }
393
+
394
+ ACTION_MAP = {
395
+ "SubmitVideoTranslateJob": doSubmitVideoTranslateJob,
396
+ "DescribeVideoTranslateJob": doDescribeVideoTranslateJob,
397
+ "SubmitVideoStylizationJob": doSubmitVideoStylizationJob,
398
+ "ConfirmVideoTranslateJob": doConfirmVideoTranslateJob,
399
+ "DescribeImageAnimateJob": doDescribeImageAnimateJob,
400
+ "SubmitImageAnimateJob": doSubmitImageAnimateJob,
401
+ "DescribeVideoStylizationJob": doDescribeVideoStylizationJob,
402
+
403
+ }
404
+
405
+ AVAILABLE_VERSION_LIST = [
406
+ "v20240523",
407
+
408
+ ]
409
+
410
+
411
+ def action_caller():
412
+ return ACTION_MAP
413
+
414
+
415
+ def parse_global_arg(parsed_globals):
416
+ g_param = parsed_globals
417
+
418
+ is_exist_profile = True
419
+ if not parsed_globals["profile"]:
420
+ is_exist_profile = False
421
+ g_param["profile"] = os.environ.get("TCCLI_PROFILE", "default")
422
+
423
+ configure_path = os.path.join(os.path.expanduser("~"), ".tccli")
424
+ is_conf_exist, conf_path = Utils.file_existed(configure_path, g_param["profile"] + ".configure")
425
+ is_cred_exist, cred_path = Utils.file_existed(configure_path, g_param["profile"] + ".credential")
426
+
427
+ conf = {}
428
+ cred = {}
429
+
430
+ if is_conf_exist:
431
+ conf = Utils.load_json_msg(conf_path)
432
+ if is_cred_exist:
433
+ cred = Utils.load_json_msg(cred_path)
434
+
435
+ if not (isinstance(conf, dict) and isinstance(cred, dict)):
436
+ raise ConfigurationError(
437
+ "file: %s or %s is not json format"
438
+ % (g_param["profile"] + ".configure", g_param["profile"] + ".credential"))
439
+
440
+ if OptionsDefine.Token not in cred:
441
+ cred[OptionsDefine.Token] = None
442
+
443
+ if not is_exist_profile:
444
+ if os.environ.get(OptionsDefine.ENV_SECRET_ID) and os.environ.get(OptionsDefine.ENV_SECRET_KEY):
445
+ cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
446
+ cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
447
+ cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
448
+
449
+ if os.environ.get(OptionsDefine.ENV_REGION):
450
+ conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
451
+
452
+ if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
453
+ cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
454
+ cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
455
+
456
+ for param in g_param.keys():
457
+ if g_param[param] is None:
458
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.Token]:
459
+ if param in cred:
460
+ g_param[param] = cred[param]
461
+ elif not (g_param[OptionsDefine.UseCVMRole.replace('-', '_')]
462
+ or os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN)):
463
+ raise ConfigurationError("%s is invalid" % param)
464
+ elif param in [OptionsDefine.Region, OptionsDefine.Output, OptionsDefine.Language]:
465
+ if param in conf[OptionsDefine.SysParam]:
466
+ g_param[param] = conf[OptionsDefine.SysParam][param]
467
+ elif param != OptionsDefine.Language:
468
+ raise ConfigurationError("%s is invalid" % param)
469
+ elif param.replace('_', '-') in [OptionsDefine.RoleArn, OptionsDefine.RoleSessionName]:
470
+ if param.replace('_', '-') in cred:
471
+ g_param[param] = cred[param.replace('_', '-')]
472
+
473
+ try:
474
+ if g_param[OptionsDefine.ServiceVersion]:
475
+ g_param[OptionsDefine.Version] = "v" + g_param[OptionsDefine.ServiceVersion].replace('-', '')
476
+ else:
477
+ version = conf["vclm"][OptionsDefine.Version]
478
+ g_param[OptionsDefine.Version] = "v" + version.replace('-', '')
479
+
480
+ if g_param[OptionsDefine.Endpoint] is None:
481
+ g_param[OptionsDefine.Endpoint] = conf["vclm"][OptionsDefine.Endpoint]
482
+ g_param["sts_cred_endpoint"] = conf.get("sts", {}).get("endpoint")
483
+ except Exception as err:
484
+ raise ConfigurationError("config file:%s error, %s" % (conf_path, str(err)))
485
+
486
+ if g_param[OptionsDefine.Version] not in AVAILABLE_VERSION_LIST:
487
+ raise Exception("available versions: %s" % " ".join(AVAILABLE_VERSION_LIST))
488
+
489
+ if g_param[OptionsDefine.Waiter]:
490
+ param = eval(g_param[OptionsDefine.Waiter])
491
+ if 'expr' not in param:
492
+ raise Exception('`expr` in `--waiter` must be defined')
493
+ if 'to' not in param:
494
+ raise Exception('`to` in `--waiter` must be defined')
495
+ if 'timeout' not in param:
496
+ if 'waiter' in conf and 'timeout' in conf['waiter']:
497
+ param['timeout'] = conf['waiter']['timeout']
498
+ else:
499
+ param['timeout'] = 180
500
+ if 'interval' not in param:
501
+ if 'waiter' in conf and 'interval' in conf['waiter']:
502
+ param['interval'] = conf['waiter']['interval']
503
+ else:
504
+ param['interval'] = 5
505
+ param['interval'] = min(param['interval'], param['timeout'])
506
+ g_param['OptionsDefine.WaiterInfo'] = param
507
+
508
+ if six.PY2:
509
+ for key, value in g_param.items():
510
+ if isinstance(value, six.text_type):
511
+ g_param[key] = value.encode('utf-8')
512
+ return g_param
513
+
@@ -422,6 +422,26 @@
422
422
  "output_required": false,
423
423
  "type": "string",
424
424
  "value_allowed_null": true
425
+ },
426
+ {
427
+ "disabled": false,
428
+ "document": "隔离时间\n注意:此字段可能返回 null,表示取不到有效值。",
429
+ "example": "无",
430
+ "member": "string",
431
+ "name": "IsolateAt",
432
+ "output_required": false,
433
+ "type": "string",
434
+ "value_allowed_null": true
435
+ },
436
+ {
437
+ "disabled": false,
438
+ "document": "是否自动续费。0: 不自动续费(可以支持特权不停服);1:自动续费;2:到期不续费.\n注意:此字段可能返回 null,表示取不到有效值。",
439
+ "example": "无",
440
+ "member": "int64",
441
+ "name": "AutoRenew",
442
+ "output_required": false,
443
+ "type": "int",
444
+ "value_allowed_null": true
425
445
  }
426
446
  ],
427
447
  "usage": "out"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tccli
3
- Version: 3.0.1137.1
3
+ Version: 3.0.1139.1
4
4
  Summary: Universal Command Line Environment for Tencent Cloud
5
5
  Project-URL: Bug Tracker, https://github.com/TencentCloud/tencentcloud-cli/issues
6
6
  Project-URL: Homepage, https://github.com/TencentCloud/tencentcloud-cli
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 2.7
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Requires-Dist: jmespath==0.10.0
15
15
  Requires-Dist: six==1.16.0
16
- Requires-Dist: tencentcloud-sdk-python>=3.0.1137
16
+ Requires-Dist: tencentcloud-sdk-python>=3.0.1139
17
17
  Description-Content-Type: text/markdown
18
18
 
19
19
  # 命令行工具简介