tccli 3.0.1380.1__py2.py3-none-any.whl → 3.0.1382.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/autoscaling/v20180419/api.json +27 -27
- tccli/services/ckafka/v20190819/api.json +174 -174
- tccli/services/ckafka/v20190819/examples.json +15 -15
- tccli/services/gs/v20191118/api.json +30 -1
- tccli/services/ioa/v20220601/api.json +22 -13
- tccli/services/iotexplorer/v20190423/api.json +1 -1
- tccli/services/lighthouse/lighthouse_client.py +375 -4
- tccli/services/lighthouse/v20200324/api.json +598 -0
- tccli/services/lighthouse/v20200324/examples.json +56 -0
- tccli/services/lke/v20231130/api.json +91 -8
- tccli/services/lkeap/v20240522/api.json +47 -1
- tccli/services/lkeap/v20240522/examples.json +6 -0
- tccli/services/mna/mna_client.py +53 -0
- tccli/services/mna/v20210119/api.json +137 -0
- tccli/services/mna/v20210119/examples.json +8 -0
- tccli/services/monitor/v20180724/api.json +2 -2
- tccli/services/mqtt/v20240516/api.json +1 -1
- tccli/services/oceanus/v20190422/api.json +105 -17
- tccli/services/omics/v20221128/api.json +1 -1
- tccli/services/redis/v20180412/api.json +3 -3
- tccli/services/redis/v20180412/examples.json +1 -1
- tccli/services/tcb/v20180608/api.json +10 -0
- tccli/services/tcbr/v20220217/api.json +10 -0
- tccli/services/teo/v20220901/api.json +6 -6
- tccli/services/thpc/v20230321/api.json +18 -14
- tccli/services/tke/v20180525/api.json +11 -11
- tccli/services/trtc/v20190722/api.json +4 -4
- tccli/services/tsf/v20180326/api.json +28 -28
- tccli/services/waf/v20180125/api.json +1442 -102
- tccli/services/waf/v20180125/examples.json +48 -0
- tccli/services/waf/waf_client.py +338 -20
- {tccli-3.0.1380.1.dist-info → tccli-3.0.1382.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1380.1.dist-info → tccli-3.0.1382.1.dist-info}/RECORD +37 -37
- {tccli-3.0.1380.1.dist-info → tccli-3.0.1382.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1380.1.dist-info → tccli-3.0.1382.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1380.1.dist-info → tccli-3.0.1382.1.dist-info}/license_files/LICENSE +0 -0
@@ -1421,6 +1421,58 @@ def doDescribeDiskDiscount(args, parsed_globals):
|
|
1421
1421
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
1422
|
|
1423
1423
|
|
1424
|
+
def doRemoveMcpServers(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.LighthouseClient(cred, g_param[OptionsDefine.Region], profile)
|
1451
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1452
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1453
|
+
model = models.RemoveMcpServersRequest()
|
1454
|
+
model.from_json_string(json.dumps(args))
|
1455
|
+
start_time = time.time()
|
1456
|
+
while True:
|
1457
|
+
rsp = client.RemoveMcpServers(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 doDescribeFirewallTemplateQuota(args, parsed_globals):
|
1425
1477
|
g_param = parse_global_arg(parsed_globals)
|
1426
1478
|
|
@@ -1993,6 +2045,58 @@ def doCreateInstanceSnapshot(args, parsed_globals):
|
|
1993
2045
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1994
2046
|
|
1995
2047
|
|
2048
|
+
def doStartMcpServers(args, parsed_globals):
|
2049
|
+
g_param = parse_global_arg(parsed_globals)
|
2050
|
+
|
2051
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2052
|
+
cred = credential.CVMRoleCredential()
|
2053
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2054
|
+
cred = credential.STSAssumeRoleCredential(
|
2055
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2056
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2057
|
+
)
|
2058
|
+
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):
|
2059
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2060
|
+
else:
|
2061
|
+
cred = credential.Credential(
|
2062
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2063
|
+
)
|
2064
|
+
http_profile = HttpProfile(
|
2065
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2066
|
+
reqMethod="POST",
|
2067
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2068
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2069
|
+
)
|
2070
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2071
|
+
if g_param[OptionsDefine.Language]:
|
2072
|
+
profile.language = g_param[OptionsDefine.Language]
|
2073
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2074
|
+
client = mod.LighthouseClient(cred, g_param[OptionsDefine.Region], profile)
|
2075
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2076
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2077
|
+
model = models.StartMcpServersRequest()
|
2078
|
+
model.from_json_string(json.dumps(args))
|
2079
|
+
start_time = time.time()
|
2080
|
+
while True:
|
2081
|
+
rsp = client.StartMcpServers(model)
|
2082
|
+
result = rsp.to_json_string()
|
2083
|
+
try:
|
2084
|
+
json_obj = json.loads(result)
|
2085
|
+
except TypeError as e:
|
2086
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2087
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2088
|
+
break
|
2089
|
+
cur_time = time.time()
|
2090
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2091
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2092
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2093
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2094
|
+
else:
|
2095
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2096
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2097
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2098
|
+
|
2099
|
+
|
1996
2100
|
def doInquirePriceCreateInstances(args, parsed_globals):
|
1997
2101
|
g_param = parse_global_arg(parsed_globals)
|
1998
2102
|
|
@@ -2669,6 +2773,58 @@ def doIsolateInstances(args, parsed_globals):
|
|
2669
2773
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2670
2774
|
|
2671
2775
|
|
2776
|
+
def doCreateMcpServer(args, parsed_globals):
|
2777
|
+
g_param = parse_global_arg(parsed_globals)
|
2778
|
+
|
2779
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2780
|
+
cred = credential.CVMRoleCredential()
|
2781
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2782
|
+
cred = credential.STSAssumeRoleCredential(
|
2783
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2784
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2785
|
+
)
|
2786
|
+
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):
|
2787
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2788
|
+
else:
|
2789
|
+
cred = credential.Credential(
|
2790
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2791
|
+
)
|
2792
|
+
http_profile = HttpProfile(
|
2793
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2794
|
+
reqMethod="POST",
|
2795
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2796
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2797
|
+
)
|
2798
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2799
|
+
if g_param[OptionsDefine.Language]:
|
2800
|
+
profile.language = g_param[OptionsDefine.Language]
|
2801
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2802
|
+
client = mod.LighthouseClient(cred, g_param[OptionsDefine.Region], profile)
|
2803
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2804
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2805
|
+
model = models.CreateMcpServerRequest()
|
2806
|
+
model.from_json_string(json.dumps(args))
|
2807
|
+
start_time = time.time()
|
2808
|
+
while True:
|
2809
|
+
rsp = client.CreateMcpServer(model)
|
2810
|
+
result = rsp.to_json_string()
|
2811
|
+
try:
|
2812
|
+
json_obj = json.loads(result)
|
2813
|
+
except TypeError as e:
|
2814
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2815
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2816
|
+
break
|
2817
|
+
cur_time = time.time()
|
2818
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2819
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2820
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2821
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2822
|
+
else:
|
2823
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2824
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2825
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2826
|
+
|
2827
|
+
|
2672
2828
|
def doCreateBlueprint(args, parsed_globals):
|
2673
2829
|
g_param = parse_global_arg(parsed_globals)
|
2674
2830
|
|
@@ -4333,6 +4489,58 @@ def doDescribeInstancesDiskNum(args, parsed_globals):
|
|
4333
4489
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4334
4490
|
|
4335
4491
|
|
4492
|
+
def doStopMcpServers(args, parsed_globals):
|
4493
|
+
g_param = parse_global_arg(parsed_globals)
|
4494
|
+
|
4495
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
4496
|
+
cred = credential.CVMRoleCredential()
|
4497
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
4498
|
+
cred = credential.STSAssumeRoleCredential(
|
4499
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
4500
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
4501
|
+
)
|
4502
|
+
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):
|
4503
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
4504
|
+
else:
|
4505
|
+
cred = credential.Credential(
|
4506
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
4507
|
+
)
|
4508
|
+
http_profile = HttpProfile(
|
4509
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
4510
|
+
reqMethod="POST",
|
4511
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
4512
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
4513
|
+
)
|
4514
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
4515
|
+
if g_param[OptionsDefine.Language]:
|
4516
|
+
profile.language = g_param[OptionsDefine.Language]
|
4517
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
4518
|
+
client = mod.LighthouseClient(cred, g_param[OptionsDefine.Region], profile)
|
4519
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
4520
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4521
|
+
model = models.StopMcpServersRequest()
|
4522
|
+
model.from_json_string(json.dumps(args))
|
4523
|
+
start_time = time.time()
|
4524
|
+
while True:
|
4525
|
+
rsp = client.StopMcpServers(model)
|
4526
|
+
result = rsp.to_json_string()
|
4527
|
+
try:
|
4528
|
+
json_obj = json.loads(result)
|
4529
|
+
except TypeError as e:
|
4530
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
4531
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
4532
|
+
break
|
4533
|
+
cur_time = time.time()
|
4534
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
4535
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
4536
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
4537
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
4538
|
+
else:
|
4539
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
4540
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
4541
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4542
|
+
|
4543
|
+
|
4336
4544
|
def doDeleteFirewallTemplateRules(args, parsed_globals):
|
4337
4545
|
g_param = parse_global_arg(parsed_globals)
|
4338
4546
|
|
@@ -4541,6 +4749,58 @@ def doDescribeFirewallRulesTemplate(args, parsed_globals):
|
|
4541
4749
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4542
4750
|
|
4543
4751
|
|
4752
|
+
def doDescribeMcpServers(args, parsed_globals):
|
4753
|
+
g_param = parse_global_arg(parsed_globals)
|
4754
|
+
|
4755
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
4756
|
+
cred = credential.CVMRoleCredential()
|
4757
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
4758
|
+
cred = credential.STSAssumeRoleCredential(
|
4759
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
4760
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
4761
|
+
)
|
4762
|
+
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):
|
4763
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
4764
|
+
else:
|
4765
|
+
cred = credential.Credential(
|
4766
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
4767
|
+
)
|
4768
|
+
http_profile = HttpProfile(
|
4769
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
4770
|
+
reqMethod="POST",
|
4771
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
4772
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
4773
|
+
)
|
4774
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
4775
|
+
if g_param[OptionsDefine.Language]:
|
4776
|
+
profile.language = g_param[OptionsDefine.Language]
|
4777
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
4778
|
+
client = mod.LighthouseClient(cred, g_param[OptionsDefine.Region], profile)
|
4779
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
4780
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4781
|
+
model = models.DescribeMcpServersRequest()
|
4782
|
+
model.from_json_string(json.dumps(args))
|
4783
|
+
start_time = time.time()
|
4784
|
+
while True:
|
4785
|
+
rsp = client.DescribeMcpServers(model)
|
4786
|
+
result = rsp.to_json_string()
|
4787
|
+
try:
|
4788
|
+
json_obj = json.loads(result)
|
4789
|
+
except TypeError as e:
|
4790
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
4791
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
4792
|
+
break
|
4793
|
+
cur_time = time.time()
|
4794
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
4795
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
4796
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
4797
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
4798
|
+
else:
|
4799
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
4800
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
4801
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4802
|
+
|
4803
|
+
|
4544
4804
|
def doDescribeInstances(args, parsed_globals):
|
4545
4805
|
g_param = parse_global_arg(parsed_globals)
|
4546
4806
|
|
@@ -4645,7 +4905,7 @@ def doRemoveDockerContainers(args, parsed_globals):
|
|
4645
4905
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4646
4906
|
|
4647
4907
|
|
4648
|
-
def
|
4908
|
+
def doModifyMcpServer(args, parsed_globals):
|
4649
4909
|
g_param = parse_global_arg(parsed_globals)
|
4650
4910
|
|
4651
4911
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -4674,11 +4934,11 @@ def doIsolateDisks(args, parsed_globals):
|
|
4674
4934
|
client = mod.LighthouseClient(cred, g_param[OptionsDefine.Region], profile)
|
4675
4935
|
client._sdkVersion += ("_CLI_" + __version__)
|
4676
4936
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4677
|
-
model = models.
|
4937
|
+
model = models.ModifyMcpServerRequest()
|
4678
4938
|
model.from_json_string(json.dumps(args))
|
4679
4939
|
start_time = time.time()
|
4680
4940
|
while True:
|
4681
|
-
rsp = client.
|
4941
|
+
rsp = client.ModifyMcpServer(model)
|
4682
4942
|
result = rsp.to_json_string()
|
4683
4943
|
try:
|
4684
4944
|
json_obj = json.loads(result)
|
@@ -5529,6 +5789,58 @@ def doDescribeFirewallRules(args, parsed_globals):
|
|
5529
5789
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5530
5790
|
|
5531
5791
|
|
5792
|
+
def doRestartMcpServers(args, parsed_globals):
|
5793
|
+
g_param = parse_global_arg(parsed_globals)
|
5794
|
+
|
5795
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
5796
|
+
cred = credential.CVMRoleCredential()
|
5797
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
5798
|
+
cred = credential.STSAssumeRoleCredential(
|
5799
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
5800
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
5801
|
+
)
|
5802
|
+
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):
|
5803
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
5804
|
+
else:
|
5805
|
+
cred = credential.Credential(
|
5806
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
5807
|
+
)
|
5808
|
+
http_profile = HttpProfile(
|
5809
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
5810
|
+
reqMethod="POST",
|
5811
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
5812
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
5813
|
+
)
|
5814
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
5815
|
+
if g_param[OptionsDefine.Language]:
|
5816
|
+
profile.language = g_param[OptionsDefine.Language]
|
5817
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
5818
|
+
client = mod.LighthouseClient(cred, g_param[OptionsDefine.Region], profile)
|
5819
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
5820
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
5821
|
+
model = models.RestartMcpServersRequest()
|
5822
|
+
model.from_json_string(json.dumps(args))
|
5823
|
+
start_time = time.time()
|
5824
|
+
while True:
|
5825
|
+
rsp = client.RestartMcpServers(model)
|
5826
|
+
result = rsp.to_json_string()
|
5827
|
+
try:
|
5828
|
+
json_obj = json.loads(result)
|
5829
|
+
except TypeError as e:
|
5830
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
5831
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
5832
|
+
break
|
5833
|
+
cur_time = time.time()
|
5834
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
5835
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
5836
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
5837
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
5838
|
+
else:
|
5839
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
5840
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
5841
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5842
|
+
|
5843
|
+
|
5532
5844
|
def doDescribeScenes(args, parsed_globals):
|
5533
5845
|
g_param = parse_global_arg(parsed_globals)
|
5534
5846
|
|
@@ -5581,6 +5893,58 @@ def doDescribeScenes(args, parsed_globals):
|
|
5581
5893
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5582
5894
|
|
5583
5895
|
|
5896
|
+
def doIsolateDisks(args, parsed_globals):
|
5897
|
+
g_param = parse_global_arg(parsed_globals)
|
5898
|
+
|
5899
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
5900
|
+
cred = credential.CVMRoleCredential()
|
5901
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
5902
|
+
cred = credential.STSAssumeRoleCredential(
|
5903
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
5904
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
5905
|
+
)
|
5906
|
+
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):
|
5907
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
5908
|
+
else:
|
5909
|
+
cred = credential.Credential(
|
5910
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
5911
|
+
)
|
5912
|
+
http_profile = HttpProfile(
|
5913
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
5914
|
+
reqMethod="POST",
|
5915
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
5916
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
5917
|
+
)
|
5918
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
5919
|
+
if g_param[OptionsDefine.Language]:
|
5920
|
+
profile.language = g_param[OptionsDefine.Language]
|
5921
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
5922
|
+
client = mod.LighthouseClient(cred, g_param[OptionsDefine.Region], profile)
|
5923
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
5924
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
5925
|
+
model = models.IsolateDisksRequest()
|
5926
|
+
model.from_json_string(json.dumps(args))
|
5927
|
+
start_time = time.time()
|
5928
|
+
while True:
|
5929
|
+
rsp = client.IsolateDisks(model)
|
5930
|
+
result = rsp.to_json_string()
|
5931
|
+
try:
|
5932
|
+
json_obj = json.loads(result)
|
5933
|
+
except TypeError as e:
|
5934
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
5935
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
5936
|
+
break
|
5937
|
+
cur_time = time.time()
|
5938
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
5939
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
5940
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
5941
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
5942
|
+
else:
|
5943
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
5944
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
5945
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5946
|
+
|
5947
|
+
|
5584
5948
|
def doCreateInstances(args, parsed_globals):
|
5585
5949
|
g_param = parse_global_arg(parsed_globals)
|
5586
5950
|
|
@@ -5775,6 +6139,7 @@ ACTION_MAP = {
|
|
5775
6139
|
"ResizeDisks": doResizeDisks,
|
5776
6140
|
"CreateDiskBackup": doCreateDiskBackup,
|
5777
6141
|
"DescribeDiskDiscount": doDescribeDiskDiscount,
|
6142
|
+
"RemoveMcpServers": doRemoveMcpServers,
|
5778
6143
|
"DescribeFirewallTemplateQuota": doDescribeFirewallTemplateQuota,
|
5779
6144
|
"DescribeAllScenes": doDescribeAllScenes,
|
5780
6145
|
"CreateFirewallTemplate": doCreateFirewallTemplate,
|
@@ -5786,6 +6151,7 @@ ACTION_MAP = {
|
|
5786
6151
|
"DescribeBlueprints": doDescribeBlueprints,
|
5787
6152
|
"ModifyDockerContainer": doModifyDockerContainer,
|
5788
6153
|
"CreateInstanceSnapshot": doCreateInstanceSnapshot,
|
6154
|
+
"StartMcpServers": doStartMcpServers,
|
5789
6155
|
"InquirePriceCreateInstances": doInquirePriceCreateInstances,
|
5790
6156
|
"DescribeInstancesDeniedActions": doDescribeInstancesDeniedActions,
|
5791
6157
|
"ModifyDisksBackupQuota": doModifyDisksBackupQuota,
|
@@ -5799,6 +6165,7 @@ ACTION_MAP = {
|
|
5799
6165
|
"CreateFirewallTemplateRules": doCreateFirewallTemplateRules,
|
5800
6166
|
"DescribeSnapshotsDeniedActions": doDescribeSnapshotsDeniedActions,
|
5801
6167
|
"IsolateInstances": doIsolateInstances,
|
6168
|
+
"CreateMcpServer": doCreateMcpServer,
|
5802
6169
|
"CreateBlueprint": doCreateBlueprint,
|
5803
6170
|
"DescribeDockerActivities": doDescribeDockerActivities,
|
5804
6171
|
"DetachDisks": doDetachDisks,
|
@@ -5831,13 +6198,15 @@ ACTION_MAP = {
|
|
5831
6198
|
"StopDockerContainers": doStopDockerContainers,
|
5832
6199
|
"ApplyDiskBackup": doApplyDiskBackup,
|
5833
6200
|
"DescribeInstancesDiskNum": doDescribeInstancesDiskNum,
|
6201
|
+
"StopMcpServers": doStopMcpServers,
|
5834
6202
|
"DeleteFirewallTemplateRules": doDeleteFirewallTemplateRules,
|
5835
6203
|
"RunDockerContainers": doRunDockerContainers,
|
5836
6204
|
"DescribeInstancesReturnable": doDescribeInstancesReturnable,
|
5837
6205
|
"DescribeFirewallRulesTemplate": doDescribeFirewallRulesTemplate,
|
6206
|
+
"DescribeMcpServers": doDescribeMcpServers,
|
5838
6207
|
"DescribeInstances": doDescribeInstances,
|
5839
6208
|
"RemoveDockerContainers": doRemoveDockerContainers,
|
5840
|
-
"
|
6209
|
+
"ModifyMcpServer": doModifyMcpServer,
|
5841
6210
|
"InquirePriceCreateBlueprint": doInquirePriceCreateBlueprint,
|
5842
6211
|
"DeleteFirewallRules": doDeleteFirewallRules,
|
5843
6212
|
"ResetInstancesPassword": doResetInstancesPassword,
|
@@ -5854,7 +6223,9 @@ ACTION_MAP = {
|
|
5854
6223
|
"RenewDisks": doRenewDisks,
|
5855
6224
|
"RenewInstances": doRenewInstances,
|
5856
6225
|
"DescribeFirewallRules": doDescribeFirewallRules,
|
6226
|
+
"RestartMcpServers": doRestartMcpServers,
|
5857
6227
|
"DescribeScenes": doDescribeScenes,
|
6228
|
+
"IsolateDisks": doIsolateDisks,
|
5858
6229
|
"CreateInstances": doCreateInstances,
|
5859
6230
|
"ReplaceFirewallTemplateRule": doReplaceFirewallTemplateRule,
|
5860
6231
|
"DescribeFirewallTemplates": doDescribeFirewallTemplates,
|