tccli 3.0.1294.1__py2.py3-none-any.whl → 3.0.1296.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/antiddos/v20200309/api.json +123 -116
- tccli/services/bi/v20220105/api.json +17 -17
- tccli/services/bi/v20220105/examples.json +16 -16
- tccli/services/cam/v20190116/api.json +2 -2
- tccli/services/cam/v20190116/examples.json +1 -1
- tccli/services/captcha/v20190722/api.json +49 -39
- tccli/services/cbs/v20170312/api.json +16 -16
- tccli/services/ccc/v20200210/api.json +124 -23
- tccli/services/ccc/v20200210/examples.json +1 -1
- tccli/services/cdc/v20201214/api.json +1 -1
- tccli/services/cdn/v20180606/api.json +61 -55
- tccli/services/cdn/v20180606/examples.json +11 -11
- tccli/services/cdwpg/v20201230/api.json +21 -21
- tccli/services/cdwpg/v20201230/examples.json +6 -6
- tccli/services/cfw/v20190904/api.json +1 -1
- tccli/services/chc/v20230418/api.json +1 -1
- tccli/services/ckafka/v20190819/api.json +3 -3
- tccli/services/clb/v20180317/api.json +1 -1
- tccli/services/cme/v20191029/api.json +522 -501
- tccli/services/cme/v20191029/examples.json +138 -138
- tccli/services/cvm/v20170312/api.json +1 -1
- tccli/services/cwp/v20180228/api.json +40 -0
- tccli/services/cynosdb/v20190107/api.json +15 -15
- tccli/services/dbdc/v20201029/api.json +42 -42
- tccli/services/dlc/v20210125/api.json +212 -17
- tccli/services/domain/v20180808/api.json +5 -5
- tccli/services/dts/v20180330/api.json +2 -2
- tccli/services/dts/v20211206/api.json +14 -14
- tccli/services/ecdn/v20191012/api.json +4 -4
- tccli/services/emr/v20190103/api.json +2 -2
- tccli/services/ess/v20201111/api.json +13 -4
- tccli/services/essbasic/v20210526/api.json +3 -3
- tccli/services/essbasic/v20210526/examples.json +2 -2
- tccli/services/gs/v20191118/api.json +9 -0
- tccli/services/hai/v20230812/api.json +53 -53
- tccli/services/hunyuan/v20230901/api.json +3 -3
- tccli/services/iotcloud/v20210408/api.json +64 -60
- tccli/services/iotcloud/v20210408/examples.json +13 -13
- tccli/services/iotexplorer/v20190423/api.json +20 -0
- tccli/services/iotvideo/v20191126/api.json +35 -34
- tccli/services/iotvideo/v20191126/examples.json +2 -2
- tccli/services/iotvideo/v20201215/api.json +314 -296
- tccli/services/iotvideo/v20201215/examples.json +56 -56
- tccli/services/iotvideo/v20211125/api.json +309 -281
- tccli/services/iotvideo/v20211125/examples.json +68 -68
- tccli/services/live/v20180801/api.json +39 -10
- tccli/services/live/v20180801/examples.json +1 -1
- tccli/services/lkeap/v20240522/api.json +11 -1
- tccli/services/mariadb/v20170312/api.json +5 -5
- tccli/services/mmps/v20200710/api.json +8 -8
- tccli/services/monitor/v20180724/api.json +59 -3
- tccli/services/monitor/v20180724/examples.json +2 -2
- tccli/services/mps/v20190612/api.json +123 -4
- tccli/services/mqtt/v20240516/api.json +144 -105
- tccli/services/mqtt/v20240516/examples.json +9 -9
- tccli/services/ocr/ocr_client.py +16 -175
- tccli/services/ocr/v20181119/api.json +15 -245
- tccli/services/ocr/v20181119/examples.json +1 -25
- tccli/services/partners/partners_client.py +118 -65
- tccli/services/partners/v20180321/api.json +93 -0
- tccli/services/partners/v20180321/examples.json +8 -0
- tccli/services/privatedns/v20201028/api.json +32 -32
- tccli/services/sqlserver/v20180328/api.json +37 -0
- tccli/services/taf/taf_client.py +53 -0
- tccli/services/taf/v20200210/api.json +138 -0
- tccli/services/taf/v20200210/examples.json +8 -0
- tccli/services/tag/v20180813/api.json +77 -75
- tccli/services/tag/v20180813/examples.json +10 -10
- tccli/services/tbaas/v20180416/api.json +21 -16
- tccli/services/tcr/v20190924/api.json +41 -23
- tccli/services/tdid/v20210519/api.json +12 -12
- tccli/services/tdmq/tdmq_client.py +0 -53
- tccli/services/tdmq/v20200217/api.json +2 -54
- tccli/services/tdmq/v20200217/examples.json +0 -8
- tccli/services/thpc/v20230321/api.json +10 -0
- tccli/services/tke/tke_client.py +61 -8
- tccli/services/tke/v20180525/api.json +355 -245
- tccli/services/tke/v20180525/examples.json +14 -0
- tccli/services/trtc/v20190722/api.json +19 -0
- tccli/services/tsf/v20180326/api.json +44 -12
- tccli/services/vod/v20180717/api.json +1486 -1415
- tccli/services/vod/v20180717/examples.json +50 -50
- tccli/services/vpc/v20170312/api.json +137 -56
- tccli/services/vpc/v20170312/examples.json +5 -5
- tccli/services/waf/v20180125/api.json +2 -2
- tccli/services/waf/v20180125/examples.json +2 -2
- {tccli-3.0.1294.1.dist-info → tccli-3.0.1296.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1294.1.dist-info → tccli-3.0.1296.1.dist-info}/RECORD +92 -92
- {tccli-3.0.1294.1.dist-info → tccli-3.0.1296.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1294.1.dist-info → tccli-3.0.1296.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1294.1.dist-info → tccli-3.0.1296.1.dist-info}/license_files/LICENSE +0 -0
@@ -26,9 +26,9 @@
|
|
26
26
|
],
|
27
27
|
"CreateAuthorizationPolicy": [
|
28
28
|
{
|
29
|
-
"document": "
|
30
|
-
"input": "POST / HTTP/1.1\nHost: mqtt.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateAuthorizationPolicy\n<公共请求参数>\n\n{\n \"InstanceId\": \"mqtt-
|
31
|
-
"output": "{\n \"Error\": null,\n \"RequestId\": null,\n \"Response\": {\n \"RequestId\": \"
|
29
|
+
"document": "",
|
30
|
+
"input": "POST / HTTP/1.1\nHost: mqtt.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateAuthorizationPolicy\n<公共请求参数>\n\n{\n \"InstanceId\": \"mqtt-xxx\",\n \"PolicyName\": \"name1\",\n \"PolicyVersion\": 1,\n \"Priority\": 4,\n \"Effect\": \"allow\",\n \"Actions\": \"pub\",\n \"Retain\": 1,\n \"Qos\": \"2\"\n}",
|
31
|
+
"output": "{\n \"Error\": null,\n \"RequestId\": null,\n \"Response\": {\n \"Id\": 6,\n \"InstanceId\": \"mqtt-xxx\",\n \"RequestId\": \"2e477c8c-abef-46e2-bde3-29433b34f309\"\n }\n}",
|
32
32
|
"title": "示例"
|
33
33
|
}
|
34
34
|
],
|
@@ -188,7 +188,7 @@
|
|
188
188
|
{
|
189
189
|
"document": "示例",
|
190
190
|
"input": "POST / HTTP/1.1\nHost: mqtt.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeCaCertificate\n<公共请求参数>\n\n{\n \"CaSn\": \"1b1e3bf3702110125887a3a721a7e66f05522513\",\n \"InstanceId\": \"mqtt-jbgwp4ae\"\n}",
|
191
|
-
"output": "{\n \"Error\": null,\n \"RequestId\": null,\n \"Response\": {\n \"CaCertificate\": \"-----BEGIN CERTIFICATE-----\\nMIIEvDCCA6SgAwIBAgIUGx4783AhEBJYh6OnIafmbwVSJRMwDQYJKoZIhvcNAQEL\\nBQAwgZIxCzAJBgNVBAYTAmNuMQ0wCwYDVQQIDAR4aWFuMQ0wCwYDVQQHDARodXlp\\nMREwDwYDVQQKDAhqZWhhbnN1bjEWMBQGA1UECwwNdW5pdCBqZWhhbnN1bjEVMBMG\\nA1UEAwwMc3Vuamlhbnhpb25nMSMwIQYJKoZIhvc1UEBwwEaHV5aTERMA8GA1UECgwI\\namVoYW5zdW4xFjAUBgNVB\\n-----END CERTIFICATE-----\\n\",\n \"CaCn\": \"
|
191
|
+
"output": "{\n \"Error\": null,\n \"RequestId\": null,\n \"Response\": {\n \"CaCertificate\": \"-----BEGIN CERTIFICATE-----\\nMIIEvDCCA6SgAwIBAgIUGx4783AhEBJYh6OnIafmbwVSJRMwDQYJKoZIhvcNAQEL\\nBQAwgZIxCzAJBgNVBAYTAmNuMQ0wCwYDVQQIDAR4aWFuMQ0wCwYDVQQHDARodXlp\\nMREwDwYDVQQKDAhqZWhhbnN1bjEWMBQGA1UECwwNdW5pdCBqZWhhbnN1bjEVMBMG\\nA1UEAwwMc3Vuamlhbnhpb25nMSMwIQYJKoZIhvc1UEBwwEaHV5aTERMA8GA1UECgwI\\namVoYW5zdW4xFjAUBgNVB\\n-----END CERTIFICATE-----\\n\",\n \"CaCn\": \"ca.cloud.tencent.com\",\n \"CaIssuerCn\": \"a.cloud.tencent.com\",\n \"CaSn\": \"1b1e3bf3702110125887a3a721a7e66f05522513\",\n \"CreatedTime\": 1724050364000,\n \"Format\": \"PEM\",\n \"LastActivationTime\": 1724050364340,\n \"LastInactivationTime\": 0,\n \"NotAfterTime\": 2030344601000,\n \"NotBeforeTime\": 1724052316000,\n \"RequestId\": \"7cb5d884-35a0-4f35-9cca-24c7d748a034\",\n \"Status\": \"ACTIVE\",\n \"UpdateTime\": 1724050364000\n }\n}",
|
192
192
|
"title": "示例"
|
193
193
|
}
|
194
194
|
],
|
@@ -220,7 +220,7 @@
|
|
220
220
|
{
|
221
221
|
"document": "示例",
|
222
222
|
"input": "POST / HTTP/1.1\nHost: mqtt.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeDeviceCertificates\n<公共请求参数>\n\n{\n \"InstanceId\": \"mqtt-qgzaawn9\"\n}",
|
223
|
-
"output": "{\n \"Error\": null,\n \"RequestId\": null,\n \"Response\": {\n \"Data\": [],\n \"RequestId\": \"378f8c36-a6a1-406c-85ac-f2379386eed6\",\n \"TotalCount\": 0\n }\n}",
|
223
|
+
"output": "{\n \"Error\": null,\n \"RequestId\": null,\n \"Response\": {\n \"Data\": [\n {\n \"ClientId\": \"client-1\",\n \"DeviceCertificateSn\": \"0eef68a582b94254296e54ce754f94d707a59913\",\n \"DeviceCertificateCn\": \"tx\",\n \"DeviceCertificate\": \"-----BEGIN CERTIFICATE-----\\n-----END CERTIFICATE-----\\n\",\n \"CaSn\": \"1b1e3bf3702110125887a3a721a7e66f05522513\",\n \"OrganizationalUnit\": \"tx\",\n \"Format\": \"PEM\",\n \"Status\": \"ACTIVE\",\n \"CertificateSource\": \"API\",\n \"LastActivationTime\": 1742983099435,\n \"LastInactivationTime\": 0,\n \"CreatedTime\": 1742983115198,\n \"UpdateTime\": 1742983115198,\n \"NotBeforeTime\": 1734537600000,\n \"NotAfterTime\": 1766073600000\n }\n ],\n \"RequestId\": \"378f8c36-a6a1-406c-85ac-f2379386eed6\",\n \"TotalCount\": 0\n }\n}",
|
224
224
|
"title": "示例"
|
225
225
|
}
|
226
226
|
],
|
@@ -244,7 +244,7 @@
|
|
244
244
|
{
|
245
245
|
"document": "示例",
|
246
246
|
"input": "POST / HTTP/1.1\nHost: mqtt.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeInstance\n<公共请求参数>\n\n{\n \"InstanceId\": \"mqtt-bg8k8v8o\"\n}",
|
247
|
-
"output": "{\n \"
|
247
|
+
"output": "{\n \"RequestId\": null,\n \"Response\": {\n \"RequestId\": \"5a2634e3-effd-4380-a9ff-3658ec6c1fdc\",\n \"InstanceType\": \"PRO\",\n \"InstanceStatus\": \"RUNNING\",\n \"PayMode\": \"POSTPAID\",\n \"RenewFlag\": 1,\n \"DestroyTime\": 0,\n \"CreatedTime\": 1741832627,\n \"TpsLimit\": 6000,\n \"Remark\": \"\",\n \"SkuCode\": \"pro_6k_1\",\n \"MaxSubscriptionPerClient\": 30,\n \"MaxSubscription\": 180000,\n \"AuthorizationPolicyLimit\": 20,\n \"ClientNumLimit\": 6000,\n \"MaxCaNum\": 20,\n \"DeviceCertificateProvisionType\": \"JITP\",\n \"RegistrationCode\": \"66a00d75-8272-421f-be2a-166e2c2e7813\",\n \"AutomaticActivation\": true,\n \"X509Mode\": \"BYOC\",\n \"ExpiryTime\": 0,\n \"TopicNumLimit\": 300,\n \"InstanceId\": \"mqtt-zxjwkr98\",\n \"TopicNum\": 1,\n \"InstanceName\": \"mqtt-instance1\"\n },\n \"Error\": null\n}",
|
248
248
|
"title": "示例"
|
249
249
|
}
|
250
250
|
],
|
@@ -258,9 +258,9 @@
|
|
258
258
|
],
|
259
259
|
"DescribeMessageList": [
|
260
260
|
{
|
261
|
-
"document": "
|
262
|
-
"input": "POST / HTTP/1.1\nHost: mqtt.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action:
|
263
|
-
"output": "{\n \"Error\": null,\n \"RequestId\": null,\n \"Response\": {\n \"Data\": [\n {\n \"DeadLetterResendSuccessTimes\":
|
261
|
+
"document": "",
|
262
|
+
"input": "POST / HTTP/1.1\nHost: mqtt.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeMessageList\n<公共请求参数>\n\n{\n \"InstanceId\": \"mqtt-g839agr2\",\n \"Topic\": \"home\",\n \"StartTime\": 1743058422270,\n \"EndTime\": 1743060222270,\n \"TaskRequestId\": \"\",\n \"Offset\": 0,\n \"Limit\": 20\n}",
|
263
|
+
"output": "{\n \"Error\": null,\n \"RequestId\": null,\n \"Response\": {\n \"Data\": [\n {\n \"DeadLetterResendSuccessTimes\": 0,\n \"DeadLetterResendTimes\": 0,\n \"Keys\": \"\",\n \"MsgId\": \"153970740050639FEE488932E9830036\",\n \"ProduceTime\": \"2025-03-27 15:23:35\",\n \"ProducerAddr\": \"21.57.114.216:34679\",\n \"Qos\": \"1\",\n \"SubTopic\": \"/11/\",\n \"Tags\": \"MQTT_COMMON\"\n },\n {\n \"DeadLetterResendSuccessTimes\": 0,\n \"DeadLetterResendTimes\": 0,\n \"Keys\": \"\",\n \"MsgId\": \"153970740050639FEE488932EB200037\",\n \"ProduceTime\": \"2025-03-27 15:23:35\",\n \"ProducerAddr\": \"21.57.114.216:34679\",\n \"Qos\": \"1\",\n \"SubTopic\": \"/11/\",\n \"Tags\": \"MQTT_COMMON\"\n }\n ],\n \"RequestId\": \"3381468d-6a5d-4fac-917f-726109bb968b\",\n \"TaskRequestId\": \"d43a8003-6359-4b25-a802-1ad46c98732a\",\n \"TotalCount\": 2\n }\n}",
|
264
264
|
"title": "示例"
|
265
265
|
}
|
266
266
|
],
|
tccli/services/ocr/ocr_client.py
CHANGED
@@ -589,7 +589,7 @@ def doInvoiceGeneralOCR(args, parsed_globals):
|
|
589
589
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
590
590
|
|
591
591
|
|
592
|
-
def
|
592
|
+
def doReconstructDocument(args, parsed_globals):
|
593
593
|
g_param = parse_global_arg(parsed_globals)
|
594
594
|
|
595
595
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -618,11 +618,11 @@ def doRideHailingTransportLicenseOCR(args, parsed_globals):
|
|
618
618
|
client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
|
619
619
|
client._sdkVersion += ("_CLI_" + __version__)
|
620
620
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
621
|
-
model = models.
|
621
|
+
model = models.ReconstructDocumentRequest()
|
622
622
|
model.from_json_string(json.dumps(args))
|
623
623
|
start_time = time.time()
|
624
624
|
while True:
|
625
|
-
rsp = client.
|
625
|
+
rsp = client.ReconstructDocument(model)
|
626
626
|
result = rsp.to_json_string()
|
627
627
|
try:
|
628
628
|
json_obj = json.loads(result)
|
@@ -1213,7 +1213,7 @@ def doMainlandPermitOCR(args, parsed_globals):
|
|
1213
1213
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
1214
|
|
1215
1215
|
|
1216
|
-
def
|
1216
|
+
def doFlightInvoiceOCR(args, parsed_globals):
|
1217
1217
|
g_param = parse_global_arg(parsed_globals)
|
1218
1218
|
|
1219
1219
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1242,11 +1242,11 @@ def doGeneralBasicOCR(args, parsed_globals):
|
|
1242
1242
|
client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
|
1243
1243
|
client._sdkVersion += ("_CLI_" + __version__)
|
1244
1244
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1245
|
-
model = models.
|
1245
|
+
model = models.FlightInvoiceOCRRequest()
|
1246
1246
|
model.from_json_string(json.dumps(args))
|
1247
1247
|
start_time = time.time()
|
1248
1248
|
while True:
|
1249
|
-
rsp = client.
|
1249
|
+
rsp = client.FlightInvoiceOCR(model)
|
1250
1250
|
result = rsp.to_json_string()
|
1251
1251
|
try:
|
1252
1252
|
json_obj = json.loads(result)
|
@@ -1577,58 +1577,6 @@ def doBizLicenseOCR(args, parsed_globals):
|
|
1577
1577
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1578
1578
|
|
1579
1579
|
|
1580
|
-
def doGetTaskState(args, parsed_globals):
|
1581
|
-
g_param = parse_global_arg(parsed_globals)
|
1582
|
-
|
1583
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1584
|
-
cred = credential.CVMRoleCredential()
|
1585
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1586
|
-
cred = credential.STSAssumeRoleCredential(
|
1587
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1588
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1589
|
-
)
|
1590
|
-
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):
|
1591
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1592
|
-
else:
|
1593
|
-
cred = credential.Credential(
|
1594
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1595
|
-
)
|
1596
|
-
http_profile = HttpProfile(
|
1597
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1598
|
-
reqMethod="POST",
|
1599
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
1600
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1601
|
-
)
|
1602
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1603
|
-
if g_param[OptionsDefine.Language]:
|
1604
|
-
profile.language = g_param[OptionsDefine.Language]
|
1605
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1606
|
-
client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
|
1607
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
1608
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1609
|
-
model = models.GetTaskStateRequest()
|
1610
|
-
model.from_json_string(json.dumps(args))
|
1611
|
-
start_time = time.time()
|
1612
|
-
while True:
|
1613
|
-
rsp = client.GetTaskState(model)
|
1614
|
-
result = rsp.to_json_string()
|
1615
|
-
try:
|
1616
|
-
json_obj = json.loads(result)
|
1617
|
-
except TypeError as e:
|
1618
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1619
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1620
|
-
break
|
1621
|
-
cur_time = time.time()
|
1622
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1623
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1624
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1625
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1626
|
-
else:
|
1627
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1628
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1629
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1630
|
-
|
1631
|
-
|
1632
1580
|
def doRecognizeGeneralCardWarn(args, parsed_globals):
|
1633
1581
|
g_param = parse_global_arg(parsed_globals)
|
1634
1582
|
|
@@ -1681,7 +1629,7 @@ def doRecognizeGeneralCardWarn(args, parsed_globals):
|
|
1681
1629
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1682
1630
|
|
1683
1631
|
|
1684
|
-
def
|
1632
|
+
def doGeneralBasicOCR(args, parsed_globals):
|
1685
1633
|
g_param = parse_global_arg(parsed_globals)
|
1686
1634
|
|
1687
1635
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1710,11 +1658,11 @@ def doFlightInvoiceOCR(args, parsed_globals):
|
|
1710
1658
|
client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
|
1711
1659
|
client._sdkVersion += ("_CLI_" + __version__)
|
1712
1660
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1713
|
-
model = models.
|
1661
|
+
model = models.GeneralBasicOCRRequest()
|
1714
1662
|
model.from_json_string(json.dumps(args))
|
1715
1663
|
start_time = time.time()
|
1716
1664
|
while True:
|
1717
|
-
rsp = client.
|
1665
|
+
rsp = client.GeneralBasicOCR(model)
|
1718
1666
|
result = rsp.to_json_string()
|
1719
1667
|
try:
|
1720
1668
|
json_obj = json.loads(result)
|
@@ -2045,58 +1993,6 @@ def doBankCardOCR(args, parsed_globals):
|
|
2045
1993
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2046
1994
|
|
2047
1995
|
|
2048
|
-
def doVatInvoiceVerify(args, parsed_globals):
|
2049
|
-
g_param = parse_global_arg(parsed_globals)
|
2050
|
-
|
2051
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2052
|
-
cred = credential.CVMRoleCredential()
|
2053
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2054
|
-
cred = credential.STSAssumeRoleCredential(
|
2055
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2056
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2057
|
-
)
|
2058
|
-
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):
|
2059
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2060
|
-
else:
|
2061
|
-
cred = credential.Credential(
|
2062
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2063
|
-
)
|
2064
|
-
http_profile = HttpProfile(
|
2065
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2066
|
-
reqMethod="POST",
|
2067
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
2068
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2069
|
-
)
|
2070
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2071
|
-
if g_param[OptionsDefine.Language]:
|
2072
|
-
profile.language = g_param[OptionsDefine.Language]
|
2073
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2074
|
-
client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
|
2075
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
2076
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2077
|
-
model = models.VatInvoiceVerifyRequest()
|
2078
|
-
model.from_json_string(json.dumps(args))
|
2079
|
-
start_time = time.time()
|
2080
|
-
while True:
|
2081
|
-
rsp = client.VatInvoiceVerify(model)
|
2082
|
-
result = rsp.to_json_string()
|
2083
|
-
try:
|
2084
|
-
json_obj = json.loads(result)
|
2085
|
-
except TypeError as e:
|
2086
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2087
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2088
|
-
break
|
2089
|
-
cur_time = time.time()
|
2090
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2091
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2092
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2093
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2094
|
-
else:
|
2095
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2096
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2097
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2098
|
-
|
2099
|
-
|
2100
1996
|
def doGetOCRToken(args, parsed_globals):
|
2101
1997
|
g_param = parse_global_arg(parsed_globals)
|
2102
1998
|
|
@@ -2877,58 +2773,6 @@ def doRecognizeTableOCR(args, parsed_globals):
|
|
2877
2773
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2878
2774
|
|
2879
2775
|
|
2880
|
-
def doCreateAIFormTask(args, parsed_globals):
|
2881
|
-
g_param = parse_global_arg(parsed_globals)
|
2882
|
-
|
2883
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2884
|
-
cred = credential.CVMRoleCredential()
|
2885
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2886
|
-
cred = credential.STSAssumeRoleCredential(
|
2887
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2888
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2889
|
-
)
|
2890
|
-
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):
|
2891
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2892
|
-
else:
|
2893
|
-
cred = credential.Credential(
|
2894
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2895
|
-
)
|
2896
|
-
http_profile = HttpProfile(
|
2897
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2898
|
-
reqMethod="POST",
|
2899
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
2900
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2901
|
-
)
|
2902
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2903
|
-
if g_param[OptionsDefine.Language]:
|
2904
|
-
profile.language = g_param[OptionsDefine.Language]
|
2905
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2906
|
-
client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
|
2907
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
2908
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2909
|
-
model = models.CreateAIFormTaskRequest()
|
2910
|
-
model.from_json_string(json.dumps(args))
|
2911
|
-
start_time = time.time()
|
2912
|
-
while True:
|
2913
|
-
rsp = client.CreateAIFormTask(model)
|
2914
|
-
result = rsp.to_json_string()
|
2915
|
-
try:
|
2916
|
-
json_obj = json.loads(result)
|
2917
|
-
except TypeError as e:
|
2918
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2919
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2920
|
-
break
|
2921
|
-
cur_time = time.time()
|
2922
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2923
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2924
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2925
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2926
|
-
else:
|
2927
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2928
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2929
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2930
|
-
|
2931
|
-
|
2932
2776
|
def doWaybillOCR(args, parsed_globals):
|
2933
2777
|
g_param = parse_global_arg(parsed_globals)
|
2934
2778
|
|
@@ -4593,7 +4437,7 @@ def doShipInvoiceOCR(args, parsed_globals):
|
|
4593
4437
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4594
4438
|
|
4595
4439
|
|
4596
|
-
def
|
4440
|
+
def doRideHailingTransportLicenseOCR(args, parsed_globals):
|
4597
4441
|
g_param = parse_global_arg(parsed_globals)
|
4598
4442
|
|
4599
4443
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -4622,11 +4466,11 @@ def doReconstructDocument(args, parsed_globals):
|
|
4622
4466
|
client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
|
4623
4467
|
client._sdkVersion += ("_CLI_" + __version__)
|
4624
4468
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4625
|
-
model = models.
|
4469
|
+
model = models.RideHailingTransportLicenseOCRRequest()
|
4626
4470
|
model.from_json_string(json.dumps(args))
|
4627
4471
|
start_time = time.time()
|
4628
4472
|
while True:
|
4629
|
-
rsp = client.
|
4473
|
+
rsp = client.RideHailingTransportLicenseOCR(model)
|
4630
4474
|
result = rsp.to_json_string()
|
4631
4475
|
try:
|
4632
4476
|
json_obj = json.loads(result)
|
@@ -4667,7 +4511,7 @@ ACTION_MAP = {
|
|
4667
4511
|
"TrainTicketOCR": doTrainTicketOCR,
|
4668
4512
|
"PropOwnerCertOCR": doPropOwnerCertOCR,
|
4669
4513
|
"InvoiceGeneralOCR": doInvoiceGeneralOCR,
|
4670
|
-
"
|
4514
|
+
"ReconstructDocument": doReconstructDocument,
|
4671
4515
|
"HKIDCardOCR": doHKIDCardOCR,
|
4672
4516
|
"MixedInvoiceOCR": doMixedInvoiceOCR,
|
4673
4517
|
"PermitOCR": doPermitOCR,
|
@@ -4679,23 +4523,21 @@ ACTION_MAP = {
|
|
4679
4523
|
"RideHailingDriverLicenseOCR": doRideHailingDriverLicenseOCR,
|
4680
4524
|
"DutyPaidProofOCR": doDutyPaidProofOCR,
|
4681
4525
|
"MainlandPermitOCR": doMainlandPermitOCR,
|
4682
|
-
"
|
4526
|
+
"FlightInvoiceOCR": doFlightInvoiceOCR,
|
4683
4527
|
"RecognizeGeneralInvoice": doRecognizeGeneralInvoice,
|
4684
4528
|
"InsuranceBillOCR": doInsuranceBillOCR,
|
4685
4529
|
"VatInvoiceVerifyNew": doVatInvoiceVerifyNew,
|
4686
4530
|
"VinOCR": doVinOCR,
|
4687
4531
|
"VehicleLicenseOCR": doVehicleLicenseOCR,
|
4688
4532
|
"BizLicenseOCR": doBizLicenseOCR,
|
4689
|
-
"GetTaskState": doGetTaskState,
|
4690
4533
|
"RecognizeGeneralCardWarn": doRecognizeGeneralCardWarn,
|
4691
|
-
"
|
4534
|
+
"GeneralBasicOCR": doGeneralBasicOCR,
|
4692
4535
|
"RecognizeThaiIDCardOCR": doRecognizeThaiIDCardOCR,
|
4693
4536
|
"TableOCR": doTableOCR,
|
4694
4537
|
"ArithmeticOCR": doArithmeticOCR,
|
4695
4538
|
"EstateCertOCR": doEstateCertOCR,
|
4696
4539
|
"RecognizeValidIDCardOCR": doRecognizeValidIDCardOCR,
|
4697
4540
|
"BankCardOCR": doBankCardOCR,
|
4698
|
-
"VatInvoiceVerify": doVatInvoiceVerify,
|
4699
4541
|
"GetOCRToken": doGetOCRToken,
|
4700
4542
|
"EduPaperOCR": doEduPaperOCR,
|
4701
4543
|
"EnterpriseLicenseOCR": doEnterpriseLicenseOCR,
|
@@ -4711,7 +4553,6 @@ ACTION_MAP = {
|
|
4711
4553
|
"GeneralHandwritingOCR": doGeneralHandwritingOCR,
|
4712
4554
|
"RecognizeOnlineTaxiItineraryOCR": doRecognizeOnlineTaxiItineraryOCR,
|
4713
4555
|
"RecognizeTableOCR": doRecognizeTableOCR,
|
4714
|
-
"CreateAIFormTask": doCreateAIFormTask,
|
4715
4556
|
"WaybillOCR": doWaybillOCR,
|
4716
4557
|
"HmtResidentPermitOCR": doHmtResidentPermitOCR,
|
4717
4558
|
"TollInvoiceOCR": doTollInvoiceOCR,
|
@@ -4744,7 +4585,7 @@ ACTION_MAP = {
|
|
4744
4585
|
"FormulaOCR": doFormulaOCR,
|
4745
4586
|
"PassportOCR": doPassportOCR,
|
4746
4587
|
"ShipInvoiceOCR": doShipInvoiceOCR,
|
4747
|
-
"
|
4588
|
+
"RideHailingTransportLicenseOCR": doRideHailingTransportLicenseOCR,
|
4748
4589
|
|
4749
4590
|
}
|
4750
4591
|
|