tccli-intl-en 3.1.1.1__py2.py3-none-any.whl → 3.1.2.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/ckafka/ckafka_client.py +288 -8
- tccli/services/ckafka/v20190819/api.json +494 -76
- tccli/services/ckafka/v20190819/examples.json +45 -5
- tccli/services/cvm/v20170312/examples.json +1 -1
- tccli/services/ocr/ocr_client.py +112 -0
- tccli/services/ocr/v20181119/api.json +505 -0
- tccli/services/ocr/v20181119/examples.json +22 -0
- {tccli_intl_en-3.1.1.1.dist-info → tccli_intl_en-3.1.2.1.dist-info}/METADATA +2 -2
- {tccli_intl_en-3.1.1.1.dist-info → tccli_intl_en-3.1.2.1.dist-info}/RECORD +14 -14
- {tccli_intl_en-3.1.1.1.dist-info → tccli_intl_en-3.1.2.1.dist-info}/LICENSE +0 -0
- {tccli_intl_en-3.1.1.1.dist-info → tccli_intl_en-3.1.2.1.dist-info}/WHEEL +0 -0
- {tccli_intl_en-3.1.1.1.dist-info → tccli_intl_en-3.1.2.1.dist-info}/entry_points.txt +0 -0
- {tccli_intl_en-3.1.1.1.dist-info → tccli_intl_en-3.1.2.1.dist-info}/top_level.txt +0 -0
|
@@ -138,6 +138,22 @@
|
|
|
138
138
|
"title": "Deleting an ACL"
|
|
139
139
|
}
|
|
140
140
|
],
|
|
141
|
+
"DeleteAclRule": [
|
|
142
|
+
{
|
|
143
|
+
"document": " ",
|
|
144
|
+
"input": "POST / HTTP/1.1\nHost: ckafka.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DeleteAclRule\n<Common request parameters>\n\n{\n \"InstanceId\": \"ckafka-123456\",\n \"RuleName\": \"testRule\"\n}",
|
|
145
|
+
"output": "{\n \"Response\": {\n \"Result\": 12,\n \"RequestId\": \"8c3daa3a-d87b-47ef-9ddd-f0905eeb8d84\"\n }\n}",
|
|
146
|
+
"title": "Deleting an ACL Rule Example"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"DeleteGroup": [
|
|
150
|
+
{
|
|
151
|
+
"document": " ",
|
|
152
|
+
"input": "POST / HTTP/1.1\nHost: ckafka.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DeleteGroup\n<Common request parameters>\n\n{\n \"InstanceId\": \"ckafka-6er88krk\",\n \"Group\": \"grouptest\"\n}",
|
|
153
|
+
"output": "{\n \"Response\": {\n \"Result\": {\n \"ReturnCode\": \"0\",\n \"ReturnMessage\": \"group delete success\",\n \"Data\": null\n },\n \"RequestId\": \"7118b7f95-43de-4d27-8sdadsa-dsadsadsa\"\n }\n}",
|
|
154
|
+
"title": "Deleting a Consumer Group Instance"
|
|
155
|
+
}
|
|
156
|
+
],
|
|
141
157
|
"DeleteInstancePost": [
|
|
142
158
|
{
|
|
143
159
|
"document": "This example shows you how to delete post-payment instances.",
|
|
@@ -210,12 +226,12 @@
|
|
|
210
226
|
"title": "Enumerating ACL"
|
|
211
227
|
}
|
|
212
228
|
],
|
|
213
|
-
"
|
|
229
|
+
"DescribeCkafkaVersion": [
|
|
214
230
|
{
|
|
215
|
-
"document": " ",
|
|
216
|
-
"input": "
|
|
217
|
-
"output": "{\n \"Response\": {\n \"
|
|
218
|
-
"title": "Querying
|
|
231
|
+
"document": "This example shows you how to query the Instance Version Information.",
|
|
232
|
+
"input": "POST / HTTP/1.1\nHost: ckafka.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeCkafkaVersion\n<Common request parameters>\n\n{\n \"InstanceId\": \"ckafka-bqwlyrg8\"\n}",
|
|
233
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"d173b4fb-c6d0-4507-a822-b6f277fc4016\"\n }\n}",
|
|
234
|
+
"title": "Querying Instance Version Information"
|
|
219
235
|
}
|
|
220
236
|
],
|
|
221
237
|
"DescribeCkafkaZone": [
|
|
@@ -434,6 +450,14 @@
|
|
|
434
450
|
"title": "Ckafka Pricing"
|
|
435
451
|
}
|
|
436
452
|
],
|
|
453
|
+
"InstanceScalingDown": [
|
|
454
|
+
{
|
|
455
|
+
"document": "This example shows you how to perform instance downsizing.",
|
|
456
|
+
"input": "POST / HTTP/1.1\nHost: ckafka.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: InstanceScalingDown\n<Common request parameters>\n\n{\n \"InstanceId\": \"ckafka-test\",\n \"DiskSize\": 900,\n \"BandWidth\": 40,\n \"Partition\": 1000,\n \"UpgradeStrategy\": 1\n}",
|
|
457
|
+
"output": "{\n \"Response\": {\n \"Result\": {\n \"DealNames\": [\n \"20230703002035272950891\"\n ]\n },\n \"RequestId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n }\n}",
|
|
458
|
+
"title": "Instance Downsizing"
|
|
459
|
+
}
|
|
460
|
+
],
|
|
437
461
|
"ModifyAclRule": [
|
|
438
462
|
{
|
|
439
463
|
"document": "This example shows you how to modify ACL rules.",
|
|
@@ -482,6 +506,14 @@
|
|
|
482
506
|
"title": "Changing Password"
|
|
483
507
|
}
|
|
484
508
|
],
|
|
509
|
+
"ModifyRoutineMaintenanceTask": [
|
|
510
|
+
{
|
|
511
|
+
"document": " ",
|
|
512
|
+
"input": "POST / HTTP/1.1\nHost: ckafka.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyRoutineMaintenanceTask\n<Common request parameters>\n\n{\n \"InstanceId\": \"ckafka-9jnejnb9\",\n \"MaintenanceType\": \"RE_BALANCE\",\n \"MaintenanceSubtype\": \"INSTANCE_PARTITION_RE_BALANCE\",\n \"PlannedTime\": 79200,\n \"Status\": 1,\n \"Week\": \"1,2,3,4,5,6,7\"\n}",
|
|
513
|
+
"output": "{\n \"Response\": {\n \"Result\": {\n \"ReturnCode\": \"0\",\n \"ReturnMessage\": \"success\",\n \"Data\": {\n \"FlowId\": 0,\n \"RouteDTO\": {\n \"RouteId\": 0\n }\n }\n },\n \"RequestId\": \"fcfb7c89-3973-44f1-9a3e-a2811c67434e\"\n }\n}",
|
|
514
|
+
"title": "Setting Instance Attributes"
|
|
515
|
+
}
|
|
516
|
+
],
|
|
485
517
|
"ModifyTopicAttributes": [
|
|
486
518
|
{
|
|
487
519
|
"document": " ",
|
|
@@ -497,6 +529,14 @@
|
|
|
497
529
|
"output": "{\n \"Response\": {\n \"RequestId\": \"20e995ed-75b9-43bb-84c0-35676567e1a8\",\n \"MessageId\": [\n \"646174616875622d6d657568396e686e3a6465736372696265436c6f75644170693a343a3236313838\",\n \"875622d6d657568396e686e3a6465736372696265436c6f75644170693a343a3236323337\"\n ]\n }\n}",
|
|
498
530
|
"title": "Sending Messages Via DataHub HTTP"
|
|
499
531
|
}
|
|
532
|
+
],
|
|
533
|
+
"UpgradeBrokerVersion": [
|
|
534
|
+
{
|
|
535
|
+
"document": "This example shows you how to upgrade the broker version.",
|
|
536
|
+
"input": "POST / HTTP/1.1\nHost: ckafka.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: UpgradeBrokerVersion\n<Common request parameters>\n\n{\n \"InstanceId\": \"ckafka-test\",\n \"Type\": 1,\n \"SourceVersion\": \"v2.8.1_r1.1.7\",\n \"TargetVersion\": \"v2.8.1_r1.1.8\",\n \"DelayTimeStamp\": \"\"\n}",
|
|
537
|
+
"output": "{\n \"Response\": {\n \"Result\": {\n \"ReturnCode\": \"0\",\n \"ReturnMessage\": \"success\",\n \"Data\": {\n \"FlowId\": 0,\n \"RouteDTO\": {\n \"RouteId\": 0\n }\n }\n },\n \"RequestId\": \"2412412412asfdsafasdsfd\"\n }\n}",
|
|
538
|
+
"title": "Upgrading the broker Version"
|
|
539
|
+
}
|
|
500
540
|
]
|
|
501
541
|
},
|
|
502
542
|
"version": "1.0"
|
|
@@ -516,7 +516,7 @@
|
|
|
516
516
|
],
|
|
517
517
|
"ModifyImageAttribute": [
|
|
518
518
|
{
|
|
519
|
-
"document": "This example shows you how to rename the image `img-6pb6lrmy` to `
|
|
519
|
+
"document": "This example shows you how to rename the image `img-6pb6lrmy` to `NewImageName`.",
|
|
520
520
|
"input": "POST / HTTP/1.1\nHost: cvm.intl.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyImageAttribute\n<Common request parameters>\n\n{\n \"ImageId\": \"img-6pb6lrmy\",\n \"ImageName\": \"NewImageName\"\n}",
|
|
521
521
|
"output": "{\n \"Response\": {\n \"RequestId\": \"71e69b56-32be-4412-ab45-49eded6a87be\"\n }\n}",
|
|
522
522
|
"title": "Modifying image name"
|
tccli/services/ocr/ocr_client.py
CHANGED
|
@@ -622,6 +622,61 @@ def doRecognizeBrazilRNEOCR(args, parsed_globals):
|
|
|
622
622
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
623
623
|
|
|
624
624
|
|
|
625
|
+
def doApplyCardVerificationExternal(args, parsed_globals):
|
|
626
|
+
g_param = parse_global_arg(parsed_globals)
|
|
627
|
+
|
|
628
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
629
|
+
cred = credential.CVMRoleCredential()
|
|
630
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
631
|
+
cred = credential.STSAssumeRoleCredential(
|
|
632
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
633
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
634
|
+
)
|
|
635
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
636
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
637
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
638
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
639
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
640
|
+
else:
|
|
641
|
+
cred = credential.Credential(
|
|
642
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
643
|
+
)
|
|
644
|
+
http_profile = HttpProfile(
|
|
645
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
646
|
+
reqMethod="POST",
|
|
647
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
648
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
649
|
+
)
|
|
650
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
651
|
+
if g_param[OptionsDefine.Language]:
|
|
652
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
653
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
654
|
+
client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
655
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
656
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
657
|
+
model = models.ApplyCardVerificationExternalRequest()
|
|
658
|
+
model.from_json_string(json.dumps(args))
|
|
659
|
+
start_time = time.time()
|
|
660
|
+
while True:
|
|
661
|
+
rsp = client.ApplyCardVerificationExternal(model)
|
|
662
|
+
result = rsp.to_json_string()
|
|
663
|
+
try:
|
|
664
|
+
json_obj = json.loads(result)
|
|
665
|
+
except TypeError as e:
|
|
666
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
667
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
668
|
+
break
|
|
669
|
+
cur_time = time.time()
|
|
670
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
671
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
672
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
673
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
674
|
+
else:
|
|
675
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
676
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
677
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
678
|
+
|
|
679
|
+
|
|
625
680
|
def doHKIDCardOCR(args, parsed_globals):
|
|
626
681
|
g_param = parse_global_arg(parsed_globals)
|
|
627
682
|
|
|
@@ -842,6 +897,61 @@ def doRecognizeThaiIDCardOCR(args, parsed_globals):
|
|
|
842
897
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
843
898
|
|
|
844
899
|
|
|
900
|
+
def doGetCardVerificationExternalResult(args, parsed_globals):
|
|
901
|
+
g_param = parse_global_arg(parsed_globals)
|
|
902
|
+
|
|
903
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
904
|
+
cred = credential.CVMRoleCredential()
|
|
905
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
906
|
+
cred = credential.STSAssumeRoleCredential(
|
|
907
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
908
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
909
|
+
)
|
|
910
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
911
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
912
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
913
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
914
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
915
|
+
else:
|
|
916
|
+
cred = credential.Credential(
|
|
917
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
918
|
+
)
|
|
919
|
+
http_profile = HttpProfile(
|
|
920
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
921
|
+
reqMethod="POST",
|
|
922
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
923
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
924
|
+
)
|
|
925
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
926
|
+
if g_param[OptionsDefine.Language]:
|
|
927
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
928
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
929
|
+
client = mod.OcrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
930
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
931
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
932
|
+
model = models.GetCardVerificationExternalResultRequest()
|
|
933
|
+
model.from_json_string(json.dumps(args))
|
|
934
|
+
start_time = time.time()
|
|
935
|
+
while True:
|
|
936
|
+
rsp = client.GetCardVerificationExternalResult(model)
|
|
937
|
+
result = rsp.to_json_string()
|
|
938
|
+
try:
|
|
939
|
+
json_obj = json.loads(result)
|
|
940
|
+
except TypeError as e:
|
|
941
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
942
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
943
|
+
break
|
|
944
|
+
cur_time = time.time()
|
|
945
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
946
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
947
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
948
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
949
|
+
else:
|
|
950
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
951
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
952
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
953
|
+
|
|
954
|
+
|
|
845
955
|
def doRecognizeMacaoIDCardOCR(args, parsed_globals):
|
|
846
956
|
g_param = parse_global_arg(parsed_globals)
|
|
847
957
|
|
|
@@ -2184,10 +2294,12 @@ ACTION_MAP = {
|
|
|
2184
2294
|
"VinOCR": doVinOCR,
|
|
2185
2295
|
"MLIDPassportOCR": doMLIDPassportOCR,
|
|
2186
2296
|
"RecognizeBrazilRNEOCR": doRecognizeBrazilRNEOCR,
|
|
2297
|
+
"ApplyCardVerificationExternal": doApplyCardVerificationExternal,
|
|
2187
2298
|
"HKIDCardOCR": doHKIDCardOCR,
|
|
2188
2299
|
"GeneralBasicOCR": doGeneralBasicOCR,
|
|
2189
2300
|
"PermitOCR": doPermitOCR,
|
|
2190
2301
|
"RecognizeThaiIDCardOCR": doRecognizeThaiIDCardOCR,
|
|
2302
|
+
"GetCardVerificationExternalResult": doGetCardVerificationExternalResult,
|
|
2191
2303
|
"RecognizeMacaoIDCardOCR": doRecognizeMacaoIDCardOCR,
|
|
2192
2304
|
"RecognizeBrazilCommonOCR": doRecognizeBrazilCommonOCR,
|
|
2193
2305
|
"TableOCR": doTableOCR,
|