tccli 3.0.1330.1__py2.py3-none-any.whl → 3.0.1333.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/services/asr/v20190614/api.json +1 -1
- tccli/services/autoscaling/v20180419/api.json +1 -1
- tccli/services/bmvpc/v20180625/api.json +36 -36
- tccli/services/ccc/ccc_client.py +53 -0
- tccli/services/ccc/v20200210/api.json +71 -2
- tccli/services/ccc/v20200210/examples.json +8 -0
- tccli/services/cdb/v20170320/api.json +37 -37
- tccli/services/cdn/v20180606/api.json +5 -5
- tccli/services/cdn/v20180606/examples.json +5 -5
- tccli/services/cfw/v20190904/api.json +1 -1
- tccli/services/ckafka/v20190819/api.json +11 -1
- tccli/services/clb/v20180317/api.json +18 -0
- tccli/services/cwp/v20180228/api.json +4 -4
- tccli/services/dbbrain/v20210527/api.json +1 -0
- tccli/services/dc/v20180410/api.json +39 -0
- tccli/services/dnspod/dnspod_client.py +106 -0
- tccli/services/dnspod/v20210323/api.json +509 -2
- tccli/services/dnspod/v20210323/examples.json +17 -1
- tccli/services/emr/v20190103/api.json +2 -2
- tccli/services/ess/ess_client.py +57 -4
- tccli/services/ess/v20201111/api.json +63 -2
- tccli/services/ess/v20201111/examples.json +8 -0
- tccli/services/essbasic/v20210526/api.json +3 -3
- tccli/services/faceid/v20180301/api.json +4 -4
- tccli/services/goosefs/v20220519/api.json +2 -2
- tccli/services/gs/gs_client.py +163 -4
- tccli/services/gs/v20191118/api.json +216 -0
- tccli/services/gs/v20191118/examples.json +24 -0
- tccli/services/ioa/ioa_client.py +167 -8
- tccli/services/ioa/v20220601/api.json +541 -1
- tccli/services/ioa/v20220601/examples.json +42 -0
- tccli/services/iotexplorer/v20190423/api.json +12 -12
- tccli/services/iotexplorer/v20190423/examples.json +2 -2
- tccli/services/live/v20180801/api.json +3 -3
- tccli/services/lke/lke_client.py +699 -63
- tccli/services/lke/v20231130/api.json +1754 -79
- tccli/services/lke/v20231130/examples.json +96 -0
- tccli/services/lkeap/v20240522/examples.json +5 -5
- tccli/services/lowcode/v20210108/api.json +41 -1
- tccli/services/lowcode/v20210108/examples.json +2 -2
- tccli/services/ocr/ocr_client.py +532 -320
- tccli/services/ocr/v20181119/api.json +545 -8
- tccli/services/ocr/v20181119/examples.json +32 -0
- tccli/services/sms/v20190711/api.json +4 -4
- tccli/services/sms/v20210111/api.json +4 -4
- tccli/services/ssl/v20191205/api.json +4 -4
- tccli/services/ssl/v20191205/examples.json +1 -1
- tccli/services/tat/v20201028/api.json +1 -1
- tccli/services/teo/v20220901/api.json +1 -1
- tccli/services/tke/tke_client.py +106 -0
- tccli/services/tke/v20180525/api.json +124 -0
- tccli/services/tke/v20180525/examples.json +16 -0
- tccli/services/trtc/v20190722/api.json +2 -2
- tccli/services/tsf/v20180326/api.json +46 -17
- tccli/services/tsf/v20180326/examples.json +10 -10
- tccli/services/vpc/v20170312/api.json +5 -5
- tccli/services/vpc/v20170312/examples.json +6 -6
- {tccli-3.0.1330.1.dist-info → tccli-3.0.1333.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1330.1.dist-info → tccli-3.0.1333.1.dist-info}/RECORD +63 -63
- {tccli-3.0.1330.1.dist-info → tccli-3.0.1333.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1330.1.dist-info → tccli-3.0.1333.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1330.1.dist-info → tccli-3.0.1333.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/lke/lke_client.py
CHANGED
@@ -537,6 +537,58 @@ def doDeleteQA(args, parsed_globals):
|
|
537
537
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
538
538
|
|
539
539
|
|
540
|
+
def doStopWorkflowRun(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.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
567
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
568
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
569
|
+
model = models.StopWorkflowRunRequest()
|
570
|
+
model.from_json_string(json.dumps(args))
|
571
|
+
start_time = time.time()
|
572
|
+
while True:
|
573
|
+
rsp = client.StopWorkflowRun(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
|
+
|
540
592
|
def doCreateAttributeLabel(args, parsed_globals):
|
541
593
|
g_param = parse_global_arg(parsed_globals)
|
542
594
|
|
@@ -589,7 +641,7 @@ def doCreateAttributeLabel(args, parsed_globals):
|
|
589
641
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
590
642
|
|
591
643
|
|
592
|
-
def
|
644
|
+
def doListDocCate(args, parsed_globals):
|
593
645
|
g_param = parse_global_arg(parsed_globals)
|
594
646
|
|
595
647
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -618,11 +670,11 @@ def doRetryDocAudit(args, parsed_globals):
|
|
618
670
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
619
671
|
client._sdkVersion += ("_CLI_" + __version__)
|
620
672
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
621
|
-
model = models.
|
673
|
+
model = models.ListDocCateRequest()
|
622
674
|
model.from_json_string(json.dumps(args))
|
623
675
|
start_time = time.time()
|
624
676
|
while True:
|
625
|
-
rsp = client.
|
677
|
+
rsp = client.ListDocCate(model)
|
626
678
|
result = rsp.to_json_string()
|
627
679
|
try:
|
628
680
|
json_obj = json.loads(result)
|
@@ -693,6 +745,58 @@ def doGenerateQA(args, parsed_globals):
|
|
693
745
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
746
|
|
695
747
|
|
748
|
+
def doListSharedKnowledge(args, parsed_globals):
|
749
|
+
g_param = parse_global_arg(parsed_globals)
|
750
|
+
|
751
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
752
|
+
cred = credential.CVMRoleCredential()
|
753
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
754
|
+
cred = credential.STSAssumeRoleCredential(
|
755
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
756
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
757
|
+
)
|
758
|
+
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):
|
759
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
760
|
+
else:
|
761
|
+
cred = credential.Credential(
|
762
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
763
|
+
)
|
764
|
+
http_profile = HttpProfile(
|
765
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
766
|
+
reqMethod="POST",
|
767
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
768
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
769
|
+
)
|
770
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
771
|
+
if g_param[OptionsDefine.Language]:
|
772
|
+
profile.language = g_param[OptionsDefine.Language]
|
773
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
774
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
775
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
776
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
777
|
+
model = models.ListSharedKnowledgeRequest()
|
778
|
+
model.from_json_string(json.dumps(args))
|
779
|
+
start_time = time.time()
|
780
|
+
while True:
|
781
|
+
rsp = client.ListSharedKnowledge(model)
|
782
|
+
result = rsp.to_json_string()
|
783
|
+
try:
|
784
|
+
json_obj = json.loads(result)
|
785
|
+
except TypeError as e:
|
786
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
787
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
788
|
+
break
|
789
|
+
cur_time = time.time()
|
790
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
791
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
792
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
793
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
794
|
+
else:
|
795
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
796
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
797
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
|
+
|
799
|
+
|
696
800
|
def doDescribeAttributeLabel(args, parsed_globals):
|
697
801
|
g_param = parse_global_arg(parsed_globals)
|
698
802
|
|
@@ -797,7 +901,7 @@ def doListRejectedQuestionPreview(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 doDescribeSharedKnowledge(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 doRunReRank(args, parsed_globals):
|
|
826
930
|
client = mod.LkeClient(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.DescribeSharedKnowledgeRequest()
|
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.DescribeSharedKnowledge(model)
|
834
938
|
result = rsp.to_json_string()
|
835
939
|
try:
|
836
940
|
json_obj = json.loads(result)
|
@@ -1265,6 +1369,58 @@ def doListReleaseConfigPreview(args, parsed_globals):
|
|
1265
1369
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1266
1370
|
|
1267
1371
|
|
1372
|
+
def doListReferShareKnowledge(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.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
1399
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1400
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1401
|
+
model = models.ListReferShareKnowledgeRequest()
|
1402
|
+
model.from_json_string(json.dumps(args))
|
1403
|
+
start_time = time.time()
|
1404
|
+
while True:
|
1405
|
+
rsp = client.ListReferShareKnowledge(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
|
+
|
1268
1424
|
def doDescribeSearchStatsGraph(args, parsed_globals):
|
1269
1425
|
g_param = parse_global_arg(parsed_globals)
|
1270
1426
|
|
@@ -2045,6 +2201,58 @@ def doDescribeCorp(args, parsed_globals):
|
|
2045
2201
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2046
2202
|
|
2047
2203
|
|
2204
|
+
def doCreateSharedKnowledge(args, parsed_globals):
|
2205
|
+
g_param = parse_global_arg(parsed_globals)
|
2206
|
+
|
2207
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2208
|
+
cred = credential.CVMRoleCredential()
|
2209
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2210
|
+
cred = credential.STSAssumeRoleCredential(
|
2211
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2212
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2213
|
+
)
|
2214
|
+
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):
|
2215
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2216
|
+
else:
|
2217
|
+
cred = credential.Credential(
|
2218
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2219
|
+
)
|
2220
|
+
http_profile = HttpProfile(
|
2221
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2222
|
+
reqMethod="POST",
|
2223
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2224
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2225
|
+
)
|
2226
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2227
|
+
if g_param[OptionsDefine.Language]:
|
2228
|
+
profile.language = g_param[OptionsDefine.Language]
|
2229
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2230
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2231
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2232
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2233
|
+
model = models.CreateSharedKnowledgeRequest()
|
2234
|
+
model.from_json_string(json.dumps(args))
|
2235
|
+
start_time = time.time()
|
2236
|
+
while True:
|
2237
|
+
rsp = client.CreateSharedKnowledge(model)
|
2238
|
+
result = rsp.to_json_string()
|
2239
|
+
try:
|
2240
|
+
json_obj = json.loads(result)
|
2241
|
+
except TypeError as e:
|
2242
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2243
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2244
|
+
break
|
2245
|
+
cur_time = time.time()
|
2246
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2247
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2248
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2249
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2250
|
+
else:
|
2251
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2252
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2253
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2254
|
+
|
2255
|
+
|
2048
2256
|
def doDescribeUnsatisfiedReplyContext(args, parsed_globals):
|
2049
2257
|
g_param = parse_global_arg(parsed_globals)
|
2050
2258
|
|
@@ -2253,6 +2461,110 @@ def doDescribeTokenUsage(args, parsed_globals):
|
|
2253
2461
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2254
2462
|
|
2255
2463
|
|
2464
|
+
def doDescribeNodeRun(args, parsed_globals):
|
2465
|
+
g_param = parse_global_arg(parsed_globals)
|
2466
|
+
|
2467
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2468
|
+
cred = credential.CVMRoleCredential()
|
2469
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2470
|
+
cred = credential.STSAssumeRoleCredential(
|
2471
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2472
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2473
|
+
)
|
2474
|
+
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):
|
2475
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2476
|
+
else:
|
2477
|
+
cred = credential.Credential(
|
2478
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2479
|
+
)
|
2480
|
+
http_profile = HttpProfile(
|
2481
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2482
|
+
reqMethod="POST",
|
2483
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2484
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2485
|
+
)
|
2486
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2487
|
+
if g_param[OptionsDefine.Language]:
|
2488
|
+
profile.language = g_param[OptionsDefine.Language]
|
2489
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2490
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2491
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2492
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2493
|
+
model = models.DescribeNodeRunRequest()
|
2494
|
+
model.from_json_string(json.dumps(args))
|
2495
|
+
start_time = time.time()
|
2496
|
+
while True:
|
2497
|
+
rsp = client.DescribeNodeRun(model)
|
2498
|
+
result = rsp.to_json_string()
|
2499
|
+
try:
|
2500
|
+
json_obj = json.loads(result)
|
2501
|
+
except TypeError as e:
|
2502
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2503
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2504
|
+
break
|
2505
|
+
cur_time = time.time()
|
2506
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2507
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2508
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2509
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2510
|
+
else:
|
2511
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2512
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2513
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2514
|
+
|
2515
|
+
|
2516
|
+
def doListWorkflowRuns(args, parsed_globals):
|
2517
|
+
g_param = parse_global_arg(parsed_globals)
|
2518
|
+
|
2519
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2520
|
+
cred = credential.CVMRoleCredential()
|
2521
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2522
|
+
cred = credential.STSAssumeRoleCredential(
|
2523
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2524
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2525
|
+
)
|
2526
|
+
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):
|
2527
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2528
|
+
else:
|
2529
|
+
cred = credential.Credential(
|
2530
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2531
|
+
)
|
2532
|
+
http_profile = HttpProfile(
|
2533
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2534
|
+
reqMethod="POST",
|
2535
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2536
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2537
|
+
)
|
2538
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2539
|
+
if g_param[OptionsDefine.Language]:
|
2540
|
+
profile.language = g_param[OptionsDefine.Language]
|
2541
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2542
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2543
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2544
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2545
|
+
model = models.ListWorkflowRunsRequest()
|
2546
|
+
model.from_json_string(json.dumps(args))
|
2547
|
+
start_time = time.time()
|
2548
|
+
while True:
|
2549
|
+
rsp = client.ListWorkflowRuns(model)
|
2550
|
+
result = rsp.to_json_string()
|
2551
|
+
try:
|
2552
|
+
json_obj = json.loads(result)
|
2553
|
+
except TypeError as e:
|
2554
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2555
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2556
|
+
break
|
2557
|
+
cur_time = time.time()
|
2558
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2559
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2560
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2561
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2562
|
+
else:
|
2563
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2564
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2565
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2566
|
+
|
2567
|
+
|
2256
2568
|
def doListQACate(args, parsed_globals):
|
2257
2569
|
g_param = parse_global_arg(parsed_globals)
|
2258
2570
|
|
@@ -2282,11 +2594,167 @@ def doListQACate(args, parsed_globals):
|
|
2282
2594
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2283
2595
|
client._sdkVersion += ("_CLI_" + __version__)
|
2284
2596
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2285
|
-
model = models.ListQACateRequest()
|
2597
|
+
model = models.ListQACateRequest()
|
2598
|
+
model.from_json_string(json.dumps(args))
|
2599
|
+
start_time = time.time()
|
2600
|
+
while True:
|
2601
|
+
rsp = client.ListQACate(model)
|
2602
|
+
result = rsp.to_json_string()
|
2603
|
+
try:
|
2604
|
+
json_obj = json.loads(result)
|
2605
|
+
except TypeError as e:
|
2606
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2607
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2608
|
+
break
|
2609
|
+
cur_time = time.time()
|
2610
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2611
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2612
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2613
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2614
|
+
else:
|
2615
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2616
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2617
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2618
|
+
|
2619
|
+
|
2620
|
+
def doListAppCategory(args, parsed_globals):
|
2621
|
+
g_param = parse_global_arg(parsed_globals)
|
2622
|
+
|
2623
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2624
|
+
cred = credential.CVMRoleCredential()
|
2625
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2626
|
+
cred = credential.STSAssumeRoleCredential(
|
2627
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2628
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2629
|
+
)
|
2630
|
+
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):
|
2631
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2632
|
+
else:
|
2633
|
+
cred = credential.Credential(
|
2634
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2635
|
+
)
|
2636
|
+
http_profile = HttpProfile(
|
2637
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2638
|
+
reqMethod="POST",
|
2639
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2640
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2641
|
+
)
|
2642
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2643
|
+
if g_param[OptionsDefine.Language]:
|
2644
|
+
profile.language = g_param[OptionsDefine.Language]
|
2645
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2646
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2647
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2648
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2649
|
+
model = models.ListAppCategoryRequest()
|
2650
|
+
model.from_json_string(json.dumps(args))
|
2651
|
+
start_time = time.time()
|
2652
|
+
while True:
|
2653
|
+
rsp = client.ListAppCategory(model)
|
2654
|
+
result = rsp.to_json_string()
|
2655
|
+
try:
|
2656
|
+
json_obj = json.loads(result)
|
2657
|
+
except TypeError as e:
|
2658
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2659
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2660
|
+
break
|
2661
|
+
cur_time = time.time()
|
2662
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2663
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2664
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2665
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2666
|
+
else:
|
2667
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2668
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2669
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2670
|
+
|
2671
|
+
|
2672
|
+
def doDescribeQA(args, parsed_globals):
|
2673
|
+
g_param = parse_global_arg(parsed_globals)
|
2674
|
+
|
2675
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2676
|
+
cred = credential.CVMRoleCredential()
|
2677
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2678
|
+
cred = credential.STSAssumeRoleCredential(
|
2679
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2680
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2681
|
+
)
|
2682
|
+
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):
|
2683
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2684
|
+
else:
|
2685
|
+
cred = credential.Credential(
|
2686
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2687
|
+
)
|
2688
|
+
http_profile = HttpProfile(
|
2689
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2690
|
+
reqMethod="POST",
|
2691
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2692
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2693
|
+
)
|
2694
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2695
|
+
if g_param[OptionsDefine.Language]:
|
2696
|
+
profile.language = g_param[OptionsDefine.Language]
|
2697
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2698
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2699
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2700
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2701
|
+
model = models.DescribeQARequest()
|
2702
|
+
model.from_json_string(json.dumps(args))
|
2703
|
+
start_time = time.time()
|
2704
|
+
while True:
|
2705
|
+
rsp = client.DescribeQA(model)
|
2706
|
+
result = rsp.to_json_string()
|
2707
|
+
try:
|
2708
|
+
json_obj = json.loads(result)
|
2709
|
+
except TypeError as e:
|
2710
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2711
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2712
|
+
break
|
2713
|
+
cur_time = time.time()
|
2714
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2715
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2716
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2717
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2718
|
+
else:
|
2719
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2720
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2721
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2722
|
+
|
2723
|
+
|
2724
|
+
def doCreateApp(args, parsed_globals):
|
2725
|
+
g_param = parse_global_arg(parsed_globals)
|
2726
|
+
|
2727
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2728
|
+
cred = credential.CVMRoleCredential()
|
2729
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2730
|
+
cred = credential.STSAssumeRoleCredential(
|
2731
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2732
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2733
|
+
)
|
2734
|
+
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):
|
2735
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2736
|
+
else:
|
2737
|
+
cred = credential.Credential(
|
2738
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2739
|
+
)
|
2740
|
+
http_profile = HttpProfile(
|
2741
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2742
|
+
reqMethod="POST",
|
2743
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2744
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2745
|
+
)
|
2746
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2747
|
+
if g_param[OptionsDefine.Language]:
|
2748
|
+
profile.language = g_param[OptionsDefine.Language]
|
2749
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2750
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2751
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2752
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2753
|
+
model = models.CreateAppRequest()
|
2286
2754
|
model.from_json_string(json.dumps(args))
|
2287
2755
|
start_time = time.time()
|
2288
2756
|
while True:
|
2289
|
-
rsp = client.
|
2757
|
+
rsp = client.CreateApp(model)
|
2290
2758
|
result = rsp.to_json_string()
|
2291
2759
|
try:
|
2292
2760
|
json_obj = json.loads(result)
|
@@ -2305,7 +2773,7 @@ def doListQACate(args, parsed_globals):
|
|
2305
2773
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2306
2774
|
|
2307
2775
|
|
2308
|
-
def
|
2776
|
+
def doModifyDoc(args, parsed_globals):
|
2309
2777
|
g_param = parse_global_arg(parsed_globals)
|
2310
2778
|
|
2311
2779
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2334,11 +2802,11 @@ def doListAppCategory(args, parsed_globals):
|
|
2334
2802
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2335
2803
|
client._sdkVersion += ("_CLI_" + __version__)
|
2336
2804
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2337
|
-
model = models.
|
2805
|
+
model = models.ModifyDocRequest()
|
2338
2806
|
model.from_json_string(json.dumps(args))
|
2339
2807
|
start_time = time.time()
|
2340
2808
|
while True:
|
2341
|
-
rsp = client.
|
2809
|
+
rsp = client.ModifyDoc(model)
|
2342
2810
|
result = rsp.to_json_string()
|
2343
2811
|
try:
|
2344
2812
|
json_obj = json.loads(result)
|
@@ -2357,7 +2825,7 @@ def doListAppCategory(args, parsed_globals):
|
|
2357
2825
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2358
2826
|
|
2359
2827
|
|
2360
|
-
def
|
2828
|
+
def doCreateQACate(args, parsed_globals):
|
2361
2829
|
g_param = parse_global_arg(parsed_globals)
|
2362
2830
|
|
2363
2831
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2386,11 +2854,11 @@ def doDescribeQA(args, parsed_globals):
|
|
2386
2854
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2387
2855
|
client._sdkVersion += ("_CLI_" + __version__)
|
2388
2856
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2389
|
-
model = models.
|
2857
|
+
model = models.CreateQACateRequest()
|
2390
2858
|
model.from_json_string(json.dumps(args))
|
2391
2859
|
start_time = time.time()
|
2392
2860
|
while True:
|
2393
|
-
rsp = client.
|
2861
|
+
rsp = client.CreateQACate(model)
|
2394
2862
|
result = rsp.to_json_string()
|
2395
2863
|
try:
|
2396
2864
|
json_obj = json.loads(result)
|
@@ -2409,7 +2877,7 @@ def doDescribeQA(args, parsed_globals):
|
|
2409
2877
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2410
2878
|
|
2411
2879
|
|
2412
|
-
def
|
2880
|
+
def doUpdateSharedKnowledge(args, parsed_globals):
|
2413
2881
|
g_param = parse_global_arg(parsed_globals)
|
2414
2882
|
|
2415
2883
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2438,11 +2906,11 @@ def doCreateApp(args, parsed_globals):
|
|
2438
2906
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2439
2907
|
client._sdkVersion += ("_CLI_" + __version__)
|
2440
2908
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2441
|
-
model = models.
|
2909
|
+
model = models.UpdateSharedKnowledgeRequest()
|
2442
2910
|
model.from_json_string(json.dumps(args))
|
2443
2911
|
start_time = time.time()
|
2444
2912
|
while True:
|
2445
|
-
rsp = client.
|
2913
|
+
rsp = client.UpdateSharedKnowledge(model)
|
2446
2914
|
result = rsp.to_json_string()
|
2447
2915
|
try:
|
2448
2916
|
json_obj = json.loads(result)
|
@@ -2461,7 +2929,7 @@ def doCreateApp(args, parsed_globals):
|
|
2461
2929
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
2930
|
|
2463
2931
|
|
2464
|
-
def
|
2932
|
+
def doExportAttributeLabel(args, parsed_globals):
|
2465
2933
|
g_param = parse_global_arg(parsed_globals)
|
2466
2934
|
|
2467
2935
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2490,11 +2958,11 @@ def doModifyDoc(args, parsed_globals):
|
|
2490
2958
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2491
2959
|
client._sdkVersion += ("_CLI_" + __version__)
|
2492
2960
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2493
|
-
model = models.
|
2961
|
+
model = models.ExportAttributeLabelRequest()
|
2494
2962
|
model.from_json_string(json.dumps(args))
|
2495
2963
|
start_time = time.time()
|
2496
2964
|
while True:
|
2497
|
-
rsp = client.
|
2965
|
+
rsp = client.ExportAttributeLabel(model)
|
2498
2966
|
result = rsp.to_json_string()
|
2499
2967
|
try:
|
2500
2968
|
json_obj = json.loads(result)
|
@@ -2513,7 +2981,7 @@ def doModifyDoc(args, parsed_globals):
|
|
2513
2981
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2514
2982
|
|
2515
2983
|
|
2516
|
-
def
|
2984
|
+
def doDescribeRefer(args, parsed_globals):
|
2517
2985
|
g_param = parse_global_arg(parsed_globals)
|
2518
2986
|
|
2519
2987
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2542,11 +3010,11 @@ def doCreateQACate(args, parsed_globals):
|
|
2542
3010
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2543
3011
|
client._sdkVersion += ("_CLI_" + __version__)
|
2544
3012
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2545
|
-
model = models.
|
3013
|
+
model = models.DescribeReferRequest()
|
2546
3014
|
model.from_json_string(json.dumps(args))
|
2547
3015
|
start_time = time.time()
|
2548
3016
|
while True:
|
2549
|
-
rsp = client.
|
3017
|
+
rsp = client.DescribeRefer(model)
|
2550
3018
|
result = rsp.to_json_string()
|
2551
3019
|
try:
|
2552
3020
|
json_obj = json.loads(result)
|
@@ -2565,7 +3033,7 @@ def doCreateQACate(args, parsed_globals):
|
|
2565
3033
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2566
3034
|
|
2567
3035
|
|
2568
|
-
def
|
3036
|
+
def doDescribeKnowledgeUsage(args, parsed_globals):
|
2569
3037
|
g_param = parse_global_arg(parsed_globals)
|
2570
3038
|
|
2571
3039
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2594,11 +3062,11 @@ def doExportAttributeLabel(args, parsed_globals):
|
|
2594
3062
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2595
3063
|
client._sdkVersion += ("_CLI_" + __version__)
|
2596
3064
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2597
|
-
model = models.
|
3065
|
+
model = models.DescribeKnowledgeUsageRequest()
|
2598
3066
|
model.from_json_string(json.dumps(args))
|
2599
3067
|
start_time = time.time()
|
2600
3068
|
while True:
|
2601
|
-
rsp = client.
|
3069
|
+
rsp = client.DescribeKnowledgeUsage(model)
|
2602
3070
|
result = rsp.to_json_string()
|
2603
3071
|
try:
|
2604
3072
|
json_obj = json.loads(result)
|
@@ -2617,7 +3085,7 @@ def doExportAttributeLabel(args, parsed_globals):
|
|
2617
3085
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2618
3086
|
|
2619
3087
|
|
2620
|
-
def
|
3088
|
+
def doDeleteSharedKnowledge(args, parsed_globals):
|
2621
3089
|
g_param = parse_global_arg(parsed_globals)
|
2622
3090
|
|
2623
3091
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2646,11 +3114,11 @@ def doDescribeRefer(args, parsed_globals):
|
|
2646
3114
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2647
3115
|
client._sdkVersion += ("_CLI_" + __version__)
|
2648
3116
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2649
|
-
model = models.
|
3117
|
+
model = models.DeleteSharedKnowledgeRequest()
|
2650
3118
|
model.from_json_string(json.dumps(args))
|
2651
3119
|
start_time = time.time()
|
2652
3120
|
while True:
|
2653
|
-
rsp = client.
|
3121
|
+
rsp = client.DeleteSharedKnowledge(model)
|
2654
3122
|
result = rsp.to_json_string()
|
2655
3123
|
try:
|
2656
3124
|
json_obj = json.loads(result)
|
@@ -2669,7 +3137,7 @@ def doDescribeRefer(args, parsed_globals):
|
|
2669
3137
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2670
3138
|
|
2671
3139
|
|
2672
|
-
def
|
3140
|
+
def doDescribeRobotBizIDByAppKey(args, parsed_globals):
|
2673
3141
|
g_param = parse_global_arg(parsed_globals)
|
2674
3142
|
|
2675
3143
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2698,11 +3166,11 @@ def doDescribeKnowledgeUsage(args, parsed_globals):
|
|
2698
3166
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2699
3167
|
client._sdkVersion += ("_CLI_" + __version__)
|
2700
3168
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2701
|
-
model = models.
|
3169
|
+
model = models.DescribeRobotBizIDByAppKeyRequest()
|
2702
3170
|
model.from_json_string(json.dumps(args))
|
2703
3171
|
start_time = time.time()
|
2704
3172
|
while True:
|
2705
|
-
rsp = client.
|
3173
|
+
rsp = client.DescribeRobotBizIDByAppKey(model)
|
2706
3174
|
result = rsp.to_json_string()
|
2707
3175
|
try:
|
2708
3176
|
json_obj = json.loads(result)
|
@@ -2721,7 +3189,7 @@ def doDescribeKnowledgeUsage(args, parsed_globals):
|
|
2721
3189
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2722
3190
|
|
2723
3191
|
|
2724
|
-
def
|
3192
|
+
def doListDoc(args, parsed_globals):
|
2725
3193
|
g_param = parse_global_arg(parsed_globals)
|
2726
3194
|
|
2727
3195
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2750,11 +3218,11 @@ def doDescribeRobotBizIDByAppKey(args, parsed_globals):
|
|
2750
3218
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2751
3219
|
client._sdkVersion += ("_CLI_" + __version__)
|
2752
3220
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2753
|
-
model = models.
|
3221
|
+
model = models.ListDocRequest()
|
2754
3222
|
model.from_json_string(json.dumps(args))
|
2755
3223
|
start_time = time.time()
|
2756
3224
|
while True:
|
2757
|
-
rsp = client.
|
3225
|
+
rsp = client.ListDoc(model)
|
2758
3226
|
result = rsp.to_json_string()
|
2759
3227
|
try:
|
2760
3228
|
json_obj = json.loads(result)
|
@@ -2773,7 +3241,7 @@ def doDescribeRobotBizIDByAppKey(args, parsed_globals):
|
|
2773
3241
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2774
3242
|
|
2775
3243
|
|
2776
|
-
def
|
3244
|
+
def doCreateWorkflowRun(args, parsed_globals):
|
2777
3245
|
g_param = parse_global_arg(parsed_globals)
|
2778
3246
|
|
2779
3247
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2802,11 +3270,11 @@ def doListDoc(args, parsed_globals):
|
|
2802
3270
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2803
3271
|
client._sdkVersion += ("_CLI_" + __version__)
|
2804
3272
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2805
|
-
model = models.
|
3273
|
+
model = models.CreateWorkflowRunRequest()
|
2806
3274
|
model.from_json_string(json.dumps(args))
|
2807
3275
|
start_time = time.time()
|
2808
3276
|
while True:
|
2809
|
-
rsp = client.
|
3277
|
+
rsp = client.CreateWorkflowRun(model)
|
2810
3278
|
result = rsp.to_json_string()
|
2811
3279
|
try:
|
2812
3280
|
json_obj = json.loads(result)
|
@@ -3085,7 +3553,7 @@ def doExportQAList(args, parsed_globals):
|
|
3085
3553
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3086
3554
|
|
3087
3555
|
|
3088
|
-
def
|
3556
|
+
def doUploadAttributeLabel(args, parsed_globals):
|
3089
3557
|
g_param = parse_global_arg(parsed_globals)
|
3090
3558
|
|
3091
3559
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3114,11 +3582,11 @@ def doIgnoreUnsatisfiedReply(args, parsed_globals):
|
|
3114
3582
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
3115
3583
|
client._sdkVersion += ("_CLI_" + __version__)
|
3116
3584
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3117
|
-
model = models.
|
3585
|
+
model = models.UploadAttributeLabelRequest()
|
3118
3586
|
model.from_json_string(json.dumps(args))
|
3119
3587
|
start_time = time.time()
|
3120
3588
|
while True:
|
3121
|
-
rsp = client.
|
3589
|
+
rsp = client.UploadAttributeLabel(model)
|
3122
3590
|
result = rsp.to_json_string()
|
3123
3591
|
try:
|
3124
3592
|
json_obj = json.loads(result)
|
@@ -3137,7 +3605,7 @@ def doIgnoreUnsatisfiedReply(args, parsed_globals):
|
|
3137
3605
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3138
3606
|
|
3139
3607
|
|
3140
|
-
def
|
3608
|
+
def doDescribeReleaseInfo(args, parsed_globals):
|
3141
3609
|
g_param = parse_global_arg(parsed_globals)
|
3142
3610
|
|
3143
3611
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3166,11 +3634,11 @@ def doUploadAttributeLabel(args, parsed_globals):
|
|
3166
3634
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
3167
3635
|
client._sdkVersion += ("_CLI_" + __version__)
|
3168
3636
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3169
|
-
model = models.
|
3637
|
+
model = models.DescribeReleaseInfoRequest()
|
3170
3638
|
model.from_json_string(json.dumps(args))
|
3171
3639
|
start_time = time.time()
|
3172
3640
|
while True:
|
3173
|
-
rsp = client.
|
3641
|
+
rsp = client.DescribeReleaseInfo(model)
|
3174
3642
|
result = rsp.to_json_string()
|
3175
3643
|
try:
|
3176
3644
|
json_obj = json.loads(result)
|
@@ -3293,7 +3761,7 @@ def doDescribeConcurrencyUsage(args, parsed_globals):
|
|
3293
3761
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3294
3762
|
|
3295
3763
|
|
3296
|
-
def
|
3764
|
+
def doCreateCorp(args, parsed_globals):
|
3297
3765
|
g_param = parse_global_arg(parsed_globals)
|
3298
3766
|
|
3299
3767
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3322,11 +3790,11 @@ def doModifyRejectedQuestion(args, parsed_globals):
|
|
3322
3790
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
3323
3791
|
client._sdkVersion += ("_CLI_" + __version__)
|
3324
3792
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3325
|
-
model = models.
|
3793
|
+
model = models.CreateCorpRequest()
|
3326
3794
|
model.from_json_string(json.dumps(args))
|
3327
3795
|
start_time = time.time()
|
3328
3796
|
while True:
|
3329
|
-
rsp = client.
|
3797
|
+
rsp = client.CreateCorp(model)
|
3330
3798
|
result = rsp.to_json_string()
|
3331
3799
|
try:
|
3332
3800
|
json_obj = json.loads(result)
|
@@ -3397,7 +3865,7 @@ def doIsTransferIntent(args, parsed_globals):
|
|
3397
3865
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3398
3866
|
|
3399
3867
|
|
3400
|
-
def
|
3868
|
+
def doIgnoreUnsatisfiedReply(args, parsed_globals):
|
3401
3869
|
g_param = parse_global_arg(parsed_globals)
|
3402
3870
|
|
3403
3871
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3426,11 +3894,63 @@ def doDescribeReleaseInfo(args, parsed_globals):
|
|
3426
3894
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
3427
3895
|
client._sdkVersion += ("_CLI_" + __version__)
|
3428
3896
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3429
|
-
model = models.
|
3897
|
+
model = models.IgnoreUnsatisfiedReplyRequest()
|
3430
3898
|
model.from_json_string(json.dumps(args))
|
3431
3899
|
start_time = time.time()
|
3432
3900
|
while True:
|
3433
|
-
rsp = client.
|
3901
|
+
rsp = client.IgnoreUnsatisfiedReply(model)
|
3902
|
+
result = rsp.to_json_string()
|
3903
|
+
try:
|
3904
|
+
json_obj = json.loads(result)
|
3905
|
+
except TypeError as e:
|
3906
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3907
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3908
|
+
break
|
3909
|
+
cur_time = time.time()
|
3910
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3911
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3912
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3913
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3914
|
+
else:
|
3915
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3916
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3917
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3918
|
+
|
3919
|
+
|
3920
|
+
def doReferShareKnowledge(args, parsed_globals):
|
3921
|
+
g_param = parse_global_arg(parsed_globals)
|
3922
|
+
|
3923
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3924
|
+
cred = credential.CVMRoleCredential()
|
3925
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3926
|
+
cred = credential.STSAssumeRoleCredential(
|
3927
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3928
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3929
|
+
)
|
3930
|
+
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):
|
3931
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3932
|
+
else:
|
3933
|
+
cred = credential.Credential(
|
3934
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3935
|
+
)
|
3936
|
+
http_profile = HttpProfile(
|
3937
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3938
|
+
reqMethod="POST",
|
3939
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3940
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3941
|
+
)
|
3942
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3943
|
+
if g_param[OptionsDefine.Language]:
|
3944
|
+
profile.language = g_param[OptionsDefine.Language]
|
3945
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3946
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
3947
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3948
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3949
|
+
model = models.ReferShareKnowledgeRequest()
|
3950
|
+
model.from_json_string(json.dumps(args))
|
3951
|
+
start_time = time.time()
|
3952
|
+
while True:
|
3953
|
+
rsp = client.ReferShareKnowledge(model)
|
3434
3954
|
result = rsp.to_json_string()
|
3435
3955
|
try:
|
3436
3956
|
json_obj = json.loads(result)
|
@@ -4021,7 +4541,7 @@ def doQueryRewrite(args, parsed_globals):
|
|
4021
4541
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4022
4542
|
|
4023
4543
|
|
4024
|
-
def
|
4544
|
+
def doRetryDocAudit(args, parsed_globals):
|
4025
4545
|
g_param = parse_global_arg(parsed_globals)
|
4026
4546
|
|
4027
4547
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -4050,11 +4570,11 @@ def doListDocCate(args, parsed_globals):
|
|
4050
4570
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
4051
4571
|
client._sdkVersion += ("_CLI_" + __version__)
|
4052
4572
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4053
|
-
model = models.
|
4573
|
+
model = models.RetryDocAuditRequest()
|
4054
4574
|
model.from_json_string(json.dumps(args))
|
4055
4575
|
start_time = time.time()
|
4056
4576
|
while True:
|
4057
|
-
rsp = client.
|
4577
|
+
rsp = client.RetryDocAudit(model)
|
4058
4578
|
result = rsp.to_json_string()
|
4059
4579
|
try:
|
4060
4580
|
json_obj = json.loads(result)
|
@@ -4333,6 +4853,58 @@ def doGetAnswerTypeDataCount(args, parsed_globals):
|
|
4333
4853
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4334
4854
|
|
4335
4855
|
|
4856
|
+
def doDescribeWorkflowRun(args, parsed_globals):
|
4857
|
+
g_param = parse_global_arg(parsed_globals)
|
4858
|
+
|
4859
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
4860
|
+
cred = credential.CVMRoleCredential()
|
4861
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
4862
|
+
cred = credential.STSAssumeRoleCredential(
|
4863
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
4864
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
4865
|
+
)
|
4866
|
+
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):
|
4867
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
4868
|
+
else:
|
4869
|
+
cred = credential.Credential(
|
4870
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
4871
|
+
)
|
4872
|
+
http_profile = HttpProfile(
|
4873
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
4874
|
+
reqMethod="POST",
|
4875
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
4876
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
4877
|
+
)
|
4878
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
4879
|
+
if g_param[OptionsDefine.Language]:
|
4880
|
+
profile.language = g_param[OptionsDefine.Language]
|
4881
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
4882
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
4883
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
4884
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4885
|
+
model = models.DescribeWorkflowRunRequest()
|
4886
|
+
model.from_json_string(json.dumps(args))
|
4887
|
+
start_time = time.time()
|
4888
|
+
while True:
|
4889
|
+
rsp = client.DescribeWorkflowRun(model)
|
4890
|
+
result = rsp.to_json_string()
|
4891
|
+
try:
|
4892
|
+
json_obj = json.loads(result)
|
4893
|
+
except TypeError as e:
|
4894
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
4895
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
4896
|
+
break
|
4897
|
+
cur_time = time.time()
|
4898
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
4899
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
4900
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
4901
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
4902
|
+
else:
|
4903
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
4904
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
4905
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4906
|
+
|
4907
|
+
|
4336
4908
|
def doListReleaseDocPreview(args, parsed_globals):
|
4337
4909
|
g_param = parse_global_arg(parsed_globals)
|
4338
4910
|
|
@@ -4437,7 +5009,7 @@ def doDescribeRelease(args, parsed_globals):
|
|
4437
5009
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4438
5010
|
|
4439
5011
|
|
4440
|
-
def
|
5012
|
+
def doModifyRejectedQuestion(args, parsed_globals):
|
4441
5013
|
g_param = parse_global_arg(parsed_globals)
|
4442
5014
|
|
4443
5015
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -4466,11 +5038,11 @@ def doCreateCorp(args, parsed_globals):
|
|
4466
5038
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
4467
5039
|
client._sdkVersion += ("_CLI_" + __version__)
|
4468
5040
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4469
|
-
model = models.
|
5041
|
+
model = models.ModifyRejectedQuestionRequest()
|
4470
5042
|
model.from_json_string(json.dumps(args))
|
4471
5043
|
start_time = time.time()
|
4472
5044
|
while True:
|
4473
|
-
rsp = client.
|
5045
|
+
rsp = client.ModifyRejectedQuestion(model)
|
4474
5046
|
result = rsp.to_json_string()
|
4475
5047
|
try:
|
4476
5048
|
json_obj = json.loads(result)
|
@@ -4853,6 +5425,58 @@ def doDescribeSegments(args, parsed_globals):
|
|
4853
5425
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4854
5426
|
|
4855
5427
|
|
5428
|
+
def doRunReRank(args, parsed_globals):
|
5429
|
+
g_param = parse_global_arg(parsed_globals)
|
5430
|
+
|
5431
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
5432
|
+
cred = credential.CVMRoleCredential()
|
5433
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
5434
|
+
cred = credential.STSAssumeRoleCredential(
|
5435
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
5436
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
5437
|
+
)
|
5438
|
+
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):
|
5439
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
5440
|
+
else:
|
5441
|
+
cred = credential.Credential(
|
5442
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
5443
|
+
)
|
5444
|
+
http_profile = HttpProfile(
|
5445
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
5446
|
+
reqMethod="POST",
|
5447
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
5448
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
5449
|
+
)
|
5450
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
5451
|
+
if g_param[OptionsDefine.Language]:
|
5452
|
+
profile.language = g_param[OptionsDefine.Language]
|
5453
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
5454
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
5455
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
5456
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
5457
|
+
model = models.RunReRankRequest()
|
5458
|
+
model.from_json_string(json.dumps(args))
|
5459
|
+
start_time = time.time()
|
5460
|
+
while True:
|
5461
|
+
rsp = client.RunReRank(model)
|
5462
|
+
result = rsp.to_json_string()
|
5463
|
+
try:
|
5464
|
+
json_obj = json.loads(result)
|
5465
|
+
except TypeError as e:
|
5466
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
5467
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
5468
|
+
break
|
5469
|
+
cur_time = time.time()
|
5470
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
5471
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
5472
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
5473
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
5474
|
+
else:
|
5475
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
5476
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
5477
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5478
|
+
|
5479
|
+
|
4856
5480
|
def doGetTaskStatus(args, parsed_globals):
|
4857
5481
|
g_param = parse_global_arg(parsed_globals)
|
4858
5482
|
|
@@ -5082,12 +5706,14 @@ ACTION_MAP = {
|
|
5082
5706
|
"ModifyDocAttrRange": doModifyDocAttrRange,
|
5083
5707
|
"CreateRelease": doCreateRelease,
|
5084
5708
|
"DeleteQA": doDeleteQA,
|
5709
|
+
"StopWorkflowRun": doStopWorkflowRun,
|
5085
5710
|
"CreateAttributeLabel": doCreateAttributeLabel,
|
5086
|
-
"
|
5711
|
+
"ListDocCate": doListDocCate,
|
5087
5712
|
"GenerateQA": doGenerateQA,
|
5713
|
+
"ListSharedKnowledge": doListSharedKnowledge,
|
5088
5714
|
"DescribeAttributeLabel": doDescribeAttributeLabel,
|
5089
5715
|
"ListRejectedQuestionPreview": doListRejectedQuestionPreview,
|
5090
|
-
"
|
5716
|
+
"DescribeSharedKnowledge": doDescribeSharedKnowledge,
|
5091
5717
|
"RetryDocParse": doRetryDocParse,
|
5092
5718
|
"CreateQA": doCreateQA,
|
5093
5719
|
"DescribeTokenUsageGraph": doDescribeTokenUsageGraph,
|
@@ -5096,6 +5722,7 @@ ACTION_MAP = {
|
|
5096
5722
|
"GetWsToken": doGetWsToken,
|
5097
5723
|
"ListAttributeLabel": doListAttributeLabel,
|
5098
5724
|
"ListReleaseConfigPreview": doListReleaseConfigPreview,
|
5725
|
+
"ListReferShareKnowledge": doListReferShareKnowledge,
|
5099
5726
|
"DescribeSearchStatsGraph": doDescribeSearchStatsGraph,
|
5100
5727
|
"DeleteDocCate": doDeleteDocCate,
|
5101
5728
|
"VerifyQA": doVerifyQA,
|
@@ -5111,33 +5738,40 @@ ACTION_MAP = {
|
|
5111
5738
|
"DeleteApp": doDeleteApp,
|
5112
5739
|
"CheckAttributeLabelRefer": doCheckAttributeLabelRefer,
|
5113
5740
|
"DescribeCorp": doDescribeCorp,
|
5741
|
+
"CreateSharedKnowledge": doCreateSharedKnowledge,
|
5114
5742
|
"DescribeUnsatisfiedReplyContext": doDescribeUnsatisfiedReplyContext,
|
5115
5743
|
"GroupDoc": doGroupDoc,
|
5116
5744
|
"ListApp": doListApp,
|
5117
5745
|
"DescribeTokenUsage": doDescribeTokenUsage,
|
5746
|
+
"DescribeNodeRun": doDescribeNodeRun,
|
5747
|
+
"ListWorkflowRuns": doListWorkflowRuns,
|
5118
5748
|
"ListQACate": doListQACate,
|
5119
5749
|
"ListAppCategory": doListAppCategory,
|
5120
5750
|
"DescribeQA": doDescribeQA,
|
5121
5751
|
"CreateApp": doCreateApp,
|
5122
5752
|
"ModifyDoc": doModifyDoc,
|
5123
5753
|
"CreateQACate": doCreateQACate,
|
5754
|
+
"UpdateSharedKnowledge": doUpdateSharedKnowledge,
|
5124
5755
|
"ExportAttributeLabel": doExportAttributeLabel,
|
5125
5756
|
"DescribeRefer": doDescribeRefer,
|
5126
5757
|
"DescribeKnowledgeUsage": doDescribeKnowledgeUsage,
|
5758
|
+
"DeleteSharedKnowledge": doDeleteSharedKnowledge,
|
5127
5759
|
"DescribeRobotBizIDByAppKey": doDescribeRobotBizIDByAppKey,
|
5128
5760
|
"ListDoc": doListDoc,
|
5761
|
+
"CreateWorkflowRun": doCreateWorkflowRun,
|
5129
5762
|
"ListQA": doListQA,
|
5130
5763
|
"CreateVar": doCreateVar,
|
5131
5764
|
"GetLikeDataCount": doGetLikeDataCount,
|
5132
5765
|
"ModifyDocCate": doModifyDocCate,
|
5133
5766
|
"ExportQAList": doExportQAList,
|
5134
|
-
"IgnoreUnsatisfiedReply": doIgnoreUnsatisfiedReply,
|
5135
5767
|
"UploadAttributeLabel": doUploadAttributeLabel,
|
5768
|
+
"DescribeReleaseInfo": doDescribeReleaseInfo,
|
5136
5769
|
"GetDocPreview": doGetDocPreview,
|
5137
5770
|
"DescribeConcurrencyUsage": doDescribeConcurrencyUsage,
|
5138
|
-
"
|
5771
|
+
"CreateCorp": doCreateCorp,
|
5139
5772
|
"IsTransferIntent": doIsTransferIntent,
|
5140
|
-
"
|
5773
|
+
"IgnoreUnsatisfiedReply": doIgnoreUnsatisfiedReply,
|
5774
|
+
"ReferShareKnowledge": doReferShareKnowledge,
|
5141
5775
|
"ListRelease": doListRelease,
|
5142
5776
|
"ListModel": doListModel,
|
5143
5777
|
"ListRejectedQuestion": doListRejectedQuestion,
|
@@ -5149,15 +5783,16 @@ ACTION_MAP = {
|
|
5149
5783
|
"CreateRejectedQuestion": doCreateRejectedQuestion,
|
5150
5784
|
"DeleteRejectedQuestion": doDeleteRejectedQuestion,
|
5151
5785
|
"QueryRewrite": doQueryRewrite,
|
5152
|
-
"
|
5786
|
+
"RetryDocAudit": doRetryDocAudit,
|
5153
5787
|
"ModifyApp": doModifyApp,
|
5154
5788
|
"GetEmbedding": doGetEmbedding,
|
5155
5789
|
"GetAppSecret": doGetAppSecret,
|
5156
5790
|
"ModifyAttributeLabel": doModifyAttributeLabel,
|
5157
5791
|
"GetAnswerTypeDataCount": doGetAnswerTypeDataCount,
|
5792
|
+
"DescribeWorkflowRun": doDescribeWorkflowRun,
|
5158
5793
|
"ListReleaseDocPreview": doListReleaseDocPreview,
|
5159
5794
|
"DescribeRelease": doDescribeRelease,
|
5160
|
-
"
|
5795
|
+
"ModifyRejectedQuestion": doModifyRejectedQuestion,
|
5161
5796
|
"GetAppKnowledgeCount": doGetAppKnowledgeCount,
|
5162
5797
|
"DescribeConcurrencyUsageGraph": doDescribeConcurrencyUsageGraph,
|
5163
5798
|
"GetMsgRecord": doGetMsgRecord,
|
@@ -5165,6 +5800,7 @@ ACTION_MAP = {
|
|
5165
5800
|
"DescribeCallStatsGraph": doDescribeCallStatsGraph,
|
5166
5801
|
"GroupQA": doGroupQA,
|
5167
5802
|
"DescribeSegments": doDescribeSegments,
|
5803
|
+
"RunReRank": doRunReRank,
|
5168
5804
|
"GetTaskStatus": doGetTaskStatus,
|
5169
5805
|
"ReconstructDocument": doReconstructDocument,
|
5170
5806
|
"ListAppKnowledgeDetail": doListAppKnowledgeDetail,
|