tccli 3.0.1135.1__py2.py3-none-any.whl → 3.0.1136.1__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tccli/__init__.py +1 -1
- tccli/services/__init__.py +3 -0
- tccli/services/asr/asr_client.py +53 -0
- tccli/services/asr/v20190614/api.json +193 -1
- tccli/services/asr/v20190614/examples.json +8 -0
- tccli/services/batch/v20170312/api.json +8 -5
- tccli/services/batch/v20170312/examples.json +1 -1
- tccli/services/ckafka/v20190819/api.json +1 -1
- tccli/services/dlc/dlc_client.py +53 -0
- tccli/services/dlc/v20210125/api.json +134 -0
- tccli/services/dlc/v20210125/examples.json +8 -0
- tccli/services/dsgc/v20190723/api.json +35 -35
- tccli/services/eiam/v20210420/api.json +4 -4
- tccli/services/eiam/v20210420/examples.json +4 -4
- tccli/services/ess/v20201111/api.json +1 -1
- tccli/services/essbasic/v20210526/api.json +2 -2
- tccli/services/iotexplorer/iotexplorer_client.py +53 -0
- tccli/services/iotexplorer/v20190423/api.json +133 -0
- tccli/services/iotexplorer/v20190423/examples.json +8 -0
- tccli/services/lighthouse/v20200324/api.json +14 -14
- tccli/services/lighthouse/v20200324/examples.json +7 -7
- tccli/services/lke/lke_client.py +175 -16
- tccli/services/lke/v20231130/api.json +429 -4
- tccli/services/lke/v20231130/examples.json +24 -0
- tccli/services/ocr/v20181119/api.json +1 -1
- tccli/services/tdmq/tdmq_client.py +53 -0
- tccli/services/tdmq/v20200217/api.json +301 -0
- tccli/services/tdmq/v20200217/examples.json +8 -0
- tccli/services/tem/v20210701/api.json +8 -5
- tccli/services/tem/v20210701/examples.json +2 -2
- tccli/services/trocket/trocket_client.py +65 -12
- tccli/services/trocket/v20230308/api.json +196 -0
- tccli/services/trocket/v20230308/examples.json +8 -0
- tccli/services/trtc/v20190722/api.json +45 -63
- tccli/services/tsi/__init__.py +4 -0
- tccli/services/tsi/tsi_client.py +301 -0
- tccli/services/tsi/v20210325/api.json +373 -0
- tccli/services/tsi/v20210325/examples.json +29 -0
- tccli/services/vpc/v20170312/api.json +36 -16
- tccli/services/vpc/v20170312/examples.json +9 -3
- tccli/services/waf/v20180125/api.json +70 -0
- tccli/services/waf/v20180125/examples.json +8 -0
- tccli/services/waf/waf_client.py +53 -0
- {tccli-3.0.1135.1.dist-info → tccli-3.0.1136.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1135.1.dist-info → tccli-3.0.1136.1.dist-info}/RECORD +48 -44
- {tccli-3.0.1135.1.dist-info → tccli-3.0.1136.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1135.1.dist-info → tccli-3.0.1136.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1135.1.dist-info → tccli-3.0.1136.1.dist-info}/license_files/LICENSE +0 -0
@@ -659,7 +659,7 @@
|
|
659
659
|
"status": "online"
|
660
660
|
},
|
661
661
|
"RerunDockerContainer": {
|
662
|
-
"document": "重新创建并运行实例内的Docker容器,之后可以通过返回的ActivityId调用DescribeDockerActivities接口查询重建情况。",
|
662
|
+
"document": "重新创建并运行实例内的Docker容器,之后可以通过返回的ActivityId调用[DescribeDockerActivities](https://cloud.tencent.com/document/product/1207/95476)接口查询重建情况。",
|
663
663
|
"input": "RerunDockerContainerRequest",
|
664
664
|
"name": "重新创建并运行Docker容器",
|
665
665
|
"output": "RerunDockerContainerResponse",
|
@@ -2781,7 +2781,7 @@
|
|
2781
2781
|
"members": [
|
2782
2782
|
{
|
2783
2783
|
"disabled": false,
|
2784
|
-
"document": "套餐 ID
|
2784
|
+
"document": "套餐 ID。可通过[DescribeBundles](https://cloud.tencent.com/document/product/1207/47575)接口返回值中的BundleId获取。",
|
2785
2785
|
"example": "bundle_bw_small1_1",
|
2786
2786
|
"member": "string",
|
2787
2787
|
"name": "BundleId",
|
@@ -2828,7 +2828,7 @@
|
|
2828
2828
|
"members": [
|
2829
2829
|
{
|
2830
2830
|
"disabled": false,
|
2831
|
-
"document": "套餐 ID
|
2831
|
+
"document": "套餐 ID 列表。可通过[DescribeBundles](https://cloud.tencent.com/document/product/1207/47575)接口返回值中的BundleId获取。",
|
2832
2832
|
"example": "[\"bundle_ntp_small1_500”]",
|
2833
2833
|
"member": "string",
|
2834
2834
|
"name": "BundleIds",
|
@@ -4585,7 +4585,7 @@
|
|
4585
4585
|
"members": [
|
4586
4586
|
{
|
4587
4587
|
"disabled": false,
|
4588
|
-
"document": "实例ID",
|
4588
|
+
"document": "实例ID。可通过 <a href=\"https://cloud.tencent.com/document/product/1207/47573\">DescribeInstances</a> 接口返回值中的 InstanceId 获取。",
|
4589
4589
|
"example": "lhins-383nzmm1",
|
4590
4590
|
"member": "string",
|
4591
4591
|
"name": "InstanceId",
|
@@ -4612,7 +4612,7 @@
|
|
4612
4612
|
},
|
4613
4613
|
{
|
4614
4614
|
"disabled": false,
|
4615
|
-
"document": "过滤器列表。\n<li>blueprint-id</li>按照【镜像 ID】进行过滤。\n类型:String\n必选:否\n<li>blueprint-type</li>按照【镜像类型】进行过滤。\n取值: APP_OS(应用镜像 );PURE_OS( 系统镜像);PRIVATE(自定义镜像)。\n类型:String\n必选:否\n<li>platform-type</li>按照【镜像平台类型】进行过滤。\n取值: LINUX_UNIX(Linux/Unix系统);WINDOWS(Windows 系统)。\n类型:String\n必选:否\n<li>blueprint-name</li>按照【镜像名称】进行过滤。\n类型:String\n必选:否\n<li>blueprint-state</li>按照【镜像状态】进行过滤。\n类型:String\n必选:否\n\n每次请求的 Filters 的上限为 10,Filter.Values 的上限为 5。参数不支持同时指定 BlueprintIds 和 Filters 。",
|
4615
|
+
"document": "过滤器列表。\n<li>blueprint-id</li>按照【镜像 ID】进行过滤。\n类型:String\n必选:否\n可通过 <a href=\"https://cloud.tencent.com/document/product/1207/47689\">DescribeBlueprints</a> 接口返回值中的 BlueprintId 获取。\n<li>blueprint-type</li>按照【镜像类型】进行过滤。\n取值: APP_OS(应用镜像 );PURE_OS( 系统镜像);PRIVATE(自定义镜像)。\n类型:String\n必选:否\n<li>platform-type</li>按照【镜像平台类型】进行过滤。\n取值: LINUX_UNIX(Linux/Unix系统);WINDOWS(Windows 系统)。\n类型:String\n必选:否\n<li>blueprint-name</li>按照【镜像名称】进行过滤。\n类型:String\n必选:否\n可通过 <a href=\"https://cloud.tencent.com/document/product/1207/47689\">DescribeBlueprints</a> 接口返回值中的 BlueprintName 获取。\n<li>blueprint-state</li>按照【镜像状态】进行过滤。\n类型:String\n必选:否\n可通过 <a href=\"https://cloud.tencent.com/document/product/1207/47689\">DescribeBlueprints</a> 接口返回值中的 BlueprintState 获取。\n\n每次请求的 Filters 的上限为 10,Filter.Values 的上限为 5。参数不支持同时指定 BlueprintIds 和 Filters 。",
|
4616
4616
|
"example": "无",
|
4617
4617
|
"member": "Filter",
|
4618
4618
|
"name": "Filters",
|
@@ -4631,7 +4631,7 @@
|
|
4631
4631
|
"example": "2",
|
4632
4632
|
"member": "int64",
|
4633
4633
|
"name": "TotalCount",
|
4634
|
-
"
|
4634
|
+
"output_required": true,
|
4635
4635
|
"type": "int",
|
4636
4636
|
"value_allowed_null": false
|
4637
4637
|
},
|
@@ -4641,7 +4641,7 @@
|
|
4641
4641
|
"example": "无",
|
4642
4642
|
"member": "ResetInstanceBlueprint",
|
4643
4643
|
"name": "ResetInstanceBlueprintSet",
|
4644
|
-
"
|
4644
|
+
"output_required": true,
|
4645
4645
|
"type": "list",
|
4646
4646
|
"value_allowed_null": false
|
4647
4647
|
},
|
@@ -7771,7 +7771,7 @@
|
|
7771
7771
|
"members": [
|
7772
7772
|
{
|
7773
7773
|
"disabled": false,
|
7774
|
-
"document": "实例ID
|
7774
|
+
"document": "实例ID。可通过[DescribeInstances](https://cloud.tencent.com/document/product/1207/47573)接口返回值中的InstanceId获取。",
|
7775
7775
|
"example": "lhins-nwycpjl3",
|
7776
7776
|
"member": "string",
|
7777
7777
|
"name": "InstanceId",
|
@@ -7780,7 +7780,7 @@
|
|
7780
7780
|
},
|
7781
7781
|
{
|
7782
7782
|
"disabled": false,
|
7783
|
-
"document": "容器ID
|
7783
|
+
"document": "容器ID。可通过[DescribeDockerContainers](https://cloud.tencent.com/document/product/1207/95473)接口返回值中的ContainerId获取。",
|
7784
7784
|
"example": "809e9d4014f08811779c07639ec13a53ee70ba166201611298611c883e553415",
|
7785
7785
|
"member": "string",
|
7786
7786
|
"name": "ContainerId",
|
@@ -8609,7 +8609,7 @@
|
|
8609
8609
|
"members": [
|
8610
8610
|
{
|
8611
8611
|
"disabled": false,
|
8612
|
-
"document": "实例ID
|
8612
|
+
"document": "实例ID。可通过[DescribeInstances](https://cloud.tencent.com/document/product/1207/47573)接口返回值中的InstanceId获取。",
|
8613
8613
|
"example": "lhins-nwycpjl3",
|
8614
8614
|
"member": "string",
|
8615
8615
|
"name": "InstanceId",
|
@@ -8627,8 +8627,8 @@
|
|
8627
8627
|
},
|
8628
8628
|
{
|
8629
8629
|
"disabled": false,
|
8630
|
-
"document": "容器ID
|
8631
|
-
"example": "
|
8630
|
+
"document": "容器ID。可通过[DescribeDockerContainers](https://cloud.tencent.com/document/product/1207/95473)接口返回值中的ContainerId获取。",
|
8631
|
+
"example": "809e9d4014f08811779c07639ec13a53ee70ba1662016112986",
|
8632
8632
|
"member": "string",
|
8633
8633
|
"name": "ContainerId",
|
8634
8634
|
"required": true,
|
@@ -8646,7 +8646,7 @@
|
|
8646
8646
|
"example": "lhda-nn82v77w",
|
8647
8647
|
"member": "string",
|
8648
8648
|
"name": "DockerActivityId",
|
8649
|
-
"
|
8649
|
+
"output_required": true,
|
8650
8650
|
"type": "string",
|
8651
8651
|
"value_allowed_null": false
|
8652
8652
|
},
|
@@ -8954,7 +8954,7 @@
|
|
8954
8954
|
"members": [
|
8955
8955
|
{
|
8956
8956
|
"disabled": false,
|
8957
|
-
"document": "实例ID
|
8957
|
+
"document": "实例ID。可通过[DescribeInstances](https://cloud.tencent.com/document/product/1207/47573)接口返回值中的InstanceId获取。",
|
8958
8958
|
"example": "lhins-nwycpjl3",
|
8959
8959
|
"member": "string",
|
8960
8960
|
"name": "InstanceId",
|
@@ -456,9 +456,9 @@
|
|
456
456
|
],
|
457
457
|
"DescribeModifyInstanceBundles": [
|
458
458
|
{
|
459
|
-
"document": "",
|
460
|
-
"input": "POST / HTTP/1.1\nHost: lighthouse.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeModifyInstanceBundles\n<公共请求参数>\n\n{\n \"InstanceId\": \"lhins-
|
461
|
-
"output": "{\n \"Response\": {\n \"
|
459
|
+
"document": "查询实例可修改套餐列表",
|
460
|
+
"input": "POST / HTTP/1.1\nHost: lighthouse.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeModifyInstanceBundles\n<公共请求参数>\n\n{\n \"InstanceId\": \"lhins-p6xbekdt\"\n}",
|
461
|
+
"output": "{\n \"Response\": {\n \"ModifyBundleSet\": [\n {\n \"Bundle\": {\n \"BundleDisplayLabel\": \"NORMAL\",\n \"BundleId\": \"bundle_gen_mc_med2_02\",\n \"BundleSalesState\": \"AVAILABLE\",\n \"BundleType\": \"GENERAL_BUNDLE\",\n \"BundleTypeDescription\": \"通用型\",\n \"CPU\": 2,\n \"InternetChargeType\": \"TRAFFIC_POSTPAID_BY_HOUR\",\n \"InternetMaxBandwidthOut\": 5,\n \"Memory\": 2,\n \"MonthlyTraffic\": 500,\n \"Price\": {\n \"InstancePrice\": {\n \"Currency\": \"CNY\",\n \"Discount\": 100,\n \"DiscountPrice\": 65,\n \"OriginalBundlePrice\": 65,\n \"OriginalPrice\": 65\n }\n },\n \"SupportLinuxUnixPlatform\": true,\n \"SupportWindowsPlatform\": true,\n \"SystemDiskSize\": 70,\n \"SystemDiskType\": \"CLOUD_PREMIUM\"\n },\n \"ModifyBundleState\": \"AVAILABLE\",\n \"ModifyPrice\": {\n \"InstancePrice\": {\n \"Currency\": \"CNY\",\n \"Discount\": 100,\n \"DiscountPrice\": 10,\n \"OriginalBundlePrice\": 65,\n \"OriginalPrice\": 10\n }\n },\n \"NotSupportModifyMessage\": \"\"\n }\n ],\n \"RequestId\": \"651060b7-b781-4ed9-898c-a06b8c5c51dc\",\n \"TotalCount\": 1\n }\n}",
|
462
462
|
"title": "查询实例可修改套餐列表"
|
463
463
|
}
|
464
464
|
],
|
@@ -472,10 +472,10 @@
|
|
472
472
|
],
|
473
473
|
"DescribeResetInstanceBlueprints": [
|
474
474
|
{
|
475
|
-
"document": "",
|
476
|
-
"input": "
|
477
|
-
"output": "{\n \"Response\": {\n \"
|
478
|
-
"title": "
|
475
|
+
"document": "查询实例可重装镜像",
|
476
|
+
"input": "POST / HTTP/1.1\nHost: lighthouse.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeResetInstanceBlueprints\n<公共请求参数>\n\n{\n \"InstanceId\": \"lhins-euqk4yut\"\n}",
|
477
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"d085dd6e-fd50-426f-bb29-b0ed899ccdf7\",\n \"ResetInstanceBlueprintSet\": [\n {\n \"BlueprintInfo\": {\n \"BlueprintId\": \"lhbp-m1g6ap11\",\n \"BlueprintName\": \"docker-debian12\",\n \"BlueprintShared\": false,\n \"BlueprintState\": \"NORMAL\",\n \"BlueprintType\": \"DOCKER\",\n \"CommunityUrl\": \"\",\n \"CreatedTime\": \"2024-06-12T23:30:03Z\",\n \"Description\": \"test\",\n \"DisplayTitle\": \"7日杀Windows\",\n \"DisplayVersion\": \" \",\n \"DockerVersion\": \"24.0.7\",\n \"GuideUrl\": \"\",\n \"ImageId\": \"\",\n \"ImageUrl\": \"https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/f1afb130-22a7-479d-a5a3-013e8f633b5a.svg\",\n \"OsName\": \"Windows Server 2022 DataCenter 64bit CN\",\n \"Platform\": \"WINDOWS\",\n \"PlatformType\": \"WINDOWS\",\n \"RequiredMemorySize\": 2,\n \"RequiredSystemDiskSize\": 50,\n \"SceneIdSet\": [],\n \"SupportAutomationTools\": true\n },\n \"IsResettable\": false,\n \"NonResettableMessage\": \"非中国大陆地域不支持Linux系统和Windows系统之间互转。\"\n }\n ],\n \"TotalCount\": 1\n }\n}",
|
478
|
+
"title": "查询实例可重装镜像"
|
479
479
|
}
|
480
480
|
],
|
481
481
|
"DescribeScenes": [
|
tccli/services/lke/lke_client.py
CHANGED
@@ -277,7 +277,7 @@ def doSaveDoc(args, parsed_globals):
|
|
277
277
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
278
|
|
279
279
|
|
280
|
-
def
|
280
|
+
def doListRelease(args, parsed_globals):
|
281
281
|
g_param = parse_global_arg(parsed_globals)
|
282
282
|
|
283
283
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -306,11 +306,11 @@ def doCreateRejectedQuestion(args, parsed_globals):
|
|
306
306
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
307
307
|
client._sdkVersion += ("_CLI_" + __version__)
|
308
308
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
-
model = models.
|
309
|
+
model = models.ListReleaseRequest()
|
310
310
|
model.from_json_string(json.dumps(args))
|
311
311
|
start_time = time.time()
|
312
312
|
while True:
|
313
|
-
rsp = client.
|
313
|
+
rsp = client.ListRelease(model)
|
314
314
|
result = rsp.to_json_string()
|
315
315
|
try:
|
316
316
|
json_obj = json.loads(result)
|
@@ -1161,7 +1161,7 @@ def doRateMsgRecord(args, parsed_globals):
|
|
1161
1161
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1162
1162
|
|
1163
1163
|
|
1164
|
-
def
|
1164
|
+
def doGetAnswerTypeDataCount(args, parsed_globals):
|
1165
1165
|
g_param = parse_global_arg(parsed_globals)
|
1166
1166
|
|
1167
1167
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1190,11 +1190,63 @@ def doListQA(args, parsed_globals):
|
|
1190
1190
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
1191
1191
|
client._sdkVersion += ("_CLI_" + __version__)
|
1192
1192
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1193
|
-
model = models.
|
1193
|
+
model = models.GetAnswerTypeDataCountRequest()
|
1194
1194
|
model.from_json_string(json.dumps(args))
|
1195
1195
|
start_time = time.time()
|
1196
1196
|
while True:
|
1197
|
-
rsp = client.
|
1197
|
+
rsp = client.GetAnswerTypeDataCount(model)
|
1198
|
+
result = rsp.to_json_string()
|
1199
|
+
try:
|
1200
|
+
json_obj = json.loads(result)
|
1201
|
+
except TypeError as e:
|
1202
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1203
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1204
|
+
break
|
1205
|
+
cur_time = time.time()
|
1206
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1207
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1208
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1209
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1210
|
+
else:
|
1211
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1212
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1213
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
|
+
|
1215
|
+
|
1216
|
+
def doGetLikeDataCount(args, parsed_globals):
|
1217
|
+
g_param = parse_global_arg(parsed_globals)
|
1218
|
+
|
1219
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1220
|
+
cred = credential.CVMRoleCredential()
|
1221
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1222
|
+
cred = credential.STSAssumeRoleCredential(
|
1223
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1224
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1225
|
+
)
|
1226
|
+
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):
|
1227
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1228
|
+
else:
|
1229
|
+
cred = credential.Credential(
|
1230
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1231
|
+
)
|
1232
|
+
http_profile = HttpProfile(
|
1233
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1234
|
+
reqMethod="POST",
|
1235
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1236
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1237
|
+
)
|
1238
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1239
|
+
if g_param[OptionsDefine.Language]:
|
1240
|
+
profile.language = g_param[OptionsDefine.Language]
|
1241
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1242
|
+
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
1243
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1244
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1245
|
+
model = models.GetLikeDataCountRequest()
|
1246
|
+
model.from_json_string(json.dumps(args))
|
1247
|
+
start_time = time.time()
|
1248
|
+
while True:
|
1249
|
+
rsp = client.GetLikeDataCount(model)
|
1198
1250
|
result = rsp.to_json_string()
|
1199
1251
|
try:
|
1200
1252
|
json_obj = json.loads(result)
|
@@ -2097,6 +2149,58 @@ def doListReleaseDocPreview(args, parsed_globals):
|
|
2097
2149
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2098
2150
|
|
2099
2151
|
|
2152
|
+
def doListQA(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.ListQARequest()
|
2182
|
+
model.from_json_string(json.dumps(args))
|
2183
|
+
start_time = time.time()
|
2184
|
+
while True:
|
2185
|
+
rsp = client.ListQA(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
|
+
|
2100
2204
|
def doModifyRejectedQuestion(args, parsed_globals):
|
2101
2205
|
g_param = parse_global_arg(parsed_globals)
|
2102
2206
|
|
@@ -2461,7 +2565,7 @@ def doCreateReconstructDocumentFlow(args, parsed_globals):
|
|
2461
2565
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
2566
|
|
2463
2567
|
|
2464
|
-
def
|
2568
|
+
def doConvertDocument(args, parsed_globals):
|
2465
2569
|
g_param = parse_global_arg(parsed_globals)
|
2466
2570
|
|
2467
2571
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2490,11 +2594,11 @@ def doExportUnsatisfiedReply(args, parsed_globals):
|
|
2490
2594
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
2491
2595
|
client._sdkVersion += ("_CLI_" + __version__)
|
2492
2596
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2493
|
-
model = models.
|
2597
|
+
model = models.ConvertDocumentRequest()
|
2494
2598
|
model.from_json_string(json.dumps(args))
|
2495
2599
|
start_time = time.time()
|
2496
2600
|
while True:
|
2497
|
-
rsp = client.
|
2601
|
+
rsp = client.ConvertDocument(model)
|
2498
2602
|
result = rsp.to_json_string()
|
2499
2603
|
try:
|
2500
2604
|
json_obj = json.loads(result)
|
@@ -2617,6 +2721,58 @@ def doListQACate(args, parsed_globals):
|
|
2617
2721
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2618
2722
|
|
2619
2723
|
|
2724
|
+
def doExportUnsatisfiedReply(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.ExportUnsatisfiedReplyRequest()
|
2754
|
+
model.from_json_string(json.dumps(args))
|
2755
|
+
start_time = time.time()
|
2756
|
+
while True:
|
2757
|
+
rsp = client.ExportUnsatisfiedReply(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
|
+
|
2620
2776
|
def doGetAppKnowledgeCount(args, parsed_globals):
|
2621
2777
|
g_param = parse_global_arg(parsed_globals)
|
2622
2778
|
|
@@ -3137,7 +3293,7 @@ def doDescribeReleaseInfo(args, parsed_globals):
|
|
3137
3293
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3138
3294
|
|
3139
3295
|
|
3140
|
-
def
|
3296
|
+
def doCreateRejectedQuestion(args, parsed_globals):
|
3141
3297
|
g_param = parse_global_arg(parsed_globals)
|
3142
3298
|
|
3143
3299
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3166,11 +3322,11 @@ def doListRelease(args, parsed_globals):
|
|
3166
3322
|
client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
|
3167
3323
|
client._sdkVersion += ("_CLI_" + __version__)
|
3168
3324
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3169
|
-
model = models.
|
3325
|
+
model = models.CreateRejectedQuestionRequest()
|
3170
3326
|
model.from_json_string(json.dumps(args))
|
3171
3327
|
start_time = time.time()
|
3172
3328
|
while True:
|
3173
|
-
rsp = client.
|
3329
|
+
rsp = client.CreateRejectedQuestion(model)
|
3174
3330
|
result = rsp.to_json_string()
|
3175
3331
|
try:
|
3176
3332
|
json_obj = json.loads(result)
|
@@ -4089,7 +4245,7 @@ ACTION_MAP = {
|
|
4089
4245
|
"ListUnsatisfiedReply": doListUnsatisfiedReply,
|
4090
4246
|
"DeleteAttributeLabel": doDeleteAttributeLabel,
|
4091
4247
|
"SaveDoc": doSaveDoc,
|
4092
|
-
"
|
4248
|
+
"ListRelease": doListRelease,
|
4093
4249
|
"CheckAttributeLabelExist": doCheckAttributeLabelExist,
|
4094
4250
|
"ModifyQAAttrRange": doModifyQAAttrRange,
|
4095
4251
|
"DescribeDoc": doDescribeDoc,
|
@@ -4106,7 +4262,8 @@ ACTION_MAP = {
|
|
4106
4262
|
"GetAppSecret": doGetAppSecret,
|
4107
4263
|
"ModifyAttributeLabel": doModifyAttributeLabel,
|
4108
4264
|
"RateMsgRecord": doRateMsgRecord,
|
4109
|
-
"
|
4265
|
+
"GetAnswerTypeDataCount": doGetAnswerTypeDataCount,
|
4266
|
+
"GetLikeDataCount": doGetLikeDataCount,
|
4110
4267
|
"DeleteQA": doDeleteQA,
|
4111
4268
|
"DescribeRobotBizIDByAppKey": doDescribeRobotBizIDByAppKey,
|
4112
4269
|
"ListReleaseQAPreview": doListReleaseQAPreview,
|
@@ -4124,6 +4281,7 @@ ACTION_MAP = {
|
|
4124
4281
|
"ListApp": doListApp,
|
4125
4282
|
"GetDocPreview": doGetDocPreview,
|
4126
4283
|
"ListReleaseDocPreview": doListReleaseDocPreview,
|
4284
|
+
"ListQA": doListQA,
|
4127
4285
|
"ModifyRejectedQuestion": doModifyRejectedQuestion,
|
4128
4286
|
"DescribeAttributeLabel": doDescribeAttributeLabel,
|
4129
4287
|
"DescribeRelease": doDescribeRelease,
|
@@ -4131,9 +4289,10 @@ ACTION_MAP = {
|
|
4131
4289
|
"RetryDocParse": doRetryDocParse,
|
4132
4290
|
"CreateCorp": doCreateCorp,
|
4133
4291
|
"CreateReconstructDocumentFlow": doCreateReconstructDocumentFlow,
|
4134
|
-
"
|
4292
|
+
"ConvertDocument": doConvertDocument,
|
4135
4293
|
"ResetSession": doResetSession,
|
4136
4294
|
"ListQACate": doListQACate,
|
4295
|
+
"ExportUnsatisfiedReply": doExportUnsatisfiedReply,
|
4137
4296
|
"GetAppKnowledgeCount": doGetAppKnowledgeCount,
|
4138
4297
|
"GenerateQA": doGenerateQA,
|
4139
4298
|
"ListAppCategory": doListAppCategory,
|
@@ -4144,7 +4303,7 @@ ACTION_MAP = {
|
|
4144
4303
|
"GetMsgRecord": doGetMsgRecord,
|
4145
4304
|
"ModifyDoc": doModifyDoc,
|
4146
4305
|
"DescribeReleaseInfo": doDescribeReleaseInfo,
|
4147
|
-
"
|
4306
|
+
"CreateRejectedQuestion": doCreateRejectedQuestion,
|
4148
4307
|
"ListModel": doListModel,
|
4149
4308
|
"GroupQA": doGroupQA,
|
4150
4309
|
"ListAttributeLabel": doListAttributeLabel,
|