tccli 3.0.1182.1__py2.py3-none-any.whl → 3.0.1184.1__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tccli/__init__.py +1 -1
- tccli/services/ams/v20201229/api.json +20 -0
- tccli/services/ams/v20201229/examples.json +1 -1
- tccli/services/asr/asr_client.py +229 -17
- tccli/services/asr/v20190614/api.json +379 -0
- tccli/services/asr/v20190614/examples.json +32 -0
- tccli/services/bi/v20220105/api.json +10 -0
- tccli/services/cdwdoris/v20211228/api.json +189 -8
- tccli/services/cdwdoris/v20211228/examples.json +3 -3
- tccli/services/cfg/v20210820/api.json +134 -11
- tccli/services/cfw/cfw_client.py +53 -0
- tccli/services/cfw/v20190904/api.json +44 -0
- tccli/services/cfw/v20190904/examples.json +8 -0
- tccli/services/ckafka/v20190819/api.json +46 -16
- tccli/services/ckafka/v20190819/examples.json +8 -8
- tccli/services/clb/v20180317/api.json +40 -1
- tccli/services/cynosdb/cynosdb_client.py +110 -4
- tccli/services/cynosdb/v20190107/api.json +246 -0
- tccli/services/cynosdb/v20190107/examples.json +16 -0
- tccli/services/dasb/v20191018/api.json +9 -0
- tccli/services/dbbrain/v20210527/api.json +15 -15
- tccli/services/dc/v20180410/api.json +117 -73
- tccli/services/dc/v20180410/examples.json +11 -11
- tccli/services/dcdb/dcdb_client.py +53 -0
- tccli/services/dcdb/v20180411/api.json +54 -0
- tccli/services/dcdb/v20180411/examples.json +8 -0
- tccli/services/emr/emr_client.py +53 -0
- tccli/services/emr/v20190103/api.json +52 -0
- tccli/services/emr/v20190103/examples.json +8 -0
- tccli/services/es/es_client.py +53 -0
- tccli/services/es/v20180416/api.json +63 -0
- tccli/services/es/v20180416/examples.json +8 -0
- tccli/services/ess/v20201111/examples.json +3 -3
- tccli/services/essbasic/v20210526/api.json +8 -8
- tccli/services/essbasic/v20210526/examples.json +9 -9
- tccli/services/hunyuan/v20230901/api.json +1 -1
- tccli/services/ims/v20201229/api.json +1 -1
- tccli/services/iss/v20230517/api.json +18 -0
- tccli/services/iss/v20230517/examples.json +3 -3
- tccli/services/lke/v20231130/api.json +142 -3
- tccli/services/mariadb/mariadb_client.py +57 -4
- tccli/services/mariadb/v20170312/api.json +54 -0
- tccli/services/mariadb/v20170312/examples.json +8 -0
- tccli/services/oceanus/v20190422/api.json +19 -0
- tccli/services/oceanus/v20190422/examples.json +1 -1
- tccli/services/ocr/v20181119/api.json +7 -7
- tccli/services/postgres/v20170312/api.json +3 -0
- tccli/services/scf/v20180416/api.json +8 -8
- tccli/services/sms/v20190711/api.json +49 -49
- tccli/services/sms/v20190711/examples.json +2 -2
- tccli/services/ssl/ssl_client.py +65 -12
- tccli/services/ssl/v20191205/api.json +133 -3
- tccli/services/ssl/v20191205/examples.json +10 -2
- tccli/services/tdmq/v20200217/api.json +170 -93
- tccli/services/tdmq/v20200217/examples.json +8 -8
- tccli/services/thpc/thpc_client.py +53 -0
- tccli/services/thpc/v20230321/api.json +561 -0
- tccli/services/thpc/v20230321/examples.json +8 -0
- tccli/services/tke/v20180525/api.json +14 -2
- tccli/services/tke/v20180525/examples.json +3 -3
- tccli/services/tmt/v20180321/api.json +1 -1
- tccli/services/trocket/v20230308/api.json +62 -12
- tccli/services/trtc/v20190722/api.json +2 -2
- tccli/services/vpc/v20170312/api.json +23 -0
- tccli/services/wedata/v20210820/api.json +176 -0
- tccli/services/wedata/v20210820/examples.json +8 -0
- tccli/services/wedata/wedata_client.py +53 -0
- {tccli-3.0.1182.1.dist-info → tccli-3.0.1184.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1182.1.dist-info → tccli-3.0.1184.1.dist-info}/RECORD +72 -72
- {tccli-3.0.1182.1.dist-info → tccli-3.0.1184.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1182.1.dist-info → tccli-3.0.1184.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1182.1.dist-info → tccli-3.0.1184.1.dist-info}/license_files/LICENSE +0 -0
tccli/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '3.0.
|
1
|
+
__version__ = '3.0.1184.1'
|
@@ -768,6 +768,26 @@
|
|
768
768
|
"type": "string",
|
769
769
|
"value_allowed_null": true
|
770
770
|
},
|
771
|
+
{
|
772
|
+
"disabled": false,
|
773
|
+
"document": "是否命中(0:否, 1: 是)",
|
774
|
+
"example": "1",
|
775
|
+
"member": "int64",
|
776
|
+
"name": "HitFlag",
|
777
|
+
"output_required": false,
|
778
|
+
"type": "int",
|
779
|
+
"value_allowed_null": false
|
780
|
+
},
|
781
|
+
{
|
782
|
+
"disabled": false,
|
783
|
+
"document": "得分",
|
784
|
+
"example": "0",
|
785
|
+
"member": "int64",
|
786
|
+
"name": "Score",
|
787
|
+
"output_required": false,
|
788
|
+
"type": "int",
|
789
|
+
"value_allowed_null": false
|
790
|
+
},
|
771
791
|
{
|
772
792
|
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
773
793
|
"member": "string",
|
@@ -12,7 +12,7 @@
|
|
12
12
|
{
|
13
13
|
"document": "",
|
14
14
|
"input": "POST / HTTP/1.1\nHost: ams.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateAudioModerationSyncTask\n<公共请求参数>\n\n{\n \"BizType\": \"test_biztype\",\n \"FileUrl\": \"https://test.myqcloud.com/test.mp3\",\n \"DataId\": \"test0000000000001\",\n \"Name\": \"test_file\",\n \"FileFormat\": \"mp3\"\n}",
|
15
|
-
"output": "{\n \"Response\": {\n \"RequestId\": \"24235235-sfsddgsdg-242532-test\",\n \"DataId\": \"test0000000000001\",\n \"Label\": \"Normal\",\n \"SubLabel\": \"\",\n \"Name\": \"test_audio\",\n \"BizType\": \"test_biztype\",\n \"Suggestion\": \"Pass\",\n \"AsrText\": \"新年快乐,恭喜发财,身体健康,万事如意。\",\n \"TextResults\": [\n {\n \"Label\": \"Normal\",\n \"Score\": 0,\n \"Keywords\": [],\n \"Suggestion\": \"Pass\",\n \"LibId\": \"\",\n \"LibType\": 0,\n \"LibName\": \"\",\n \"SubLabel\": \"\"\n }\n ],\n \"MoanResults\": [],\n \"LanguageResults\": [],\n \"SpeakerResults\": [],\n \"RecognitionResults\": [],\n \"Duration\": \"15000\"\n }\n}",
|
15
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"24235235-sfsddgsdg-242532-test\",\n \"DataId\": \"test0000000000001\",\n \"Label\": \"Normal\",\n \"SubLabel\": \"\",\n \"Name\": \"test_audio\",\n \"BizType\": \"test_biztype\",\n \"Suggestion\": \"Pass\",\n \"AsrText\": \"新年快乐,恭喜发财,身体健康,万事如意。\",\n \"TextResults\": [\n {\n \"Label\": \"Normal\",\n \"Score\": 0,\n \"Keywords\": [],\n \"Suggestion\": \"Pass\",\n \"LibId\": \"\",\n \"LibType\": 0,\n \"LibName\": \"\",\n \"SubLabel\": \"\"\n }\n ],\n \"MoanResults\": [],\n \"LanguageResults\": [],\n \"SpeakerResults\": [],\n \"RecognitionResults\": [],\n \"Duration\": \"15000\",\n \"HitFlag\": 0,\n \"Score\": 0\n }\n}",
|
16
16
|
"title": "音频同步接口返回示例"
|
17
17
|
}
|
18
18
|
],
|
tccli/services/asr/asr_client.py
CHANGED
@@ -17,6 +17,58 @@ from tencentcloud.asr.v20190614 import models as models_v20190614
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
+
def doCreateAsrKeyWordLib(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.AsrClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
+
model = models.CreateAsrKeyWordLibRequest()
|
50
|
+
model.from_json_string(json.dumps(args))
|
51
|
+
start_time = time.time()
|
52
|
+
while True:
|
53
|
+
rsp = client.CreateAsrKeyWordLib(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
|
+
|
20
72
|
def doVoicePrintCompare(args, parsed_globals):
|
21
73
|
g_param = parse_global_arg(parsed_globals)
|
22
74
|
|
@@ -277,7 +329,7 @@ def doVoicePrintCount(args, parsed_globals):
|
|
277
329
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
330
|
|
279
331
|
|
280
|
-
def
|
332
|
+
def doVoicePrintVerify(args, parsed_globals):
|
281
333
|
g_param = parse_global_arg(parsed_globals)
|
282
334
|
|
283
335
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -306,11 +358,11 @@ def doVoicePrintUpdate(args, parsed_globals):
|
|
306
358
|
client = mod.AsrClient(cred, g_param[OptionsDefine.Region], profile)
|
307
359
|
client._sdkVersion += ("_CLI_" + __version__)
|
308
360
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
-
model = models.
|
361
|
+
model = models.VoicePrintVerifyRequest()
|
310
362
|
model.from_json_string(json.dumps(args))
|
311
363
|
start_time = time.time()
|
312
364
|
while True:
|
313
|
-
rsp = client.
|
365
|
+
rsp = client.VoicePrintVerify(model)
|
314
366
|
result = rsp.to_json_string()
|
315
367
|
try:
|
316
368
|
json_obj = json.loads(result)
|
@@ -641,6 +693,58 @@ def doDeleteAsrVocab(args, parsed_globals):
|
|
641
693
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
642
694
|
|
643
695
|
|
696
|
+
def doGetAsrKeyWordLibList(args, parsed_globals):
|
697
|
+
g_param = parse_global_arg(parsed_globals)
|
698
|
+
|
699
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
700
|
+
cred = credential.CVMRoleCredential()
|
701
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
702
|
+
cred = credential.STSAssumeRoleCredential(
|
703
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
704
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
705
|
+
)
|
706
|
+
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):
|
707
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
708
|
+
else:
|
709
|
+
cred = credential.Credential(
|
710
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
711
|
+
)
|
712
|
+
http_profile = HttpProfile(
|
713
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
714
|
+
reqMethod="POST",
|
715
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
716
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
717
|
+
)
|
718
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
719
|
+
if g_param[OptionsDefine.Language]:
|
720
|
+
profile.language = g_param[OptionsDefine.Language]
|
721
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
722
|
+
client = mod.AsrClient(cred, g_param[OptionsDefine.Region], profile)
|
723
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
724
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
+
model = models.GetAsrKeyWordLibListRequest()
|
726
|
+
model.from_json_string(json.dumps(args))
|
727
|
+
start_time = time.time()
|
728
|
+
while True:
|
729
|
+
rsp = client.GetAsrKeyWordLibList(model)
|
730
|
+
result = rsp.to_json_string()
|
731
|
+
try:
|
732
|
+
json_obj = json.loads(result)
|
733
|
+
except TypeError as e:
|
734
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
735
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
736
|
+
break
|
737
|
+
cur_time = time.time()
|
738
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
739
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
740
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
741
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
742
|
+
else:
|
743
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
744
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
745
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
746
|
+
|
747
|
+
|
644
748
|
def doSentenceRecognition(args, parsed_globals):
|
645
749
|
g_param = parse_global_arg(parsed_globals)
|
646
750
|
|
@@ -693,7 +797,7 @@ def doSentenceRecognition(args, parsed_globals):
|
|
693
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
798
|
|
695
799
|
|
696
|
-
def
|
800
|
+
def doUpdateAsrKeyWordLib(args, parsed_globals):
|
697
801
|
g_param = parse_global_arg(parsed_globals)
|
698
802
|
|
699
803
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -722,11 +826,11 @@ def doCreateRecTask(args, parsed_globals):
|
|
722
826
|
client = mod.AsrClient(cred, g_param[OptionsDefine.Region], profile)
|
723
827
|
client._sdkVersion += ("_CLI_" + __version__)
|
724
828
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
-
model = models.
|
829
|
+
model = models.UpdateAsrKeyWordLibRequest()
|
726
830
|
model.from_json_string(json.dumps(args))
|
727
831
|
start_time = time.time()
|
728
832
|
while True:
|
729
|
-
rsp = client.
|
833
|
+
rsp = client.UpdateAsrKeyWordLib(model)
|
730
834
|
result = rsp.to_json_string()
|
731
835
|
try:
|
732
836
|
json_obj = json.loads(result)
|
@@ -745,7 +849,7 @@ def doCreateRecTask(args, parsed_globals):
|
|
745
849
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
746
850
|
|
747
851
|
|
748
|
-
def
|
852
|
+
def doVoicePrintUpdate(args, parsed_globals):
|
749
853
|
g_param = parse_global_arg(parsed_globals)
|
750
854
|
|
751
855
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -774,11 +878,11 @@ def doDescribeTaskStatus(args, parsed_globals):
|
|
774
878
|
client = mod.AsrClient(cred, g_param[OptionsDefine.Region], profile)
|
775
879
|
client._sdkVersion += ("_CLI_" + __version__)
|
776
880
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
777
|
-
model = models.
|
881
|
+
model = models.VoicePrintUpdateRequest()
|
778
882
|
model.from_json_string(json.dumps(args))
|
779
883
|
start_time = time.time()
|
780
884
|
while True:
|
781
|
-
rsp = client.
|
885
|
+
rsp = client.VoicePrintUpdate(model)
|
782
886
|
result = rsp.to_json_string()
|
783
887
|
try:
|
784
888
|
json_obj = json.loads(result)
|
@@ -797,7 +901,7 @@ def doDescribeTaskStatus(args, parsed_globals):
|
|
797
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
902
|
|
799
903
|
|
800
|
-
def
|
904
|
+
def doCreateRecTask(args, parsed_globals):
|
801
905
|
g_param = parse_global_arg(parsed_globals)
|
802
906
|
|
803
907
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -826,11 +930,11 @@ def doVoicePrintEnroll(args, parsed_globals):
|
|
826
930
|
client = mod.AsrClient(cred, g_param[OptionsDefine.Region], profile)
|
827
931
|
client._sdkVersion += ("_CLI_" + __version__)
|
828
932
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
-
model = models.
|
933
|
+
model = models.CreateRecTaskRequest()
|
830
934
|
model.from_json_string(json.dumps(args))
|
831
935
|
start_time = time.time()
|
832
936
|
while True:
|
833
|
-
rsp = client.
|
937
|
+
rsp = client.CreateRecTask(model)
|
834
938
|
result = rsp.to_json_string()
|
835
939
|
try:
|
836
940
|
json_obj = json.loads(result)
|
@@ -849,7 +953,7 @@ def doVoicePrintEnroll(args, parsed_globals):
|
|
849
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
954
|
|
851
955
|
|
852
|
-
def
|
956
|
+
def doDescribeTaskStatus(args, parsed_globals):
|
853
957
|
g_param = parse_global_arg(parsed_globals)
|
854
958
|
|
855
959
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -878,11 +982,63 @@ def doVoicePrintVerify(args, parsed_globals):
|
|
878
982
|
client = mod.AsrClient(cred, g_param[OptionsDefine.Region], profile)
|
879
983
|
client._sdkVersion += ("_CLI_" + __version__)
|
880
984
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
-
model = models.
|
985
|
+
model = models.DescribeTaskStatusRequest()
|
882
986
|
model.from_json_string(json.dumps(args))
|
883
987
|
start_time = time.time()
|
884
988
|
while True:
|
885
|
-
rsp = client.
|
989
|
+
rsp = client.DescribeTaskStatus(model)
|
990
|
+
result = rsp.to_json_string()
|
991
|
+
try:
|
992
|
+
json_obj = json.loads(result)
|
993
|
+
except TypeError as e:
|
994
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
995
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
996
|
+
break
|
997
|
+
cur_time = time.time()
|
998
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
999
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1000
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1001
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1002
|
+
else:
|
1003
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1004
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1005
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
|
+
|
1007
|
+
|
1008
|
+
def doVoicePrintEnroll(args, parsed_globals):
|
1009
|
+
g_param = parse_global_arg(parsed_globals)
|
1010
|
+
|
1011
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1012
|
+
cred = credential.CVMRoleCredential()
|
1013
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1014
|
+
cred = credential.STSAssumeRoleCredential(
|
1015
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1016
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1017
|
+
)
|
1018
|
+
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):
|
1019
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1020
|
+
else:
|
1021
|
+
cred = credential.Credential(
|
1022
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1023
|
+
)
|
1024
|
+
http_profile = HttpProfile(
|
1025
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1026
|
+
reqMethod="POST",
|
1027
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1028
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1029
|
+
)
|
1030
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1031
|
+
if g_param[OptionsDefine.Language]:
|
1032
|
+
profile.language = g_param[OptionsDefine.Language]
|
1033
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1034
|
+
client = mod.AsrClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1036
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
+
model = models.VoicePrintEnrollRequest()
|
1038
|
+
model.from_json_string(json.dumps(args))
|
1039
|
+
start_time = time.time()
|
1040
|
+
while True:
|
1041
|
+
rsp = client.VoicePrintEnroll(model)
|
886
1042
|
result = rsp.to_json_string()
|
887
1043
|
try:
|
888
1044
|
json_obj = json.loads(result)
|
@@ -1213,6 +1369,58 @@ def doGetModelInfo(args, parsed_globals):
|
|
1213
1369
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
1370
|
|
1215
1371
|
|
1372
|
+
def doDeleteAsrKeyWordLib(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.AsrClient(cred, g_param[OptionsDefine.Region], profile)
|
1399
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1400
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1401
|
+
model = models.DeleteAsrKeyWordLibRequest()
|
1402
|
+
model.from_json_string(json.dumps(args))
|
1403
|
+
start_time = time.time()
|
1404
|
+
while True:
|
1405
|
+
rsp = client.DeleteAsrKeyWordLib(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 doModifyCustomizationState(args, parsed_globals):
|
1217
1425
|
g_param = parse_global_arg(parsed_globals)
|
1218
1426
|
|
@@ -1432,29 +1640,33 @@ MODELS_MAP = {
|
|
1432
1640
|
}
|
1433
1641
|
|
1434
1642
|
ACTION_MAP = {
|
1643
|
+
"CreateAsrKeyWordLib": doCreateAsrKeyWordLib,
|
1435
1644
|
"VoicePrintCompare": doVoicePrintCompare,
|
1436
1645
|
"UpdateAsrVocab": doUpdateAsrVocab,
|
1437
1646
|
"CreateAsyncRecognitionTask": doCreateAsyncRecognitionTask,
|
1438
1647
|
"GetCustomizationList": doGetCustomizationList,
|
1439
1648
|
"VoicePrintCount": doVoicePrintCount,
|
1440
|
-
"
|
1649
|
+
"VoicePrintVerify": doVoicePrintVerify,
|
1441
1650
|
"GetAsrVocab": doGetAsrVocab,
|
1442
1651
|
"SetVocabState": doSetVocabState,
|
1443
1652
|
"DownloadAsrVocab": doDownloadAsrVocab,
|
1444
1653
|
"CreateCustomization": doCreateCustomization,
|
1445
1654
|
"VoicePrintGroupVerify": doVoicePrintGroupVerify,
|
1446
1655
|
"DeleteAsrVocab": doDeleteAsrVocab,
|
1656
|
+
"GetAsrKeyWordLibList": doGetAsrKeyWordLibList,
|
1447
1657
|
"SentenceRecognition": doSentenceRecognition,
|
1658
|
+
"UpdateAsrKeyWordLib": doUpdateAsrKeyWordLib,
|
1659
|
+
"VoicePrintUpdate": doVoicePrintUpdate,
|
1448
1660
|
"CreateRecTask": doCreateRecTask,
|
1449
1661
|
"DescribeTaskStatus": doDescribeTaskStatus,
|
1450
1662
|
"VoicePrintEnroll": doVoicePrintEnroll,
|
1451
|
-
"VoicePrintVerify": doVoicePrintVerify,
|
1452
1663
|
"DescribeAsyncRecognitionTasks": doDescribeAsyncRecognitionTasks,
|
1453
1664
|
"VoicePrintDelete": doVoicePrintDelete,
|
1454
1665
|
"GetAsrVocabList": doGetAsrVocabList,
|
1455
1666
|
"ModifyCustomization": doModifyCustomization,
|
1456
1667
|
"CloseAsyncRecognitionTask": doCloseAsyncRecognitionTask,
|
1457
1668
|
"GetModelInfo": doGetModelInfo,
|
1669
|
+
"DeleteAsrKeyWordLib": doDeleteAsrKeyWordLib,
|
1458
1670
|
"ModifyCustomizationState": doModifyCustomizationState,
|
1459
1671
|
"CreateAsrVocab": doCreateAsrVocab,
|
1460
1672
|
"DeleteCustomization": doDeleteCustomization,
|