tccli 3.0.1407.1__py2.py3-none-any.whl → 3.0.1408.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/ccc/v20200210/api.json +9 -0
- tccli/services/cdb/cdb_client.py +53 -0
- tccli/services/cdb/v20170320/api.json +54 -0
- tccli/services/cdb/v20170320/examples.json +8 -0
- tccli/services/dbbrain/v20210527/api.json +7 -7
- tccli/services/dcdb/v20180411/api.json +1 -1
- tccli/services/essbasic/v20210526/api.json +3 -3
- tccli/services/essbasic/v20210526/examples.json +6 -6
- tccli/services/gaap/v20180529/api.json +13 -3
- tccli/services/ioa/ioa_client.py +61 -8
- tccli/services/ioa/v20220601/api.json +126 -0
- tccli/services/ioa/v20220601/examples.json +8 -0
- tccli/services/lighthouse/v20200324/api.json +36 -0
- tccli/services/lighthouse/v20200324/examples.json +1 -1
- tccli/services/live/v20180801/examples.json +6 -0
- tccli/services/mariadb/v20170312/api.json +1 -1
- tccli/services/mps/v20190612/api.json +26 -4
- tccli/services/oceanus/v20190422/api.json +2 -2
- tccli/services/oceanus/v20190422/examples.json +2 -2
- tccli/services/pts/v20210728/api.json +2 -2
- tccli/services/rum/v20210622/api.json +18 -0
- tccli/services/tmt/v20180321/api.json +78 -1
- tccli/services/tsf/v20180326/api.json +3 -0
- tccli/services/vpc/v20170312/api.json +819 -0
- tccli/services/vpc/v20170312/examples.json +96 -0
- tccli/services/vpc/vpc_client.py +669 -33
- tccli/services/wedata/v20250806/api.json +43 -4
- {tccli-3.0.1407.1.dist-info → tccli-3.0.1408.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1407.1.dist-info → tccli-3.0.1408.1.dist-info}/RECORD +33 -33
- {tccli-3.0.1407.1.dist-info → tccli-3.0.1408.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1407.1.dist-info → tccli-3.0.1408.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1407.1.dist-info → tccli-3.0.1408.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/vpc/vpc_client.py
CHANGED
|
@@ -1681,6 +1681,58 @@ def doAddBandwidthPackageResources(args, parsed_globals):
|
|
|
1681
1681
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1682
1682
|
|
|
1683
1683
|
|
|
1684
|
+
def doReplaceRoutePolicyEntries(args, parsed_globals):
|
|
1685
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1686
|
+
|
|
1687
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1688
|
+
cred = credential.CVMRoleCredential()
|
|
1689
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1690
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1691
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1692
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1693
|
+
)
|
|
1694
|
+
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):
|
|
1695
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1696
|
+
else:
|
|
1697
|
+
cred = credential.Credential(
|
|
1698
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1699
|
+
)
|
|
1700
|
+
http_profile = HttpProfile(
|
|
1701
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1702
|
+
reqMethod="POST",
|
|
1703
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1704
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1705
|
+
)
|
|
1706
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
1707
|
+
if g_param[OptionsDefine.Language]:
|
|
1708
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1709
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1710
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1711
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1712
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1713
|
+
model = models.ReplaceRoutePolicyEntriesRequest()
|
|
1714
|
+
model.from_json_string(json.dumps(args))
|
|
1715
|
+
start_time = time.time()
|
|
1716
|
+
while True:
|
|
1717
|
+
rsp = client.ReplaceRoutePolicyEntries(model)
|
|
1718
|
+
result = rsp.to_json_string()
|
|
1719
|
+
try:
|
|
1720
|
+
json_obj = json.loads(result)
|
|
1721
|
+
except TypeError as e:
|
|
1722
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1723
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1724
|
+
break
|
|
1725
|
+
cur_time = time.time()
|
|
1726
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1727
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1728
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1729
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1730
|
+
else:
|
|
1731
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1732
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1733
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1734
|
+
|
|
1735
|
+
|
|
1684
1736
|
def doAllocateAddresses(args, parsed_globals):
|
|
1685
1737
|
g_param = parse_global_arg(parsed_globals)
|
|
1686
1738
|
|
|
@@ -2513,6 +2565,110 @@ def doDeleteAssistantCidr(args, parsed_globals):
|
|
|
2513
2565
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2514
2566
|
|
|
2515
2567
|
|
|
2568
|
+
def doDescribeRoutePolicyEntries(args, parsed_globals):
|
|
2569
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2570
|
+
|
|
2571
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2572
|
+
cred = credential.CVMRoleCredential()
|
|
2573
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2574
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2575
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2576
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2577
|
+
)
|
|
2578
|
+
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):
|
|
2579
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2580
|
+
else:
|
|
2581
|
+
cred = credential.Credential(
|
|
2582
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2583
|
+
)
|
|
2584
|
+
http_profile = HttpProfile(
|
|
2585
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2586
|
+
reqMethod="POST",
|
|
2587
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2588
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2589
|
+
)
|
|
2590
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
2591
|
+
if g_param[OptionsDefine.Language]:
|
|
2592
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2593
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2594
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2595
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2596
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2597
|
+
model = models.DescribeRoutePolicyEntriesRequest()
|
|
2598
|
+
model.from_json_string(json.dumps(args))
|
|
2599
|
+
start_time = time.time()
|
|
2600
|
+
while True:
|
|
2601
|
+
rsp = client.DescribeRoutePolicyEntries(model)
|
|
2602
|
+
result = rsp.to_json_string()
|
|
2603
|
+
try:
|
|
2604
|
+
json_obj = json.loads(result)
|
|
2605
|
+
except TypeError as e:
|
|
2606
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2607
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2608
|
+
break
|
|
2609
|
+
cur_time = time.time()
|
|
2610
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2611
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2612
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2613
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2614
|
+
else:
|
|
2615
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2616
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2617
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2618
|
+
|
|
2619
|
+
|
|
2620
|
+
def doDeleteRoutePolicyAssociations(args, parsed_globals):
|
|
2621
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2622
|
+
|
|
2623
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2624
|
+
cred = credential.CVMRoleCredential()
|
|
2625
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2626
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2627
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2628
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2629
|
+
)
|
|
2630
|
+
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):
|
|
2631
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2632
|
+
else:
|
|
2633
|
+
cred = credential.Credential(
|
|
2634
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2635
|
+
)
|
|
2636
|
+
http_profile = HttpProfile(
|
|
2637
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2638
|
+
reqMethod="POST",
|
|
2639
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2640
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2641
|
+
)
|
|
2642
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
2643
|
+
if g_param[OptionsDefine.Language]:
|
|
2644
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2645
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2646
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2647
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2648
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2649
|
+
model = models.DeleteRoutePolicyAssociationsRequest()
|
|
2650
|
+
model.from_json_string(json.dumps(args))
|
|
2651
|
+
start_time = time.time()
|
|
2652
|
+
while True:
|
|
2653
|
+
rsp = client.DeleteRoutePolicyAssociations(model)
|
|
2654
|
+
result = rsp.to_json_string()
|
|
2655
|
+
try:
|
|
2656
|
+
json_obj = json.loads(result)
|
|
2657
|
+
except TypeError as e:
|
|
2658
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2659
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2660
|
+
break
|
|
2661
|
+
cur_time = time.time()
|
|
2662
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2663
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2664
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2665
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2666
|
+
else:
|
|
2667
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2668
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2669
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2670
|
+
|
|
2671
|
+
|
|
2516
2672
|
def doDeleteNetworkInterface(args, parsed_globals):
|
|
2517
2673
|
g_param = parse_global_arg(parsed_globals)
|
|
2518
2674
|
|
|
@@ -3813,6 +3969,58 @@ def doModifyNetworkInterfaceAttribute(args, parsed_globals):
|
|
|
3813
3969
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
3814
3970
|
|
|
3815
3971
|
|
|
3972
|
+
def doModifyRoutePolicyAttribute(args, parsed_globals):
|
|
3973
|
+
g_param = parse_global_arg(parsed_globals)
|
|
3974
|
+
|
|
3975
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
3976
|
+
cred = credential.CVMRoleCredential()
|
|
3977
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
3978
|
+
cred = credential.STSAssumeRoleCredential(
|
|
3979
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
3980
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
3981
|
+
)
|
|
3982
|
+
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):
|
|
3983
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
3984
|
+
else:
|
|
3985
|
+
cred = credential.Credential(
|
|
3986
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
3987
|
+
)
|
|
3988
|
+
http_profile = HttpProfile(
|
|
3989
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
3990
|
+
reqMethod="POST",
|
|
3991
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
3992
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
3993
|
+
)
|
|
3994
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
3995
|
+
if g_param[OptionsDefine.Language]:
|
|
3996
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
3997
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
3998
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
3999
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
4000
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
4001
|
+
model = models.ModifyRoutePolicyAttributeRequest()
|
|
4002
|
+
model.from_json_string(json.dumps(args))
|
|
4003
|
+
start_time = time.time()
|
|
4004
|
+
while True:
|
|
4005
|
+
rsp = client.ModifyRoutePolicyAttribute(model)
|
|
4006
|
+
result = rsp.to_json_string()
|
|
4007
|
+
try:
|
|
4008
|
+
json_obj = json.loads(result)
|
|
4009
|
+
except TypeError as e:
|
|
4010
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
4011
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
4012
|
+
break
|
|
4013
|
+
cur_time = time.time()
|
|
4014
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
4015
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
4016
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
4017
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
4018
|
+
else:
|
|
4019
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
4020
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
4021
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
4022
|
+
|
|
4023
|
+
|
|
3816
4024
|
def doModifyVpcPeeringConnection(args, parsed_globals):
|
|
3817
4025
|
g_param = parse_global_arg(parsed_globals)
|
|
3818
4026
|
|
|
@@ -3865,6 +4073,58 @@ def doModifyVpcPeeringConnection(args, parsed_globals):
|
|
|
3865
4073
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
3866
4074
|
|
|
3867
4075
|
|
|
4076
|
+
def doDeleteRoutePolicyEntries(args, parsed_globals):
|
|
4077
|
+
g_param = parse_global_arg(parsed_globals)
|
|
4078
|
+
|
|
4079
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
4080
|
+
cred = credential.CVMRoleCredential()
|
|
4081
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
4082
|
+
cred = credential.STSAssumeRoleCredential(
|
|
4083
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
4084
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
4085
|
+
)
|
|
4086
|
+
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):
|
|
4087
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
4088
|
+
else:
|
|
4089
|
+
cred = credential.Credential(
|
|
4090
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
4091
|
+
)
|
|
4092
|
+
http_profile = HttpProfile(
|
|
4093
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
4094
|
+
reqMethod="POST",
|
|
4095
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
4096
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
4097
|
+
)
|
|
4098
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
4099
|
+
if g_param[OptionsDefine.Language]:
|
|
4100
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
4101
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
4102
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
4103
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
4104
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
4105
|
+
model = models.DeleteRoutePolicyEntriesRequest()
|
|
4106
|
+
model.from_json_string(json.dumps(args))
|
|
4107
|
+
start_time = time.time()
|
|
4108
|
+
while True:
|
|
4109
|
+
rsp = client.DeleteRoutePolicyEntries(model)
|
|
4110
|
+
result = rsp.to_json_string()
|
|
4111
|
+
try:
|
|
4112
|
+
json_obj = json.loads(result)
|
|
4113
|
+
except TypeError as e:
|
|
4114
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
4115
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
4116
|
+
break
|
|
4117
|
+
cur_time = time.time()
|
|
4118
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
4119
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
4120
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
4121
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
4122
|
+
else:
|
|
4123
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
4124
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
4125
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
4126
|
+
|
|
4127
|
+
|
|
3868
4128
|
def doDescribeVpcLimits(args, parsed_globals):
|
|
3869
4129
|
g_param = parse_global_arg(parsed_globals)
|
|
3870
4130
|
|
|
@@ -6309,6 +6569,58 @@ def doUnassignIpv6Addresses(args, parsed_globals):
|
|
|
6309
6569
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
6310
6570
|
|
|
6311
6571
|
|
|
6572
|
+
def doResetRoutePolicyEntries(args, parsed_globals):
|
|
6573
|
+
g_param = parse_global_arg(parsed_globals)
|
|
6574
|
+
|
|
6575
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
6576
|
+
cred = credential.CVMRoleCredential()
|
|
6577
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
6578
|
+
cred = credential.STSAssumeRoleCredential(
|
|
6579
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
6580
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
6581
|
+
)
|
|
6582
|
+
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):
|
|
6583
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
6584
|
+
else:
|
|
6585
|
+
cred = credential.Credential(
|
|
6586
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
6587
|
+
)
|
|
6588
|
+
http_profile = HttpProfile(
|
|
6589
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
6590
|
+
reqMethod="POST",
|
|
6591
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
6592
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
6593
|
+
)
|
|
6594
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
6595
|
+
if g_param[OptionsDefine.Language]:
|
|
6596
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
6597
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
6598
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
6599
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
6600
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
6601
|
+
model = models.ResetRoutePolicyEntriesRequest()
|
|
6602
|
+
model.from_json_string(json.dumps(args))
|
|
6603
|
+
start_time = time.time()
|
|
6604
|
+
while True:
|
|
6605
|
+
rsp = client.ResetRoutePolicyEntries(model)
|
|
6606
|
+
result = rsp.to_json_string()
|
|
6607
|
+
try:
|
|
6608
|
+
json_obj = json.loads(result)
|
|
6609
|
+
except TypeError as e:
|
|
6610
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
6611
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
6612
|
+
break
|
|
6613
|
+
cur_time = time.time()
|
|
6614
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
6615
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
6616
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
6617
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
6618
|
+
else:
|
|
6619
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
6620
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
6621
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
6622
|
+
|
|
6623
|
+
|
|
6312
6624
|
def doAssociateIPv6Address(args, parsed_globals):
|
|
6313
6625
|
g_param = parse_global_arg(parsed_globals)
|
|
6314
6626
|
|
|
@@ -6517,6 +6829,58 @@ def doCreateDirectConnectGateway(args, parsed_globals):
|
|
|
6517
6829
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
6518
6830
|
|
|
6519
6831
|
|
|
6832
|
+
def doModifyGlobalRoutes(args, parsed_globals):
|
|
6833
|
+
g_param = parse_global_arg(parsed_globals)
|
|
6834
|
+
|
|
6835
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
6836
|
+
cred = credential.CVMRoleCredential()
|
|
6837
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
6838
|
+
cred = credential.STSAssumeRoleCredential(
|
|
6839
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
6840
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
6841
|
+
)
|
|
6842
|
+
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):
|
|
6843
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
6844
|
+
else:
|
|
6845
|
+
cred = credential.Credential(
|
|
6846
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
6847
|
+
)
|
|
6848
|
+
http_profile = HttpProfile(
|
|
6849
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
6850
|
+
reqMethod="POST",
|
|
6851
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
6852
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
6853
|
+
)
|
|
6854
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
6855
|
+
if g_param[OptionsDefine.Language]:
|
|
6856
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
6857
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
6858
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
6859
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
6860
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
6861
|
+
model = models.ModifyGlobalRoutesRequest()
|
|
6862
|
+
model.from_json_string(json.dumps(args))
|
|
6863
|
+
start_time = time.time()
|
|
6864
|
+
while True:
|
|
6865
|
+
rsp = client.ModifyGlobalRoutes(model)
|
|
6866
|
+
result = rsp.to_json_string()
|
|
6867
|
+
try:
|
|
6868
|
+
json_obj = json.loads(result)
|
|
6869
|
+
except TypeError as e:
|
|
6870
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
6871
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
6872
|
+
break
|
|
6873
|
+
cur_time = time.time()
|
|
6874
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
6875
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
6876
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
6877
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
6878
|
+
else:
|
|
6879
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
6880
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
6881
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
6882
|
+
|
|
6883
|
+
|
|
6520
6884
|
def doAssociateNatGatewayAddress(args, parsed_globals):
|
|
6521
6885
|
g_param = parse_global_arg(parsed_globals)
|
|
6522
6886
|
|
|
@@ -6862,7 +7226,59 @@ def doRefreshDirectConnectGatewayRouteToNatGateway(args, parsed_globals):
|
|
|
6862
7226
|
model.from_json_string(json.dumps(args))
|
|
6863
7227
|
start_time = time.time()
|
|
6864
7228
|
while True:
|
|
6865
|
-
rsp = client.RefreshDirectConnectGatewayRouteToNatGateway(model)
|
|
7229
|
+
rsp = client.RefreshDirectConnectGatewayRouteToNatGateway(model)
|
|
7230
|
+
result = rsp.to_json_string()
|
|
7231
|
+
try:
|
|
7232
|
+
json_obj = json.loads(result)
|
|
7233
|
+
except TypeError as e:
|
|
7234
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
7235
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
7236
|
+
break
|
|
7237
|
+
cur_time = time.time()
|
|
7238
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
7239
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
7240
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
7241
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
7242
|
+
else:
|
|
7243
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
7244
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
7245
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
7246
|
+
|
|
7247
|
+
|
|
7248
|
+
def doModifySnapshotPolicies(args, parsed_globals):
|
|
7249
|
+
g_param = parse_global_arg(parsed_globals)
|
|
7250
|
+
|
|
7251
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
7252
|
+
cred = credential.CVMRoleCredential()
|
|
7253
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
7254
|
+
cred = credential.STSAssumeRoleCredential(
|
|
7255
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
7256
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
7257
|
+
)
|
|
7258
|
+
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):
|
|
7259
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
7260
|
+
else:
|
|
7261
|
+
cred = credential.Credential(
|
|
7262
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
7263
|
+
)
|
|
7264
|
+
http_profile = HttpProfile(
|
|
7265
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
7266
|
+
reqMethod="POST",
|
|
7267
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
7268
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
7269
|
+
)
|
|
7270
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
7271
|
+
if g_param[OptionsDefine.Language]:
|
|
7272
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
7273
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
7274
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
7275
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
7276
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
7277
|
+
model = models.ModifySnapshotPoliciesRequest()
|
|
7278
|
+
model.from_json_string(json.dumps(args))
|
|
7279
|
+
start_time = time.time()
|
|
7280
|
+
while True:
|
|
7281
|
+
rsp = client.ModifySnapshotPolicies(model)
|
|
6866
7282
|
result = rsp.to_json_string()
|
|
6867
7283
|
try:
|
|
6868
7284
|
json_obj = json.loads(result)
|
|
@@ -6881,7 +7297,7 @@ def doRefreshDirectConnectGatewayRouteToNatGateway(args, parsed_globals):
|
|
|
6881
7297
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
6882
7298
|
|
|
6883
7299
|
|
|
6884
|
-
def
|
|
7300
|
+
def doDisassociateDhcpIpWithAddressIp(args, parsed_globals):
|
|
6885
7301
|
g_param = parse_global_arg(parsed_globals)
|
|
6886
7302
|
|
|
6887
7303
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -6910,11 +7326,11 @@ def doModifySnapshotPolicies(args, parsed_globals):
|
|
|
6910
7326
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
6911
7327
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
6912
7328
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
6913
|
-
model = models.
|
|
7329
|
+
model = models.DisassociateDhcpIpWithAddressIpRequest()
|
|
6914
7330
|
model.from_json_string(json.dumps(args))
|
|
6915
7331
|
start_time = time.time()
|
|
6916
7332
|
while True:
|
|
6917
|
-
rsp = client.
|
|
7333
|
+
rsp = client.DisassociateDhcpIpWithAddressIp(model)
|
|
6918
7334
|
result = rsp.to_json_string()
|
|
6919
7335
|
try:
|
|
6920
7336
|
json_obj = json.loads(result)
|
|
@@ -6933,7 +7349,7 @@ def doModifySnapshotPolicies(args, parsed_globals):
|
|
|
6933
7349
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
6934
7350
|
|
|
6935
7351
|
|
|
6936
|
-
def
|
|
7352
|
+
def doDeleteVpnGatewaySslClient(args, parsed_globals):
|
|
6937
7353
|
g_param = parse_global_arg(parsed_globals)
|
|
6938
7354
|
|
|
6939
7355
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -6962,11 +7378,11 @@ def doDisassociateDhcpIpWithAddressIp(args, parsed_globals):
|
|
|
6962
7378
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
6963
7379
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
6964
7380
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
6965
|
-
model = models.
|
|
7381
|
+
model = models.DeleteVpnGatewaySslClientRequest()
|
|
6966
7382
|
model.from_json_string(json.dumps(args))
|
|
6967
7383
|
start_time = time.time()
|
|
6968
7384
|
while True:
|
|
6969
|
-
rsp = client.
|
|
7385
|
+
rsp = client.DeleteVpnGatewaySslClient(model)
|
|
6970
7386
|
result = rsp.to_json_string()
|
|
6971
7387
|
try:
|
|
6972
7388
|
json_obj = json.loads(result)
|
|
@@ -6985,7 +7401,7 @@ def doDisassociateDhcpIpWithAddressIp(args, parsed_globals):
|
|
|
6985
7401
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
6986
7402
|
|
|
6987
7403
|
|
|
6988
|
-
def
|
|
7404
|
+
def doCreateNatGatewayDestinationIpPortTranslationNatRule(args, parsed_globals):
|
|
6989
7405
|
g_param = parse_global_arg(parsed_globals)
|
|
6990
7406
|
|
|
6991
7407
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -7014,11 +7430,11 @@ def doDeleteVpnGatewaySslClient(args, parsed_globals):
|
|
|
7014
7430
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
7015
7431
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
7016
7432
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
7017
|
-
model = models.
|
|
7433
|
+
model = models.CreateNatGatewayDestinationIpPortTranslationNatRuleRequest()
|
|
7018
7434
|
model.from_json_string(json.dumps(args))
|
|
7019
7435
|
start_time = time.time()
|
|
7020
7436
|
while True:
|
|
7021
|
-
rsp = client.
|
|
7437
|
+
rsp = client.CreateNatGatewayDestinationIpPortTranslationNatRule(model)
|
|
7022
7438
|
result = rsp.to_json_string()
|
|
7023
7439
|
try:
|
|
7024
7440
|
json_obj = json.loads(result)
|
|
@@ -7037,7 +7453,7 @@ def doDeleteVpnGatewaySslClient(args, parsed_globals):
|
|
|
7037
7453
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
7038
7454
|
|
|
7039
7455
|
|
|
7040
|
-
def
|
|
7456
|
+
def doModifyAddressTemplateAttribute(args, parsed_globals):
|
|
7041
7457
|
g_param = parse_global_arg(parsed_globals)
|
|
7042
7458
|
|
|
7043
7459
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -7066,11 +7482,11 @@ def doCreateNatGatewayDestinationIpPortTranslationNatRule(args, parsed_globals):
|
|
|
7066
7482
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
7067
7483
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
7068
7484
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
7069
|
-
model = models.
|
|
7485
|
+
model = models.ModifyAddressTemplateAttributeRequest()
|
|
7070
7486
|
model.from_json_string(json.dumps(args))
|
|
7071
7487
|
start_time = time.time()
|
|
7072
7488
|
while True:
|
|
7073
|
-
rsp = client.
|
|
7489
|
+
rsp = client.ModifyAddressTemplateAttribute(model)
|
|
7074
7490
|
result = rsp.to_json_string()
|
|
7075
7491
|
try:
|
|
7076
7492
|
json_obj = json.loads(result)
|
|
@@ -7089,7 +7505,7 @@ def doCreateNatGatewayDestinationIpPortTranslationNatRule(args, parsed_globals):
|
|
|
7089
7505
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
7090
7506
|
|
|
7091
7507
|
|
|
7092
|
-
def
|
|
7508
|
+
def doDeleteTemplateMember(args, parsed_globals):
|
|
7093
7509
|
g_param = parse_global_arg(parsed_globals)
|
|
7094
7510
|
|
|
7095
7511
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -7118,11 +7534,11 @@ def doModifyAddressTemplateAttribute(args, parsed_globals):
|
|
|
7118
7534
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
7119
7535
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
7120
7536
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
7121
|
-
model = models.
|
|
7537
|
+
model = models.DeleteTemplateMemberRequest()
|
|
7122
7538
|
model.from_json_string(json.dumps(args))
|
|
7123
7539
|
start_time = time.time()
|
|
7124
7540
|
while True:
|
|
7125
|
-
rsp = client.
|
|
7541
|
+
rsp = client.DeleteTemplateMember(model)
|
|
7126
7542
|
result = rsp.to_json_string()
|
|
7127
7543
|
try:
|
|
7128
7544
|
json_obj = json.loads(result)
|
|
@@ -7141,7 +7557,7 @@ def doModifyAddressTemplateAttribute(args, parsed_globals):
|
|
|
7141
7557
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
7142
7558
|
|
|
7143
7559
|
|
|
7144
|
-
def
|
|
7560
|
+
def doAssignIpv6SubnetCidrBlock(args, parsed_globals):
|
|
7145
7561
|
g_param = parse_global_arg(parsed_globals)
|
|
7146
7562
|
|
|
7147
7563
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -7170,11 +7586,11 @@ def doDeleteTemplateMember(args, parsed_globals):
|
|
|
7170
7586
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
7171
7587
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
7172
7588
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
7173
|
-
model = models.
|
|
7589
|
+
model = models.AssignIpv6SubnetCidrBlockRequest()
|
|
7174
7590
|
model.from_json_string(json.dumps(args))
|
|
7175
7591
|
start_time = time.time()
|
|
7176
7592
|
while True:
|
|
7177
|
-
rsp = client.
|
|
7593
|
+
rsp = client.AssignIpv6SubnetCidrBlock(model)
|
|
7178
7594
|
result = rsp.to_json_string()
|
|
7179
7595
|
try:
|
|
7180
7596
|
json_obj = json.loads(result)
|
|
@@ -7193,7 +7609,7 @@ def doDeleteTemplateMember(args, parsed_globals):
|
|
|
7193
7609
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
7194
7610
|
|
|
7195
7611
|
|
|
7196
|
-
def
|
|
7612
|
+
def doDescribeVpnGatewayCcnRoutes(args, parsed_globals):
|
|
7197
7613
|
g_param = parse_global_arg(parsed_globals)
|
|
7198
7614
|
|
|
7199
7615
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -7222,11 +7638,11 @@ def doAssignIpv6SubnetCidrBlock(args, parsed_globals):
|
|
|
7222
7638
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
7223
7639
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
7224
7640
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
7225
|
-
model = models.
|
|
7641
|
+
model = models.DescribeVpnGatewayCcnRoutesRequest()
|
|
7226
7642
|
model.from_json_string(json.dumps(args))
|
|
7227
7643
|
start_time = time.time()
|
|
7228
7644
|
while True:
|
|
7229
|
-
rsp = client.
|
|
7645
|
+
rsp = client.DescribeVpnGatewayCcnRoutes(model)
|
|
7230
7646
|
result = rsp.to_json_string()
|
|
7231
7647
|
try:
|
|
7232
7648
|
json_obj = json.loads(result)
|
|
@@ -7245,7 +7661,7 @@ def doAssignIpv6SubnetCidrBlock(args, parsed_globals):
|
|
|
7245
7661
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
7246
7662
|
|
|
7247
7663
|
|
|
7248
|
-
def
|
|
7664
|
+
def doDeleteRoutePolicy(args, parsed_globals):
|
|
7249
7665
|
g_param = parse_global_arg(parsed_globals)
|
|
7250
7666
|
|
|
7251
7667
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -7274,11 +7690,11 @@ def doDescribeVpnGatewayCcnRoutes(args, parsed_globals):
|
|
|
7274
7690
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
7275
7691
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
7276
7692
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
7277
|
-
model = models.
|
|
7693
|
+
model = models.DeleteRoutePolicyRequest()
|
|
7278
7694
|
model.from_json_string(json.dumps(args))
|
|
7279
7695
|
start_time = time.time()
|
|
7280
7696
|
while True:
|
|
7281
|
-
rsp = client.
|
|
7697
|
+
rsp = client.DeleteRoutePolicy(model)
|
|
7282
7698
|
result = rsp.to_json_string()
|
|
7283
7699
|
try:
|
|
7284
7700
|
json_obj = json.loads(result)
|
|
@@ -10105,7 +10521,7 @@ def doModifyNetDetect(args, parsed_globals):
|
|
|
10105
10521
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
10106
10522
|
|
|
10107
10523
|
|
|
10108
|
-
def
|
|
10524
|
+
def doReplaceRoutePolicyAssociations(args, parsed_globals):
|
|
10109
10525
|
g_param = parse_global_arg(parsed_globals)
|
|
10110
10526
|
|
|
10111
10527
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -10134,11 +10550,11 @@ def doDescribeBandwidthPackageQuota(args, parsed_globals):
|
|
|
10134
10550
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
10135
10551
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
10136
10552
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
10137
|
-
model = models.
|
|
10553
|
+
model = models.ReplaceRoutePolicyAssociationsRequest()
|
|
10138
10554
|
model.from_json_string(json.dumps(args))
|
|
10139
10555
|
start_time = time.time()
|
|
10140
10556
|
while True:
|
|
10141
|
-
rsp = client.
|
|
10557
|
+
rsp = client.ReplaceRoutePolicyAssociations(model)
|
|
10142
10558
|
result = rsp.to_json_string()
|
|
10143
10559
|
try:
|
|
10144
10560
|
json_obj = json.loads(result)
|
|
@@ -11301,6 +11717,58 @@ def doReplaceRouteTableAssociation(args, parsed_globals):
|
|
|
11301
11717
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
11302
11718
|
|
|
11303
11719
|
|
|
11720
|
+
def doCreateRoutePolicyAssociations(args, parsed_globals):
|
|
11721
|
+
g_param = parse_global_arg(parsed_globals)
|
|
11722
|
+
|
|
11723
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
11724
|
+
cred = credential.CVMRoleCredential()
|
|
11725
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
11726
|
+
cred = credential.STSAssumeRoleCredential(
|
|
11727
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
11728
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
11729
|
+
)
|
|
11730
|
+
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):
|
|
11731
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
11732
|
+
else:
|
|
11733
|
+
cred = credential.Credential(
|
|
11734
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
11735
|
+
)
|
|
11736
|
+
http_profile = HttpProfile(
|
|
11737
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
11738
|
+
reqMethod="POST",
|
|
11739
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
11740
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
11741
|
+
)
|
|
11742
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
11743
|
+
if g_param[OptionsDefine.Language]:
|
|
11744
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
11745
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
11746
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
11747
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
11748
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
11749
|
+
model = models.CreateRoutePolicyAssociationsRequest()
|
|
11750
|
+
model.from_json_string(json.dumps(args))
|
|
11751
|
+
start_time = time.time()
|
|
11752
|
+
while True:
|
|
11753
|
+
rsp = client.CreateRoutePolicyAssociations(model)
|
|
11754
|
+
result = rsp.to_json_string()
|
|
11755
|
+
try:
|
|
11756
|
+
json_obj = json.loads(result)
|
|
11757
|
+
except TypeError as e:
|
|
11758
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
11759
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
11760
|
+
break
|
|
11761
|
+
cur_time = time.time()
|
|
11762
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
11763
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
11764
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
11765
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
11766
|
+
else:
|
|
11767
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
11768
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
11769
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
11770
|
+
|
|
11771
|
+
|
|
11304
11772
|
def doDeleteVpnGatewaySslServer(args, parsed_globals):
|
|
11305
11773
|
g_param = parse_global_arg(parsed_globals)
|
|
11306
11774
|
|
|
@@ -14213,6 +14681,58 @@ def doDescribeNetworkInterfaces(args, parsed_globals):
|
|
|
14213
14681
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
14214
14682
|
|
|
14215
14683
|
|
|
14684
|
+
def doCreateRoutePolicy(args, parsed_globals):
|
|
14685
|
+
g_param = parse_global_arg(parsed_globals)
|
|
14686
|
+
|
|
14687
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
14688
|
+
cred = credential.CVMRoleCredential()
|
|
14689
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
14690
|
+
cred = credential.STSAssumeRoleCredential(
|
|
14691
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
14692
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
14693
|
+
)
|
|
14694
|
+
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):
|
|
14695
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
14696
|
+
else:
|
|
14697
|
+
cred = credential.Credential(
|
|
14698
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
14699
|
+
)
|
|
14700
|
+
http_profile = HttpProfile(
|
|
14701
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
14702
|
+
reqMethod="POST",
|
|
14703
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
14704
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
14705
|
+
)
|
|
14706
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
14707
|
+
if g_param[OptionsDefine.Language]:
|
|
14708
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
14709
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
14710
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
14711
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
14712
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
14713
|
+
model = models.CreateRoutePolicyRequest()
|
|
14714
|
+
model.from_json_string(json.dumps(args))
|
|
14715
|
+
start_time = time.time()
|
|
14716
|
+
while True:
|
|
14717
|
+
rsp = client.CreateRoutePolicy(model)
|
|
14718
|
+
result = rsp.to_json_string()
|
|
14719
|
+
try:
|
|
14720
|
+
json_obj = json.loads(result)
|
|
14721
|
+
except TypeError as e:
|
|
14722
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
14723
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
14724
|
+
break
|
|
14725
|
+
cur_time = time.time()
|
|
14726
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
14727
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
14728
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
14729
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
14730
|
+
else:
|
|
14731
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
14732
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
14733
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
14734
|
+
|
|
14735
|
+
|
|
14216
14736
|
def doDisableCcnRoutes(args, parsed_globals):
|
|
14217
14737
|
g_param = parse_global_arg(parsed_globals)
|
|
14218
14738
|
|
|
@@ -18165,6 +18685,58 @@ def doDeleteBandwidthPackage(args, parsed_globals):
|
|
|
18165
18685
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
18166
18686
|
|
|
18167
18687
|
|
|
18688
|
+
def doCreateRoutePolicyEntries(args, parsed_globals):
|
|
18689
|
+
g_param = parse_global_arg(parsed_globals)
|
|
18690
|
+
|
|
18691
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
18692
|
+
cred = credential.CVMRoleCredential()
|
|
18693
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
18694
|
+
cred = credential.STSAssumeRoleCredential(
|
|
18695
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
18696
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
18697
|
+
)
|
|
18698
|
+
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):
|
|
18699
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
18700
|
+
else:
|
|
18701
|
+
cred = credential.Credential(
|
|
18702
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
18703
|
+
)
|
|
18704
|
+
http_profile = HttpProfile(
|
|
18705
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
18706
|
+
reqMethod="POST",
|
|
18707
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
18708
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
18709
|
+
)
|
|
18710
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
18711
|
+
if g_param[OptionsDefine.Language]:
|
|
18712
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
18713
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
18714
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
18715
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
18716
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
18717
|
+
model = models.CreateRoutePolicyEntriesRequest()
|
|
18718
|
+
model.from_json_string(json.dumps(args))
|
|
18719
|
+
start_time = time.time()
|
|
18720
|
+
while True:
|
|
18721
|
+
rsp = client.CreateRoutePolicyEntries(model)
|
|
18722
|
+
result = rsp.to_json_string()
|
|
18723
|
+
try:
|
|
18724
|
+
json_obj = json.loads(result)
|
|
18725
|
+
except TypeError as e:
|
|
18726
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
18727
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
18728
|
+
break
|
|
18729
|
+
cur_time = time.time()
|
|
18730
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
18731
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
18732
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
18733
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
18734
|
+
else:
|
|
18735
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
18736
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
18737
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
18738
|
+
|
|
18739
|
+
|
|
18168
18740
|
def doDeleteIp6Translators(args, parsed_globals):
|
|
18169
18741
|
g_param = parse_global_arg(parsed_globals)
|
|
18170
18742
|
|
|
@@ -18685,7 +19257,7 @@ def doModifyIpv6AddressesAttribute(args, parsed_globals):
|
|
|
18685
19257
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
18686
19258
|
|
|
18687
19259
|
|
|
18688
|
-
def
|
|
19260
|
+
def doDescribeBandwidthPackageQuota(args, parsed_globals):
|
|
18689
19261
|
g_param = parse_global_arg(parsed_globals)
|
|
18690
19262
|
|
|
18691
19263
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -18714,11 +19286,11 @@ def doModifyGlobalRoutes(args, parsed_globals):
|
|
|
18714
19286
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
18715
19287
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
18716
19288
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
18717
|
-
model = models.
|
|
19289
|
+
model = models.DescribeBandwidthPackageQuotaRequest()
|
|
18718
19290
|
model.from_json_string(json.dumps(args))
|
|
18719
19291
|
start_time = time.time()
|
|
18720
19292
|
while True:
|
|
18721
|
-
rsp = client.
|
|
19293
|
+
rsp = client.DescribeBandwidthPackageQuota(model)
|
|
18722
19294
|
result = rsp.to_json_string()
|
|
18723
19295
|
try:
|
|
18724
19296
|
json_obj = json.loads(result)
|
|
@@ -20037,6 +20609,58 @@ def doHaVipAssociateAddressIp(args, parsed_globals):
|
|
|
20037
20609
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
20038
20610
|
|
|
20039
20611
|
|
|
20612
|
+
def doResetRoutePolicyAssociations(args, parsed_globals):
|
|
20613
|
+
g_param = parse_global_arg(parsed_globals)
|
|
20614
|
+
|
|
20615
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
20616
|
+
cred = credential.CVMRoleCredential()
|
|
20617
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
20618
|
+
cred = credential.STSAssumeRoleCredential(
|
|
20619
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
20620
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
20621
|
+
)
|
|
20622
|
+
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):
|
|
20623
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
20624
|
+
else:
|
|
20625
|
+
cred = credential.Credential(
|
|
20626
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
20627
|
+
)
|
|
20628
|
+
http_profile = HttpProfile(
|
|
20629
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
20630
|
+
reqMethod="POST",
|
|
20631
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
20632
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
20633
|
+
)
|
|
20634
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
20635
|
+
if g_param[OptionsDefine.Language]:
|
|
20636
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
20637
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
20638
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
|
20639
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
20640
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
20641
|
+
model = models.ResetRoutePolicyAssociationsRequest()
|
|
20642
|
+
model.from_json_string(json.dumps(args))
|
|
20643
|
+
start_time = time.time()
|
|
20644
|
+
while True:
|
|
20645
|
+
rsp = client.ResetRoutePolicyAssociations(model)
|
|
20646
|
+
result = rsp.to_json_string()
|
|
20647
|
+
try:
|
|
20648
|
+
json_obj = json.loads(result)
|
|
20649
|
+
except TypeError as e:
|
|
20650
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
20651
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
20652
|
+
break
|
|
20653
|
+
cur_time = time.time()
|
|
20654
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
20655
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
20656
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
20657
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
20658
|
+
else:
|
|
20659
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
20660
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
20661
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
20662
|
+
|
|
20663
|
+
|
|
20040
20664
|
def doCheckDefaultSubnet(args, parsed_globals):
|
|
20041
20665
|
g_param = parse_global_arg(parsed_globals)
|
|
20042
20666
|
|
|
@@ -21744,6 +22368,7 @@ ACTION_MAP = {
|
|
|
21744
22368
|
"LockCcnBandwidths": doLockCcnBandwidths,
|
|
21745
22369
|
"DeleteServiceTemplateGroup": doDeleteServiceTemplateGroup,
|
|
21746
22370
|
"AddBandwidthPackageResources": doAddBandwidthPackageResources,
|
|
22371
|
+
"ReplaceRoutePolicyEntries": doReplaceRoutePolicyEntries,
|
|
21747
22372
|
"AllocateAddresses": doAllocateAddresses,
|
|
21748
22373
|
"DeleteCdcLDCXList": doDeleteCdcLDCXList,
|
|
21749
22374
|
"DescribeIp6Addresses": doDescribeIp6Addresses,
|
|
@@ -21760,6 +22385,8 @@ ACTION_MAP = {
|
|
|
21760
22385
|
"DetachNetworkInterface": doDetachNetworkInterface,
|
|
21761
22386
|
"ModifyNetworkAclQuintupleEntries": doModifyNetworkAclQuintupleEntries,
|
|
21762
22387
|
"DeleteAssistantCidr": doDeleteAssistantCidr,
|
|
22388
|
+
"DescribeRoutePolicyEntries": doDescribeRoutePolicyEntries,
|
|
22389
|
+
"DeleteRoutePolicyAssociations": doDeleteRoutePolicyAssociations,
|
|
21763
22390
|
"DeleteNetworkInterface": doDeleteNetworkInterface,
|
|
21764
22391
|
"ModifyLocalGateway": doModifyLocalGateway,
|
|
21765
22392
|
"DescribeSubnetResourceDashboard": doDescribeSubnetResourceDashboard,
|
|
@@ -21785,7 +22412,9 @@ ACTION_MAP = {
|
|
|
21785
22412
|
"DescribeCrossBorderCompliance": doDescribeCrossBorderCompliance,
|
|
21786
22413
|
"CreateSecurityGroup": doCreateSecurityGroup,
|
|
21787
22414
|
"ModifyNetworkInterfaceAttribute": doModifyNetworkInterfaceAttribute,
|
|
22415
|
+
"ModifyRoutePolicyAttribute": doModifyRoutePolicyAttribute,
|
|
21788
22416
|
"ModifyVpcPeeringConnection": doModifyVpcPeeringConnection,
|
|
22417
|
+
"DeleteRoutePolicyEntries": doDeleteRoutePolicyEntries,
|
|
21789
22418
|
"DescribeVpcLimits": doDescribeVpcLimits,
|
|
21790
22419
|
"AddTemplateMember": doAddTemplateMember,
|
|
21791
22420
|
"DeleteTrafficMirror": doDeleteTrafficMirror,
|
|
@@ -21833,10 +22462,12 @@ ACTION_MAP = {
|
|
|
21833
22462
|
"DescribeAddressTemplateInstances": doDescribeAddressTemplateInstances,
|
|
21834
22463
|
"DescribeGatewayFlowMonitorDetail": doDescribeGatewayFlowMonitorDetail,
|
|
21835
22464
|
"UnassignIpv6Addresses": doUnassignIpv6Addresses,
|
|
22465
|
+
"ResetRoutePolicyEntries": doResetRoutePolicyEntries,
|
|
21836
22466
|
"AssociateIPv6Address": doAssociateIPv6Address,
|
|
21837
22467
|
"DeleteAddressTemplateGroup": doDeleteAddressTemplateGroup,
|
|
21838
22468
|
"DescribeVpcTaskResult": doDescribeVpcTaskResult,
|
|
21839
22469
|
"CreateDirectConnectGateway": doCreateDirectConnectGateway,
|
|
22470
|
+
"ModifyGlobalRoutes": doModifyGlobalRoutes,
|
|
21840
22471
|
"AssociateNatGatewayAddress": doAssociateNatGatewayAddress,
|
|
21841
22472
|
"DeleteCcnRouteTables": doDeleteCcnRouteTables,
|
|
21842
22473
|
"ModifyPrivateNatGatewayTranslationNatRule": doModifyPrivateNatGatewayTranslationNatRule,
|
|
@@ -21852,6 +22483,7 @@ ACTION_MAP = {
|
|
|
21852
22483
|
"DeleteTemplateMember": doDeleteTemplateMember,
|
|
21853
22484
|
"AssignIpv6SubnetCidrBlock": doAssignIpv6SubnetCidrBlock,
|
|
21854
22485
|
"DescribeVpnGatewayCcnRoutes": doDescribeVpnGatewayCcnRoutes,
|
|
22486
|
+
"DeleteRoutePolicy": doDeleteRoutePolicy,
|
|
21855
22487
|
"AttachCcnInstances": doAttachCcnInstances,
|
|
21856
22488
|
"DeleteSubnet": doDeleteSubnet,
|
|
21857
22489
|
"AttachClassicLinkVpc": doAttachClassicLinkVpc,
|
|
@@ -21906,7 +22538,7 @@ ACTION_MAP = {
|
|
|
21906
22538
|
"DeleteSecurityGroup": doDeleteSecurityGroup,
|
|
21907
22539
|
"DescribeNatGatewaySourceIpTranslationNatRules": doDescribeNatGatewaySourceIpTranslationNatRules,
|
|
21908
22540
|
"ModifyNetDetect": doModifyNetDetect,
|
|
21909
|
-
"
|
|
22541
|
+
"ReplaceRoutePolicyAssociations": doReplaceRoutePolicyAssociations,
|
|
21910
22542
|
"CreateSnapshotPolicies": doCreateSnapshotPolicies,
|
|
21911
22543
|
"ResetAttachCcnInstances": doResetAttachCcnInstances,
|
|
21912
22544
|
"ModifyVpcEndPointServiceAttribute": doModifyVpcEndPointServiceAttribute,
|
|
@@ -21929,6 +22561,7 @@ ACTION_MAP = {
|
|
|
21929
22561
|
"CreateBandwidthPackage": doCreateBandwidthPackage,
|
|
21930
22562
|
"DeleteFlowLog": doDeleteFlowLog,
|
|
21931
22563
|
"ReplaceRouteTableAssociation": doReplaceRouteTableAssociation,
|
|
22564
|
+
"CreateRoutePolicyAssociations": doCreateRoutePolicyAssociations,
|
|
21932
22565
|
"DeleteVpnGatewaySslServer": doDeleteVpnGatewaySslServer,
|
|
21933
22566
|
"DescribeNetworkInterfaceLimit": doDescribeNetworkInterfaceLimit,
|
|
21934
22567
|
"EnableSnapshotPolicies": doEnableSnapshotPolicies,
|
|
@@ -21985,6 +22618,7 @@ ACTION_MAP = {
|
|
|
21985
22618
|
"ModifySubnetAttribute": doModifySubnetAttribute,
|
|
21986
22619
|
"DescribeSgSnapshotFileContent": doDescribeSgSnapshotFileContent,
|
|
21987
22620
|
"DescribeNetworkInterfaces": doDescribeNetworkInterfaces,
|
|
22621
|
+
"CreateRoutePolicy": doCreateRoutePolicy,
|
|
21988
22622
|
"DisableCcnRoutes": doDisableCcnRoutes,
|
|
21989
22623
|
"DescribeCcnRouteTableBroadcastPolicys": doDescribeCcnRouteTableBroadcastPolicys,
|
|
21990
22624
|
"CreateAddressTemplateGroup": doCreateAddressTemplateGroup,
|
|
@@ -22061,6 +22695,7 @@ ACTION_MAP = {
|
|
|
22061
22695
|
"DescribeDirectConnectGatewayCcnRoutes": doDescribeDirectConnectGatewayCcnRoutes,
|
|
22062
22696
|
"CreateNetworkAclEntries": doCreateNetworkAclEntries,
|
|
22063
22697
|
"DeleteBandwidthPackage": doDeleteBandwidthPackage,
|
|
22698
|
+
"CreateRoutePolicyEntries": doCreateRoutePolicyEntries,
|
|
22064
22699
|
"DeleteIp6Translators": doDeleteIp6Translators,
|
|
22065
22700
|
"DescribeRoutes": doDescribeRoutes,
|
|
22066
22701
|
"DeleteVpnGatewayRoutes": doDeleteVpnGatewayRoutes,
|
|
@@ -22071,7 +22706,7 @@ ACTION_MAP = {
|
|
|
22071
22706
|
"DeleteNatGateway": doDeleteNatGateway,
|
|
22072
22707
|
"DescribeRouteList": doDescribeRouteList,
|
|
22073
22708
|
"ModifyIpv6AddressesAttribute": doModifyIpv6AddressesAttribute,
|
|
22074
|
-
"
|
|
22709
|
+
"DescribeBandwidthPackageQuota": doDescribeBandwidthPackageQuota,
|
|
22075
22710
|
"ModifyHighPriorityRouteTableAttribute": doModifyHighPriorityRouteTableAttribute,
|
|
22076
22711
|
"ReleaseIPv6Addresses": doReleaseIPv6Addresses,
|
|
22077
22712
|
"DeleteReserveIpAddresses": doDeleteReserveIpAddresses,
|
|
@@ -22097,6 +22732,7 @@ ACTION_MAP = {
|
|
|
22097
22732
|
"DescribeBandwidthPackageBillUsage": doDescribeBandwidthPackageBillUsage,
|
|
22098
22733
|
"UnlockCcns": doUnlockCcns,
|
|
22099
22734
|
"HaVipAssociateAddressIp": doHaVipAssociateAddressIp,
|
|
22735
|
+
"ResetRoutePolicyAssociations": doResetRoutePolicyAssociations,
|
|
22100
22736
|
"CheckDefaultSubnet": doCheckDefaultSubnet,
|
|
22101
22737
|
"AssociateNetworkInterfaceSecurityGroups": doAssociateNetworkInterfaceSecurityGroups,
|
|
22102
22738
|
"DescribeAddressQuota": doDescribeAddressQuota,
|