tccli 3.0.1227.1__py2.py3-none-any.whl → 3.0.1229.1__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tccli/__init__.py +1 -1
- tccli/services/__init__.py +3 -0
- tccli/services/aiart/v20221229/api.json +12 -3
- tccli/services/cam/v20190116/api.json +25 -25
- tccli/services/cam/v20190116/examples.json +8 -8
- tccli/services/cdb/v20170320/api.json +167 -9
- tccli/services/cdb/v20170320/examples.json +2 -2
- tccli/services/cfs/v20190719/api.json +19 -0
- tccli/services/ckafka/v20190819/api.json +5 -5
- tccli/services/ckafka/v20190819/examples.json +106 -112
- tccli/services/clb/v20180317/api.json +1 -1
- tccli/services/cloudaudit/v20190319/api.json +15 -15
- tccli/services/cloudaudit/v20190319/examples.json +3 -3
- tccli/services/config/v20220802/api.json +70 -68
- tccli/services/config/v20220802/examples.json +6 -6
- tccli/services/cynosdb/cynosdb_client.py +228 -16
- tccli/services/cynosdb/v20190107/api.json +251 -0
- tccli/services/cynosdb/v20190107/examples.json +32 -0
- tccli/services/emr/v20190103/api.json +28 -22
- tccli/services/ess/v20201111/api.json +18 -0
- tccli/services/essbasic/v20210526/api.json +20 -1
- tccli/services/facefusion/v20181201/api.json +12 -6
- tccli/services/faceid/v20180301/api.json +1 -1
- tccli/services/hai/v20230812/api.json +6 -6
- tccli/services/hai/v20230812/examples.json +2 -2
- tccli/services/lke/lke_client.py +394 -23
- tccli/services/lke/v20231130/api.json +737 -4
- tccli/services/lke/v20231130/examples.json +62 -0
- tccli/services/mps/v20190612/api.json +1 -1
- tccli/services/mqtt/mqtt_client.py +118 -12
- tccli/services/mqtt/v20240516/api.json +312 -33
- tccli/services/mqtt/v20240516/examples.json +23 -13
- tccli/services/ocr/v20181119/api.json +11 -2
- tccli/services/ocr/v20181119/examples.json +6 -6
- tccli/services/privatedns/v20201028/api.json +41 -13
- tccli/services/pts/v20210728/api.json +22 -12
- tccli/services/redis/v20180412/api.json +14 -14
- tccli/services/scf/v20180416/api.json +12 -0
- tccli/services/ssl/v20191205/api.json +246 -173
- tccli/services/ssl/v20191205/examples.json +69 -69
- tccli/services/sts/v20180813/api.json +17 -11
- tccli/services/sts/v20180813/examples.json +6 -6
- tccli/services/tcr/v20190924/api.json +17 -17
- tccli/services/tdmq/tdmq_client.py +4 -57
- tccli/services/tdmq/v20200217/api.json +119 -200
- tccli/services/tdmq/v20200217/examples.json +29 -49
- tccli/services/tmt/v20180321/api.json +1 -1
- tccli/services/tmt/v20180321/examples.json +2 -2
- tccli/services/trocket/v20230308/api.json +79 -79
- tccli/services/trocket/v20230308/examples.json +8 -8
- tccli/services/trtc/v20190722/api.json +1 -1
- tccli/services/vclm/v20240523/api.json +25 -15
- tccli/services/vclm/v20240523/examples.json +2 -2
- tccli/services/vcube/__init__.py +4 -0
- tccli/services/vcube/v20220410/api.json +4168 -0
- tccli/services/vcube/v20220410/examples.json +277 -0
- tccli/services/vcube/vcube_client.py +1956 -0
- tccli/services/vod/v20180717/api.json +38 -1
- tccli/services/vod/v20180717/examples.json +13 -1
- tccli/services/vpc/v20170312/api.json +195 -148
- tccli/services/vpc/v20170312/examples.json +5 -5
- {tccli-3.0.1227.1.dist-info → tccli-3.0.1229.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1227.1.dist-info → tccli-3.0.1229.1.dist-info}/RECORD +66 -62
- {tccli-3.0.1227.1.dist-info → tccli-3.0.1229.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1227.1.dist-info → tccli-3.0.1229.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1227.1.dist-info → tccli-3.0.1229.1.dist-info}/license_files/LICENSE +0 -0
@@ -69,7 +69,7 @@ def doResumeServerless(args, parsed_globals):
|
|
69
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
70
|
|
71
71
|
|
72
|
-
def
|
72
|
+
def doDescribeBackupConfig(args, parsed_globals):
|
73
73
|
g_param = parse_global_arg(parsed_globals)
|
74
74
|
|
75
75
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -98,11 +98,11 @@ def doDescribeInstanceSpecs(args, parsed_globals):
|
|
98
98
|
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
99
99
|
client._sdkVersion += ("_CLI_" + __version__)
|
100
100
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
-
model = models.
|
101
|
+
model = models.DescribeBackupConfigRequest()
|
102
102
|
model.from_json_string(json.dumps(args))
|
103
103
|
start_time = time.time()
|
104
104
|
while True:
|
105
|
-
rsp = client.
|
105
|
+
rsp = client.DescribeBackupConfig(model)
|
106
106
|
result = rsp.to_json_string()
|
107
107
|
try:
|
108
108
|
json_obj = json.loads(result)
|
@@ -797,6 +797,58 @@ def doRenewClusters(args, parsed_globals):
|
|
797
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
798
|
|
799
799
|
|
800
|
+
def doCloseProxyEndPoint(args, parsed_globals):
|
801
|
+
g_param = parse_global_arg(parsed_globals)
|
802
|
+
|
803
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
804
|
+
cred = credential.CVMRoleCredential()
|
805
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
806
|
+
cred = credential.STSAssumeRoleCredential(
|
807
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
808
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
809
|
+
)
|
810
|
+
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):
|
811
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
812
|
+
else:
|
813
|
+
cred = credential.Credential(
|
814
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
815
|
+
)
|
816
|
+
http_profile = HttpProfile(
|
817
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
818
|
+
reqMethod="POST",
|
819
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
820
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
821
|
+
)
|
822
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
823
|
+
if g_param[OptionsDefine.Language]:
|
824
|
+
profile.language = g_param[OptionsDefine.Language]
|
825
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
826
|
+
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
827
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
828
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
+
model = models.CloseProxyEndPointRequest()
|
830
|
+
model.from_json_string(json.dumps(args))
|
831
|
+
start_time = time.time()
|
832
|
+
while True:
|
833
|
+
rsp = client.CloseProxyEndPoint(model)
|
834
|
+
result = rsp.to_json_string()
|
835
|
+
try:
|
836
|
+
json_obj = json.loads(result)
|
837
|
+
except TypeError as e:
|
838
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
839
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
840
|
+
break
|
841
|
+
cur_time = time.time()
|
842
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
843
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
844
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
845
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
846
|
+
else:
|
847
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
848
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
849
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
|
+
|
851
|
+
|
800
852
|
def doCloseProxy(args, parsed_globals):
|
801
853
|
g_param = parse_global_arg(parsed_globals)
|
802
854
|
|
@@ -1057,7 +1109,7 @@ def doDescribeTasks(args, parsed_globals):
|
|
1057
1109
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
1110
|
|
1059
1111
|
|
1060
|
-
def
|
1112
|
+
def doDescribeInstanceSpecs(args, parsed_globals):
|
1061
1113
|
g_param = parse_global_arg(parsed_globals)
|
1062
1114
|
|
1063
1115
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1086,11 +1138,11 @@ def doDescribeBackupConfig(args, parsed_globals):
|
|
1086
1138
|
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
1139
|
client._sdkVersion += ("_CLI_" + __version__)
|
1088
1140
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
-
model = models.
|
1141
|
+
model = models.DescribeInstanceSpecsRequest()
|
1090
1142
|
model.from_json_string(json.dumps(args))
|
1091
1143
|
start_time = time.time()
|
1092
1144
|
while True:
|
1093
|
-
rsp = client.
|
1145
|
+
rsp = client.DescribeInstanceSpecs(model)
|
1094
1146
|
result = rsp.to_json_string()
|
1095
1147
|
try:
|
1096
1148
|
json_obj = json.loads(result)
|
@@ -1421,7 +1473,7 @@ def doDisassociateSecurityGroups(args, parsed_globals):
|
|
1421
1473
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
1474
|
|
1423
1475
|
|
1424
|
-
def
|
1476
|
+
def doDescribeClusterTransparentEncryptInfo(args, parsed_globals):
|
1425
1477
|
g_param = parse_global_arg(parsed_globals)
|
1426
1478
|
|
1427
1479
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1450,11 +1502,11 @@ def doOpenReadOnlyInstanceExclusiveAccess(args, parsed_globals):
|
|
1450
1502
|
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
1451
1503
|
client._sdkVersion += ("_CLI_" + __version__)
|
1452
1504
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1453
|
-
model = models.
|
1505
|
+
model = models.DescribeClusterTransparentEncryptInfoRequest()
|
1454
1506
|
model.from_json_string(json.dumps(args))
|
1455
1507
|
start_time = time.time()
|
1456
1508
|
while True:
|
1457
|
-
rsp = client.
|
1509
|
+
rsp = client.DescribeClusterTransparentEncryptInfo(model)
|
1458
1510
|
result = rsp.to_json_string()
|
1459
1511
|
try:
|
1460
1512
|
json_obj = json.loads(result)
|
@@ -2565,7 +2617,7 @@ def doIsolateCluster(args, parsed_globals):
|
|
2565
2617
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2566
2618
|
|
2567
2619
|
|
2568
|
-
def
|
2620
|
+
def doDescribeInstancesWithinSameCluster(args, parsed_globals):
|
2569
2621
|
g_param = parse_global_arg(parsed_globals)
|
2570
2622
|
|
2571
2623
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2594,11 +2646,11 @@ def doDescribeProxySpecs(args, parsed_globals):
|
|
2594
2646
|
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
2595
2647
|
client._sdkVersion += ("_CLI_" + __version__)
|
2596
2648
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2597
|
-
model = models.
|
2649
|
+
model = models.DescribeInstancesWithinSameClusterRequest()
|
2598
2650
|
model.from_json_string(json.dumps(args))
|
2599
2651
|
start_time = time.time()
|
2600
2652
|
while True:
|
2601
|
-
rsp = client.
|
2653
|
+
rsp = client.DescribeInstancesWithinSameCluster(model)
|
2602
2654
|
result = rsp.to_json_string()
|
2603
2655
|
try:
|
2604
2656
|
json_obj = json.loads(result)
|
@@ -3605,6 +3657,58 @@ def doSwitchClusterZone(args, parsed_globals):
|
|
3605
3657
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3606
3658
|
|
3607
3659
|
|
3660
|
+
def doOpenClusterTransparentEncrypt(args, parsed_globals):
|
3661
|
+
g_param = parse_global_arg(parsed_globals)
|
3662
|
+
|
3663
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3664
|
+
cred = credential.CVMRoleCredential()
|
3665
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3666
|
+
cred = credential.STSAssumeRoleCredential(
|
3667
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3668
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3669
|
+
)
|
3670
|
+
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):
|
3671
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3672
|
+
else:
|
3673
|
+
cred = credential.Credential(
|
3674
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3675
|
+
)
|
3676
|
+
http_profile = HttpProfile(
|
3677
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3678
|
+
reqMethod="POST",
|
3679
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3680
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3681
|
+
)
|
3682
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3683
|
+
if g_param[OptionsDefine.Language]:
|
3684
|
+
profile.language = g_param[OptionsDefine.Language]
|
3685
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3686
|
+
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
3687
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3688
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3689
|
+
model = models.OpenClusterTransparentEncryptRequest()
|
3690
|
+
model.from_json_string(json.dumps(args))
|
3691
|
+
start_time = time.time()
|
3692
|
+
while True:
|
3693
|
+
rsp = client.OpenClusterTransparentEncrypt(model)
|
3694
|
+
result = rsp.to_json_string()
|
3695
|
+
try:
|
3696
|
+
json_obj = json.loads(result)
|
3697
|
+
except TypeError as e:
|
3698
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3699
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3700
|
+
break
|
3701
|
+
cur_time = time.time()
|
3702
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3703
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3704
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3705
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3706
|
+
else:
|
3707
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3708
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3709
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3710
|
+
|
3711
|
+
|
3608
3712
|
def doAddInstances(args, parsed_globals):
|
3609
3713
|
g_param = parse_global_arg(parsed_globals)
|
3610
3714
|
|
@@ -3657,6 +3761,58 @@ def doAddInstances(args, parsed_globals):
|
|
3657
3761
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3658
3762
|
|
3659
3763
|
|
3764
|
+
def doDescribeProxySpecs(args, parsed_globals):
|
3765
|
+
g_param = parse_global_arg(parsed_globals)
|
3766
|
+
|
3767
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3768
|
+
cred = credential.CVMRoleCredential()
|
3769
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3770
|
+
cred = credential.STSAssumeRoleCredential(
|
3771
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3772
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3773
|
+
)
|
3774
|
+
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):
|
3775
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3776
|
+
else:
|
3777
|
+
cred = credential.Credential(
|
3778
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3779
|
+
)
|
3780
|
+
http_profile = HttpProfile(
|
3781
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3782
|
+
reqMethod="POST",
|
3783
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3784
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3785
|
+
)
|
3786
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3787
|
+
if g_param[OptionsDefine.Language]:
|
3788
|
+
profile.language = g_param[OptionsDefine.Language]
|
3789
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3790
|
+
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
3791
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3792
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3793
|
+
model = models.DescribeProxySpecsRequest()
|
3794
|
+
model.from_json_string(json.dumps(args))
|
3795
|
+
start_time = time.time()
|
3796
|
+
while True:
|
3797
|
+
rsp = client.DescribeProxySpecs(model)
|
3798
|
+
result = rsp.to_json_string()
|
3799
|
+
try:
|
3800
|
+
json_obj = json.loads(result)
|
3801
|
+
except TypeError as e:
|
3802
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3803
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3804
|
+
break
|
3805
|
+
cur_time = time.time()
|
3806
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3807
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3808
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3809
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3810
|
+
else:
|
3811
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3812
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3813
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3814
|
+
|
3815
|
+
|
3660
3816
|
def doModifyInstanceUpgradeLimitDays(args, parsed_globals):
|
3661
3817
|
g_param = parse_global_arg(parsed_globals)
|
3662
3818
|
|
@@ -5685,6 +5841,58 @@ def doStopCLSDelivery(args, parsed_globals):
|
|
5685
5841
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5686
5842
|
|
5687
5843
|
|
5844
|
+
def doOpenReadOnlyInstanceExclusiveAccess(args, parsed_globals):
|
5845
|
+
g_param = parse_global_arg(parsed_globals)
|
5846
|
+
|
5847
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
5848
|
+
cred = credential.CVMRoleCredential()
|
5849
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
5850
|
+
cred = credential.STSAssumeRoleCredential(
|
5851
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
5852
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
5853
|
+
)
|
5854
|
+
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):
|
5855
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
5856
|
+
else:
|
5857
|
+
cred = credential.Credential(
|
5858
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
5859
|
+
)
|
5860
|
+
http_profile = HttpProfile(
|
5861
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
5862
|
+
reqMethod="POST",
|
5863
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
5864
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
5865
|
+
)
|
5866
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
5867
|
+
if g_param[OptionsDefine.Language]:
|
5868
|
+
profile.language = g_param[OptionsDefine.Language]
|
5869
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
5870
|
+
client = mod.CynosdbClient(cred, g_param[OptionsDefine.Region], profile)
|
5871
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
5872
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
5873
|
+
model = models.OpenReadOnlyInstanceExclusiveAccessRequest()
|
5874
|
+
model.from_json_string(json.dumps(args))
|
5875
|
+
start_time = time.time()
|
5876
|
+
while True:
|
5877
|
+
rsp = client.OpenReadOnlyInstanceExclusiveAccess(model)
|
5878
|
+
result = rsp.to_json_string()
|
5879
|
+
try:
|
5880
|
+
json_obj = json.loads(result)
|
5881
|
+
except TypeError as e:
|
5882
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
5883
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
5884
|
+
break
|
5885
|
+
cur_time = time.time()
|
5886
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
5887
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
5888
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
5889
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
5890
|
+
else:
|
5891
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
5892
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
5893
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5894
|
+
|
5895
|
+
|
5688
5896
|
def doDescribeBackupList(args, parsed_globals):
|
5689
5897
|
g_param = parse_global_arg(parsed_globals)
|
5690
5898
|
|
@@ -7777,7 +7985,7 @@ MODELS_MAP = {
|
|
7777
7985
|
|
7778
7986
|
ACTION_MAP = {
|
7779
7987
|
"ResumeServerless": doResumeServerless,
|
7780
|
-
"
|
7988
|
+
"DescribeBackupConfig": doDescribeBackupConfig,
|
7781
7989
|
"ModifyBinlogConfig": doModifyBinlogConfig,
|
7782
7990
|
"CreateProxyEndPoint": doCreateProxyEndPoint,
|
7783
7991
|
"ModifyResourcePackageClusters": doModifyResourcePackageClusters,
|
@@ -7791,19 +7999,20 @@ ACTION_MAP = {
|
|
7791
7999
|
"DescribeSupportProxyVersion": doDescribeSupportProxyVersion,
|
7792
8000
|
"CreateAuditLogFile": doCreateAuditLogFile,
|
7793
8001
|
"RenewClusters": doRenewClusters,
|
8002
|
+
"CloseProxyEndPoint": doCloseProxyEndPoint,
|
7794
8003
|
"CloseProxy": doCloseProxy,
|
7795
8004
|
"ExportResourcePackageDeductDetails": doExportResourcePackageDeductDetails,
|
7796
8005
|
"InquirePriceModify": doInquirePriceModify,
|
7797
8006
|
"DescribeClusterDetail": doDescribeClusterDetail,
|
7798
8007
|
"DescribeTasks": doDescribeTasks,
|
7799
|
-
"
|
8008
|
+
"DescribeInstanceSpecs": doDescribeInstanceSpecs,
|
7800
8009
|
"DescribeBinlogDownloadUrl": doDescribeBinlogDownloadUrl,
|
7801
8010
|
"DescribeResourcesByDealName": doDescribeResourcesByDealName,
|
7802
8011
|
"ModifyClusterStorage": doModifyClusterStorage,
|
7803
8012
|
"ActivateInstance": doActivateInstance,
|
7804
8013
|
"DescribeProxyNodes": doDescribeProxyNodes,
|
7805
8014
|
"DisassociateSecurityGroups": doDisassociateSecurityGroups,
|
7806
|
-
"
|
8015
|
+
"DescribeClusterTransparentEncryptInfo": doDescribeClusterTransparentEncryptInfo,
|
7807
8016
|
"ExportInstanceSlowQueries": doExportInstanceSlowQueries,
|
7808
8017
|
"DeleteCLSDelivery": doDeleteCLSDelivery,
|
7809
8018
|
"DescribeChangedParamsAfterUpgrade": doDescribeChangedParamsAfterUpgrade,
|
@@ -7825,7 +8034,7 @@ ACTION_MAP = {
|
|
7825
8034
|
"CreateBackup": doCreateBackup,
|
7826
8035
|
"OfflineInstance": doOfflineInstance,
|
7827
8036
|
"IsolateCluster": doIsolateCluster,
|
7828
|
-
"
|
8037
|
+
"DescribeInstancesWithinSameCluster": doDescribeInstancesWithinSameCluster,
|
7829
8038
|
"RestartInstance": doRestartInstance,
|
7830
8039
|
"UpgradeProxy": doUpgradeProxy,
|
7831
8040
|
"DescribeClusters": doDescribeClusters,
|
@@ -7845,7 +8054,9 @@ ACTION_MAP = {
|
|
7845
8054
|
"DescribeAuditLogFiles": doDescribeAuditLogFiles,
|
7846
8055
|
"DeleteClusterDatabase": doDeleteClusterDatabase,
|
7847
8056
|
"SwitchClusterZone": doSwitchClusterZone,
|
8057
|
+
"OpenClusterTransparentEncrypt": doOpenClusterTransparentEncrypt,
|
7848
8058
|
"AddInstances": doAddInstances,
|
8059
|
+
"DescribeProxySpecs": doDescribeProxySpecs,
|
7849
8060
|
"ModifyInstanceUpgradeLimitDays": doModifyInstanceUpgradeLimitDays,
|
7850
8061
|
"DeleteAccounts": doDeleteAccounts,
|
7851
8062
|
"RevokeAccountPrivileges": doRevokeAccountPrivileges,
|
@@ -7885,6 +8096,7 @@ ACTION_MAP = {
|
|
7885
8096
|
"DescribeIsolatedInstances": doDescribeIsolatedInstances,
|
7886
8097
|
"ModifyAuditRuleTemplates": doModifyAuditRuleTemplates,
|
7887
8098
|
"StopCLSDelivery": doStopCLSDelivery,
|
8099
|
+
"OpenReadOnlyInstanceExclusiveAccess": doOpenReadOnlyInstanceExclusiveAccess,
|
7888
8100
|
"DescribeBackupList": doDescribeBackupList,
|
7889
8101
|
"ModifyAccountDescription": doModifyAccountDescription,
|
7890
8102
|
"ModifyServerlessStrategy": doModifyServerlessStrategy,
|