tccli 3.0.1125.1__py2.py3-none-any.whl → 3.0.1127.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/billing/v20180709/api.json +2 -2
- tccli/services/cam/cam_client.py +110 -57
- tccli/services/cam/v20190116/api.json +128 -0
- tccli/services/cam/v20190116/examples.json +8 -0
- tccli/services/cat/v20180409/api.json +10 -0
- tccli/services/cds/v20180420/api.json +2 -2
- tccli/services/cls/v20201016/api.json +19 -0
- tccli/services/domain/v20180808/api.json +702 -40
- tccli/services/domain/v20180808/examples.json +13 -13
- tccli/services/emr/v20190103/api.json +20 -0
- tccli/services/essbasic/v20210526/api.json +1 -1
- tccli/services/iotexplorer/v20190423/api.json +31 -23
- tccli/services/iotexplorer/v20190423/examples.json +4 -4
- tccli/services/mongodb/mongodb_client.py +212 -0
- tccli/services/mongodb/v20190725/api.json +322 -0
- tccli/services/mongodb/v20190725/examples.json +32 -0
- tccli/services/monitor/v20180724/api.json +1 -0
- tccli/services/monitor/v20180724/examples.json +2 -2
- tccli/services/postgres/v20170312/api.json +11 -11
- tccli/services/redis/redis_client.py +53 -0
- tccli/services/redis/v20180412/api.json +151 -0
- tccli/services/redis/v20180412/examples.json +8 -0
- tccli/services/teo/teo_client.py +216 -4
- tccli/services/teo/v20220901/api.json +375 -0
- tccli/services/teo/v20220901/examples.json +32 -0
- tccli/services/tmt/v20180321/api.json +5 -4
- tccli/services/trtc/v20190722/api.json +1 -1
- tccli/services/tse/tse_client.py +53 -0
- tccli/services/tse/v20201207/api.json +43 -0
- tccli/services/tse/v20201207/examples.json +8 -0
- {tccli-3.0.1125.1.dist-info → tccli-3.0.1127.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1125.1.dist-info → tccli-3.0.1127.1.dist-info}/RECORD +36 -36
- {tccli-3.0.1125.1.dist-info → tccli-3.0.1127.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1125.1.dist-info → tccli-3.0.1127.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1125.1.dist-info → tccli-3.0.1127.1.dist-info}/license_files/LICENSE +0 -0
@@ -133,6 +133,13 @@
|
|
133
133
|
"output": "DescribeAutoBackupConfigResponse",
|
134
134
|
"status": "online"
|
135
135
|
},
|
136
|
+
"DescribeBackupDetail": {
|
137
|
+
"document": "本接口(DescribeBackupDetail)用于查询实例的备份信息详情。",
|
138
|
+
"input": "DescribeBackupDetailRequest",
|
139
|
+
"name": "查询备份信息详情",
|
140
|
+
"output": "DescribeBackupDetailResponse",
|
141
|
+
"status": "online"
|
142
|
+
},
|
136
143
|
"DescribeBackupDownloadRestriction": {
|
137
144
|
"document": "本接口(DescribeBackupDownloadRestriction)用于查询当前地域数据库备份文件的下载地址。",
|
138
145
|
"input": "DescribeBackupDownloadRestrictionRequest",
|
@@ -2367,6 +2374,150 @@
|
|
2367
2374
|
],
|
2368
2375
|
"type": "object"
|
2369
2376
|
},
|
2377
|
+
"DescribeBackupDetailRequest": {
|
2378
|
+
"document": "DescribeBackupDetail请求参数结构体",
|
2379
|
+
"members": [
|
2380
|
+
{
|
2381
|
+
"disabled": false,
|
2382
|
+
"document": "实例 ID。",
|
2383
|
+
"example": "crs-4y9t57vt",
|
2384
|
+
"member": "string",
|
2385
|
+
"name": "InstanceId",
|
2386
|
+
"required": true,
|
2387
|
+
"type": "string"
|
2388
|
+
},
|
2389
|
+
{
|
2390
|
+
"disabled": false,
|
2391
|
+
"document": "备份 ID,可通过接口 [DescribeInstanceBackups](https://cloud.tencent.com/document/product/239/20011) 返回的参数 **RedisBackupSet** 获取。",
|
2392
|
+
"example": "678362566696298532848117",
|
2393
|
+
"member": "string",
|
2394
|
+
"name": "BackupId",
|
2395
|
+
"required": true,
|
2396
|
+
"type": "string"
|
2397
|
+
}
|
2398
|
+
],
|
2399
|
+
"type": "object"
|
2400
|
+
},
|
2401
|
+
"DescribeBackupDetailResponse": {
|
2402
|
+
"document": "DescribeBackupDetail返回参数结构体",
|
2403
|
+
"members": [
|
2404
|
+
{
|
2405
|
+
"disabled": false,
|
2406
|
+
"document": "备份 ID。",
|
2407
|
+
"example": "678362566696298532848117",
|
2408
|
+
"member": "string",
|
2409
|
+
"name": "BackupId",
|
2410
|
+
"type": "string",
|
2411
|
+
"value_allowed_null": false
|
2412
|
+
},
|
2413
|
+
{
|
2414
|
+
"disabled": false,
|
2415
|
+
"document": "备份开始时间。",
|
2416
|
+
"example": "\"2022-03-24 11:52:20\"",
|
2417
|
+
"member": "string",
|
2418
|
+
"name": "StartTime",
|
2419
|
+
"type": "string",
|
2420
|
+
"value_allowed_null": false
|
2421
|
+
},
|
2422
|
+
{
|
2423
|
+
"disabled": false,
|
2424
|
+
"document": "备份结束时间。",
|
2425
|
+
"example": "\"2022-03-24 11:59:16\"",
|
2426
|
+
"member": "string",
|
2427
|
+
"name": "EndTime",
|
2428
|
+
"type": "string",
|
2429
|
+
"value_allowed_null": false
|
2430
|
+
},
|
2431
|
+
{
|
2432
|
+
"disabled": false,
|
2433
|
+
"document": "备份方式。 \n\n- 1:手动备份。\n- 0:自动备份。",
|
2434
|
+
"example": "\"1\"",
|
2435
|
+
"member": "string",
|
2436
|
+
"name": "BackupType",
|
2437
|
+
"type": "string",
|
2438
|
+
"value_allowed_null": false
|
2439
|
+
},
|
2440
|
+
{
|
2441
|
+
"disabled": false,
|
2442
|
+
"document": "备份状态。 \n\n- 1:备份被其它流程锁定。\n- 2:备份正常,没有被任何流程锁定。\n- -1:备份已过期。\n- 3:备份正在被导出。\n- 4:备份导出成功。",
|
2443
|
+
"example": "2",
|
2444
|
+
"member": "int64",
|
2445
|
+
"name": "Status",
|
2446
|
+
"type": "int",
|
2447
|
+
"value_allowed_null": false
|
2448
|
+
},
|
2449
|
+
{
|
2450
|
+
"disabled": false,
|
2451
|
+
"document": "备份的备注信息。",
|
2452
|
+
"example": "\"\"",
|
2453
|
+
"member": "string",
|
2454
|
+
"name": "Remark",
|
2455
|
+
"type": "string",
|
2456
|
+
"value_allowed_null": false
|
2457
|
+
},
|
2458
|
+
{
|
2459
|
+
"disabled": false,
|
2460
|
+
"document": "备份是否被锁定。\n\n- 0:未被锁定。\n- 1:已被锁定。",
|
2461
|
+
"example": "0",
|
2462
|
+
"member": "int64",
|
2463
|
+
"name": "Locked",
|
2464
|
+
"type": "int",
|
2465
|
+
"value_allowed_null": false
|
2466
|
+
},
|
2467
|
+
{
|
2468
|
+
"disabled": false,
|
2469
|
+
"document": "备份文件大小。单位:Byte。",
|
2470
|
+
"example": "10240",
|
2471
|
+
"member": "int64",
|
2472
|
+
"name": "BackupSize",
|
2473
|
+
"type": "int",
|
2474
|
+
"value_allowed_null": false
|
2475
|
+
},
|
2476
|
+
{
|
2477
|
+
"disabled": false,
|
2478
|
+
"document": "实例类型。",
|
2479
|
+
"example": "6",
|
2480
|
+
"member": "int64",
|
2481
|
+
"name": "InstanceType",
|
2482
|
+
"type": "int",
|
2483
|
+
"value_allowed_null": false
|
2484
|
+
},
|
2485
|
+
{
|
2486
|
+
"disabled": false,
|
2487
|
+
"document": "单分片内存规格大小,单位:MB。",
|
2488
|
+
"example": "4096",
|
2489
|
+
"member": "int64",
|
2490
|
+
"name": "MemSize",
|
2491
|
+
"type": "int",
|
2492
|
+
"value_allowed_null": false
|
2493
|
+
},
|
2494
|
+
{
|
2495
|
+
"disabled": false,
|
2496
|
+
"document": "分片数量。",
|
2497
|
+
"example": "3",
|
2498
|
+
"member": "int64",
|
2499
|
+
"name": "ShardNum",
|
2500
|
+
"type": "int",
|
2501
|
+
"value_allowed_null": false
|
2502
|
+
},
|
2503
|
+
{
|
2504
|
+
"disabled": false,
|
2505
|
+
"document": "副本数量。",
|
2506
|
+
"example": "1",
|
2507
|
+
"member": "int64",
|
2508
|
+
"name": "ReplicasNum",
|
2509
|
+
"type": "int",
|
2510
|
+
"value_allowed_null": false
|
2511
|
+
},
|
2512
|
+
{
|
2513
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
2514
|
+
"member": "string",
|
2515
|
+
"name": "RequestId",
|
2516
|
+
"type": "string"
|
2517
|
+
}
|
2518
|
+
],
|
2519
|
+
"type": "object"
|
2520
|
+
},
|
2370
2521
|
"DescribeBackupDownloadRestrictionRequest": {
|
2371
2522
|
"document": "DescribeBackupDownloadRestriction请求参数结构体",
|
2372
2523
|
"members": [],
|
@@ -158,6 +158,14 @@
|
|
158
158
|
"title": "请求示例"
|
159
159
|
}
|
160
160
|
],
|
161
|
+
"DescribeBackupDetail": [
|
162
|
+
{
|
163
|
+
"document": "通过该接口查询指定实例备份 ID 的备份信息。",
|
164
|
+
"input": "POST / HTTP/1.1\nHost: redis.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeBackupDetail\n<公共请求参数>\n\n{\n \"InstanceId\": \"crs-g9my5vt7\",\n \"BackupId\": \"154571841-1165701309-438602494\"\n}",
|
165
|
+
"output": "{\n \"Response\": {\n \"BackupId\": \"154571841-1165701309-438602494\",\n \"BackupSize\": 528,\n \"BackupType\": \"0\",\n \"EndTime\": \"2022-12-19 19:42:20\",\n \"InstanceType\": 9,\n \"Locked\": 0,\n \"MemSize\": 2048,\n \"Remark\": \"test005\",\n \"ReplicasNum\": 1,\n \"RequestId\": \"add15b91-8f3c-4ff3-ba52-7c64c9c435ba\",\n \"ShardNum\": 3,\n \"StartTime\": \"2022-12-19 19:41:42\",\n \"Status\": 2\n }\n}",
|
166
|
+
"title": "查询备份信息详情"
|
167
|
+
}
|
168
|
+
],
|
161
169
|
"DescribeBackupDownloadRestriction": [
|
162
170
|
{
|
163
171
|
"document": "通过该接口查询当前地域用户设置的备份文件的下载来源限制。",
|
tccli/services/teo/teo_client.py
CHANGED
@@ -2671,6 +2671,58 @@ def doDeleteL4ProxyRules(args, parsed_globals):
|
|
2671
2671
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2672
2672
|
|
2673
2673
|
|
2674
|
+
def doCreateCustomizeErrorPage(args, parsed_globals):
|
2675
|
+
g_param = parse_global_arg(parsed_globals)
|
2676
|
+
|
2677
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2678
|
+
cred = credential.CVMRoleCredential()
|
2679
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2680
|
+
cred = credential.STSAssumeRoleCredential(
|
2681
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2682
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2683
|
+
)
|
2684
|
+
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):
|
2685
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2686
|
+
else:
|
2687
|
+
cred = credential.Credential(
|
2688
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2689
|
+
)
|
2690
|
+
http_profile = HttpProfile(
|
2691
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2692
|
+
reqMethod="POST",
|
2693
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2694
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2695
|
+
)
|
2696
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2697
|
+
if g_param[OptionsDefine.Language]:
|
2698
|
+
profile.language = g_param[OptionsDefine.Language]
|
2699
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2700
|
+
client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
|
2701
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2702
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2703
|
+
model = models.CreateCustomizeErrorPageRequest()
|
2704
|
+
model.from_json_string(json.dumps(args))
|
2705
|
+
start_time = time.time()
|
2706
|
+
while True:
|
2707
|
+
rsp = client.CreateCustomizeErrorPage(model)
|
2708
|
+
result = rsp.to_json_string()
|
2709
|
+
try:
|
2710
|
+
json_obj = json.loads(result)
|
2711
|
+
except TypeError as e:
|
2712
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2713
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2714
|
+
break
|
2715
|
+
cur_time = time.time()
|
2716
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2717
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2718
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2719
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2720
|
+
else:
|
2721
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2722
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2723
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2724
|
+
|
2725
|
+
|
2674
2726
|
def doModifyAccelerationDomain(args, parsed_globals):
|
2675
2727
|
g_param = parse_global_arg(parsed_globals)
|
2676
2728
|
|
@@ -3295,6 +3347,58 @@ def doDescribeAvailablePlans(args, parsed_globals):
|
|
3295
3347
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3296
3348
|
|
3297
3349
|
|
3350
|
+
def doDescribeCustomErrorPages(args, parsed_globals):
|
3351
|
+
g_param = parse_global_arg(parsed_globals)
|
3352
|
+
|
3353
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3354
|
+
cred = credential.CVMRoleCredential()
|
3355
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3356
|
+
cred = credential.STSAssumeRoleCredential(
|
3357
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3358
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3359
|
+
)
|
3360
|
+
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):
|
3361
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3362
|
+
else:
|
3363
|
+
cred = credential.Credential(
|
3364
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3365
|
+
)
|
3366
|
+
http_profile = HttpProfile(
|
3367
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3368
|
+
reqMethod="POST",
|
3369
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3370
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3371
|
+
)
|
3372
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3373
|
+
if g_param[OptionsDefine.Language]:
|
3374
|
+
profile.language = g_param[OptionsDefine.Language]
|
3375
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3376
|
+
client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
|
3377
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3378
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3379
|
+
model = models.DescribeCustomErrorPagesRequest()
|
3380
|
+
model.from_json_string(json.dumps(args))
|
3381
|
+
start_time = time.time()
|
3382
|
+
while True:
|
3383
|
+
rsp = client.DescribeCustomErrorPages(model)
|
3384
|
+
result = rsp.to_json_string()
|
3385
|
+
try:
|
3386
|
+
json_obj = json.loads(result)
|
3387
|
+
except TypeError as e:
|
3388
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3389
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3390
|
+
break
|
3391
|
+
cur_time = time.time()
|
3392
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3393
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3394
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3395
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3396
|
+
else:
|
3397
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3398
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3399
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3400
|
+
|
3401
|
+
|
3298
3402
|
def doDescribeRulesSetting(args, parsed_globals):
|
3299
3403
|
g_param = parse_global_arg(parsed_globals)
|
3300
3404
|
|
@@ -3763,7 +3867,7 @@ def doDescribeL4ProxyRules(args, parsed_globals):
|
|
3763
3867
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3764
3868
|
|
3765
3869
|
|
3766
|
-
def
|
3870
|
+
def doDeleteCustomErrorPage(args, parsed_globals):
|
3767
3871
|
g_param = parse_global_arg(parsed_globals)
|
3768
3872
|
|
3769
3873
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3792,11 +3896,11 @@ def doDescribeL4Proxy(args, parsed_globals):
|
|
3792
3896
|
client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
|
3793
3897
|
client._sdkVersion += ("_CLI_" + __version__)
|
3794
3898
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3795
|
-
model = models.
|
3899
|
+
model = models.DeleteCustomErrorPageRequest()
|
3796
3900
|
model.from_json_string(json.dumps(args))
|
3797
3901
|
start_time = time.time()
|
3798
3902
|
while True:
|
3799
|
-
rsp = client.
|
3903
|
+
rsp = client.DeleteCustomErrorPage(model)
|
3800
3904
|
result = rsp.to_json_string()
|
3801
3905
|
try:
|
3802
3906
|
json_obj = json.loads(result)
|
@@ -5115,6 +5219,58 @@ def doDescribeSecurityIPGroup(args, parsed_globals):
|
|
5115
5219
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5116
5220
|
|
5117
5221
|
|
5222
|
+
def doModifyCustomErrorPage(args, parsed_globals):
|
5223
|
+
g_param = parse_global_arg(parsed_globals)
|
5224
|
+
|
5225
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
5226
|
+
cred = credential.CVMRoleCredential()
|
5227
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
5228
|
+
cred = credential.STSAssumeRoleCredential(
|
5229
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
5230
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
5231
|
+
)
|
5232
|
+
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):
|
5233
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
5234
|
+
else:
|
5235
|
+
cred = credential.Credential(
|
5236
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
5237
|
+
)
|
5238
|
+
http_profile = HttpProfile(
|
5239
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
5240
|
+
reqMethod="POST",
|
5241
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
5242
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
5243
|
+
)
|
5244
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
5245
|
+
if g_param[OptionsDefine.Language]:
|
5246
|
+
profile.language = g_param[OptionsDefine.Language]
|
5247
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
5248
|
+
client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
|
5249
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
5250
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
5251
|
+
model = models.ModifyCustomErrorPageRequest()
|
5252
|
+
model.from_json_string(json.dumps(args))
|
5253
|
+
start_time = time.time()
|
5254
|
+
while True:
|
5255
|
+
rsp = client.ModifyCustomErrorPage(model)
|
5256
|
+
result = rsp.to_json_string()
|
5257
|
+
try:
|
5258
|
+
json_obj = json.loads(result)
|
5259
|
+
except TypeError as e:
|
5260
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
5261
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
5262
|
+
break
|
5263
|
+
cur_time = time.time()
|
5264
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
5265
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
5266
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
5267
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
5268
|
+
else:
|
5269
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
5270
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
5271
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5272
|
+
|
5273
|
+
|
5118
5274
|
def doDescribeDDoSAttackData(args, parsed_globals):
|
5119
5275
|
g_param = parse_global_arg(parsed_globals)
|
5120
5276
|
|
@@ -5271,6 +5427,58 @@ def doDescribeAliasDomains(args, parsed_globals):
|
|
5271
5427
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5272
5428
|
|
5273
5429
|
|
5430
|
+
def doDescribeL4Proxy(args, parsed_globals):
|
5431
|
+
g_param = parse_global_arg(parsed_globals)
|
5432
|
+
|
5433
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
5434
|
+
cred = credential.CVMRoleCredential()
|
5435
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
5436
|
+
cred = credential.STSAssumeRoleCredential(
|
5437
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
5438
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
5439
|
+
)
|
5440
|
+
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):
|
5441
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
5442
|
+
else:
|
5443
|
+
cred = credential.Credential(
|
5444
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
5445
|
+
)
|
5446
|
+
http_profile = HttpProfile(
|
5447
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
5448
|
+
reqMethod="POST",
|
5449
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
5450
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
5451
|
+
)
|
5452
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
5453
|
+
if g_param[OptionsDefine.Language]:
|
5454
|
+
profile.language = g_param[OptionsDefine.Language]
|
5455
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
5456
|
+
client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
|
5457
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
5458
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
5459
|
+
model = models.DescribeL4ProxyRequest()
|
5460
|
+
model.from_json_string(json.dumps(args))
|
5461
|
+
start_time = time.time()
|
5462
|
+
while True:
|
5463
|
+
rsp = client.DescribeL4Proxy(model)
|
5464
|
+
result = rsp.to_json_string()
|
5465
|
+
try:
|
5466
|
+
json_obj = json.loads(result)
|
5467
|
+
except TypeError as e:
|
5468
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
5469
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
5470
|
+
break
|
5471
|
+
cur_time = time.time()
|
5472
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
5473
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
5474
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
5475
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
5476
|
+
else:
|
5477
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
5478
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
5479
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5480
|
+
|
5481
|
+
|
5274
5482
|
def doDescribeBillingData(args, parsed_globals):
|
5275
5483
|
g_param = parse_global_arg(parsed_globals)
|
5276
5484
|
|
@@ -5387,6 +5595,7 @@ ACTION_MAP = {
|
|
5387
5595
|
"BindZoneToPlan": doBindZoneToPlan,
|
5388
5596
|
"DescribeDDoSAttackEvent": doDescribeDDoSAttackEvent,
|
5389
5597
|
"DeleteL4ProxyRules": doDeleteL4ProxyRules,
|
5598
|
+
"CreateCustomizeErrorPage": doCreateCustomizeErrorPage,
|
5390
5599
|
"ModifyAccelerationDomain": doModifyAccelerationDomain,
|
5391
5600
|
"CreateL4Proxy": doCreateL4Proxy,
|
5392
5601
|
"ModifyApplicationProxyStatus": doModifyApplicationProxyStatus,
|
@@ -5399,6 +5608,7 @@ ACTION_MAP = {
|
|
5399
5608
|
"ModifyApplicationProxy": doModifyApplicationProxy,
|
5400
5609
|
"CreateZone": doCreateZone,
|
5401
5610
|
"DescribeAvailablePlans": doDescribeAvailablePlans,
|
5611
|
+
"DescribeCustomErrorPages": doDescribeCustomErrorPages,
|
5402
5612
|
"DescribeRulesSetting": doDescribeRulesSetting,
|
5403
5613
|
"ModifyAccelerationDomainStatuses": doModifyAccelerationDomainStatuses,
|
5404
5614
|
"ModifySecurityIPGroup": doModifySecurityIPGroup,
|
@@ -5408,7 +5618,7 @@ ACTION_MAP = {
|
|
5408
5618
|
"DescribePurgeTasks": doDescribePurgeTasks,
|
5409
5619
|
"DeleteRules": doDeleteRules,
|
5410
5620
|
"DescribeL4ProxyRules": doDescribeL4ProxyRules,
|
5411
|
-
"
|
5621
|
+
"DeleteCustomErrorPage": doDeleteCustomErrorPage,
|
5412
5622
|
"DescribeRules": doDescribeRules,
|
5413
5623
|
"CreateCLSIndex": doCreateCLSIndex,
|
5414
5624
|
"CreateApplicationProxy": doCreateApplicationProxy,
|
@@ -5434,9 +5644,11 @@ ACTION_MAP = {
|
|
5434
5644
|
"DeleteZone": doDeleteZone,
|
5435
5645
|
"DescribeSecurityIPGroupInfo": doDescribeSecurityIPGroupInfo,
|
5436
5646
|
"DescribeSecurityIPGroup": doDescribeSecurityIPGroup,
|
5647
|
+
"ModifyCustomErrorPage": doModifyCustomErrorPage,
|
5437
5648
|
"DescribeDDoSAttackData": doDescribeDDoSAttackData,
|
5438
5649
|
"DeleteSharedCNAME": doDeleteSharedCNAME,
|
5439
5650
|
"DescribeAliasDomains": doDescribeAliasDomains,
|
5651
|
+
"DescribeL4Proxy": doDescribeL4Proxy,
|
5440
5652
|
"DescribeBillingData": doDescribeBillingData,
|
5441
5653
|
|
5442
5654
|
}
|