tccli 3.0.1243.1__py2.py3-none-any.whl → 3.0.1244.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/aca/v20210323/api.json +107 -107
- tccli/services/aca/v20210323/examples.json +5 -5
- tccli/services/asr/v20190614/examples.json +6 -6
- tccli/services/cbs/v20170312/api.json +9 -0
- tccli/services/cdwdoris/v20211228/api.json +22 -2
- tccli/services/cdwdoris/v20211228/examples.json +1 -1
- tccli/services/cls/v20201016/api.json +185 -156
- tccli/services/cls/v20201016/examples.json +5 -5
- tccli/services/cvm/v20170312/api.json +8 -8
- tccli/services/cvm/v20170312/examples.json +4 -4
- tccli/services/dts/v20211206/api.json +9 -0
- tccli/services/dts/v20211206/examples.json +1 -1
- tccli/services/mna/v20210119/examples.json +1 -1
- tccli/services/ocr/ocr_client.py +38 -91
- tccli/services/ocr/v20181119/api.json +0 -187
- tccli/services/ocr/v20181119/examples.json +0 -8
- tccli/services/scf/scf_client.py +118 -65
- tccli/services/scf/v20180416/api.json +570 -475
- tccli/services/scf/v20180416/examples.json +52 -44
- tccli/services/tcb/v20180608/api.json +13 -13
- tccli/services/tcm/v20210413/api.json +45 -47
- tccli/services/tcr/v20190924/api.json +399 -371
- tccli/services/tcr/v20190924/examples.json +32 -32
- tccli/services/tke/v20180525/api.json +690 -590
- tccli/services/tke/v20180525/examples.json +128 -128
- tccli/services/vpc/v20170312/api.json +162 -134
- tccli/services/vpc/v20170312/examples.json +3 -3
- {tccli-3.0.1243.1.dist-info → tccli-3.0.1244.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1243.1.dist-info → tccli-3.0.1244.1.dist-info}/RECORD +33 -33
- {tccli-3.0.1243.1.dist-info → tccli-3.0.1244.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1243.1.dist-info → tccli-3.0.1244.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1243.1.dist-info → tccli-3.0.1244.1.dist-info}/license_files/LICENSE +0 -0
@@ -14,13 +14,6 @@
|
|
14
14
|
"output": "ArithmeticOCRResponse",
|
15
15
|
"status": "online"
|
16
16
|
},
|
17
|
-
"BankCardOCR": {
|
18
|
-
"document": "本接口支持对中国大陆主流银行卡正反面关键字段的检测与识别,包括卡号、卡类型、卡名字、银行信息、有效期。支持竖排异形卡识别、多角度旋转图片识别。支持对复印件、翻拍件、边框遮挡的银行卡进行告警,可应用于各种银行卡信息有效性校验场景,如金融行业身份认证、第三方支付绑卡等场景。\n\n默认接口请求频率限制:10次/秒。",
|
19
|
-
"input": "BankCardOCRRequest",
|
20
|
-
"name": "银行卡识别",
|
21
|
-
"output": "BankCardOCRResponse",
|
22
|
-
"status": "online"
|
23
|
-
},
|
24
17
|
"BankSlipOCR": {
|
25
18
|
"document": "本接口支持银行回单全字段的识别,包括付款开户行、收款开户行、付款账号、收款账号、回单类型、回单编号、币种、流水号、凭证号码、交易机构、交易金额、手续费、日期等字段信息。\n\n默认接口请求频率限制:10次/秒。",
|
26
19
|
"input": "BankSlipOCRRequest",
|
@@ -1387,186 +1380,6 @@
|
|
1387
1380
|
],
|
1388
1381
|
"type": "object"
|
1389
1382
|
},
|
1390
|
-
"BankCardOCRRequest": {
|
1391
|
-
"document": "BankCardOCR请求参数结构体",
|
1392
|
-
"members": [
|
1393
|
-
{
|
1394
|
-
"disabled": false,
|
1395
|
-
"document": "图片的 Base64 值。要求图片经Base64编码后不超过 7M,分辨率建议500*800以上,支持PNG、JPG、JPEG、BMP格式。建议卡片部分占据图片2/3以上。\n图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。",
|
1396
|
-
"example": "/9j/4AAQSkZJRg.....s97n//2Q==",
|
1397
|
-
"member": "string",
|
1398
|
-
"name": "ImageBase64",
|
1399
|
-
"required": false,
|
1400
|
-
"type": "string"
|
1401
|
-
},
|
1402
|
-
{
|
1403
|
-
"disabled": false,
|
1404
|
-
"document": "图片的 Url 地址。要求图片经Base64编码后不超过 7M,分辨率建议500*800以上,支持PNG、JPG、JPEG、BMP格式。建议卡片部分占据图片2/3以上。\n建议图片存储于腾讯云,可保障更高的下载速度和稳定性。",
|
1405
|
-
"example": "https://ocr-demo-1254418846.cos.ap-guangzhou.myqcloud.com/card/BankCardOCR/BankCardOCR1.jpg",
|
1406
|
-
"member": "string",
|
1407
|
-
"name": "ImageUrl",
|
1408
|
-
"required": false,
|
1409
|
-
"type": "string"
|
1410
|
-
},
|
1411
|
-
{
|
1412
|
-
"disabled": false,
|
1413
|
-
"document": "是否返回预处理(精确剪裁对齐)后的银行卡图片数据,默认false。",
|
1414
|
-
"example": "false",
|
1415
|
-
"member": "bool",
|
1416
|
-
"name": "RetBorderCutImage",
|
1417
|
-
"required": false,
|
1418
|
-
"type": "bool"
|
1419
|
-
},
|
1420
|
-
{
|
1421
|
-
"disabled": false,
|
1422
|
-
"document": "是否返回卡号的切图图片数据,默认false。",
|
1423
|
-
"example": "false",
|
1424
|
-
"member": "bool",
|
1425
|
-
"name": "RetCardNoImage",
|
1426
|
-
"required": false,
|
1427
|
-
"type": "bool"
|
1428
|
-
},
|
1429
|
-
{
|
1430
|
-
"disabled": false,
|
1431
|
-
"document": "复印件检测开关,如果输入的图片是银行卡复印件图片则返回告警,默认false。",
|
1432
|
-
"example": "false",
|
1433
|
-
"member": "bool",
|
1434
|
-
"name": "EnableCopyCheck",
|
1435
|
-
"required": false,
|
1436
|
-
"type": "bool"
|
1437
|
-
},
|
1438
|
-
{
|
1439
|
-
"disabled": false,
|
1440
|
-
"document": "翻拍检测开关,如果输入的图片是银行卡翻拍图片则返回告警,默认false。",
|
1441
|
-
"example": "false",
|
1442
|
-
"member": "bool",
|
1443
|
-
"name": "EnableReshootCheck",
|
1444
|
-
"required": false,
|
1445
|
-
"type": "bool"
|
1446
|
-
},
|
1447
|
-
{
|
1448
|
-
"disabled": false,
|
1449
|
-
"document": "边框遮挡检测开关,如果输入的图片是银行卡边框被遮挡则返回告警,默认false。",
|
1450
|
-
"example": "false",
|
1451
|
-
"member": "bool",
|
1452
|
-
"name": "EnableBorderCheck",
|
1453
|
-
"required": false,
|
1454
|
-
"type": "bool"
|
1455
|
-
},
|
1456
|
-
{
|
1457
|
-
"disabled": false,
|
1458
|
-
"document": "是否返回图片质量分数(图片质量分数是评价一个图片的模糊程度的标准),默认false。",
|
1459
|
-
"example": "false",
|
1460
|
-
"member": "bool",
|
1461
|
-
"name": "EnableQualityValue",
|
1462
|
-
"required": false,
|
1463
|
-
"type": "bool"
|
1464
|
-
}
|
1465
|
-
],
|
1466
|
-
"type": "object"
|
1467
|
-
},
|
1468
|
-
"BankCardOCRResponse": {
|
1469
|
-
"document": "BankCardOCR返回参数结构体",
|
1470
|
-
"members": [
|
1471
|
-
{
|
1472
|
-
"disabled": false,
|
1473
|
-
"document": "卡号",
|
1474
|
-
"example": "6225768888888888",
|
1475
|
-
"member": "string",
|
1476
|
-
"name": "CardNo",
|
1477
|
-
"output_required": true,
|
1478
|
-
"type": "string",
|
1479
|
-
"value_allowed_null": false
|
1480
|
-
},
|
1481
|
-
{
|
1482
|
-
"disabled": false,
|
1483
|
-
"document": "银行信息",
|
1484
|
-
"example": "招商银行(03080000)",
|
1485
|
-
"member": "string",
|
1486
|
-
"name": "BankInfo",
|
1487
|
-
"output_required": true,
|
1488
|
-
"type": "string",
|
1489
|
-
"value_allowed_null": false
|
1490
|
-
},
|
1491
|
-
{
|
1492
|
-
"disabled": false,
|
1493
|
-
"document": "有效期,格式如:07/2023",
|
1494
|
-
"example": "07/2023",
|
1495
|
-
"member": "string",
|
1496
|
-
"name": "ValidDate",
|
1497
|
-
"output_required": true,
|
1498
|
-
"type": "string",
|
1499
|
-
"value_allowed_null": false
|
1500
|
-
},
|
1501
|
-
{
|
1502
|
-
"disabled": false,
|
1503
|
-
"document": "卡类型",
|
1504
|
-
"example": "贷记卡",
|
1505
|
-
"member": "string",
|
1506
|
-
"name": "CardType",
|
1507
|
-
"output_required": true,
|
1508
|
-
"type": "string",
|
1509
|
-
"value_allowed_null": false
|
1510
|
-
},
|
1511
|
-
{
|
1512
|
-
"disabled": false,
|
1513
|
-
"document": "卡名字",
|
1514
|
-
"example": "招商银行信用卡",
|
1515
|
-
"member": "string",
|
1516
|
-
"name": "CardName",
|
1517
|
-
"output_required": true,
|
1518
|
-
"type": "string",
|
1519
|
-
"value_allowed_null": false
|
1520
|
-
},
|
1521
|
-
{
|
1522
|
-
"disabled": false,
|
1523
|
-
"document": "切片图片数据\n注意:此字段可能返回 null,表示取不到有效值。",
|
1524
|
-
"example": "/9j/4AAQSkZJRg.....s97n//2Q==",
|
1525
|
-
"member": "string",
|
1526
|
-
"name": "BorderCutImage",
|
1527
|
-
"output_required": true,
|
1528
|
-
"type": "string",
|
1529
|
-
"value_allowed_null": true
|
1530
|
-
},
|
1531
|
-
{
|
1532
|
-
"disabled": false,
|
1533
|
-
"document": "卡号图片数据\n注意:此字段可能返回 null,表示取不到有效值。",
|
1534
|
-
"example": "/9j/4AAQSkZJRg.....s97n//2Q==",
|
1535
|
-
"member": "string",
|
1536
|
-
"name": "CardNoImage",
|
1537
|
-
"output_required": true,
|
1538
|
-
"type": "string",
|
1539
|
-
"value_allowed_null": true
|
1540
|
-
},
|
1541
|
-
{
|
1542
|
-
"disabled": false,
|
1543
|
-
"document": "WarningCode 告警码列表和释义:\n-9110:银行卡日期无效; \n-9111:银行卡边框不完整; \n-9112:银行卡图片反光;\n-9113:银行卡复印件;\n-9114:银行卡翻拍件\n(告警码可以同时存在多个)\n注意:此字段可能返回 null,表示取不到有效值。",
|
1544
|
-
"example": "[-9110]",
|
1545
|
-
"member": "int64",
|
1546
|
-
"name": "WarningCode",
|
1547
|
-
"output_required": true,
|
1548
|
-
"type": "list",
|
1549
|
-
"value_allowed_null": true
|
1550
|
-
},
|
1551
|
-
{
|
1552
|
-
"disabled": false,
|
1553
|
-
"document": "图片质量分数,请求EnableQualityValue时返回(取值范围:0-100,分数越低越模糊,建议阈值≥50)。\n注意:此字段可能返回 null,表示取不到有效值。",
|
1554
|
-
"example": "90",
|
1555
|
-
"member": "int64",
|
1556
|
-
"name": "QualityValue",
|
1557
|
-
"output_required": true,
|
1558
|
-
"type": "int",
|
1559
|
-
"value_allowed_null": true
|
1560
|
-
},
|
1561
|
-
{
|
1562
|
-
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
1563
|
-
"member": "string",
|
1564
|
-
"name": "RequestId",
|
1565
|
-
"type": "string"
|
1566
|
-
}
|
1567
|
-
],
|
1568
|
-
"type": "object"
|
1569
|
-
},
|
1570
1383
|
"BankSlipInfo": {
|
1571
1384
|
"document": "银行回单识别出的字段",
|
1572
1385
|
"members": [
|
@@ -16,14 +16,6 @@
|
|
16
16
|
"title": "算式识别示例代码"
|
17
17
|
}
|
18
18
|
],
|
19
|
-
"BankCardOCR": [
|
20
|
-
{
|
21
|
-
"document": "",
|
22
|
-
"input": "POST / HTTP/1.1\nHost: ocr.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: BankCardOCR\n<公共请求参数>\n\n{\n \"ImageUrl\": \"https://ocr-demo-1254418846.cos.ap-guangzhou.myqcloud.com/card/BankCardOCR/BankCardOCR1.jpg\"\n}",
|
23
|
-
"output": "{\n \"Response\": {\n \"BankInfo\": \"招商银行(03080000)\",\n \"BorderCutImage\": null,\n \"CardName\": \"招商银行信用卡\",\n \"CardNo\": \"6225768888888888\",\n \"CardNoImage\": null,\n \"CardType\": \"贷记卡\",\n \"QualityValue\": null,\n \"RequestId\": \"4a4438c5-09ff-4031-945c-17000ba4542d\",\n \"ValidDate\": \"07/2023\",\n \"WarningCode\": null\n }\n}",
|
24
|
-
"title": "BankCardOCR调用"
|
25
|
-
}
|
26
|
-
],
|
27
19
|
"BankSlipOCR": [
|
28
20
|
{
|
29
21
|
"document": "银行回单识别",
|
tccli/services/scf/scf_client.py
CHANGED
@@ -485,7 +485,7 @@ def doCopyFunction(args, parsed_globals):
|
|
485
485
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
486
486
|
|
487
487
|
|
488
|
-
def
|
488
|
+
def doDeleteTrigger(args, parsed_globals):
|
489
489
|
g_param = parse_global_arg(parsed_globals)
|
490
490
|
|
491
491
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -514,11 +514,11 @@ def doGetFunctionLogs(args, parsed_globals):
|
|
514
514
|
client = mod.ScfClient(cred, g_param[OptionsDefine.Region], profile)
|
515
515
|
client._sdkVersion += ("_CLI_" + __version__)
|
516
516
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
517
|
-
model = models.
|
517
|
+
model = models.DeleteTriggerRequest()
|
518
518
|
model.from_json_string(json.dumps(args))
|
519
519
|
start_time = time.time()
|
520
520
|
while True:
|
521
|
-
rsp = client.
|
521
|
+
rsp = client.DeleteTrigger(model)
|
522
522
|
result = rsp.to_json_string()
|
523
523
|
try:
|
524
524
|
json_obj = json.loads(result)
|
@@ -589,7 +589,7 @@ def doListAliases(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 doDeleteNamespace(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 doDeleteTrigger(args, parsed_globals):
|
|
618
618
|
client = mod.ScfClient(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.DeleteNamespaceRequest()
|
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.DeleteNamespace(model)
|
626
626
|
result = rsp.to_json_string()
|
627
627
|
try:
|
628
628
|
json_obj = json.loads(result)
|
@@ -1109,7 +1109,7 @@ def doGetAsyncEventStatus(args, parsed_globals):
|
|
1109
1109
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1110
1110
|
|
1111
1111
|
|
1112
|
-
def
|
1112
|
+
def doPutTotalConcurrencyConfig(args, parsed_globals):
|
1113
1113
|
g_param = parse_global_arg(parsed_globals)
|
1114
1114
|
|
1115
1115
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1138,11 +1138,11 @@ def doDeleteNamespace(args, parsed_globals):
|
|
1138
1138
|
client = mod.ScfClient(cred, g_param[OptionsDefine.Region], profile)
|
1139
1139
|
client._sdkVersion += ("_CLI_" + __version__)
|
1140
1140
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1141
|
-
model = models.
|
1141
|
+
model = models.PutTotalConcurrencyConfigRequest()
|
1142
1142
|
model.from_json_string(json.dumps(args))
|
1143
1143
|
start_time = time.time()
|
1144
1144
|
while True:
|
1145
|
-
rsp = client.
|
1145
|
+
rsp = client.PutTotalConcurrencyConfig(model)
|
1146
1146
|
result = rsp.to_json_string()
|
1147
1147
|
try:
|
1148
1148
|
json_obj = json.loads(result)
|
@@ -1213,6 +1213,110 @@ def doListAsyncEvents(args, parsed_globals):
|
|
1213
1213
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
1214
|
|
1215
1215
|
|
1216
|
+
def doDeleteFunctionVersion(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.ScfClient(cred, g_param[OptionsDefine.Region], profile)
|
1243
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1244
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1245
|
+
model = models.DeleteFunctionVersionRequest()
|
1246
|
+
model.from_json_string(json.dumps(args))
|
1247
|
+
start_time = time.time()
|
1248
|
+
while True:
|
1249
|
+
rsp = client.DeleteFunctionVersion(model)
|
1250
|
+
result = rsp.to_json_string()
|
1251
|
+
try:
|
1252
|
+
json_obj = json.loads(result)
|
1253
|
+
except TypeError as e:
|
1254
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1255
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1256
|
+
break
|
1257
|
+
cur_time = time.time()
|
1258
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1259
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1260
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1261
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1262
|
+
else:
|
1263
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1264
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1265
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1266
|
+
|
1267
|
+
|
1268
|
+
def doGetFunctionLogs(args, parsed_globals):
|
1269
|
+
g_param = parse_global_arg(parsed_globals)
|
1270
|
+
|
1271
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1272
|
+
cred = credential.CVMRoleCredential()
|
1273
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1274
|
+
cred = credential.STSAssumeRoleCredential(
|
1275
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1276
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1277
|
+
)
|
1278
|
+
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):
|
1279
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1280
|
+
else:
|
1281
|
+
cred = credential.Credential(
|
1282
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1283
|
+
)
|
1284
|
+
http_profile = HttpProfile(
|
1285
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1286
|
+
reqMethod="POST",
|
1287
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1288
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1289
|
+
)
|
1290
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1291
|
+
if g_param[OptionsDefine.Language]:
|
1292
|
+
profile.language = g_param[OptionsDefine.Language]
|
1293
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1294
|
+
client = mod.ScfClient(cred, g_param[OptionsDefine.Region], profile)
|
1295
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1296
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1297
|
+
model = models.GetFunctionLogsRequest()
|
1298
|
+
model.from_json_string(json.dumps(args))
|
1299
|
+
start_time = time.time()
|
1300
|
+
while True:
|
1301
|
+
rsp = client.GetFunctionLogs(model)
|
1302
|
+
result = rsp.to_json_string()
|
1303
|
+
try:
|
1304
|
+
json_obj = json.loads(result)
|
1305
|
+
except TypeError as e:
|
1306
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1307
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1308
|
+
break
|
1309
|
+
cur_time = time.time()
|
1310
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1311
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1312
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1313
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1314
|
+
else:
|
1315
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1316
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1317
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1318
|
+
|
1319
|
+
|
1216
1320
|
def doCreateAlias(args, parsed_globals):
|
1217
1321
|
g_param = parse_global_arg(parsed_globals)
|
1218
1322
|
|
@@ -2305,58 +2409,6 @@ def doGetReservedConcurrencyConfig(args, parsed_globals):
|
|
2305
2409
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2306
2410
|
|
2307
2411
|
|
2308
|
-
def doPutTotalConcurrencyConfig(args, parsed_globals):
|
2309
|
-
g_param = parse_global_arg(parsed_globals)
|
2310
|
-
|
2311
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2312
|
-
cred = credential.CVMRoleCredential()
|
2313
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2314
|
-
cred = credential.STSAssumeRoleCredential(
|
2315
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2316
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2317
|
-
)
|
2318
|
-
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):
|
2319
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2320
|
-
else:
|
2321
|
-
cred = credential.Credential(
|
2322
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2323
|
-
)
|
2324
|
-
http_profile = HttpProfile(
|
2325
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2326
|
-
reqMethod="POST",
|
2327
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
2328
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2329
|
-
)
|
2330
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2331
|
-
if g_param[OptionsDefine.Language]:
|
2332
|
-
profile.language = g_param[OptionsDefine.Language]
|
2333
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2334
|
-
client = mod.ScfClient(cred, g_param[OptionsDefine.Region], profile)
|
2335
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
2336
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2337
|
-
model = models.PutTotalConcurrencyConfigRequest()
|
2338
|
-
model.from_json_string(json.dumps(args))
|
2339
|
-
start_time = time.time()
|
2340
|
-
while True:
|
2341
|
-
rsp = client.PutTotalConcurrencyConfig(model)
|
2342
|
-
result = rsp.to_json_string()
|
2343
|
-
try:
|
2344
|
-
json_obj = json.loads(result)
|
2345
|
-
except TypeError as e:
|
2346
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2347
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2348
|
-
break
|
2349
|
-
cur_time = time.time()
|
2350
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2351
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2352
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2353
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2354
|
-
else:
|
2355
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2356
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2357
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2358
|
-
|
2359
|
-
|
2360
2412
|
def doGetCustomDomain(args, parsed_globals):
|
2361
2413
|
g_param = parse_global_arg(parsed_globals)
|
2362
2414
|
|
@@ -2689,9 +2741,9 @@ ACTION_MAP = {
|
|
2689
2741
|
"CreateTrigger": doCreateTrigger,
|
2690
2742
|
"CreateNamespace": doCreateNamespace,
|
2691
2743
|
"CopyFunction": doCopyFunction,
|
2692
|
-
"GetFunctionLogs": doGetFunctionLogs,
|
2693
|
-
"ListAliases": doListAliases,
|
2694
2744
|
"DeleteTrigger": doDeleteTrigger,
|
2745
|
+
"ListAliases": doListAliases,
|
2746
|
+
"DeleteNamespace": doDeleteNamespace,
|
2695
2747
|
"GetProvisionedConcurrencyConfig": doGetProvisionedConcurrencyConfig,
|
2696
2748
|
"UpdateNamespace": doUpdateNamespace,
|
2697
2749
|
"ListCustomDomains": doListCustomDomains,
|
@@ -2701,8 +2753,10 @@ ACTION_MAP = {
|
|
2701
2753
|
"GetFunction": doGetFunction,
|
2702
2754
|
"DeleteAlias": doDeleteAlias,
|
2703
2755
|
"GetAsyncEventStatus": doGetAsyncEventStatus,
|
2704
|
-
"
|
2756
|
+
"PutTotalConcurrencyConfig": doPutTotalConcurrencyConfig,
|
2705
2757
|
"ListAsyncEvents": doListAsyncEvents,
|
2758
|
+
"DeleteFunctionVersion": doDeleteFunctionVersion,
|
2759
|
+
"GetFunctionLogs": doGetFunctionLogs,
|
2706
2760
|
"CreateAlias": doCreateAlias,
|
2707
2761
|
"TerminateAsyncEvent": doTerminateAsyncEvent,
|
2708
2762
|
"DeleteCustomDomain": doDeleteCustomDomain,
|
@@ -2724,7 +2778,6 @@ ACTION_MAP = {
|
|
2724
2778
|
"PutProvisionedConcurrencyConfig": doPutProvisionedConcurrencyConfig,
|
2725
2779
|
"GetAlias": doGetAlias,
|
2726
2780
|
"GetReservedConcurrencyConfig": doGetReservedConcurrencyConfig,
|
2727
|
-
"PutTotalConcurrencyConfig": doPutTotalConcurrencyConfig,
|
2728
2781
|
"GetCustomDomain": doGetCustomDomain,
|
2729
2782
|
"UpdateCustomDomain": doUpdateCustomDomain,
|
2730
2783
|
"CreateFunction": doCreateFunction,
|