tccli 3.0.1288.1__py2.py3-none-any.whl → 3.0.1290.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.
- tccli/__init__.py +1 -1
- tccli/plugins/sso/__init__.py +11 -1
- tccli/plugins/sso/login.py +3 -3
- tccli/services/asr/v20190614/api.json +6 -6
- tccli/services/asr/v20190614/examples.json +4 -4
- tccli/services/bi/v20220105/api.json +43 -0
- tccli/services/billing/v20180709/api.json +326 -266
- tccli/services/billing/v20180709/examples.json +1 -1
- tccli/services/cdb/cdb_client.py +53 -0
- tccli/services/cdb/v20170320/api.json +64 -0
- tccli/services/cdb/v20170320/examples.json +8 -0
- tccli/services/cdwpg/v20201230/api.json +5 -5
- tccli/services/cdwpg/v20201230/examples.json +6 -6
- tccli/services/cdz/v20221123/api.json +4 -4
- tccli/services/cfg/v20210820/api.json +197 -197
- tccli/services/cfg/v20210820/examples.json +1 -1
- tccli/services/clb/v20180317/api.json +21 -16
- tccli/services/cls/v20201016/api.json +230 -198
- tccli/services/cls/v20201016/examples.json +2 -2
- tccli/services/cwp/v20180228/api.json +39 -9
- tccli/services/cynosdb/v20190107/api.json +2 -2
- tccli/services/dbbrain/dbbrain_client.py +383 -12
- tccli/services/dbbrain/v20191016/api.json +24 -21
- tccli/services/dbbrain/v20210527/api.json +851 -68
- tccli/services/dbbrain/v20210527/examples.json +56 -0
- tccli/services/domain/v20180808/api.json +11 -11
- tccli/services/dts/v20180330/api.json +34 -34
- tccli/services/dts/v20180330/examples.json +1 -1
- tccli/services/dts/v20211206/api.json +225 -223
- tccli/services/dts/v20211206/examples.json +2 -2
- tccli/services/ess/v20201111/api.json +30 -3
- tccli/services/essbasic/v20210526/api.json +29 -2
- tccli/services/fmu/v20191213/api.json +2 -2
- tccli/services/goosefs/v20220519/api.json +2 -2
- tccli/services/gwlb/v20240906/api.json +1 -1
- tccli/services/iotcloud/v20210408/api.json +66 -66
- tccli/services/iotcloud/v20210408/examples.json +13 -13
- tccli/services/iotexplorer/iotexplorer_client.py +159 -0
- tccli/services/iotexplorer/v20190423/api.json +561 -0
- tccli/services/iotexplorer/v20190423/examples.json +24 -0
- tccli/services/iotvideo/iotvideo_client.py +106 -0
- tccli/services/iotvideo/v20211125/api.json +105 -0
- tccli/services/iotvideo/v20211125/examples.json +16 -0
- tccli/services/lighthouse/v20200324/api.json +53 -53
- tccli/services/lighthouse/v20200324/examples.json +2 -2
- tccli/services/lke/v20231130/api.json +12 -2
- tccli/services/lkeap/v20240522/api.json +2 -2
- tccli/services/lowcode/v20210108/api.json +2 -2
- tccli/services/monitor/monitor_client.py +53 -0
- tccli/services/monitor/v20180724/api.json +144 -0
- tccli/services/monitor/v20180724/examples.json +8 -0
- tccli/services/mps/mps_client.py +501 -24
- tccli/services/mps/v20190612/api.json +2118 -247
- tccli/services/mps/v20190612/examples.json +72 -0
- tccli/services/mqtt/v20240516/api.json +4 -4
- tccli/services/mqtt/v20240516/examples.json +5 -11
- tccli/services/organization/v20210331/api.json +113 -113
- tccli/services/redis/redis_client.py +53 -0
- tccli/services/redis/v20180412/api.json +34 -0
- tccli/services/redis/v20180412/examples.json +8 -0
- tccli/services/svp/v20240125/api.json +1 -1
- tccli/services/tcb/tcb_client.py +53 -0
- tccli/services/tcb/v20180608/api.json +224 -157
- tccli/services/tcb/v20180608/examples.json +8 -0
- tccli/services/tcbr/v20220217/examples.json +1 -1
- tccli/services/tdmq/v20200217/api.json +379 -285
- tccli/services/tdmq/v20200217/examples.json +1 -1
- tccli/services/teo/v20220901/api.json +541 -5
- tccli/services/teo/v20220901/examples.json +21 -3
- tccli/services/tione/v20211111/api.json +64 -6
- tccli/services/vdb/v20230616/api.json +31 -2
- tccli/services/vdb/v20230616/examples.json +8 -2
- tccli/services/vrs/v20200824/api.json +14 -2
- tccli/services/vrs/v20200824/examples.json +1 -1
- tccli/services/wedata/v20210820/api.json +102 -0
- tccli/services/weilingwith/v20230427/api.json +997 -997
- {tccli-3.0.1288.1.dist-info → tccli-3.0.1290.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1288.1.dist-info → tccli-3.0.1290.1.dist-info}/RECORD +81 -81
- {tccli-3.0.1288.1.dist-info → tccli-3.0.1290.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1288.1.dist-info → tccli-3.0.1290.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1288.1.dist-info → tccli-3.0.1290.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/mps/mps_client.py
CHANGED
@@ -17,7 +17,7 @@ from tencentcloud.mps.v20190612 import models as models_v20190612
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
-
def
|
20
|
+
def doDescribeAsrHotwords(args, parsed_globals):
|
21
21
|
g_param = parse_global_arg(parsed_globals)
|
22
22
|
|
23
23
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -46,11 +46,63 @@ def doDeleteAnimatedGraphicsTemplate(args, parsed_globals):
|
|
46
46
|
client = mod.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
47
47
|
client._sdkVersion += ("_CLI_" + __version__)
|
48
48
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
-
model = models.
|
49
|
+
model = models.DescribeAsrHotwordsRequest()
|
50
50
|
model.from_json_string(json.dumps(args))
|
51
51
|
start_time = time.time()
|
52
52
|
while True:
|
53
|
-
rsp = client.
|
53
|
+
rsp = client.DescribeAsrHotwords(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 doCreateSnapshotByTimeOffsetTemplate(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.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
99
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
100
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
+
model = models.CreateSnapshotByTimeOffsetTemplateRequest()
|
102
|
+
model.from_json_string(json.dumps(args))
|
103
|
+
start_time = time.time()
|
104
|
+
while True:
|
105
|
+
rsp = client.CreateSnapshotByTimeOffsetTemplate(model)
|
54
106
|
result = rsp.to_json_string()
|
55
107
|
try:
|
56
108
|
json_obj = json.loads(result)
|
@@ -173,6 +225,58 @@ def doCreateAnimatedGraphicsTemplate(args, parsed_globals):
|
|
173
225
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
226
|
|
175
227
|
|
228
|
+
def doDeleteWatermarkTemplate(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.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
255
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
256
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
+
model = models.DeleteWatermarkTemplateRequest()
|
258
|
+
model.from_json_string(json.dumps(args))
|
259
|
+
start_time = time.time()
|
260
|
+
while True:
|
261
|
+
rsp = client.DeleteWatermarkTemplate(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
|
+
|
176
280
|
def doModifyLiveRecordTemplate(args, parsed_globals):
|
177
281
|
g_param = parse_global_arg(parsed_globals)
|
178
282
|
|
@@ -329,7 +433,7 @@ def doDescribeStreamLinkEvent(args, parsed_globals):
|
|
329
433
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
330
434
|
|
331
435
|
|
332
|
-
def
|
436
|
+
def doDeleteAnimatedGraphicsTemplate(args, parsed_globals):
|
333
437
|
g_param = parse_global_arg(parsed_globals)
|
334
438
|
|
335
439
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -358,11 +462,11 @@ def doCreateSnapshotByTimeOffsetTemplate(args, parsed_globals):
|
|
358
462
|
client = mod.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
359
463
|
client._sdkVersion += ("_CLI_" + __version__)
|
360
464
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
-
model = models.
|
465
|
+
model = models.DeleteAnimatedGraphicsTemplateRequest()
|
362
466
|
model.from_json_string(json.dumps(args))
|
363
467
|
start_time = time.time()
|
364
468
|
while True:
|
365
|
-
rsp = client.
|
469
|
+
rsp = client.DeleteAnimatedGraphicsTemplate(model)
|
366
470
|
result = rsp.to_json_string()
|
367
471
|
try:
|
368
472
|
json_obj = json.loads(result)
|
@@ -433,6 +537,58 @@ def doDescribeAIAnalysisTemplates(args, parsed_globals):
|
|
433
537
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
538
|
|
435
539
|
|
540
|
+
def doDeleteSmartSubtitleTemplate(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.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
567
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
568
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
569
|
+
model = models.DeleteSmartSubtitleTemplateRequest()
|
570
|
+
model.from_json_string(json.dumps(args))
|
571
|
+
start_time = time.time()
|
572
|
+
while True:
|
573
|
+
rsp = client.DeleteSmartSubtitleTemplate(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
|
+
|
436
592
|
def doDeleteTranscodeTemplate(args, parsed_globals):
|
437
593
|
g_param = parse_global_arg(parsed_globals)
|
438
594
|
|
@@ -1057,7 +1213,7 @@ def doDescribeLiveRecordTemplates(args, parsed_globals):
|
|
1057
1213
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
1214
|
|
1059
1215
|
|
1060
|
-
def
|
1216
|
+
def doDeleteAsrHotwords(args, parsed_globals):
|
1061
1217
|
g_param = parse_global_arg(parsed_globals)
|
1062
1218
|
|
1063
1219
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1086,11 +1242,11 @@ def doDeleteSnapshotByTimeOffsetTemplate(args, parsed_globals):
|
|
1086
1242
|
client = mod.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
1243
|
client._sdkVersion += ("_CLI_" + __version__)
|
1088
1244
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
-
model = models.
|
1245
|
+
model = models.DeleteAsrHotwordsRequest()
|
1090
1246
|
model.from_json_string(json.dumps(args))
|
1091
1247
|
start_time = time.time()
|
1092
1248
|
while True:
|
1093
|
-
rsp = client.
|
1249
|
+
rsp = client.DeleteAsrHotwords(model)
|
1094
1250
|
result = rsp.to_json_string()
|
1095
1251
|
try:
|
1096
1252
|
json_obj = json.loads(result)
|
@@ -1213,6 +1369,58 @@ def doRecognizeMediaForZhiXue(args, parsed_globals):
|
|
1213
1369
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
1370
|
|
1215
1371
|
|
1372
|
+
def doDescribeAsrHotwordsList(args, parsed_globals):
|
1373
|
+
g_param = parse_global_arg(parsed_globals)
|
1374
|
+
|
1375
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1376
|
+
cred = credential.CVMRoleCredential()
|
1377
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1378
|
+
cred = credential.STSAssumeRoleCredential(
|
1379
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1380
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1381
|
+
)
|
1382
|
+
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):
|
1383
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1384
|
+
else:
|
1385
|
+
cred = credential.Credential(
|
1386
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1387
|
+
)
|
1388
|
+
http_profile = HttpProfile(
|
1389
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1390
|
+
reqMethod="POST",
|
1391
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1392
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1393
|
+
)
|
1394
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1395
|
+
if g_param[OptionsDefine.Language]:
|
1396
|
+
profile.language = g_param[OptionsDefine.Language]
|
1397
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1398
|
+
client = mod.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
1399
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1400
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1401
|
+
model = models.DescribeAsrHotwordsListRequest()
|
1402
|
+
model.from_json_string(json.dumps(args))
|
1403
|
+
start_time = time.time()
|
1404
|
+
while True:
|
1405
|
+
rsp = client.DescribeAsrHotwordsList(model)
|
1406
|
+
result = rsp.to_json_string()
|
1407
|
+
try:
|
1408
|
+
json_obj = json.loads(result)
|
1409
|
+
except TypeError as e:
|
1410
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1411
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1412
|
+
break
|
1413
|
+
cur_time = time.time()
|
1414
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1415
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1416
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1417
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1418
|
+
else:
|
1419
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1420
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1421
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
|
+
|
1423
|
+
|
1216
1424
|
def doModifyStreamLinkFlow(args, parsed_globals):
|
1217
1425
|
g_param = parse_global_arg(parsed_globals)
|
1218
1426
|
|
@@ -1317,7 +1525,7 @@ def doDescribeTasks(args, parsed_globals):
|
|
1317
1525
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1318
1526
|
|
1319
1527
|
|
1320
|
-
def
|
1528
|
+
def doBatchStartStreamLinkFlow(args, parsed_globals):
|
1321
1529
|
g_param = parse_global_arg(parsed_globals)
|
1322
1530
|
|
1323
1531
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1346,11 +1554,11 @@ def doCreateWordSamples(args, parsed_globals):
|
|
1346
1554
|
client = mod.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
1347
1555
|
client._sdkVersion += ("_CLI_" + __version__)
|
1348
1556
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1349
|
-
model = models.
|
1557
|
+
model = models.BatchStartStreamLinkFlowRequest()
|
1350
1558
|
model.from_json_string(json.dumps(args))
|
1351
1559
|
start_time = time.time()
|
1352
1560
|
while True:
|
1353
|
-
rsp = client.
|
1561
|
+
rsp = client.BatchStartStreamLinkFlow(model)
|
1354
1562
|
result = rsp.to_json_string()
|
1355
1563
|
try:
|
1356
1564
|
json_obj = json.loads(result)
|
@@ -2721,6 +2929,58 @@ def doModifyStreamLinkInput(args, parsed_globals):
|
|
2721
2929
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2722
2930
|
|
2723
2931
|
|
2932
|
+
def doCreateSmartSubtitleTemplate(args, parsed_globals):
|
2933
|
+
g_param = parse_global_arg(parsed_globals)
|
2934
|
+
|
2935
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2936
|
+
cred = credential.CVMRoleCredential()
|
2937
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2938
|
+
cred = credential.STSAssumeRoleCredential(
|
2939
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2940
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2941
|
+
)
|
2942
|
+
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):
|
2943
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2944
|
+
else:
|
2945
|
+
cred = credential.Credential(
|
2946
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2947
|
+
)
|
2948
|
+
http_profile = HttpProfile(
|
2949
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2950
|
+
reqMethod="POST",
|
2951
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2952
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2953
|
+
)
|
2954
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2955
|
+
if g_param[OptionsDefine.Language]:
|
2956
|
+
profile.language = g_param[OptionsDefine.Language]
|
2957
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2958
|
+
client = mod.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
2959
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2960
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2961
|
+
model = models.CreateSmartSubtitleTemplateRequest()
|
2962
|
+
model.from_json_string(json.dumps(args))
|
2963
|
+
start_time = time.time()
|
2964
|
+
while True:
|
2965
|
+
rsp = client.CreateSmartSubtitleTemplate(model)
|
2966
|
+
result = rsp.to_json_string()
|
2967
|
+
try:
|
2968
|
+
json_obj = json.loads(result)
|
2969
|
+
except TypeError as e:
|
2970
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2971
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2972
|
+
break
|
2973
|
+
cur_time = time.time()
|
2974
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2975
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2976
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2977
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2978
|
+
else:
|
2979
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2980
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2981
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2982
|
+
|
2983
|
+
|
2724
2984
|
def doDescribeStreamLinkRegions(args, parsed_globals):
|
2725
2985
|
g_param = parse_global_arg(parsed_globals)
|
2726
2986
|
|
@@ -3189,6 +3449,58 @@ def doDescribeStreamLinkEventAttachedFlows(args, parsed_globals):
|
|
3189
3449
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3190
3450
|
|
3191
3451
|
|
3452
|
+
def doDescribeSmartSubtitleTemplates(args, parsed_globals):
|
3453
|
+
g_param = parse_global_arg(parsed_globals)
|
3454
|
+
|
3455
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3456
|
+
cred = credential.CVMRoleCredential()
|
3457
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3458
|
+
cred = credential.STSAssumeRoleCredential(
|
3459
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3460
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3461
|
+
)
|
3462
|
+
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):
|
3463
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3464
|
+
else:
|
3465
|
+
cred = credential.Credential(
|
3466
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3467
|
+
)
|
3468
|
+
http_profile = HttpProfile(
|
3469
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3470
|
+
reqMethod="POST",
|
3471
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3472
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3473
|
+
)
|
3474
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3475
|
+
if g_param[OptionsDefine.Language]:
|
3476
|
+
profile.language = g_param[OptionsDefine.Language]
|
3477
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3478
|
+
client = mod.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
3479
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3480
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3481
|
+
model = models.DescribeSmartSubtitleTemplatesRequest()
|
3482
|
+
model.from_json_string(json.dumps(args))
|
3483
|
+
start_time = time.time()
|
3484
|
+
while True:
|
3485
|
+
rsp = client.DescribeSmartSubtitleTemplates(model)
|
3486
|
+
result = rsp.to_json_string()
|
3487
|
+
try:
|
3488
|
+
json_obj = json.loads(result)
|
3489
|
+
except TypeError as e:
|
3490
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3491
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3492
|
+
break
|
3493
|
+
cur_time = time.time()
|
3494
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3495
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3496
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3497
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3498
|
+
else:
|
3499
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3500
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3501
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3502
|
+
|
3503
|
+
|
3192
3504
|
def doModifyStreamLinkEvent(args, parsed_globals):
|
3193
3505
|
g_param = parse_global_arg(parsed_globals)
|
3194
3506
|
|
@@ -3449,6 +3761,58 @@ def doDescribeStreamLinkEvents(args, parsed_globals):
|
|
3449
3761
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3450
3762
|
|
3451
3763
|
|
3764
|
+
def doModifyAsrHotwords(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.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
3791
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3792
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3793
|
+
model = models.ModifyAsrHotwordsRequest()
|
3794
|
+
model.from_json_string(json.dumps(args))
|
3795
|
+
start_time = time.time()
|
3796
|
+
while True:
|
3797
|
+
rsp = client.ModifyAsrHotwords(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
|
+
|
3452
3816
|
def doDescribeStreamLinkFlowSRTStatistics(args, parsed_globals):
|
3453
3817
|
g_param = parse_global_arg(parsed_globals)
|
3454
3818
|
|
@@ -4229,7 +4593,7 @@ def doModifySnapshotByTimeOffsetTemplate(args, parsed_globals):
|
|
4229
4593
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4230
4594
|
|
4231
4595
|
|
4232
|
-
def
|
4596
|
+
def doCreateWordSamples(args, parsed_globals):
|
4233
4597
|
g_param = parse_global_arg(parsed_globals)
|
4234
4598
|
|
4235
4599
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -4258,11 +4622,11 @@ def doBatchStartStreamLinkFlow(args, parsed_globals):
|
|
4258
4622
|
client = mod.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
4259
4623
|
client._sdkVersion += ("_CLI_" + __version__)
|
4260
4624
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4261
|
-
model = models.
|
4625
|
+
model = models.CreateWordSamplesRequest()
|
4262
4626
|
model.from_json_string(json.dumps(args))
|
4263
4627
|
start_time = time.time()
|
4264
4628
|
while True:
|
4265
|
-
rsp = client.
|
4629
|
+
rsp = client.CreateWordSamples(model)
|
4266
4630
|
result = rsp.to_json_string()
|
4267
4631
|
try:
|
4268
4632
|
json_obj = json.loads(result)
|
@@ -4957,7 +5321,7 @@ def doModifyAdaptiveDynamicStreamingTemplate(args, parsed_globals):
|
|
4957
5321
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4958
5322
|
|
4959
5323
|
|
4960
|
-
def
|
5324
|
+
def doModifySmartSubtitleTemplate(args, parsed_globals):
|
4961
5325
|
g_param = parse_global_arg(parsed_globals)
|
4962
5326
|
|
4963
5327
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -4986,11 +5350,11 @@ def doDeleteWatermarkTemplate(args, parsed_globals):
|
|
4986
5350
|
client = mod.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
4987
5351
|
client._sdkVersion += ("_CLI_" + __version__)
|
4988
5352
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4989
|
-
model = models.
|
5353
|
+
model = models.ModifySmartSubtitleTemplateRequest()
|
4990
5354
|
model.from_json_string(json.dumps(args))
|
4991
5355
|
start_time = time.time()
|
4992
5356
|
while True:
|
4993
|
-
rsp = client.
|
5357
|
+
rsp = client.ModifySmartSubtitleTemplate(model)
|
4994
5358
|
result = rsp.to_json_string()
|
4995
5359
|
try:
|
4996
5360
|
json_obj = json.loads(result)
|
@@ -5217,6 +5581,58 @@ def doCreateVideoDatabaseEntryTask(args, parsed_globals):
|
|
5217
5581
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5218
5582
|
|
5219
5583
|
|
5584
|
+
def doDeleteSnapshotByTimeOffsetTemplate(args, parsed_globals):
|
5585
|
+
g_param = parse_global_arg(parsed_globals)
|
5586
|
+
|
5587
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
5588
|
+
cred = credential.CVMRoleCredential()
|
5589
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
5590
|
+
cred = credential.STSAssumeRoleCredential(
|
5591
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
5592
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
5593
|
+
)
|
5594
|
+
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):
|
5595
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
5596
|
+
else:
|
5597
|
+
cred = credential.Credential(
|
5598
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
5599
|
+
)
|
5600
|
+
http_profile = HttpProfile(
|
5601
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
5602
|
+
reqMethod="POST",
|
5603
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
5604
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
5605
|
+
)
|
5606
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
5607
|
+
if g_param[OptionsDefine.Language]:
|
5608
|
+
profile.language = g_param[OptionsDefine.Language]
|
5609
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
5610
|
+
client = mod.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
5611
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
5612
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
5613
|
+
model = models.DeleteSnapshotByTimeOffsetTemplateRequest()
|
5614
|
+
model.from_json_string(json.dumps(args))
|
5615
|
+
start_time = time.time()
|
5616
|
+
while True:
|
5617
|
+
rsp = client.DeleteSnapshotByTimeOffsetTemplate(model)
|
5618
|
+
result = rsp.to_json_string()
|
5619
|
+
try:
|
5620
|
+
json_obj = json.loads(result)
|
5621
|
+
except TypeError as e:
|
5622
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
5623
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
5624
|
+
break
|
5625
|
+
cur_time = time.time()
|
5626
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
5627
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
5628
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
5629
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
5630
|
+
else:
|
5631
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
5632
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
5633
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5634
|
+
|
5635
|
+
|
5220
5636
|
def doProcessLiveStream(args, parsed_globals):
|
5221
5637
|
g_param = parse_global_arg(parsed_globals)
|
5222
5638
|
|
@@ -5477,6 +5893,58 @@ def doDescribeStreamLinkFlowMediaStatistics(args, parsed_globals):
|
|
5477
5893
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5478
5894
|
|
5479
5895
|
|
5896
|
+
def doCreateAsrHotwords(args, parsed_globals):
|
5897
|
+
g_param = parse_global_arg(parsed_globals)
|
5898
|
+
|
5899
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
5900
|
+
cred = credential.CVMRoleCredential()
|
5901
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
5902
|
+
cred = credential.STSAssumeRoleCredential(
|
5903
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
5904
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
5905
|
+
)
|
5906
|
+
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):
|
5907
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
5908
|
+
else:
|
5909
|
+
cred = credential.Credential(
|
5910
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
5911
|
+
)
|
5912
|
+
http_profile = HttpProfile(
|
5913
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
5914
|
+
reqMethod="POST",
|
5915
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
5916
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
5917
|
+
)
|
5918
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
5919
|
+
if g_param[OptionsDefine.Language]:
|
5920
|
+
profile.language = g_param[OptionsDefine.Language]
|
5921
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
5922
|
+
client = mod.MpsClient(cred, g_param[OptionsDefine.Region], profile)
|
5923
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
5924
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
5925
|
+
model = models.CreateAsrHotwordsRequest()
|
5926
|
+
model.from_json_string(json.dumps(args))
|
5927
|
+
start_time = time.time()
|
5928
|
+
while True:
|
5929
|
+
rsp = client.CreateAsrHotwords(model)
|
5930
|
+
result = rsp.to_json_string()
|
5931
|
+
try:
|
5932
|
+
json_obj = json.loads(result)
|
5933
|
+
except TypeError as e:
|
5934
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
5935
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
5936
|
+
break
|
5937
|
+
cur_time = time.time()
|
5938
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
5939
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
5940
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
5941
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
5942
|
+
else:
|
5943
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
5944
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
5945
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5946
|
+
|
5947
|
+
|
5480
5948
|
def doCreateStreamLinkEvent(args, parsed_globals):
|
5481
5949
|
g_param = parse_global_arg(parsed_globals)
|
5482
5950
|
|
@@ -6216,14 +6684,17 @@ MODELS_MAP = {
|
|
6216
6684
|
}
|
6217
6685
|
|
6218
6686
|
ACTION_MAP = {
|
6219
|
-
"
|
6687
|
+
"DescribeAsrHotwords": doDescribeAsrHotwords,
|
6688
|
+
"CreateSnapshotByTimeOffsetTemplate": doCreateSnapshotByTimeOffsetTemplate,
|
6220
6689
|
"DescribeStreamLinkFlowRealtimeStatus": doDescribeStreamLinkFlowRealtimeStatus,
|
6221
6690
|
"CreateAnimatedGraphicsTemplate": doCreateAnimatedGraphicsTemplate,
|
6691
|
+
"DeleteWatermarkTemplate": doDeleteWatermarkTemplate,
|
6222
6692
|
"ModifyLiveRecordTemplate": doModifyLiveRecordTemplate,
|
6223
6693
|
"EditMedia": doEditMedia,
|
6224
6694
|
"DescribeStreamLinkEvent": doDescribeStreamLinkEvent,
|
6225
|
-
"
|
6695
|
+
"DeleteAnimatedGraphicsTemplate": doDeleteAnimatedGraphicsTemplate,
|
6226
6696
|
"DescribeAIAnalysisTemplates": doDescribeAIAnalysisTemplates,
|
6697
|
+
"DeleteSmartSubtitleTemplate": doDeleteSmartSubtitleTemplate,
|
6227
6698
|
"DeleteTranscodeTemplate": doDeleteTranscodeTemplate,
|
6228
6699
|
"DescribeTaskDetail": doDescribeTaskDetail,
|
6229
6700
|
"DescribeWordSamples": doDescribeWordSamples,
|
@@ -6236,12 +6707,13 @@ ACTION_MAP = {
|
|
6236
6707
|
"DescribeStreamLinkFlowStatistics": doDescribeStreamLinkFlowStatistics,
|
6237
6708
|
"BatchDeleteStreamLinkFlow": doBatchDeleteStreamLinkFlow,
|
6238
6709
|
"DescribeLiveRecordTemplates": doDescribeLiveRecordTemplates,
|
6239
|
-
"
|
6710
|
+
"DeleteAsrHotwords": doDeleteAsrHotwords,
|
6240
6711
|
"EnableWorkflow": doEnableWorkflow,
|
6241
6712
|
"RecognizeMediaForZhiXue": doRecognizeMediaForZhiXue,
|
6713
|
+
"DescribeAsrHotwordsList": doDescribeAsrHotwordsList,
|
6242
6714
|
"ModifyStreamLinkFlow": doModifyStreamLinkFlow,
|
6243
6715
|
"DescribeTasks": doDescribeTasks,
|
6244
|
-
"
|
6716
|
+
"BatchStartStreamLinkFlow": doBatchStartStreamLinkFlow,
|
6245
6717
|
"CreateTranscodeTemplate": doCreateTranscodeTemplate,
|
6246
6718
|
"CreateStreamLinkFlow": doCreateStreamLinkFlow,
|
6247
6719
|
"ExecuteFunction": doExecuteFunction,
|
@@ -6268,6 +6740,7 @@ ACTION_MAP = {
|
|
6268
6740
|
"StartStreamLinkFlow": doStartStreamLinkFlow,
|
6269
6741
|
"ProcessImage": doProcessImage,
|
6270
6742
|
"ModifyStreamLinkInput": doModifyStreamLinkInput,
|
6743
|
+
"CreateSmartSubtitleTemplate": doCreateSmartSubtitleTemplate,
|
6271
6744
|
"DescribeStreamLinkRegions": doDescribeStreamLinkRegions,
|
6272
6745
|
"DescribeSchedules": doDescribeSchedules,
|
6273
6746
|
"ModifyPersonSample": doModifyPersonSample,
|
@@ -6277,11 +6750,13 @@ ACTION_MAP = {
|
|
6277
6750
|
"ModifyQualityControlTemplate": doModifyQualityControlTemplate,
|
6278
6751
|
"StopStreamLinkFlow": doStopStreamLinkFlow,
|
6279
6752
|
"DescribeStreamLinkEventAttachedFlows": doDescribeStreamLinkEventAttachedFlows,
|
6753
|
+
"DescribeSmartSubtitleTemplates": doDescribeSmartSubtitleTemplates,
|
6280
6754
|
"ModifyStreamLinkEvent": doModifyStreamLinkEvent,
|
6281
6755
|
"ModifyAnimatedGraphicsTemplate": doModifyAnimatedGraphicsTemplate,
|
6282
6756
|
"ModifyTranscodeTemplate": doModifyTranscodeTemplate,
|
6283
6757
|
"DescribeAIRecognitionTemplates": doDescribeAIRecognitionTemplates,
|
6284
6758
|
"DescribeStreamLinkEvents": doDescribeStreamLinkEvents,
|
6759
|
+
"ModifyAsrHotwords": doModifyAsrHotwords,
|
6285
6760
|
"DescribeStreamLinkFlowSRTStatistics": doDescribeStreamLinkFlowSRTStatistics,
|
6286
6761
|
"CreateStreamLinkOutputInfo": doCreateStreamLinkOutputInfo,
|
6287
6762
|
"DescribeWorkflows": doDescribeWorkflows,
|
@@ -6297,7 +6772,7 @@ ACTION_MAP = {
|
|
6297
6772
|
"ManageTask": doManageTask,
|
6298
6773
|
"DescribeVideoDatabaseEntryTaskDetail": doDescribeVideoDatabaseEntryTaskDetail,
|
6299
6774
|
"ModifySnapshotByTimeOffsetTemplate": doModifySnapshotByTimeOffsetTemplate,
|
6300
|
-
"
|
6775
|
+
"CreateWordSamples": doCreateWordSamples,
|
6301
6776
|
"CreateWorkflow": doCreateWorkflow,
|
6302
6777
|
"DescribeAdaptiveDynamicStreamingTemplates": doDescribeAdaptiveDynamicStreamingTemplates,
|
6303
6778
|
"CreateSchedule": doCreateSchedule,
|
@@ -6311,16 +6786,18 @@ ACTION_MAP = {
|
|
6311
6786
|
"DescribeStreamLinkFlow": doDescribeStreamLinkFlow,
|
6312
6787
|
"DeleteSchedule": doDeleteSchedule,
|
6313
6788
|
"ModifyAdaptiveDynamicStreamingTemplate": doModifyAdaptiveDynamicStreamingTemplate,
|
6314
|
-
"
|
6789
|
+
"ModifySmartSubtitleTemplate": doModifySmartSubtitleTemplate,
|
6315
6790
|
"DeletePersonSample": doDeletePersonSample,
|
6316
6791
|
"ParseLiveStreamProcessNotification": doParseLiveStreamProcessNotification,
|
6317
6792
|
"EnableSchedule": doEnableSchedule,
|
6318
6793
|
"CreateVideoDatabaseEntryTask": doCreateVideoDatabaseEntryTask,
|
6794
|
+
"DeleteSnapshotByTimeOffsetTemplate": doDeleteSnapshotByTimeOffsetTemplate,
|
6319
6795
|
"ProcessLiveStream": doProcessLiveStream,
|
6320
6796
|
"DeleteLiveRecordTemplate": doDeleteLiveRecordTemplate,
|
6321
6797
|
"DeleteContentReviewTemplate": doDeleteContentReviewTemplate,
|
6322
6798
|
"DeleteSampleSnapshotTemplate": doDeleteSampleSnapshotTemplate,
|
6323
6799
|
"DescribeStreamLinkFlowMediaStatistics": doDescribeStreamLinkFlowMediaStatistics,
|
6800
|
+
"CreateAsrHotwords": doCreateAsrHotwords,
|
6324
6801
|
"CreateStreamLinkEvent": doCreateStreamLinkEvent,
|
6325
6802
|
"CreatePersonSample": doCreatePersonSample,
|
6326
6803
|
"DescribeQualityControlTemplates": doDescribeQualityControlTemplates,
|