tccli 3.0.1328.1__py2.py3-none-any.whl → 3.0.1331.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/autoscaling/v20180419/api.json +3 -3
- tccli/services/autoscaling/v20180419/examples.json +1 -1
- tccli/services/btoe/v20210514/api.json +26 -26
- tccli/services/cbs/v20170312/api.json +13 -13
- tccli/services/ccc/ccc_client.py +53 -0
- tccli/services/ccc/v20200210/api.json +105 -0
- tccli/services/ccc/v20200210/examples.json +8 -0
- tccli/services/cdn/v20180606/api.json +3 -3
- tccli/services/cdn/v20180606/examples.json +4 -4
- tccli/services/cdwch/v20200915/api.json +3 -3
- tccli/services/cdwch/v20200915/examples.json +1 -1
- tccli/services/ckafka/v20190819/api.json +9 -0
- tccli/services/clb/v20180317/api.json +18 -0
- tccli/services/dbbrain/v20210527/api.json +1 -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 +1 -1
- tccli/services/ess/v20201111/api.json +13 -4
- tccli/services/essbasic/v20210526/api.json +15 -6
- tccli/services/essbasic/v20210526/examples.json +3 -3
- tccli/services/faceid/v20180301/api.json +49 -4
- tccli/services/gs/gs_client.py +53 -0
- tccli/services/gs/v20191118/api.json +62 -9
- tccli/services/gs/v20191118/examples.json +8 -0
- tccli/services/hai/hai_client.py +110 -4
- tccli/services/hai/v20230812/api.json +105 -0
- tccli/services/hai/v20230812/examples.json +16 -0
- tccli/services/ioa/ioa_client.py +106 -0
- tccli/services/ioa/v20220601/api.json +428 -0
- tccli/services/ioa/v20220601/examples.json +22 -0
- tccli/services/iotexplorer/v20190423/api.json +61 -10
- tccli/services/iotexplorer/v20190423/examples.json +1 -1
- tccli/services/lighthouse/v20200324/api.json +1 -1
- tccli/services/lke/lke_client.py +383 -12
- tccli/services/lke/v20231130/api.json +950 -24
- tccli/services/lke/v20231130/examples.json +60 -4
- tccli/services/lowcode/v20210108/api.json +41 -1
- tccli/services/lowcode/v20210108/examples.json +2 -2
- tccli/services/mps/v20190612/api.json +11 -0
- tccli/services/ocr/ocr_client.py +532 -320
- tccli/services/ocr/v20181119/api.json +651 -74
- tccli/services/ocr/v20181119/examples.json +32 -0
- tccli/services/postgres/v20170312/api.json +1 -1
- tccli/services/sms/v20190711/api.json +4 -4
- tccli/services/sms/v20210111/api.json +4 -4
- tccli/services/sqlserver/v20180328/api.json +29 -2
- tccli/services/ssl/v20191205/api.json +79 -0
- tccli/services/ssl/v20191205/examples.json +6 -6
- tccli/services/tcss/tcss_client.py +57 -4
- tccli/services/tcss/v20201101/api.json +79 -0
- tccli/services/tcss/v20201101/examples.json +8 -0
- tccli/services/teo/v20220901/api.json +1 -1
- tccli/services/tke/tke_client.py +53 -0
- tccli/services/tke/v20180525/api.json +59 -1
- tccli/services/tke/v20180525/examples.json +4 -4
- tccli/services/tke/v20220501/api.json +61 -0
- tccli/services/tke/v20220501/examples.json +8 -0
- tccli/services/trtc/trtc_client.py +216 -4
- tccli/services/trtc/v20190722/api.json +430 -1
- tccli/services/trtc/v20190722/examples.json +32 -0
- tccli/services/vm/v20210922/api.json +16 -20
- tccli/services/vod/v20180717/api.json +25 -13
- tccli/services/vod/v20180717/examples.json +2 -2
- tccli/services/wedata/v20210820/api.json +4144 -447
- tccli/services/wedata/v20210820/examples.json +52 -10
- tccli/services/wedata/wedata_client.py +403 -85
- {tccli-3.0.1328.1.dist-info → tccli-3.0.1331.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1328.1.dist-info → tccli-3.0.1331.1.dist-info}/RECORD +73 -73
- {tccli-3.0.1328.1.dist-info → tccli-3.0.1331.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1328.1.dist-info → tccli-3.0.1331.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1328.1.dist-info → tccli-3.0.1331.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/lke/lke_client.py
CHANGED
@@ -693,6 +693,58 @@ def doGenerateQA(args, parsed_globals):
|
|
693
693
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
694
|
|
695
695
|
|
696
|
+
def doListSharedKnowledge(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.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
723
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
724
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
+
model = models.ListSharedKnowledgeRequest()
|
726
|
+
model.from_json_string(json.dumps(args))
|
727
|
+
start_time = time.time()
|
728
|
+
while True:
|
729
|
+
rsp = client.ListSharedKnowledge(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
|
+
|
696
748
|
def doDescribeAttributeLabel(args, parsed_globals):
|
697
749
|
g_param = parse_global_arg(parsed_globals)
|
698
750
|
|
@@ -797,7 +849,7 @@ def doListRejectedQuestionPreview(args, parsed_globals):
|
|
797
849
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
850
|
|
799
851
|
|
800
|
-
def
|
852
|
+
def doDescribeSharedKnowledge(args, parsed_globals):
|
801
853
|
g_param = parse_global_arg(parsed_globals)
|
802
854
|
|
803
855
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -826,11 +878,11 @@ def doRunReRank(args, parsed_globals):
|
|
826
878
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
827
879
|
client._sdkVersion += ("_CLI_" + __version__)
|
828
880
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
-
model = models.
|
881
|
+
model = models.DescribeSharedKnowledgeRequest()
|
830
882
|
model.from_json_string(json.dumps(args))
|
831
883
|
start_time = time.time()
|
832
884
|
while True:
|
833
|
-
rsp = client.
|
885
|
+
rsp = client.DescribeSharedKnowledge(model)
|
834
886
|
result = rsp.to_json_string()
|
835
887
|
try:
|
836
888
|
json_obj = json.loads(result)
|
@@ -1265,6 +1317,58 @@ def doListReleaseConfigPreview(args, parsed_globals):
|
|
1265
1317
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1266
1318
|
|
1267
1319
|
|
1320
|
+
def doListReferShareKnowledge(args, parsed_globals):
|
1321
|
+
g_param = parse_global_arg(parsed_globals)
|
1322
|
+
|
1323
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1324
|
+
cred = credential.CVMRoleCredential()
|
1325
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1326
|
+
cred = credential.STSAssumeRoleCredential(
|
1327
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1328
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1329
|
+
)
|
1330
|
+
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):
|
1331
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1332
|
+
else:
|
1333
|
+
cred = credential.Credential(
|
1334
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1335
|
+
)
|
1336
|
+
http_profile = HttpProfile(
|
1337
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1338
|
+
reqMethod="POST",
|
1339
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1340
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1341
|
+
)
|
1342
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1343
|
+
if g_param[OptionsDefine.Language]:
|
1344
|
+
profile.language = g_param[OptionsDefine.Language]
|
1345
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1346
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
1347
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1348
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1349
|
+
model = models.ListReferShareKnowledgeRequest()
|
1350
|
+
model.from_json_string(json.dumps(args))
|
1351
|
+
start_time = time.time()
|
1352
|
+
while True:
|
1353
|
+
rsp = client.ListReferShareKnowledge(model)
|
1354
|
+
result = rsp.to_json_string()
|
1355
|
+
try:
|
1356
|
+
json_obj = json.loads(result)
|
1357
|
+
except TypeError as e:
|
1358
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1359
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1360
|
+
break
|
1361
|
+
cur_time = time.time()
|
1362
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1363
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1364
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1365
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1366
|
+
else:
|
1367
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1368
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1369
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1370
|
+
|
1371
|
+
|
1268
1372
|
def doDescribeSearchStatsGraph(args, parsed_globals):
|
1269
1373
|
g_param = parse_global_arg(parsed_globals)
|
1270
1374
|
|
@@ -2045,6 +2149,58 @@ def doDescribeCorp(args, parsed_globals):
|
|
2045
2149
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2046
2150
|
|
2047
2151
|
|
2152
|
+
def doCreateSharedKnowledge(args, parsed_globals):
|
2153
|
+
g_param = parse_global_arg(parsed_globals)
|
2154
|
+
|
2155
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2156
|
+
cred = credential.CVMRoleCredential()
|
2157
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2158
|
+
cred = credential.STSAssumeRoleCredential(
|
2159
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2160
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2161
|
+
)
|
2162
|
+
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):
|
2163
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2164
|
+
else:
|
2165
|
+
cred = credential.Credential(
|
2166
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2167
|
+
)
|
2168
|
+
http_profile = HttpProfile(
|
2169
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2170
|
+
reqMethod="POST",
|
2171
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2172
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2173
|
+
)
|
2174
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2175
|
+
if g_param[OptionsDefine.Language]:
|
2176
|
+
profile.language = g_param[OptionsDefine.Language]
|
2177
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2178
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2179
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2180
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2181
|
+
model = models.CreateSharedKnowledgeRequest()
|
2182
|
+
model.from_json_string(json.dumps(args))
|
2183
|
+
start_time = time.time()
|
2184
|
+
while True:
|
2185
|
+
rsp = client.CreateSharedKnowledge(model)
|
2186
|
+
result = rsp.to_json_string()
|
2187
|
+
try:
|
2188
|
+
json_obj = json.loads(result)
|
2189
|
+
except TypeError as e:
|
2190
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2191
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2192
|
+
break
|
2193
|
+
cur_time = time.time()
|
2194
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2195
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2196
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2197
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2198
|
+
else:
|
2199
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2200
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2201
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2202
|
+
|
2203
|
+
|
2048
2204
|
def doDescribeUnsatisfiedReplyContext(args, parsed_globals):
|
2049
2205
|
g_param = parse_global_arg(parsed_globals)
|
2050
2206
|
|
@@ -2565,6 +2721,58 @@ def doCreateQACate(args, parsed_globals):
|
|
2565
2721
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2566
2722
|
|
2567
2723
|
|
2724
|
+
def doUpdateSharedKnowledge(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.UpdateSharedKnowledgeRequest()
|
2754
|
+
model.from_json_string(json.dumps(args))
|
2755
|
+
start_time = time.time()
|
2756
|
+
while True:
|
2757
|
+
rsp = client.UpdateSharedKnowledge(model)
|
2758
|
+
result = rsp.to_json_string()
|
2759
|
+
try:
|
2760
|
+
json_obj = json.loads(result)
|
2761
|
+
except TypeError as e:
|
2762
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2763
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2764
|
+
break
|
2765
|
+
cur_time = time.time()
|
2766
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2767
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2768
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2769
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2770
|
+
else:
|
2771
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2772
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2773
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2774
|
+
|
2775
|
+
|
2568
2776
|
def doExportAttributeLabel(args, parsed_globals):
|
2569
2777
|
g_param = parse_global_arg(parsed_globals)
|
2570
2778
|
|
@@ -2721,6 +2929,58 @@ def doDescribeKnowledgeUsage(args, parsed_globals):
|
|
2721
2929
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2722
2930
|
|
2723
2931
|
|
2932
|
+
def doDeleteSharedKnowledge(args, parsed_globals):
|
2933
|
+
g_param = parse_global_arg(parsed_globals)
|
2934
|
+
|
2935
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2936
|
+
cred = credential.CVMRoleCredential()
|
2937
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2938
|
+
cred = credential.STSAssumeRoleCredential(
|
2939
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2940
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2941
|
+
)
|
2942
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
2943
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2944
|
+
else:
|
2945
|
+
cred = credential.Credential(
|
2946
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2947
|
+
)
|
2948
|
+
http_profile = HttpProfile(
|
2949
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2950
|
+
reqMethod="POST",
|
2951
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2952
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2953
|
+
)
|
2954
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2955
|
+
if g_param[OptionsDefine.Language]:
|
2956
|
+
profile.language = g_param[OptionsDefine.Language]
|
2957
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2958
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2959
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2960
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2961
|
+
model = models.DeleteSharedKnowledgeRequest()
|
2962
|
+
model.from_json_string(json.dumps(args))
|
2963
|
+
start_time = time.time()
|
2964
|
+
while True:
|
2965
|
+
rsp = client.DeleteSharedKnowledge(model)
|
2966
|
+
result = rsp.to_json_string()
|
2967
|
+
try:
|
2968
|
+
json_obj = json.loads(result)
|
2969
|
+
except TypeError as e:
|
2970
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2971
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2972
|
+
break
|
2973
|
+
cur_time = time.time()
|
2974
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2975
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2976
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2977
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2978
|
+
else:
|
2979
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2980
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2981
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2982
|
+
|
2983
|
+
|
2724
2984
|
def doDescribeRobotBizIDByAppKey(args, parsed_globals):
|
2725
2985
|
g_param = parse_global_arg(parsed_globals)
|
2726
2986
|
|
@@ -3293,7 +3553,7 @@ def doDescribeConcurrencyUsage(args, parsed_globals):
|
|
3293
3553
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3294
3554
|
|
3295
3555
|
|
3296
|
-
def
|
3556
|
+
def doCreateCorp(args, parsed_globals):
|
3297
3557
|
g_param = parse_global_arg(parsed_globals)
|
3298
3558
|
|
3299
3559
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3322,11 +3582,11 @@ def doModifyRejectedQuestion(args, parsed_globals):
|
|
3322
3582
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
3323
3583
|
client._sdkVersion += ("_CLI_" + __version__)
|
3324
3584
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3325
|
-
model = models.
|
3585
|
+
model = models.CreateCorpRequest()
|
3326
3586
|
model.from_json_string(json.dumps(args))
|
3327
3587
|
start_time = time.time()
|
3328
3588
|
while True:
|
3329
|
-
rsp = client.
|
3589
|
+
rsp = client.CreateCorp(model)
|
3330
3590
|
result = rsp.to_json_string()
|
3331
3591
|
try:
|
3332
3592
|
json_obj = json.loads(result)
|
@@ -3449,6 +3709,58 @@ def doDescribeReleaseInfo(args, parsed_globals):
|
|
3449
3709
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3450
3710
|
|
3451
3711
|
|
3712
|
+
def doReferShareKnowledge(args, parsed_globals):
|
3713
|
+
g_param = parse_global_arg(parsed_globals)
|
3714
|
+
|
3715
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3716
|
+
cred = credential.CVMRoleCredential()
|
3717
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3718
|
+
cred = credential.STSAssumeRoleCredential(
|
3719
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3720
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3721
|
+
)
|
3722
|
+
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):
|
3723
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3724
|
+
else:
|
3725
|
+
cred = credential.Credential(
|
3726
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3727
|
+
)
|
3728
|
+
http_profile = HttpProfile(
|
3729
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3730
|
+
reqMethod="POST",
|
3731
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3732
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3733
|
+
)
|
3734
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3735
|
+
if g_param[OptionsDefine.Language]:
|
3736
|
+
profile.language = g_param[OptionsDefine.Language]
|
3737
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3738
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
3739
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3740
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3741
|
+
model = models.ReferShareKnowledgeRequest()
|
3742
|
+
model.from_json_string(json.dumps(args))
|
3743
|
+
start_time = time.time()
|
3744
|
+
while True:
|
3745
|
+
rsp = client.ReferShareKnowledge(model)
|
3746
|
+
result = rsp.to_json_string()
|
3747
|
+
try:
|
3748
|
+
json_obj = json.loads(result)
|
3749
|
+
except TypeError as e:
|
3750
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3751
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3752
|
+
break
|
3753
|
+
cur_time = time.time()
|
3754
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3755
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3756
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3757
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3758
|
+
else:
|
3759
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3760
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3761
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3762
|
+
|
3763
|
+
|
3452
3764
|
def doListRelease(args, parsed_globals):
|
3453
3765
|
g_param = parse_global_arg(parsed_globals)
|
3454
3766
|
|
@@ -4437,7 +4749,7 @@ def doDescribeRelease(args, parsed_globals):
|
|
4437
4749
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4438
4750
|
|
4439
4751
|
|
4440
|
-
def
|
4752
|
+
def doModifyRejectedQuestion(args, parsed_globals):
|
4441
4753
|
g_param = parse_global_arg(parsed_globals)
|
4442
4754
|
|
4443
4755
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -4466,11 +4778,11 @@ def doCreateCorp(args, parsed_globals):
|
|
4466
4778
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
4467
4779
|
client._sdkVersion += ("_CLI_" + __version__)
|
4468
4780
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4469
|
-
model = models.
|
4781
|
+
model = models.ModifyRejectedQuestionRequest()
|
4470
4782
|
model.from_json_string(json.dumps(args))
|
4471
4783
|
start_time = time.time()
|
4472
4784
|
while True:
|
4473
|
-
rsp = client.
|
4785
|
+
rsp = client.ModifyRejectedQuestion(model)
|
4474
4786
|
result = rsp.to_json_string()
|
4475
4787
|
try:
|
4476
4788
|
json_obj = json.loads(result)
|
@@ -4853,6 +5165,58 @@ def doDescribeSegments(args, parsed_globals):
|
|
4853
5165
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4854
5166
|
|
4855
5167
|
|
5168
|
+
def doRunReRank(args, parsed_globals):
|
5169
|
+
g_param = parse_global_arg(parsed_globals)
|
5170
|
+
|
5171
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
5172
|
+
cred = credential.CVMRoleCredential()
|
5173
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
5174
|
+
cred = credential.STSAssumeRoleCredential(
|
5175
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
5176
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
5177
|
+
)
|
5178
|
+
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):
|
5179
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
5180
|
+
else:
|
5181
|
+
cred = credential.Credential(
|
5182
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
5183
|
+
)
|
5184
|
+
http_profile = HttpProfile(
|
5185
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
5186
|
+
reqMethod="POST",
|
5187
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
5188
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
5189
|
+
)
|
5190
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
5191
|
+
if g_param[OptionsDefine.Language]:
|
5192
|
+
profile.language = g_param[OptionsDefine.Language]
|
5193
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
5194
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
5195
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
5196
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
5197
|
+
model = models.RunReRankRequest()
|
5198
|
+
model.from_json_string(json.dumps(args))
|
5199
|
+
start_time = time.time()
|
5200
|
+
while True:
|
5201
|
+
rsp = client.RunReRank(model)
|
5202
|
+
result = rsp.to_json_string()
|
5203
|
+
try:
|
5204
|
+
json_obj = json.loads(result)
|
5205
|
+
except TypeError as e:
|
5206
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
5207
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
5208
|
+
break
|
5209
|
+
cur_time = time.time()
|
5210
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
5211
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
5212
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
5213
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
5214
|
+
else:
|
5215
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
5216
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
5217
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5218
|
+
|
5219
|
+
|
4856
5220
|
def doGetTaskStatus(args, parsed_globals):
|
4857
5221
|
g_param = parse_global_arg(parsed_globals)
|
4858
5222
|
|
@@ -5085,9 +5449,10 @@ ACTION_MAP = {
|
|
5085
5449
|
"CreateAttributeLabel": doCreateAttributeLabel,
|
5086
5450
|
"RetryDocAudit": doRetryDocAudit,
|
5087
5451
|
"GenerateQA": doGenerateQA,
|
5452
|
+
"ListSharedKnowledge": doListSharedKnowledge,
|
5088
5453
|
"DescribeAttributeLabel": doDescribeAttributeLabel,
|
5089
5454
|
"ListRejectedQuestionPreview": doListRejectedQuestionPreview,
|
5090
|
-
"
|
5455
|
+
"DescribeSharedKnowledge": doDescribeSharedKnowledge,
|
5091
5456
|
"RetryDocParse": doRetryDocParse,
|
5092
5457
|
"CreateQA": doCreateQA,
|
5093
5458
|
"DescribeTokenUsageGraph": doDescribeTokenUsageGraph,
|
@@ -5096,6 +5461,7 @@ ACTION_MAP = {
|
|
5096
5461
|
"GetWsToken": doGetWsToken,
|
5097
5462
|
"ListAttributeLabel": doListAttributeLabel,
|
5098
5463
|
"ListReleaseConfigPreview": doListReleaseConfigPreview,
|
5464
|
+
"ListReferShareKnowledge": doListReferShareKnowledge,
|
5099
5465
|
"DescribeSearchStatsGraph": doDescribeSearchStatsGraph,
|
5100
5466
|
"DeleteDocCate": doDeleteDocCate,
|
5101
5467
|
"VerifyQA": doVerifyQA,
|
@@ -5111,6 +5477,7 @@ ACTION_MAP = {
|
|
5111
5477
|
"DeleteApp": doDeleteApp,
|
5112
5478
|
"CheckAttributeLabelRefer": doCheckAttributeLabelRefer,
|
5113
5479
|
"DescribeCorp": doDescribeCorp,
|
5480
|
+
"CreateSharedKnowledge": doCreateSharedKnowledge,
|
5114
5481
|
"DescribeUnsatisfiedReplyContext": doDescribeUnsatisfiedReplyContext,
|
5115
5482
|
"GroupDoc": doGroupDoc,
|
5116
5483
|
"ListApp": doListApp,
|
@@ -5121,9 +5488,11 @@ ACTION_MAP = {
|
|
5121
5488
|
"CreateApp": doCreateApp,
|
5122
5489
|
"ModifyDoc": doModifyDoc,
|
5123
5490
|
"CreateQACate": doCreateQACate,
|
5491
|
+
"UpdateSharedKnowledge": doUpdateSharedKnowledge,
|
5124
5492
|
"ExportAttributeLabel": doExportAttributeLabel,
|
5125
5493
|
"DescribeRefer": doDescribeRefer,
|
5126
5494
|
"DescribeKnowledgeUsage": doDescribeKnowledgeUsage,
|
5495
|
+
"DeleteSharedKnowledge": doDeleteSharedKnowledge,
|
5127
5496
|
"DescribeRobotBizIDByAppKey": doDescribeRobotBizIDByAppKey,
|
5128
5497
|
"ListDoc": doListDoc,
|
5129
5498
|
"ListQA": doListQA,
|
@@ -5135,9 +5504,10 @@ ACTION_MAP = {
|
|
5135
5504
|
"UploadAttributeLabel": doUploadAttributeLabel,
|
5136
5505
|
"GetDocPreview": doGetDocPreview,
|
5137
5506
|
"DescribeConcurrencyUsage": doDescribeConcurrencyUsage,
|
5138
|
-
"
|
5507
|
+
"CreateCorp": doCreateCorp,
|
5139
5508
|
"IsTransferIntent": doIsTransferIntent,
|
5140
5509
|
"DescribeReleaseInfo": doDescribeReleaseInfo,
|
5510
|
+
"ReferShareKnowledge": doReferShareKnowledge,
|
5141
5511
|
"ListRelease": doListRelease,
|
5142
5512
|
"ListModel": doListModel,
|
5143
5513
|
"ListRejectedQuestion": doListRejectedQuestion,
|
@@ -5157,7 +5527,7 @@ ACTION_MAP = {
|
|
5157
5527
|
"GetAnswerTypeDataCount": doGetAnswerTypeDataCount,
|
5158
5528
|
"ListReleaseDocPreview": doListReleaseDocPreview,
|
5159
5529
|
"DescribeRelease": doDescribeRelease,
|
5160
|
-
"
|
5530
|
+
"ModifyRejectedQuestion": doModifyRejectedQuestion,
|
5161
5531
|
"GetAppKnowledgeCount": doGetAppKnowledgeCount,
|
5162
5532
|
"DescribeConcurrencyUsageGraph": doDescribeConcurrencyUsageGraph,
|
5163
5533
|
"GetMsgRecord": doGetMsgRecord,
|
@@ -5165,6 +5535,7 @@ ACTION_MAP = {
|
|
5165
5535
|
"DescribeCallStatsGraph": doDescribeCallStatsGraph,
|
5166
5536
|
"GroupQA": doGroupQA,
|
5167
5537
|
"DescribeSegments": doDescribeSegments,
|
5538
|
+
"RunReRank": doRunReRank,
|
5168
5539
|
"GetTaskStatus": doGetTaskStatus,
|
5169
5540
|
"ReconstructDocument": doReconstructDocument,
|
5170
5541
|
"ListAppKnowledgeDetail": doListAppKnowledgeDetail,
|