tccli 3.0.1334.1__py2.py3-none-any.whl → 3.0.1336.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.
Files changed (31) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/bi/v20220105/api.json +93 -0
  3. tccli/services/cdb/v20170320/api.json +3 -3
  4. tccli/services/cdn/v20180606/api.json +3 -3
  5. tccli/services/cfs/v20190719/api.json +7 -7
  6. tccli/services/cls/v20201016/api.json +10 -0
  7. tccli/services/essbasic/v20210526/api.json +1 -1
  8. tccli/services/iotexplorer/iotexplorer_client.py +114 -8
  9. tccli/services/iotexplorer/v20190423/api.json +170 -0
  10. tccli/services/iotexplorer/v20190423/examples.json +16 -0
  11. tccli/services/lke/v20231130/api.json +25 -5
  12. tccli/services/monitor/monitor_client.py +53 -0
  13. tccli/services/monitor/v20180724/api.json +43 -0
  14. tccli/services/monitor/v20180724/examples.json +8 -0
  15. tccli/services/mps/v20190612/api.json +129 -0
  16. tccli/services/ocr/ocr_client.py +4 -110
  17. tccli/services/ocr/v20181119/api.json +1 -283
  18. tccli/services/ocr/v20181119/examples.json +0 -16
  19. tccli/services/ssl/ssl_client.py +53 -0
  20. tccli/services/ssl/v20191205/api.json +100 -0
  21. tccli/services/ssl/v20191205/examples.json +8 -0
  22. tccli/services/tcbr/v20220217/api.json +22 -0
  23. tccli/services/trocket/v20230308/api.json +1 -1
  24. tccli/services/trocket/v20230308/examples.json +1 -1
  25. tccli/services/tse/v20201207/api.json +1 -1
  26. tccli/services/tsf/v20180326/api.json +3 -2
  27. {tccli-3.0.1334.1.dist-info → tccli-3.0.1336.1.dist-info}/METADATA +2 -2
  28. {tccli-3.0.1334.1.dist-info → tccli-3.0.1336.1.dist-info}/RECORD +31 -31
  29. {tccli-3.0.1334.1.dist-info → tccli-3.0.1336.1.dist-info}/WHEEL +0 -0
  30. {tccli-3.0.1334.1.dist-info → tccli-3.0.1336.1.dist-info}/entry_points.txt +0 -0
  31. {tccli-3.0.1334.1.dist-info → tccli-3.0.1336.1.dist-info}/license_files/LICENSE +0 -0
@@ -104,6 +104,14 @@
104
104
  "title": "设备不在线时或未订阅相关 Topic 时,设置设备数据"
105
105
  }
106
106
  ],
107
+ "CreateAISearchTaskAsync": [
108
+ {
109
+ "document": "",
110
+ "input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateAISearchTaskAsync\n\n{\n \"ProductId\": \"MVTYMD8YCD\",\n \"DeviceName\": \"dev001\",\n \"Query\": \"What happened on April 1st\"\n}",
111
+ "output": "{\n \"Response\": {\n \"RequestId\": \"a9a9d232-01c0-494a-baa3-57c384463c3f\",\n \"TaskId\": \"task_0001\"\n }\n}",
112
+ "title": "创建视频语义异步搜索任务"
113
+ }
114
+ ],
107
115
  "CreateBatchProduction": [
108
116
  {
109
117
  "document": "使用上传文件 url 的方式进行量产",
@@ -406,6 +414,14 @@
406
414
  "title": "删除规则"
407
415
  }
408
416
  ],
417
+ "DescribeAISearchTaskAsync": [
418
+ {
419
+ "document": "",
420
+ "input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeAISearchTaskAsync\n\n{\n \"TaskId\": \"task_0001\"\n}",
421
+ "output": "{\n \"Response\": {\n \"RequestId\": \"a9a9d232-01c0-494a-baa3-57c384463c3f\",\n \"Status\": 3,\n \"Data\": {\n \"Summary\": \"Nine videos captured various scenes on April 1st, showcasing pets eating and playing, a peaceful baby interaction, a resting child, and diligent workers like cleaners and delivery men, all without any safety concerns.\",\n \"Targets\": [\n {\n \"ProductId\": \"MVTYMD8YCD\",\n \"DeviceName\": \"dev001\",\n \"StartTimeMs\": 1743456533000,\n \"EndTimeMs\": 1743456543000,\n \"EventId\": \"alarm\",\n \"Summary\": \"Two cats and a dog eating\"\n }\n ]\n }\n }\n}",
422
+ "title": "获取视频语义异步搜索任务详情"
423
+ }
424
+ ],
409
425
  "DescribeActivateDevice": [
410
426
  {
411
427
  "document": "",
@@ -668,7 +668,7 @@
668
668
  "RateMsgRecord": {
669
669
  "document": "点赞点踩消息",
670
670
  "input": "RateMsgRecordRequest",
671
- "name": "评价消息",
671
+ "name": "评价消息【点赞点踩】",
672
672
  "output": "RateMsgRecordResponse",
673
673
  "status": "online"
674
674
  },
@@ -8680,6 +8680,17 @@
8680
8680
  "required": false,
8681
8681
  "type": "string",
8682
8682
  "value_allowed_null": true
8683
+ },
8684
+ {
8685
+ "disabled": false,
8686
+ "document": "是否共享知识库类型\n注意:此字段可能返回 null,表示取不到有效值。",
8687
+ "example": "无",
8688
+ "member": "bool",
8689
+ "name": "IsSharedKnowledge",
8690
+ "output_required": false,
8691
+ "required": false,
8692
+ "type": "bool",
8693
+ "value_allowed_null": true
8683
8694
  }
8684
8695
  ],
8685
8696
  "usage": "both"
@@ -12559,8 +12570,8 @@
12559
12570
  },
12560
12571
  {
12561
12572
  "disabled": false,
12562
- "document": "标签适用范围 1:全部,2:按条件",
12563
- "example": "",
12573
+ "document": "标签适用范围,需要传参为1",
12574
+ "example": "1",
12564
12575
  "member": "uint64",
12565
12576
  "name": "AttrRange",
12566
12577
  "required": true,
@@ -12637,6 +12648,15 @@
12637
12648
  "name": "CateBizId",
12638
12649
  "required": false,
12639
12650
  "type": "string"
12651
+ },
12652
+ {
12653
+ "disabled": false,
12654
+ "document": "是否可下载,IsRefer为true并且ReferUrlType为0时,该值才有意义",
12655
+ "example": "false",
12656
+ "member": "bool",
12657
+ "name": "IsDownload",
12658
+ "required": false,
12659
+ "type": "bool"
12640
12660
  }
12641
12661
  ],
12642
12662
  "type": "object"
@@ -14378,7 +14398,7 @@
14378
14398
  },
14379
14399
  {
14380
14400
  "disabled": false,
14381
- "document": "消息ID",
14401
+ "document": "消息ID 【大模型回复答案的RecordID】",
14382
14402
  "example": "9c18e1c0-c89e-4a91-be92-4d6732bf54ce",
14383
14403
  "member": "string",
14384
14404
  "name": "RecordId",
@@ -14388,7 +14408,7 @@
14388
14408
  {
14389
14409
  "disabled": false,
14390
14410
  "document": "1点赞2点踩",
14391
- "example": "",
14411
+ "example": "1",
14392
14412
  "member": "uint64",
14393
14413
  "name": "Score",
14394
14414
  "required": true,
@@ -4959,6 +4959,58 @@ def doUnbindPrometheusManagedGrafana(args, parsed_globals):
4959
4959
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4960
4960
 
4961
4961
 
4962
+ def doDeleteAlarmShields(args, parsed_globals):
4963
+ g_param = parse_global_arg(parsed_globals)
4964
+
4965
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4966
+ cred = credential.CVMRoleCredential()
4967
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4968
+ cred = credential.STSAssumeRoleCredential(
4969
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4970
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4971
+ )
4972
+ 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):
4973
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4974
+ else:
4975
+ cred = credential.Credential(
4976
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4977
+ )
4978
+ http_profile = HttpProfile(
4979
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4980
+ reqMethod="POST",
4981
+ endpoint=g_param[OptionsDefine.Endpoint],
4982
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4983
+ )
4984
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4985
+ if g_param[OptionsDefine.Language]:
4986
+ profile.language = g_param[OptionsDefine.Language]
4987
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4988
+ client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
4989
+ client._sdkVersion += ("_CLI_" + __version__)
4990
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
4991
+ model = models.DeleteAlarmShieldsRequest()
4992
+ model.from_json_string(json.dumps(args))
4993
+ start_time = time.time()
4994
+ while True:
4995
+ rsp = client.DeleteAlarmShields(model)
4996
+ result = rsp.to_json_string()
4997
+ try:
4998
+ json_obj = json.loads(result)
4999
+ except TypeError as e:
5000
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
5001
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
5002
+ break
5003
+ cur_time = time.time()
5004
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
5005
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
5006
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
5007
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
5008
+ else:
5009
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
5010
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
5011
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
5012
+
5013
+
4962
5014
  def doDescribeExporterIntegrations(args, parsed_globals):
4963
5015
  g_param = parse_global_arg(parsed_globals)
4964
5016
 
@@ -8759,6 +8811,7 @@ ACTION_MAP = {
8759
8811
  "GetTopNMonitorData": doGetTopNMonitorData,
8760
8812
  "ModifyPrometheusTemp": doModifyPrometheusTemp,
8761
8813
  "UnbindPrometheusManagedGrafana": doUnbindPrometheusManagedGrafana,
8814
+ "DeleteAlarmShields": doDeleteAlarmShields,
8762
8815
  "DescribeExporterIntegrations": doDescribeExporterIntegrations,
8763
8816
  "DescribeInstalledPlugins": doDescribeInstalledPlugins,
8764
8817
  "DescribePrometheusGlobalNotification": doDescribePrometheusGlobalNotification,
@@ -210,6 +210,13 @@
210
210
  "output": "DeleteAlarmPolicyResponse",
211
211
  "status": "online"
212
212
  },
213
+ "DeleteAlarmShields": {
214
+ "document": "删除告警屏蔽规则",
215
+ "input": "DeleteAlarmShieldsRequest",
216
+ "name": "删除告警屏蔽规则",
217
+ "output": "DeleteAlarmShieldsResponse",
218
+ "status": "online"
219
+ },
213
220
  "DeleteAlertRules": {
214
221
  "document": "批量删除 Prometheus 报警规则",
215
222
  "input": "DeleteAlertRulesRequest",
@@ -5668,6 +5675,42 @@
5668
5675
  ],
5669
5676
  "type": "object"
5670
5677
  },
5678
+ "DeleteAlarmShieldsRequest": {
5679
+ "document": "DeleteAlarmShields请求参数结构体",
5680
+ "members": [
5681
+ {
5682
+ "disabled": false,
5683
+ "document": "模块名,这里填“monitor”",
5684
+ "example": "monitor",
5685
+ "member": "string",
5686
+ "name": "Module",
5687
+ "required": true,
5688
+ "type": "string"
5689
+ },
5690
+ {
5691
+ "disabled": false,
5692
+ "document": "屏蔽策略Id列表",
5693
+ "example": "[\"Shield-2a2818gxe6\"]",
5694
+ "member": "string",
5695
+ "name": "Shields",
5696
+ "required": true,
5697
+ "type": "list"
5698
+ }
5699
+ ],
5700
+ "type": "object"
5701
+ },
5702
+ "DeleteAlarmShieldsResponse": {
5703
+ "document": "DeleteAlarmShields返回参数结构体",
5704
+ "members": [
5705
+ {
5706
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
5707
+ "member": "string",
5708
+ "name": "RequestId",
5709
+ "type": "string"
5710
+ }
5711
+ ],
5712
+ "type": "object"
5713
+ },
5671
5714
  "DeleteAlertRulesRequest": {
5672
5715
  "document": "DeleteAlertRules请求参数结构体",
5673
5716
  "members": [
@@ -378,6 +378,14 @@
378
378
  "title": "删除告警策略"
379
379
  }
380
380
  ],
381
+ "DeleteAlarmShields": [
382
+ {
383
+ "document": "",
384
+ "input": "POST / HTTP/1.1\nHost: monitor.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DeleteAlarmShields\n<公共请求参数>\n\n{\n \"Shields\": [\n \"xx\"\n ],\n \"Module\": \"xx\"\n}",
385
+ "output": "{\n \"Response\": {\n \"RequestId\": \"29ghj2hh-45-266627r66hheh-23\"\n }\n}",
386
+ "title": "删除告警屏蔽规则"
387
+ }
388
+ ],
381
389
  "DeleteAlertRules": [
382
390
  {
383
391
  "document": "",
@@ -1820,6 +1820,34 @@
1820
1820
  ],
1821
1821
  "usage": "both"
1822
1822
  },
1823
+ "AddBlindWatermarkConfig": {
1824
+ "document": "增加盲水印配置",
1825
+ "members": [
1826
+ {
1827
+ "disabled": false,
1828
+ "document": "能力配置开关,可选值:\n<li>ON:开启;</li>\n<li>OFF:关闭。</li>\n默认值:ON。\n注意:此字段可能返回 null,表示取不到有效值。",
1829
+ "example": "ON",
1830
+ "member": "string",
1831
+ "name": "Switch",
1832
+ "output_required": false,
1833
+ "required": false,
1834
+ "type": "string",
1835
+ "value_allowed_null": true
1836
+ },
1837
+ {
1838
+ "disabled": false,
1839
+ "document": "盲水印嵌入数据\n注意:此字段可能返回 null,表示取不到有效值。",
1840
+ "example": "无",
1841
+ "member": "BlindWatermarkEmbedInfo",
1842
+ "name": "EmbedInfo",
1843
+ "output_required": false,
1844
+ "required": false,
1845
+ "type": "object",
1846
+ "value_allowed_null": true
1847
+ }
1848
+ ],
1849
+ "usage": "both"
1850
+ },
1823
1851
  "AddOnSubtitle": {
1824
1852
  "document": "外挂字幕。",
1825
1853
  "members": [
@@ -7363,6 +7391,62 @@
7363
7391
  ],
7364
7392
  "usage": "out"
7365
7393
  },
7394
+ "BlindWatermarkConfig": {
7395
+ "document": "盲水印配置",
7396
+ "members": [
7397
+ {
7398
+ "disabled": false,
7399
+ "document": "增加盲水印\n注意:此字段可能返回 null,表示取不到有效值。",
7400
+ "example": "无",
7401
+ "member": "AddBlindWatermarkConfig",
7402
+ "name": "AddBlindWatermark",
7403
+ "output_required": false,
7404
+ "required": false,
7405
+ "type": "object",
7406
+ "value_allowed_null": true
7407
+ },
7408
+ {
7409
+ "disabled": false,
7410
+ "document": "提取盲水印\n注意:此字段可能返回 null,表示取不到有效值。",
7411
+ "example": "无",
7412
+ "member": "ExtractBlindWatermarkConfig",
7413
+ "name": "ExtractBlindWatermark",
7414
+ "output_required": false,
7415
+ "required": false,
7416
+ "type": "object",
7417
+ "value_allowed_null": true
7418
+ },
7419
+ {
7420
+ "disabled": false,
7421
+ "document": "移除盲水印\n注意:此字段可能返回 null,表示取不到有效值。",
7422
+ "example": "无",
7423
+ "member": "RemoveBlindWatermarkConfig",
7424
+ "name": "RemoveBlindWatermark",
7425
+ "output_required": false,
7426
+ "required": false,
7427
+ "type": "object",
7428
+ "value_allowed_null": true
7429
+ }
7430
+ ],
7431
+ "usage": "both"
7432
+ },
7433
+ "BlindWatermarkEmbedInfo": {
7434
+ "document": "嵌入盲水印配置",
7435
+ "members": [
7436
+ {
7437
+ "disabled": false,
7438
+ "document": "盲水印文字,需要经过 URL 安全的 Base64 编码。\n注意:此字段可能返回 null,表示取不到有效值。",
7439
+ "example": "dGVzdA==",
7440
+ "member": "string",
7441
+ "name": "EmbedText",
7442
+ "output_required": false,
7443
+ "required": false,
7444
+ "type": "string",
7445
+ "value_allowed_null": true
7446
+ }
7447
+ ],
7448
+ "usage": "both"
7449
+ },
7366
7450
  "ClassificationConfigureInfo": {
7367
7451
  "document": "智能分类任务控制参数",
7368
7452
  "members": [
@@ -17116,6 +17200,23 @@
17116
17200
  ],
17117
17201
  "usage": "both"
17118
17202
  },
17203
+ "ExtractBlindWatermarkConfig": {
17204
+ "document": "提取盲水印配置",
17205
+ "members": [
17206
+ {
17207
+ "disabled": false,
17208
+ "document": "能力配置开关,可选值:\n<li>ON:开启;</li>\n<li>OFF:关闭。</li>\n默认值:ON。\n注意:此字段可能返回 null,表示取不到有效值。",
17209
+ "example": "ON",
17210
+ "member": "string",
17211
+ "name": "Switch",
17212
+ "output_required": false,
17213
+ "required": false,
17214
+ "type": "string",
17215
+ "value_allowed_null": true
17216
+ }
17217
+ ],
17218
+ "usage": "both"
17219
+ },
17119
17220
  "FaceConfigureInfo": {
17120
17221
  "document": "人脸识别任务控制参数",
17121
17222
  "members": [
@@ -18979,6 +19080,17 @@
18979
19080
  "required": false,
18980
19081
  "type": "object",
18981
19082
  "value_allowed_null": true
19083
+ },
19084
+ {
19085
+ "disabled": false,
19086
+ "document": "盲水印配置。\n注意:此字段可能返回 null,表示取不到有效值。",
19087
+ "example": "无",
19088
+ "member": "BlindWatermarkConfig",
19089
+ "name": "BlindWatermarkConfig",
19090
+ "output_required": false,
19091
+ "required": false,
19092
+ "type": "object",
19093
+ "value_allowed_null": true
18982
19094
  }
18983
19095
  ],
18984
19096
  "usage": "both"
@@ -27568,6 +27680,23 @@
27568
27680
  ],
27569
27681
  "usage": "out"
27570
27682
  },
27683
+ "RemoveBlindWatermarkConfig": {
27684
+ "document": "移除盲水印配置",
27685
+ "members": [
27686
+ {
27687
+ "disabled": false,
27688
+ "document": "能力配置开关,可选值:\n<li>ON:开启;</li>\n<li>OFF:关闭。</li>\n默认值:ON。\n注意:此字段可能返回 null,表示取不到有效值。",
27689
+ "example": "ON",
27690
+ "member": "string",
27691
+ "name": "Switch",
27692
+ "output_required": false,
27693
+ "required": false,
27694
+ "type": "string",
27695
+ "value_allowed_null": true
27696
+ }
27697
+ ],
27698
+ "usage": "both"
27699
+ },
27571
27700
  "ResetWorkflowRequest": {
27572
27701
  "document": "ResetWorkflow请求参数结构体",
27573
27702
  "members": [
@@ -641,58 +641,6 @@ def doHKIDCardOCR(args, parsed_globals):
641
641
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
642
642
 
643
643
 
644
- def doMixedInvoiceOCR(args, parsed_globals):
645
- g_param = parse_global_arg(parsed_globals)
646
-
647
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
648
- cred = credential.CVMRoleCredential()
649
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
650
- cred = credential.STSAssumeRoleCredential(
651
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
652
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
653
- )
654
- 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):
655
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
656
- else:
657
- cred = credential.Credential(
658
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
659
- )
660
- http_profile = HttpProfile(
661
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
662
- reqMethod="POST",
663
- endpoint=g_param[OptionsDefine.Endpoint],
664
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
665
- )
666
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
667
- if g_param[OptionsDefine.Language]:
668
- profile.language = g_param[OptionsDefine.Language]
669
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
670
- client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
671
- client._sdkVersion += ("_CLI_" + __version__)
672
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
673
- model = models.MixedInvoiceOCRRequest()
674
- model.from_json_string(json.dumps(args))
675
- start_time = time.time()
676
- while True:
677
- rsp = client.MixedInvoiceOCR(model)
678
- result = rsp.to_json_string()
679
- try:
680
- json_obj = json.loads(result)
681
- except TypeError as e:
682
- json_obj = json.loads(result.decode('utf-8')) # python3.3
683
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
684
- break
685
- cur_time = time.time()
686
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
687
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
688
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
689
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
690
- else:
691
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
692
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
693
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
694
-
695
-
696
644
  def doPermitOCR(args, parsed_globals):
697
645
  g_param = parse_global_arg(parsed_globals)
698
646
 
@@ -2357,58 +2305,6 @@ def doInstitutionOCR(args, parsed_globals):
2357
2305
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2358
2306
 
2359
2307
 
2360
- def doSmartStructuralOCRV2(args, parsed_globals):
2361
- g_param = parse_global_arg(parsed_globals)
2362
-
2363
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2364
- cred = credential.CVMRoleCredential()
2365
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2366
- cred = credential.STSAssumeRoleCredential(
2367
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2368
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2369
- )
2370
- 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):
2371
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2372
- else:
2373
- cred = credential.Credential(
2374
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2375
- )
2376
- http_profile = HttpProfile(
2377
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2378
- reqMethod="POST",
2379
- endpoint=g_param[OptionsDefine.Endpoint],
2380
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2381
- )
2382
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2383
- if g_param[OptionsDefine.Language]:
2384
- profile.language = g_param[OptionsDefine.Language]
2385
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2386
- client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
2387
- client._sdkVersion += ("_CLI_" + __version__)
2388
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
2389
- model = models.SmartStructuralOCRV2Request()
2390
- model.from_json_string(json.dumps(args))
2391
- start_time = time.time()
2392
- while True:
2393
- rsp = client.SmartStructuralOCRV2(model)
2394
- result = rsp.to_json_string()
2395
- try:
2396
- json_obj = json.loads(result)
2397
- except TypeError as e:
2398
- json_obj = json.loads(result.decode('utf-8')) # python3.3
2399
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2400
- break
2401
- cur_time = time.time()
2402
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2403
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2404
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2405
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2406
- else:
2407
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2408
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2409
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2410
-
2411
-
2412
2308
  def doRecognizeTableAccurateOCR(args, parsed_globals):
2413
2309
  g_param = parse_global_arg(parsed_globals)
2414
2310
 
@@ -3501,7 +3397,7 @@ def doFinanBillOCR(args, parsed_globals):
3501
3397
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3502
3398
 
3503
3399
 
3504
- def doSmartStructuralPro(args, parsed_globals):
3400
+ def doMixedInvoiceOCR(args, parsed_globals):
3505
3401
  g_param = parse_global_arg(parsed_globals)
3506
3402
 
3507
3403
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -3530,11 +3426,11 @@ def doSmartStructuralPro(args, parsed_globals):
3530
3426
  client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
3531
3427
  client._sdkVersion += ("_CLI_" + __version__)
3532
3428
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
3533
- model = models.SmartStructuralProRequest()
3429
+ model = models.MixedInvoiceOCRRequest()
3534
3430
  model.from_json_string(json.dumps(args))
3535
3431
  start_time = time.time()
3536
3432
  while True:
3537
- rsp = client.SmartStructuralPro(model)
3433
+ rsp = client.MixedInvoiceOCR(model)
3538
3434
  result = rsp.to_json_string()
3539
3435
  try:
3540
3436
  json_obj = json.loads(result)
@@ -4668,7 +4564,6 @@ ACTION_MAP = {
4668
4564
  "PropOwnerCertOCR": doPropOwnerCertOCR,
4669
4565
  "InvoiceGeneralOCR": doInvoiceGeneralOCR,
4670
4566
  "HKIDCardOCR": doHKIDCardOCR,
4671
- "MixedInvoiceOCR": doMixedInvoiceOCR,
4672
4567
  "PermitOCR": doPermitOCR,
4673
4568
  "BusInvoiceOCR": doBusInvoiceOCR,
4674
4569
  "EnglishOCR": doEnglishOCR,
@@ -4701,7 +4596,6 @@ ACTION_MAP = {
4701
4596
  "IDCardOCR": doIDCardOCR,
4702
4597
  "RecognizeGeneralTextImageWarn": doRecognizeGeneralTextImageWarn,
4703
4598
  "InstitutionOCR": doInstitutionOCR,
4704
- "SmartStructuralOCRV2": doSmartStructuralOCRV2,
4705
4599
  "RecognizeTableAccurateOCR": doRecognizeTableAccurateOCR,
4706
4600
  "MixedInvoiceDetect": doMixedInvoiceDetect,
4707
4601
  "VatRollInvoiceOCR": doVatRollInvoiceOCR,
@@ -4723,7 +4617,7 @@ ACTION_MAP = {
4723
4617
  "VerifyOfdVatInvoiceOCR": doVerifyOfdVatInvoiceOCR,
4724
4618
  "DriverLicenseOCR": doDriverLicenseOCR,
4725
4619
  "FinanBillOCR": doFinanBillOCR,
4726
- "SmartStructuralPro": doSmartStructuralPro,
4620
+ "MixedInvoiceOCR": doMixedInvoiceOCR,
4727
4621
  "RecognizeHealthCodeOCR": doRecognizeHealthCodeOCR,
4728
4622
  "ImageEnhancement": doImageEnhancement,
4729
4623
  "QuestionSplitOCR": doQuestionSplitOCR,