tccli 3.0.1139.1__py2.py3-none-any.whl → 3.0.1140.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/emr/v20190103/api.json +9 -0
- tccli/services/ess/v20201111/api.json +11 -11
- tccli/services/ess/v20201111/examples.json +2 -2
- tccli/services/essbasic/v20210526/api.json +13 -13
- tccli/services/essbasic/v20210526/examples.json +2 -2
- tccli/services/iotexplorer/v20190423/api.json +49 -0
- tccli/services/iss/iss_client.py +114 -8
- tccli/services/iss/v20230517/api.json +221 -0
- tccli/services/iss/v20230517/examples.json +16 -0
- tccli/services/ses/ses_client.py +228 -16
- tccli/services/ses/v20201002/api.json +266 -0
- tccli/services/ses/v20201002/examples.json +32 -0
- tccli/services/ssl/v20191205/api.json +13 -3
- tccli/services/ssl/v20191205/examples.json +1 -1
- tccli/services/tcr/v20190924/api.json +5 -1
- tccli/services/tcr/v20190924/examples.json +1 -1
- tccli/services/tdmq/v20200217/api.json +2 -2
- tccli/services/vpc/v20170312/api.json +5 -5
- tccli/services/vpc/v20170312/examples.json +1 -1
- {tccli-3.0.1139.1.dist-info → tccli-3.0.1140.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1139.1.dist-info → tccli-3.0.1140.1.dist-info}/RECORD +25 -25
- {tccli-3.0.1139.1.dist-info → tccli-3.0.1140.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1139.1.dist-info → tccli-3.0.1140.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1139.1.dist-info → tccli-3.0.1140.1.dist-info}/license_files/LICENSE +0 -0
@@ -483,6 +483,13 @@
|
|
483
483
|
"output": "PlayRecordResponse",
|
484
484
|
"status": "online"
|
485
485
|
},
|
486
|
+
"QueryForbidPlayChannelList": {
|
487
|
+
"document": "查询禁播通道列表",
|
488
|
+
"input": "QueryForbidPlayChannelListRequest",
|
489
|
+
"name": "查询禁播通道列表",
|
490
|
+
"output": "QueryForbidPlayChannelListResponse",
|
491
|
+
"status": "online"
|
492
|
+
},
|
486
493
|
"RefreshDeviceChannel": {
|
487
494
|
"document": "用于刷新国标设备的通道(接口调用后,触发向设备请求通道列表,新增的通道入库,设备上已删除的通道需自行删除、后台不自动删除)。",
|
488
495
|
"input": "RefreshDeviceChannelRequest",
|
@@ -490,6 +497,13 @@
|
|
490
497
|
"output": "RefreshDeviceChannelResponse",
|
491
498
|
"status": "online"
|
492
499
|
},
|
500
|
+
"SetForbidPlayChannels": {
|
501
|
+
"document": "禁止主、子账号对视频通道的实况预览",
|
502
|
+
"input": "SetForbidPlayChannelsRequest",
|
503
|
+
"name": "设置通道禁止播流",
|
504
|
+
"output": "SetForbidPlayChannelsResponse",
|
505
|
+
"status": "online"
|
506
|
+
},
|
493
507
|
"UpdateAITask": {
|
494
508
|
"document": "更新AI任务",
|
495
509
|
"input": "UpdateAITaskRequest",
|
@@ -2506,6 +2520,52 @@
|
|
2506
2520
|
],
|
2507
2521
|
"usage": "out"
|
2508
2522
|
},
|
2523
|
+
"ChannelAttrInfo": {
|
2524
|
+
"document": "通道属性信息",
|
2525
|
+
"members": [
|
2526
|
+
{
|
2527
|
+
"disabled": false,
|
2528
|
+
"document": "设备通道所属的设备ID",
|
2529
|
+
"example": "389708b2-bcbb-********-a61f528b2a15",
|
2530
|
+
"member": "string",
|
2531
|
+
"name": "DeviceId",
|
2532
|
+
"output_required": true,
|
2533
|
+
"type": "string",
|
2534
|
+
"value_allowed_null": false
|
2535
|
+
},
|
2536
|
+
{
|
2537
|
+
"disabled": false,
|
2538
|
+
"document": "设备通道所属的设备名称\n注意:此字段可能返回 null,表示取不到有效值。",
|
2539
|
+
"example": "NVR05",
|
2540
|
+
"member": "string",
|
2541
|
+
"name": "DeviceName",
|
2542
|
+
"output_required": true,
|
2543
|
+
"type": "string",
|
2544
|
+
"value_allowed_null": true
|
2545
|
+
},
|
2546
|
+
{
|
2547
|
+
"disabled": false,
|
2548
|
+
"document": "设备通道ID",
|
2549
|
+
"example": "53ca64d3-9627-********-cea5122f6977",
|
2550
|
+
"member": "string",
|
2551
|
+
"name": "ChannelId",
|
2552
|
+
"output_required": true,
|
2553
|
+
"type": "string",
|
2554
|
+
"value_allowed_null": false
|
2555
|
+
},
|
2556
|
+
{
|
2557
|
+
"disabled": false,
|
2558
|
+
"document": "设备通道名称\n注意:此字段可能返回 null,表示取不到有效值。",
|
2559
|
+
"example": "PTZ03",
|
2560
|
+
"member": "string",
|
2561
|
+
"name": "ChannelName",
|
2562
|
+
"output_required": true,
|
2563
|
+
"type": "string",
|
2564
|
+
"value_allowed_null": true
|
2565
|
+
}
|
2566
|
+
],
|
2567
|
+
"usage": "out"
|
2568
|
+
},
|
2509
2569
|
"ChannelInfo": {
|
2510
2570
|
"document": "通道及通道所属设备信息",
|
2511
2571
|
"members": [
|
@@ -6405,6 +6465,52 @@
|
|
6405
6465
|
],
|
6406
6466
|
"type": "object"
|
6407
6467
|
},
|
6468
|
+
"ListForbidplayChannelsData": {
|
6469
|
+
"document": "用户禁止播流的通道列表返回数据",
|
6470
|
+
"members": [
|
6471
|
+
{
|
6472
|
+
"disabled": false,
|
6473
|
+
"document": "第几页",
|
6474
|
+
"example": "1",
|
6475
|
+
"member": "int64",
|
6476
|
+
"name": "PageNumber",
|
6477
|
+
"output_required": true,
|
6478
|
+
"type": "int",
|
6479
|
+
"value_allowed_null": false
|
6480
|
+
},
|
6481
|
+
{
|
6482
|
+
"disabled": false,
|
6483
|
+
"document": "当前页的设备数量",
|
6484
|
+
"example": "10",
|
6485
|
+
"member": "int64",
|
6486
|
+
"name": "PageSize",
|
6487
|
+
"output_required": true,
|
6488
|
+
"type": "int",
|
6489
|
+
"value_allowed_null": false
|
6490
|
+
},
|
6491
|
+
{
|
6492
|
+
"disabled": false,
|
6493
|
+
"document": "本次查询的设备通道总数",
|
6494
|
+
"example": "100",
|
6495
|
+
"member": "int64",
|
6496
|
+
"name": "TotalCount",
|
6497
|
+
"output_required": true,
|
6498
|
+
"type": "int",
|
6499
|
+
"value_allowed_null": false
|
6500
|
+
},
|
6501
|
+
{
|
6502
|
+
"disabled": false,
|
6503
|
+
"document": "设备通道信息列表\n注意:此字段可能返回 null,表示取不到有效值。",
|
6504
|
+
"example": "无",
|
6505
|
+
"member": "ChannelAttrInfo",
|
6506
|
+
"name": "List",
|
6507
|
+
"output_required": true,
|
6508
|
+
"type": "list",
|
6509
|
+
"value_allowed_null": true
|
6510
|
+
}
|
6511
|
+
],
|
6512
|
+
"usage": "out"
|
6513
|
+
},
|
6408
6514
|
"ListGatewayDevicesData": {
|
6409
6515
|
"document": "查询网关设备列表返回数据",
|
6410
6516
|
"members": [
|
@@ -7917,6 +8023,61 @@
|
|
7917
8023
|
],
|
7918
8024
|
"type": "object"
|
7919
8025
|
},
|
8026
|
+
"QueryForbidPlayChannelListRequest": {
|
8027
|
+
"document": "QueryForbidPlayChannelList请求参数结构体",
|
8028
|
+
"members": [
|
8029
|
+
{
|
8030
|
+
"disabled": false,
|
8031
|
+
"document": "子用户uin,也可以是主用户的uin",
|
8032
|
+
"example": "12*******36",
|
8033
|
+
"member": "string",
|
8034
|
+
"name": "UserId",
|
8035
|
+
"required": true,
|
8036
|
+
"type": "string"
|
8037
|
+
},
|
8038
|
+
{
|
8039
|
+
"disabled": false,
|
8040
|
+
"document": "每页最大数量,最大为200,超过按照200返回",
|
8041
|
+
"example": "10",
|
8042
|
+
"member": "int64",
|
8043
|
+
"name": "PageSize",
|
8044
|
+
"required": true,
|
8045
|
+
"type": "int"
|
8046
|
+
},
|
8047
|
+
{
|
8048
|
+
"disabled": false,
|
8049
|
+
"document": "第几页",
|
8050
|
+
"example": "1",
|
8051
|
+
"member": "int64",
|
8052
|
+
"name": "PageNumber",
|
8053
|
+
"required": true,
|
8054
|
+
"type": "int"
|
8055
|
+
}
|
8056
|
+
],
|
8057
|
+
"type": "object"
|
8058
|
+
},
|
8059
|
+
"QueryForbidPlayChannelListResponse": {
|
8060
|
+
"document": "QueryForbidPlayChannelList返回参数结构体",
|
8061
|
+
"members": [
|
8062
|
+
{
|
8063
|
+
"disabled": false,
|
8064
|
+
"document": "返回结果\n注意:此字段可能返回 null,表示取不到有效值。",
|
8065
|
+
"example": "无",
|
8066
|
+
"member": "ListForbidplayChannelsData",
|
8067
|
+
"name": "Data",
|
8068
|
+
"output_required": true,
|
8069
|
+
"type": "object",
|
8070
|
+
"value_allowed_null": true
|
8071
|
+
},
|
8072
|
+
{
|
8073
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
8074
|
+
"member": "string",
|
8075
|
+
"name": "RequestId",
|
8076
|
+
"type": "string"
|
8077
|
+
}
|
8078
|
+
],
|
8079
|
+
"type": "object"
|
8080
|
+
},
|
7920
8081
|
"RecordPlanBaseInfo": {
|
7921
8082
|
"document": "实时上云计划基础信息",
|
7922
8083
|
"members": [
|
@@ -8457,6 +8618,66 @@
|
|
8457
8618
|
],
|
8458
8619
|
"type": "object"
|
8459
8620
|
},
|
8621
|
+
"SetForbidPlayChannelsRequest": {
|
8622
|
+
"document": "SetForbidPlayChannels请求参数结构体",
|
8623
|
+
"members": [
|
8624
|
+
{
|
8625
|
+
"disabled": false,
|
8626
|
+
"document": "要禁播的通道参数,一次最多可以设置200个通道",
|
8627
|
+
"example": "无",
|
8628
|
+
"member": "SetForbidplayChannelParam",
|
8629
|
+
"name": "Channels",
|
8630
|
+
"required": true,
|
8631
|
+
"type": "list"
|
8632
|
+
},
|
8633
|
+
{
|
8634
|
+
"disabled": false,
|
8635
|
+
"document": "用户uin,可以是子用户的也可以是主用户的uin",
|
8636
|
+
"example": "12*******36",
|
8637
|
+
"member": "string",
|
8638
|
+
"name": "UserId",
|
8639
|
+
"required": true,
|
8640
|
+
"type": "string"
|
8641
|
+
}
|
8642
|
+
],
|
8643
|
+
"type": "object"
|
8644
|
+
},
|
8645
|
+
"SetForbidPlayChannelsResponse": {
|
8646
|
+
"document": "SetForbidPlayChannels返回参数结构体",
|
8647
|
+
"members": [
|
8648
|
+
{
|
8649
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
8650
|
+
"member": "string",
|
8651
|
+
"name": "RequestId",
|
8652
|
+
"type": "string"
|
8653
|
+
}
|
8654
|
+
],
|
8655
|
+
"type": "object"
|
8656
|
+
},
|
8657
|
+
"SetForbidplayChannelParam": {
|
8658
|
+
"document": "设置通道禁止播流,有通道Id和使能enable字段",
|
8659
|
+
"members": [
|
8660
|
+
{
|
8661
|
+
"disabled": false,
|
8662
|
+
"document": "通道Id",
|
8663
|
+
"example": "9ee325e9984**********a805c19b4e1",
|
8664
|
+
"member": "string",
|
8665
|
+
"name": "ChannelId",
|
8666
|
+
"required": true,
|
8667
|
+
"type": "string"
|
8668
|
+
},
|
8669
|
+
{
|
8670
|
+
"disabled": false,
|
8671
|
+
"document": "是否禁止通道播流",
|
8672
|
+
"example": "true",
|
8673
|
+
"member": "bool",
|
8674
|
+
"name": "Enable",
|
8675
|
+
"required": true,
|
8676
|
+
"type": "bool"
|
8677
|
+
}
|
8678
|
+
],
|
8679
|
+
"usage": "in"
|
8680
|
+
},
|
8460
8681
|
"SmokingAIResultInfo": {
|
8461
8682
|
"document": "抽烟识别结果详情",
|
8462
8683
|
"members": [
|
@@ -732,6 +732,14 @@
|
|
732
732
|
"title": "成功"
|
733
733
|
}
|
734
734
|
],
|
735
|
+
"QueryForbidPlayChannelList": [
|
736
|
+
{
|
737
|
+
"document": "",
|
738
|
+
"input": "POST / HTTP/1.1\nHost: iss.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: QueryForbidPlayChannelList\n<公共请求参数>\n\n{\n \"UserId\": \"10********82\",\n \"PageSize\": 5,\n \"PageNumber\": 1\n}",
|
739
|
+
"output": "{\n \"Response\": {\n \"Data\": {\n \"List\": [\n {\n \"ChannelId\": \"32525dd7-c3fc-****-****-d5beb4acd1e1\",\n \"ChannelName\": \"11\",\n \"DeviceId\": \"389708b2-bcbb-****-****-a61f528b2a15\",\n \"DeviceName\": \"SDK-NVR05\"\n }\n ],\n \"PageNumber\": 1,\n \"PageSize\": 1,\n \"TotalCount\": 1\n },\n \"RequestId\": \"fba7981b-d6a4-4177-b11d-e53a6110e4cd\"\n }\n}",
|
740
|
+
"title": "查询禁播列表"
|
741
|
+
}
|
742
|
+
],
|
735
743
|
"RefreshDeviceChannel": [
|
736
744
|
{
|
737
745
|
"document": " ",
|
@@ -746,6 +754,14 @@
|
|
746
754
|
"title": "设备未注册"
|
747
755
|
}
|
748
756
|
],
|
757
|
+
"SetForbidPlayChannels": [
|
758
|
+
{
|
759
|
+
"document": "",
|
760
|
+
"input": "POST / HTTP/1.1\nHost: iss.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: SetForbidPlayChannels\n<公共请求参数>\n\n{\n \"UserId\": \"10********02\",\n \"Channels\": [\n {\n \"ChannelId\": \"0001a415-****-****-****-b13cfb96c778\",\n \"Enable\": true\n },\n {\n \"ChannelId\": \"00037e5f-****-****-****-f30b13a86b02\",\n \"Enable\": false\n }\n ]\n}",
|
761
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"fba7981b-d6a4-4177-b11d-e53a6110e4cd\"\n }\n}",
|
762
|
+
"title": "通道禁播使能"
|
763
|
+
}
|
764
|
+
],
|
749
765
|
"UpdateAITask": [
|
750
766
|
{
|
751
767
|
"document": "AI任务不存在",
|
tccli/services/ses/ses_client.py
CHANGED
@@ -433,7 +433,7 @@ def doGetEmailTemplate(args, parsed_globals):
|
|
433
433
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
434
|
|
435
435
|
|
436
|
-
def
|
436
|
+
def doUpdateCustomBlackList(args, parsed_globals):
|
437
437
|
g_param = parse_global_arg(parsed_globals)
|
438
438
|
|
439
439
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -462,11 +462,63 @@ def doGetStatisticsReport(args, parsed_globals):
|
|
462
462
|
client = mod.SesClient(cred, g_param[OptionsDefine.Region], profile)
|
463
463
|
client._sdkVersion += ("_CLI_" + __version__)
|
464
464
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
-
model = models.
|
465
|
+
model = models.UpdateCustomBlackListRequest()
|
466
466
|
model.from_json_string(json.dumps(args))
|
467
467
|
start_time = time.time()
|
468
468
|
while True:
|
469
|
-
rsp = client.
|
469
|
+
rsp = client.UpdateCustomBlackList(model)
|
470
|
+
result = rsp.to_json_string()
|
471
|
+
try:
|
472
|
+
json_obj = json.loads(result)
|
473
|
+
except TypeError as e:
|
474
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
475
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
476
|
+
break
|
477
|
+
cur_time = time.time()
|
478
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
479
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
480
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
481
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
482
|
+
else:
|
483
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
484
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
485
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
486
|
+
|
487
|
+
|
488
|
+
def doListBlackEmailAddress(args, parsed_globals):
|
489
|
+
g_param = parse_global_arg(parsed_globals)
|
490
|
+
|
491
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
492
|
+
cred = credential.CVMRoleCredential()
|
493
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
494
|
+
cred = credential.STSAssumeRoleCredential(
|
495
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
496
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
497
|
+
)
|
498
|
+
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):
|
499
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
500
|
+
else:
|
501
|
+
cred = credential.Credential(
|
502
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
503
|
+
)
|
504
|
+
http_profile = HttpProfile(
|
505
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
506
|
+
reqMethod="POST",
|
507
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
508
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
509
|
+
)
|
510
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
511
|
+
if g_param[OptionsDefine.Language]:
|
512
|
+
profile.language = g_param[OptionsDefine.Language]
|
513
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
514
|
+
client = mod.SesClient(cred, g_param[OptionsDefine.Region], profile)
|
515
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
516
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
517
|
+
model = models.ListBlackEmailAddressRequest()
|
518
|
+
model.from_json_string(json.dumps(args))
|
519
|
+
start_time = time.time()
|
520
|
+
while True:
|
521
|
+
rsp = client.ListBlackEmailAddress(model)
|
470
522
|
result = rsp.to_json_string()
|
471
523
|
try:
|
472
524
|
json_obj = json.loads(result)
|
@@ -901,6 +953,58 @@ def doUpdateEmailSmtpPassWord(args, parsed_globals):
|
|
901
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
954
|
|
903
955
|
|
956
|
+
def doCreateCustomBlacklist(args, parsed_globals):
|
957
|
+
g_param = parse_global_arg(parsed_globals)
|
958
|
+
|
959
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
960
|
+
cred = credential.CVMRoleCredential()
|
961
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
962
|
+
cred = credential.STSAssumeRoleCredential(
|
963
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
964
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
965
|
+
)
|
966
|
+
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):
|
967
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
968
|
+
else:
|
969
|
+
cred = credential.Credential(
|
970
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
971
|
+
)
|
972
|
+
http_profile = HttpProfile(
|
973
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
974
|
+
reqMethod="POST",
|
975
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
976
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
977
|
+
)
|
978
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
979
|
+
if g_param[OptionsDefine.Language]:
|
980
|
+
profile.language = g_param[OptionsDefine.Language]
|
981
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
982
|
+
client = mod.SesClient(cred, g_param[OptionsDefine.Region], profile)
|
983
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
984
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
+
model = models.CreateCustomBlacklistRequest()
|
986
|
+
model.from_json_string(json.dumps(args))
|
987
|
+
start_time = time.time()
|
988
|
+
while True:
|
989
|
+
rsp = client.CreateCustomBlacklist(model)
|
990
|
+
result = rsp.to_json_string()
|
991
|
+
try:
|
992
|
+
json_obj = json.loads(result)
|
993
|
+
except TypeError as e:
|
994
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
995
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
996
|
+
break
|
997
|
+
cur_time = time.time()
|
998
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
999
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1000
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1001
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1002
|
+
else:
|
1003
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1004
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1005
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
|
+
|
1007
|
+
|
904
1008
|
def doDeleteEmailTemplate(args, parsed_globals):
|
905
1009
|
g_param = parse_global_arg(parsed_globals)
|
906
1010
|
|
@@ -1005,7 +1109,7 @@ def doListEmailTemplates(args, parsed_globals):
|
|
1005
1109
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
1110
|
|
1007
1111
|
|
1008
|
-
def
|
1112
|
+
def doDeleteBlackList(args, parsed_globals):
|
1009
1113
|
g_param = parse_global_arg(parsed_globals)
|
1010
1114
|
|
1011
1115
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1034,11 +1138,11 @@ def doListSendTasks(args, parsed_globals):
|
|
1034
1138
|
client = mod.SesClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
1139
|
client._sdkVersion += ("_CLI_" + __version__)
|
1036
1140
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
-
model = models.
|
1141
|
+
model = models.DeleteBlackListRequest()
|
1038
1142
|
model.from_json_string(json.dumps(args))
|
1039
1143
|
start_time = time.time()
|
1040
1144
|
while True:
|
1041
|
-
rsp = client.
|
1145
|
+
rsp = client.DeleteBlackList(model)
|
1042
1146
|
result = rsp.to_json_string()
|
1043
1147
|
try:
|
1044
1148
|
json_obj = json.loads(result)
|
@@ -1109,7 +1213,7 @@ def doCreateEmailTemplate(args, parsed_globals):
|
|
1109
1213
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1110
1214
|
|
1111
1215
|
|
1112
|
-
def
|
1216
|
+
def doDeleteCustomBlackList(args, parsed_globals):
|
1113
1217
|
g_param = parse_global_arg(parsed_globals)
|
1114
1218
|
|
1115
1219
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1138,11 +1242,63 @@ def doDeleteBlackList(args, parsed_globals):
|
|
1138
1242
|
client = mod.SesClient(cred, g_param[OptionsDefine.Region], profile)
|
1139
1243
|
client._sdkVersion += ("_CLI_" + __version__)
|
1140
1244
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1141
|
-
model = models.
|
1245
|
+
model = models.DeleteCustomBlackListRequest()
|
1142
1246
|
model.from_json_string(json.dumps(args))
|
1143
1247
|
start_time = time.time()
|
1144
1248
|
while True:
|
1145
|
-
rsp = client.
|
1249
|
+
rsp = client.DeleteCustomBlackList(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 doListSendTasks(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.SesClient(cred, g_param[OptionsDefine.Region], profile)
|
1295
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1296
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1297
|
+
model = models.ListSendTasksRequest()
|
1298
|
+
model.from_json_string(json.dumps(args))
|
1299
|
+
start_time = time.time()
|
1300
|
+
while True:
|
1301
|
+
rsp = client.ListSendTasks(model)
|
1146
1302
|
result = rsp.to_json_string()
|
1147
1303
|
try:
|
1148
1304
|
json_obj = json.loads(result)
|
@@ -1213,7 +1369,7 @@ def doSendEmail(args, parsed_globals):
|
|
1213
1369
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
1370
|
|
1215
1371
|
|
1216
|
-
def
|
1372
|
+
def doListCustomBlacklist(args, parsed_globals):
|
1217
1373
|
g_param = parse_global_arg(parsed_globals)
|
1218
1374
|
|
1219
1375
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1242,11 +1398,63 @@ def doListBlackEmailAddress(args, parsed_globals):
|
|
1242
1398
|
client = mod.SesClient(cred, g_param[OptionsDefine.Region], profile)
|
1243
1399
|
client._sdkVersion += ("_CLI_" + __version__)
|
1244
1400
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1245
|
-
model = models.
|
1401
|
+
model = models.ListCustomBlacklistRequest()
|
1246
1402
|
model.from_json_string(json.dumps(args))
|
1247
1403
|
start_time = time.time()
|
1248
1404
|
while True:
|
1249
|
-
rsp = client.
|
1405
|
+
rsp = client.ListCustomBlacklist(model)
|
1406
|
+
result = rsp.to_json_string()
|
1407
|
+
try:
|
1408
|
+
json_obj = json.loads(result)
|
1409
|
+
except TypeError as e:
|
1410
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1411
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1412
|
+
break
|
1413
|
+
cur_time = time.time()
|
1414
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1415
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1416
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1417
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1418
|
+
else:
|
1419
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1420
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1421
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
|
+
|
1423
|
+
|
1424
|
+
def doGetStatisticsReport(args, parsed_globals):
|
1425
|
+
g_param = parse_global_arg(parsed_globals)
|
1426
|
+
|
1427
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1428
|
+
cred = credential.CVMRoleCredential()
|
1429
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1430
|
+
cred = credential.STSAssumeRoleCredential(
|
1431
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1432
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1433
|
+
)
|
1434
|
+
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):
|
1435
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1436
|
+
else:
|
1437
|
+
cred = credential.Credential(
|
1438
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1439
|
+
)
|
1440
|
+
http_profile = HttpProfile(
|
1441
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1442
|
+
reqMethod="POST",
|
1443
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1444
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1445
|
+
)
|
1446
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1447
|
+
if g_param[OptionsDefine.Language]:
|
1448
|
+
profile.language = g_param[OptionsDefine.Language]
|
1449
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1450
|
+
client = mod.SesClient(cred, g_param[OptionsDefine.Region], profile)
|
1451
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1452
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1453
|
+
model = models.GetStatisticsReportRequest()
|
1454
|
+
model.from_json_string(json.dumps(args))
|
1455
|
+
start_time = time.time()
|
1456
|
+
while True:
|
1457
|
+
rsp = client.GetStatisticsReport(model)
|
1250
1458
|
result = rsp.to_json_string()
|
1251
1459
|
try:
|
1252
1460
|
json_obj = json.loads(result)
|
@@ -1440,7 +1648,8 @@ ACTION_MAP = {
|
|
1440
1648
|
"CreateReceiver": doCreateReceiver,
|
1441
1649
|
"GetEmailIdentity": doGetEmailIdentity,
|
1442
1650
|
"GetEmailTemplate": doGetEmailTemplate,
|
1443
|
-
"
|
1651
|
+
"UpdateCustomBlackList": doUpdateCustomBlackList,
|
1652
|
+
"ListBlackEmailAddress": doListBlackEmailAddress,
|
1444
1653
|
"UpdateEmailTemplate": doUpdateEmailTemplate,
|
1445
1654
|
"UpdateEmailIdentity": doUpdateEmailIdentity,
|
1446
1655
|
"DeleteEmailIdentity": doDeleteEmailIdentity,
|
@@ -1449,13 +1658,16 @@ ACTION_MAP = {
|
|
1449
1658
|
"CreateEmailIdentity": doCreateEmailIdentity,
|
1450
1659
|
"BatchSendEmail": doBatchSendEmail,
|
1451
1660
|
"UpdateEmailSmtpPassWord": doUpdateEmailSmtpPassWord,
|
1661
|
+
"CreateCustomBlacklist": doCreateCustomBlacklist,
|
1452
1662
|
"DeleteEmailTemplate": doDeleteEmailTemplate,
|
1453
1663
|
"ListEmailTemplates": doListEmailTemplates,
|
1454
|
-
"ListSendTasks": doListSendTasks,
|
1455
|
-
"CreateEmailTemplate": doCreateEmailTemplate,
|
1456
1664
|
"DeleteBlackList": doDeleteBlackList,
|
1665
|
+
"CreateEmailTemplate": doCreateEmailTemplate,
|
1666
|
+
"DeleteCustomBlackList": doDeleteCustomBlackList,
|
1667
|
+
"ListSendTasks": doListSendTasks,
|
1457
1668
|
"SendEmail": doSendEmail,
|
1458
|
-
"
|
1669
|
+
"ListCustomBlacklist": doListCustomBlacklist,
|
1670
|
+
"GetStatisticsReport": doGetStatisticsReport,
|
1459
1671
|
"CreateReceiverDetail": doCreateReceiverDetail,
|
1460
1672
|
"ListReceivers": doListReceivers,
|
1461
1673
|
"DeleteEmailAddress": doDeleteEmailAddress,
|