tccli 3.0.1154.1__py2.py3-none-any.whl → 3.0.1156.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/autoscaling/v20180419/api.json +48 -20
- tccli/services/ccc/v20200210/api.json +11 -1
- tccli/services/ccc/v20200210/examples.json +1 -1
- tccli/services/cdb/v20170320/api.json +39 -2
- tccli/services/ckafka/ckafka_client.py +65 -12
- tccli/services/ckafka/v20190819/api.json +134 -0
- tccli/services/ckafka/v20190819/examples.json +8 -0
- tccli/services/cvm/cvm_client.py +110 -4
- tccli/services/cvm/v20170312/api.json +95 -0
- tccli/services/cvm/v20170312/examples.json +16 -0
- tccli/services/cynosdb/cynosdb_client.py +110 -4
- tccli/services/cynosdb/v20190107/api.json +192 -0
- tccli/services/cynosdb/v20190107/examples.json +16 -0
- tccli/services/es/v20180416/api.json +36 -0
- tccli/services/ess/ess_client.py +53 -0
- tccli/services/ess/v20201111/api.json +101 -10
- tccli/services/ess/v20201111/examples.json +8 -0
- tccli/services/essbasic/v20210526/api.json +16 -16
- tccli/services/essbasic/v20210526/examples.json +3 -3
- tccli/services/gaap/v20180529/api.json +17 -17
- tccli/services/gaap/v20180529/examples.json +7 -13
- tccli/services/hunyuan/v20230901/api.json +77 -2
- tccli/services/iss/v20230517/api.json +6 -6
- tccli/services/mna/mna_client.py +322 -4
- tccli/services/mna/v20210119/api.json +435 -0
- tccli/services/mna/v20210119/examples.json +48 -0
- tccli/services/mongodb/v20190725/api.json +6 -6
- tccli/services/monitor/v20180724/api.json +23 -23
- tccli/services/monitor/v20180724/examples.json +12 -12
- tccli/services/oceanus/v20190422/api.json +9 -0
- tccli/services/postgres/postgres_client.py +395 -24
- tccli/services/postgres/v20170312/api.json +549 -0
- tccli/services/postgres/v20170312/examples.json +92 -0
- tccli/services/rce/v20201103/api.json +78 -0
- tccli/services/tcr/v20190924/api.json +71 -45
- tccli/services/tcr/v20190924/examples.json +9 -9
- tccli/services/vpc/v20170312/api.json +10 -10
- tccli/services/waf/v20180125/api.json +421 -72
- tccli/services/waf/v20180125/examples.json +6 -6
- {tccli-3.0.1154.1.dist-info → tccli-3.0.1156.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1154.1.dist-info → tccli-3.0.1156.1.dist-info}/RECORD +45 -45
- {tccli-3.0.1154.1.dist-info → tccli-3.0.1156.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1154.1.dist-info → tccli-3.0.1156.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1154.1.dist-info → tccli-3.0.1156.1.dist-info}/license_files/LICENSE +0 -0
@@ -682,6 +682,14 @@
|
|
682
682
|
"title": "修改密码"
|
683
683
|
}
|
684
684
|
],
|
685
|
+
"ModifyRoutineMaintenanceTask": [
|
686
|
+
{
|
687
|
+
"document": "",
|
688
|
+
"input": "POST / HTTP/1.1\nHost: ckafka.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyRoutineMaintenanceTask\n<公共请求参数>\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}",
|
689
|
+
"output": "{\n \"Response\": {\n \"Result\": {\n \"ReturnCode\": \"abc\",\n \"ReturnMessage\": \"abc\",\n \"Data\": {\n \"FlowId\": 0,\n \"RouteDTO\": {\n \"RouteId\": 0\n }\n }\n },\n \"RequestId\": \"abc\"\n }\n}",
|
690
|
+
"title": "设置实例属性"
|
691
|
+
}
|
692
|
+
],
|
685
693
|
"ModifyTopicAttributes": [
|
686
694
|
{
|
687
695
|
"document": "",
|
tccli/services/cvm/cvm_client.py
CHANGED
@@ -1421,6 +1421,58 @@ def doDescribeInstancesModification(args, parsed_globals):
|
|
1421
1421
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
1422
|
|
1423
1423
|
|
1424
|
+
def doCreateKeyPair(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.CvmClient(cred, g_param[OptionsDefine.Region], profile)
|
1451
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1452
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1453
|
+
model = models.CreateKeyPairRequest()
|
1454
|
+
model.from_json_string(json.dumps(args))
|
1455
|
+
start_time = time.time()
|
1456
|
+
while True:
|
1457
|
+
rsp = client.CreateKeyPair(model)
|
1458
|
+
result = rsp.to_json_string()
|
1459
|
+
try:
|
1460
|
+
json_obj = json.loads(result)
|
1461
|
+
except TypeError as e:
|
1462
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1463
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1464
|
+
break
|
1465
|
+
cur_time = time.time()
|
1466
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1467
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1468
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1469
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1470
|
+
else:
|
1471
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1472
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1473
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1474
|
+
|
1475
|
+
|
1424
1476
|
def doAssociateInstancesKeyPairs(args, parsed_globals):
|
1425
1477
|
g_param = parse_global_arg(parsed_globals)
|
1426
1478
|
|
@@ -2253,6 +2305,58 @@ def doDescribeHosts(args, parsed_globals):
|
|
2253
2305
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2254
2306
|
|
2255
2307
|
|
2308
|
+
def doEnterRescueMode(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.CvmClient(cred, g_param[OptionsDefine.Region], profile)
|
2335
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2336
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2337
|
+
model = models.EnterRescueModeRequest()
|
2338
|
+
model.from_json_string(json.dumps(args))
|
2339
|
+
start_time = time.time()
|
2340
|
+
while True:
|
2341
|
+
rsp = client.EnterRescueMode(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
|
+
|
2256
2360
|
def doDescribeInstancesStatus(args, parsed_globals):
|
2257
2361
|
g_param = parse_global_arg(parsed_globals)
|
2258
2362
|
|
@@ -2461,7 +2565,7 @@ def doModifyLaunchTemplateDefaultVersion(args, parsed_globals):
|
|
2461
2565
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
2566
|
|
2463
2567
|
|
2464
|
-
def
|
2568
|
+
def doExitRescueMode(args, parsed_globals):
|
2465
2569
|
g_param = parse_global_arg(parsed_globals)
|
2466
2570
|
|
2467
2571
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2490,11 +2594,11 @@ def doCreateKeyPair(args, parsed_globals):
|
|
2490
2594
|
client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
|
2491
2595
|
client._sdkVersion += ("_CLI_" + __version__)
|
2492
2596
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2493
|
-
model = models.
|
2597
|
+
model = models.ExitRescueModeRequest()
|
2494
2598
|
model.from_json_string(json.dumps(args))
|
2495
2599
|
start_time = time.time()
|
2496
2600
|
while True:
|
2497
|
-
rsp = client.
|
2601
|
+
rsp = client.ExitRescueMode(model)
|
2498
2602
|
result = rsp.to_json_string()
|
2499
2603
|
try:
|
2500
2604
|
json_obj = json.loads(result)
|
@@ -5099,6 +5203,7 @@ ACTION_MAP = {
|
|
5099
5203
|
"DescribeImageSharePermission": doDescribeImageSharePermission,
|
5100
5204
|
"DescribeRegions": doDescribeRegions,
|
5101
5205
|
"DescribeInstancesModification": doDescribeInstancesModification,
|
5206
|
+
"CreateKeyPair": doCreateKeyPair,
|
5102
5207
|
"AssociateInstancesKeyPairs": doAssociateInstancesKeyPairs,
|
5103
5208
|
"DisassociateInstancesKeyPairs": doDisassociateInstancesKeyPairs,
|
5104
5209
|
"DeleteInstancesActionTimer": doDeleteInstancesActionTimer,
|
@@ -5115,11 +5220,12 @@ ACTION_MAP = {
|
|
5115
5220
|
"RenewHosts": doRenewHosts,
|
5116
5221
|
"RepairTaskControl": doRepairTaskControl,
|
5117
5222
|
"DescribeHosts": doDescribeHosts,
|
5223
|
+
"EnterRescueMode": doEnterRescueMode,
|
5118
5224
|
"DescribeInstancesStatus": doDescribeInstancesStatus,
|
5119
5225
|
"ModifyImageSharePermission": doModifyImageSharePermission,
|
5120
5226
|
"ImportInstancesActionTimer": doImportInstancesActionTimer,
|
5121
5227
|
"ModifyLaunchTemplateDefaultVersion": doModifyLaunchTemplateDefaultVersion,
|
5122
|
-
"
|
5228
|
+
"ExitRescueMode": doExitRescueMode,
|
5123
5229
|
"DescribeInstancesActionTimer": doDescribeInstancesActionTimer,
|
5124
5230
|
"InquiryPriceResizeInstanceDisks": doInquiryPriceResizeInstanceDisks,
|
5125
5231
|
"InquiryPriceResetInstance": doInquiryPriceResetInstance,
|
@@ -357,6 +357,20 @@
|
|
357
357
|
"output": "DisassociateSecurityGroupsResponse",
|
358
358
|
"status": "online"
|
359
359
|
},
|
360
|
+
"EnterRescueMode": {
|
361
|
+
"document": "进入救援模式",
|
362
|
+
"input": "EnterRescueModeRequest",
|
363
|
+
"name": "进入救援模式",
|
364
|
+
"output": "EnterRescueModeResponse",
|
365
|
+
"status": "online"
|
366
|
+
},
|
367
|
+
"ExitRescueMode": {
|
368
|
+
"document": "退出救援模式",
|
369
|
+
"input": "ExitRescueModeRequest",
|
370
|
+
"name": "退出救援模式",
|
371
|
+
"output": "ExitRescueModeResponse",
|
372
|
+
"status": "online"
|
373
|
+
},
|
360
374
|
"ExportImages": {
|
361
375
|
"document": "提供导出自定义镜像到指定COS存储桶的能力",
|
362
376
|
"input": "ExportImagesRequest",
|
@@ -4702,6 +4716,87 @@
|
|
4702
4716
|
],
|
4703
4717
|
"usage": "both"
|
4704
4718
|
},
|
4719
|
+
"EnterRescueModeRequest": {
|
4720
|
+
"document": "EnterRescueMode请求参数结构体",
|
4721
|
+
"members": [
|
4722
|
+
{
|
4723
|
+
"disabled": false,
|
4724
|
+
"document": "需要进入救援模式的实例id",
|
4725
|
+
"example": "'ins-abcdefg'",
|
4726
|
+
"member": "string",
|
4727
|
+
"name": "InstanceId",
|
4728
|
+
"required": true,
|
4729
|
+
"type": "string"
|
4730
|
+
},
|
4731
|
+
{
|
4732
|
+
"disabled": false,
|
4733
|
+
"document": "救援模式下系统密码",
|
4734
|
+
"example": "'hello123456789'",
|
4735
|
+
"member": "string",
|
4736
|
+
"name": "Password",
|
4737
|
+
"required": true,
|
4738
|
+
"type": "string"
|
4739
|
+
},
|
4740
|
+
{
|
4741
|
+
"disabled": false,
|
4742
|
+
"document": "救援模式下系统用户名",
|
4743
|
+
"example": "'root'",
|
4744
|
+
"member": "string",
|
4745
|
+
"name": "Username",
|
4746
|
+
"required": false,
|
4747
|
+
"type": "string"
|
4748
|
+
},
|
4749
|
+
{
|
4750
|
+
"disabled": false,
|
4751
|
+
"document": "是否强制关机",
|
4752
|
+
"example": "False",
|
4753
|
+
"member": "bool",
|
4754
|
+
"name": "ForceStop",
|
4755
|
+
"required": false,
|
4756
|
+
"type": "bool"
|
4757
|
+
}
|
4758
|
+
],
|
4759
|
+
"type": "object"
|
4760
|
+
},
|
4761
|
+
"EnterRescueModeResponse": {
|
4762
|
+
"document": "EnterRescueMode返回参数结构体",
|
4763
|
+
"members": [
|
4764
|
+
{
|
4765
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
4766
|
+
"member": "string",
|
4767
|
+
"name": "RequestId",
|
4768
|
+
"type": "string"
|
4769
|
+
}
|
4770
|
+
],
|
4771
|
+
"type": "object"
|
4772
|
+
},
|
4773
|
+
"ExitRescueModeRequest": {
|
4774
|
+
"document": "ExitRescueMode请求参数结构体",
|
4775
|
+
"members": [
|
4776
|
+
{
|
4777
|
+
"disabled": false,
|
4778
|
+
"document": "退出救援模式的实例id",
|
4779
|
+
"example": "instance_Id",
|
4780
|
+
"member": "string",
|
4781
|
+
"name": "InstanceId",
|
4782
|
+
"required": true,
|
4783
|
+
"type": "string"
|
4784
|
+
}
|
4785
|
+
],
|
4786
|
+
"type": "object"
|
4787
|
+
},
|
4788
|
+
"ExitRescueModeResponse": {
|
4789
|
+
"document": "ExitRescueMode返回参数结构体",
|
4790
|
+
"members": [
|
4791
|
+
{
|
4792
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
4793
|
+
"member": "string",
|
4794
|
+
"name": "RequestId",
|
4795
|
+
"type": "string"
|
4796
|
+
}
|
4797
|
+
],
|
4798
|
+
"type": "object"
|
4799
|
+
},
|
4705
4800
|
"ExportImagesRequest": {
|
4706
4801
|
"document": "ExportImages请求参数结构体",
|
4707
4802
|
"members": [
|
@@ -438,6 +438,22 @@
|
|
438
438
|
"title": "解绑实例安全组"
|
439
439
|
}
|
440
440
|
],
|
441
|
+
"EnterRescueMode": [
|
442
|
+
{
|
443
|
+
"document": "",
|
444
|
+
"input": "POST / HTTP/1.1\nHost: cvm.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: EnterRescueMode\n<公共请求参数>\n\n{\n \"InstanceId\": \"instance_Id\",\n \"Password\": \"\\\"uu7797UUX\\\"\"\n}",
|
445
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"5920380e-277a-420a-a221-0caac3eb7159\"\n }\n}",
|
446
|
+
"title": "进入救援模式"
|
447
|
+
}
|
448
|
+
],
|
449
|
+
"ExitRescueMode": [
|
450
|
+
{
|
451
|
+
"document": "",
|
452
|
+
"input": "https://cvm.tencentcloudapi.com/?Action=ExitRescueMode\n&InstanceId=instance_Id\n&<公共请求参数>",
|
453
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"5920380e-277a-420a-a221-0caac3eb7159\"\n }\n}",
|
454
|
+
"title": "退出救援模式"
|
455
|
+
}
|
456
|
+
],
|
441
457
|
"ExportImages": [
|
442
458
|
{
|
443
459
|
"document": "导出自定义镜像",
|
@@ -797,7 +797,7 @@ def doCloseProxy(args, parsed_globals):
|
|
797
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
798
|
|
799
799
|
|
800
|
-
def
|
800
|
+
def doExportResourcePackageDeductDetails(args, parsed_globals):
|
801
801
|
g_param = parse_global_arg(parsed_globals)
|
802
802
|
|
803
803
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -826,11 +826,11 @@ def doDescribeProxySpecs(args, parsed_globals):
|
|
826
826
|
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
827
827
|
client._sdkVersion += ("_CLI_" + __version__)
|
828
828
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
-
model = models.
|
829
|
+
model = models.ExportResourcePackageDeductDetailsRequest()
|
830
830
|
model.from_json_string(json.dumps(args))
|
831
831
|
start_time = time.time()
|
832
832
|
while True:
|
833
|
-
rsp = client.
|
833
|
+
rsp = client.ExportResourcePackageDeductDetails(model)
|
834
834
|
result = rsp.to_json_string()
|
835
835
|
try:
|
836
836
|
json_obj = json.loads(result)
|
@@ -2409,6 +2409,58 @@ def doIsolateCluster(args, parsed_globals):
|
|
2409
2409
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2410
2410
|
|
2411
2411
|
|
2412
|
+
def doDescribeProxySpecs(args, parsed_globals):
|
2413
|
+
g_param = parse_global_arg(parsed_globals)
|
2414
|
+
|
2415
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2416
|
+
cred = credential.CVMRoleCredential()
|
2417
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2418
|
+
cred = credential.STSAssumeRoleCredential(
|
2419
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2420
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2421
|
+
)
|
2422
|
+
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):
|
2423
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2424
|
+
else:
|
2425
|
+
cred = credential.Credential(
|
2426
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2427
|
+
)
|
2428
|
+
http_profile = HttpProfile(
|
2429
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2430
|
+
reqMethod="POST",
|
2431
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2432
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2433
|
+
)
|
2434
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2435
|
+
if g_param[OptionsDefine.Language]:
|
2436
|
+
profile.language = g_param[OptionsDefine.Language]
|
2437
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2438
|
+
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
2439
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2440
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2441
|
+
model = models.DescribeProxySpecsRequest()
|
2442
|
+
model.from_json_string(json.dumps(args))
|
2443
|
+
start_time = time.time()
|
2444
|
+
while True:
|
2445
|
+
rsp = client.DescribeProxySpecs(model)
|
2446
|
+
result = rsp.to_json_string()
|
2447
|
+
try:
|
2448
|
+
json_obj = json.loads(result)
|
2449
|
+
except TypeError as e:
|
2450
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2451
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2452
|
+
break
|
2453
|
+
cur_time = time.time()
|
2454
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2455
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2456
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2457
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2458
|
+
else:
|
2459
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2460
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2461
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
|
+
|
2463
|
+
|
2412
2464
|
def doRestartInstance(args, parsed_globals):
|
2413
2465
|
g_param = parse_global_arg(parsed_globals)
|
2414
2466
|
|
@@ -2773,6 +2825,58 @@ def doModifyParamTemplate(args, parsed_globals):
|
|
2773
2825
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2774
2826
|
|
2775
2827
|
|
2828
|
+
def doModifyResourcePackagesDeductionPriority(args, parsed_globals):
|
2829
|
+
g_param = parse_global_arg(parsed_globals)
|
2830
|
+
|
2831
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2832
|
+
cred = credential.CVMRoleCredential()
|
2833
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2834
|
+
cred = credential.STSAssumeRoleCredential(
|
2835
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2836
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2837
|
+
)
|
2838
|
+
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):
|
2839
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2840
|
+
else:
|
2841
|
+
cred = credential.Credential(
|
2842
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2843
|
+
)
|
2844
|
+
http_profile = HttpProfile(
|
2845
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2846
|
+
reqMethod="POST",
|
2847
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2848
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2849
|
+
)
|
2850
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2851
|
+
if g_param[OptionsDefine.Language]:
|
2852
|
+
profile.language = g_param[OptionsDefine.Language]
|
2853
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2854
|
+
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
2855
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2856
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2857
|
+
model = models.ModifyResourcePackagesDeductionPriorityRequest()
|
2858
|
+
model.from_json_string(json.dumps(args))
|
2859
|
+
start_time = time.time()
|
2860
|
+
while True:
|
2861
|
+
rsp = client.ModifyResourcePackagesDeductionPriority(model)
|
2862
|
+
result = rsp.to_json_string()
|
2863
|
+
try:
|
2864
|
+
json_obj = json.loads(result)
|
2865
|
+
except TypeError as e:
|
2866
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2867
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2868
|
+
break
|
2869
|
+
cur_time = time.time()
|
2870
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2871
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2872
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2873
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2874
|
+
else:
|
2875
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2876
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2877
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2878
|
+
|
2879
|
+
|
2776
2880
|
def doDescribeInstanceParams(args, parsed_globals):
|
2777
2881
|
g_param = parse_global_arg(parsed_globals)
|
2778
2882
|
|
@@ -7427,7 +7531,7 @@ ACTION_MAP = {
|
|
7427
7531
|
"CreateAuditLogFile": doCreateAuditLogFile,
|
7428
7532
|
"RenewClusters": doRenewClusters,
|
7429
7533
|
"CloseProxy": doCloseProxy,
|
7430
|
-
"
|
7534
|
+
"ExportResourcePackageDeductDetails": doExportResourcePackageDeductDetails,
|
7431
7535
|
"DescribeClusterDetail": doDescribeClusterDetail,
|
7432
7536
|
"DescribeTasks": doDescribeTasks,
|
7433
7537
|
"DescribeBackupConfig": doDescribeBackupConfig,
|
@@ -7458,6 +7562,7 @@ ACTION_MAP = {
|
|
7458
7562
|
"CreateBackup": doCreateBackup,
|
7459
7563
|
"OfflineInstance": doOfflineInstance,
|
7460
7564
|
"IsolateCluster": doIsolateCluster,
|
7565
|
+
"DescribeProxySpecs": doDescribeProxySpecs,
|
7461
7566
|
"RestartInstance": doRestartInstance,
|
7462
7567
|
"UpgradeProxy": doUpgradeProxy,
|
7463
7568
|
"DescribeClusters": doDescribeClusters,
|
@@ -7465,6 +7570,7 @@ ACTION_MAP = {
|
|
7465
7570
|
"DescribeProjectSecurityGroups": doDescribeProjectSecurityGroups,
|
7466
7571
|
"ModifyClusterDatabase": doModifyClusterDatabase,
|
7467
7572
|
"ModifyParamTemplate": doModifyParamTemplate,
|
7573
|
+
"ModifyResourcePackagesDeductionPriority": doModifyResourcePackagesDeductionPriority,
|
7468
7574
|
"DescribeInstanceParams": doDescribeInstanceParams,
|
7469
7575
|
"DescribeInstanceSlowQueries": doDescribeInstanceSlowQueries,
|
7470
7576
|
"DescribeClusterDatabases": doDescribeClusterDatabases,
|