tccli 3.0.1215.1__py2.py3-none-any.whl → 3.0.1216.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/configure.py +46 -1
- tccli/services/__init__.py +0 -3
- tccli/services/apm/v20210622/api.json +20 -0
- tccli/services/asr/v20190614/api.json +3 -3
- tccli/services/bi/v20220105/api.json +32 -4
- tccli/services/bi/v20220105/examples.json +1 -1
- tccli/services/billing/billing_client.py +53 -0
- tccli/services/billing/v20180709/api.json +304 -0
- tccli/services/billing/v20180709/examples.json +8 -0
- tccli/services/bsca/v20210811/api.json +222 -17
- tccli/services/bsca/v20210811/examples.json +4 -4
- tccli/services/ccc/ccc_client.py +53 -0
- tccli/services/ccc/v20200210/api.json +167 -18
- tccli/services/ccc/v20200210/examples.json +11 -3
- tccli/services/cdb/v20170320/api.json +13 -4
- tccli/services/cdb/v20170320/examples.json +1 -1
- tccli/services/cdn/v20180606/api.json +5 -3
- tccli/services/cdwdoris/v20211228/api.json +12 -2
- tccli/services/cfw/v20190904/api.json +81 -47
- tccli/services/cfw/v20190904/examples.json +46 -40
- tccli/services/ciam/v20220331/api.json +316 -315
- tccli/services/ciam/v20220331/examples.json +49 -49
- tccli/services/cloudaudit/cloudaudit_client.py +30 -30
- tccli/services/cloudaudit/v20190319/api.json +215 -186
- tccli/services/cloudaudit/v20190319/examples.json +13 -13
- tccli/services/cls/v20201016/api.json +365 -66
- tccli/services/cls/v20201016/examples.json +9 -3
- tccli/services/csip/v20221121/api.json +4 -4
- tccli/services/cvm/v20170312/api.json +42 -0
- tccli/services/cwp/v20180228/api.json +217 -163
- tccli/services/cwp/v20180228/examples.json +53 -65
- tccli/services/cynosdb/v20190107/api.json +77 -29
- tccli/services/cynosdb/v20190107/examples.json +22 -22
- tccli/services/dasb/v20191018/api.json +77 -0
- tccli/services/dasb/v20191018/examples.json +5 -5
- tccli/services/domain/v20180808/api.json +3 -3
- tccli/services/domain/v20180808/examples.json +3 -3
- tccli/services/eb/v20210416/api.json +15 -15
- tccli/services/eb/v20210416/examples.json +1 -1
- tccli/services/es/es_client.py +249 -37
- tccli/services/es/v20180416/api.json +521 -0
- tccli/services/es/v20180416/examples.json +32 -0
- tccli/services/ess/ess_client.py +53 -0
- tccli/services/ess/v20201111/api.json +145 -9
- tccli/services/ess/v20201111/examples.json +15 -1
- tccli/services/essbasic/essbasic_client.py +106 -0
- tccli/services/essbasic/v20210526/api.json +234 -12
- tccli/services/essbasic/v20210526/examples.json +22 -0
- tccli/services/gaap/v20180529/api.json +44 -26
- tccli/services/gaap/v20180529/examples.json +24 -30
- tccli/services/iotexplorer/v20190423/api.json +40 -0
- tccli/services/live/v20180801/api.json +35 -9
- tccli/services/mongodb/v20190725/api.json +6 -8
- tccli/services/ocr/v20181119/api.json +2 -2
- tccli/services/organization/organization_client.py +352 -34
- tccli/services/organization/v20210331/api.json +451 -0
- tccli/services/organization/v20210331/examples.json +48 -0
- tccli/services/region/v20220627/api.json +1 -1
- tccli/services/scf/scf_client.py +269 -4
- tccli/services/scf/v20180416/api.json +554 -0
- tccli/services/scf/v20180416/examples.json +46 -0
- tccli/services/ssl/v20191205/api.json +1 -1
- tccli/services/tat/v20201028/api.json +27 -25
- tccli/services/tat/v20201028/examples.json +4 -4
- tccli/services/tcss/v20201101/api.json +13 -13
- tccli/services/tcss/v20201101/examples.json +5 -5
- tccli/services/tdmq/v20200217/api.json +64 -63
- tccli/services/tdmq/v20200217/examples.json +2 -2
- tccli/services/tem/v20210701/api.json +144 -103
- tccli/services/tem/v20210701/examples.json +27 -27
- tccli/services/teo/teo_client.py +277 -12
- tccli/services/teo/v20220901/api.json +1020 -143
- tccli/services/teo/v20220901/examples.json +71 -1
- tccli/services/tke/tke_client.py +53 -0
- tccli/services/tke/v20180525/api.json +43 -0
- tccli/services/tke/v20180525/examples.json +8 -0
- tccli/services/tms/tms_client.py +4 -57
- tccli/services/tms/v20201229/api.json +0 -354
- tccli/services/tms/v20201229/examples.json +0 -8
- tccli/services/trtc/v20190722/api.json +221 -22
- tccli/services/vpc/v20170312/api.json +105 -30
- tccli/services/vpc/v20170312/examples.json +10 -2
- tccli/services/vpc/vpc_client.py +107 -54
- tccli/services/waf/v20180125/api.json +61 -0
- tccli/services/waf/v20180125/examples.json +8 -0
- tccli/services/waf/waf_client.py +53 -0
- tccli/services/wedata/v20210820/api.json +686 -0
- tccli/services/wedata/v20210820/examples.json +16 -0
- tccli/services/wedata/wedata_client.py +106 -0
- {tccli-3.0.1215.1.dist-info → tccli-3.0.1216.1.dist-info}/METADATA +6 -2
- {tccli-3.0.1215.1.dist-info → tccli-3.0.1216.1.dist-info}/RECORD +95 -99
- tccli/services/cr/__init__.py +0 -4
- tccli/services/cr/cr_client.py +0 -1626
- tccli/services/cr/v20180321/api.json +0 -2829
- tccli/services/cr/v20180321/examples.json +0 -235
- {tccli-3.0.1215.1.dist-info → tccli-3.0.1216.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1215.1.dist-info → tccli-3.0.1216.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1215.1.dist-info → tccli-3.0.1216.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/es/es_client.py
CHANGED
@@ -121,7 +121,7 @@ def doDeleteLogstashInstance(args, parsed_globals):
|
|
121
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
122
|
|
123
123
|
|
124
|
-
def
|
124
|
+
def doRestoreClusterSnapshot(args, parsed_globals):
|
125
125
|
g_param = parse_global_arg(parsed_globals)
|
126
126
|
|
127
127
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -150,11 +150,11 @@ def doDeleteLogstashPipelines(args, parsed_globals):
|
|
150
150
|
client = mod.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
151
151
|
client._sdkVersion += ("_CLI_" + __version__)
|
152
152
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.
|
153
|
+
model = models.RestoreClusterSnapshotRequest()
|
154
154
|
model.from_json_string(json.dumps(args))
|
155
155
|
start_time = time.time()
|
156
156
|
while True:
|
157
|
-
rsp = client.
|
157
|
+
rsp = client.RestoreClusterSnapshot(model)
|
158
158
|
result = rsp.to_json_string()
|
159
159
|
try:
|
160
160
|
json_obj = json.loads(result)
|
@@ -901,7 +901,7 @@ def doUpdateJdk(args, parsed_globals):
|
|
901
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
902
|
|
903
903
|
|
904
|
-
def
|
904
|
+
def doDeleteServerlessInstance(args, parsed_globals):
|
905
905
|
g_param = parse_global_arg(parsed_globals)
|
906
906
|
|
907
907
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -930,11 +930,11 @@ def doCreateServerlessSpaceV2(args, parsed_globals):
|
|
930
930
|
client = mod.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
931
931
|
client._sdkVersion += ("_CLI_" + __version__)
|
932
932
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
-
model = models.
|
933
|
+
model = models.DeleteServerlessInstanceRequest()
|
934
934
|
model.from_json_string(json.dumps(args))
|
935
935
|
start_time = time.time()
|
936
936
|
while True:
|
937
|
-
rsp = client.
|
937
|
+
rsp = client.DeleteServerlessInstance(model)
|
938
938
|
result = rsp.to_json_string()
|
939
939
|
try:
|
940
940
|
json_obj = json.loads(result)
|
@@ -953,7 +953,7 @@ def doCreateServerlessSpaceV2(args, parsed_globals):
|
|
953
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
954
954
|
|
955
955
|
|
956
|
-
def
|
956
|
+
def doCreateServerlessSpaceV2(args, parsed_globals):
|
957
957
|
g_param = parse_global_arg(parsed_globals)
|
958
958
|
|
959
959
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -982,11 +982,11 @@ def doDeleteServerlessInstance(args, parsed_globals):
|
|
982
982
|
client = mod.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
983
983
|
client._sdkVersion += ("_CLI_" + __version__)
|
984
984
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
-
model = models.
|
985
|
+
model = models.CreateServerlessSpaceV2Request()
|
986
986
|
model.from_json_string(json.dumps(args))
|
987
987
|
start_time = time.time()
|
988
988
|
while True:
|
989
|
-
rsp = client.
|
989
|
+
rsp = client.CreateServerlessSpaceV2(model)
|
990
990
|
result = rsp.to_json_string()
|
991
991
|
try:
|
992
992
|
json_obj = json.loads(result)
|
@@ -1005,7 +1005,7 @@ def doDeleteServerlessInstance(args, parsed_globals):
|
|
1005
1005
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
1006
|
|
1007
1007
|
|
1008
|
-
def
|
1008
|
+
def doDescribeClusterSnapshot(args, parsed_globals):
|
1009
1009
|
g_param = parse_global_arg(parsed_globals)
|
1010
1010
|
|
1011
1011
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1034,11 +1034,11 @@ def doDescribeDiagnose(args, parsed_globals):
|
|
1034
1034
|
client = mod.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
1035
|
client._sdkVersion += ("_CLI_" + __version__)
|
1036
1036
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
-
model = models.
|
1037
|
+
model = models.DescribeClusterSnapshotRequest()
|
1038
1038
|
model.from_json_string(json.dumps(args))
|
1039
1039
|
start_time = time.time()
|
1040
1040
|
while True:
|
1041
|
-
rsp = client.
|
1041
|
+
rsp = client.DescribeClusterSnapshot(model)
|
1042
1042
|
result = rsp.to_json_string()
|
1043
1043
|
try:
|
1044
1044
|
json_obj = json.loads(result)
|
@@ -1057,7 +1057,7 @@ def doDescribeDiagnose(args, parsed_globals):
|
|
1057
1057
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
1058
|
|
1059
1059
|
|
1060
|
-
def
|
1060
|
+
def doCreateLogstashInstance(args, parsed_globals):
|
1061
1061
|
g_param = parse_global_arg(parsed_globals)
|
1062
1062
|
|
1063
1063
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1086,11 +1086,11 @@ def doUpdateInstance(args, parsed_globals):
|
|
1086
1086
|
client = mod.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
1087
|
client._sdkVersion += ("_CLI_" + __version__)
|
1088
1088
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
-
model = models.
|
1089
|
+
model = models.CreateLogstashInstanceRequest()
|
1090
1090
|
model.from_json_string(json.dumps(args))
|
1091
1091
|
start_time = time.time()
|
1092
1092
|
while True:
|
1093
|
-
rsp = client.
|
1093
|
+
rsp = client.CreateLogstashInstance(model)
|
1094
1094
|
result = rsp.to_json_string()
|
1095
1095
|
try:
|
1096
1096
|
json_obj = json.loads(result)
|
@@ -1109,7 +1109,7 @@ def doUpdateInstance(args, parsed_globals):
|
|
1109
1109
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1110
1110
|
|
1111
1111
|
|
1112
|
-
def
|
1112
|
+
def doRestartInstance(args, parsed_globals):
|
1113
1113
|
g_param = parse_global_arg(parsed_globals)
|
1114
1114
|
|
1115
1115
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1138,11 +1138,11 @@ def doCreateLogstashInstance(args, parsed_globals):
|
|
1138
1138
|
client = mod.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
1139
1139
|
client._sdkVersion += ("_CLI_" + __version__)
|
1140
1140
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1141
|
-
model = models.
|
1141
|
+
model = models.RestartInstanceRequest()
|
1142
1142
|
model.from_json_string(json.dumps(args))
|
1143
1143
|
start_time = time.time()
|
1144
1144
|
while True:
|
1145
|
-
rsp = client.
|
1145
|
+
rsp = client.RestartInstance(model)
|
1146
1146
|
result = rsp.to_json_string()
|
1147
1147
|
try:
|
1148
1148
|
json_obj = json.loads(result)
|
@@ -1161,7 +1161,7 @@ def doCreateLogstashInstance(args, parsed_globals):
|
|
1161
1161
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1162
1162
|
|
1163
1163
|
|
1164
|
-
def
|
1164
|
+
def doUpdateInstance(args, parsed_globals):
|
1165
1165
|
g_param = parse_global_arg(parsed_globals)
|
1166
1166
|
|
1167
1167
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1190,11 +1190,11 @@ def doRestartInstance(args, parsed_globals):
|
|
1190
1190
|
client = mod.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
1191
1191
|
client._sdkVersion += ("_CLI_" + __version__)
|
1192
1192
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1193
|
-
model = models.
|
1193
|
+
model = models.UpdateInstanceRequest()
|
1194
1194
|
model.from_json_string(json.dumps(args))
|
1195
1195
|
start_time = time.time()
|
1196
1196
|
while True:
|
1197
|
-
rsp = client.
|
1197
|
+
rsp = client.UpdateInstance(model)
|
1198
1198
|
result = rsp.to_json_string()
|
1199
1199
|
try:
|
1200
1200
|
json_obj = json.loads(result)
|
@@ -1369,7 +1369,7 @@ def doUpdateLogstashPipelineDesc(args, parsed_globals):
|
|
1369
1369
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1370
1370
|
|
1371
1371
|
|
1372
|
-
def
|
1372
|
+
def doCreateServerlessInstance(args, parsed_globals):
|
1373
1373
|
g_param = parse_global_arg(parsed_globals)
|
1374
1374
|
|
1375
1375
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1398,11 +1398,11 @@ def doDescribeLogstashInstanceOperations(args, parsed_globals):
|
|
1398
1398
|
client = mod.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
1399
1399
|
client._sdkVersion += ("_CLI_" + __version__)
|
1400
1400
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1401
|
-
model = models.
|
1401
|
+
model = models.CreateServerlessInstanceRequest()
|
1402
1402
|
model.from_json_string(json.dumps(args))
|
1403
1403
|
start_time = time.time()
|
1404
1404
|
while True:
|
1405
|
-
rsp = client.
|
1405
|
+
rsp = client.CreateServerlessInstance(model)
|
1406
1406
|
result = rsp.to_json_string()
|
1407
1407
|
try:
|
1408
1408
|
json_obj = json.loads(result)
|
@@ -1993,6 +1993,162 @@ def doRestartLogstashInstance(args, parsed_globals):
|
|
1993
1993
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1994
1994
|
|
1995
1995
|
|
1996
|
+
def doDescribeDiagnose(args, parsed_globals):
|
1997
|
+
g_param = parse_global_arg(parsed_globals)
|
1998
|
+
|
1999
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2000
|
+
cred = credential.CVMRoleCredential()
|
2001
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2002
|
+
cred = credential.STSAssumeRoleCredential(
|
2003
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2004
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2005
|
+
)
|
2006
|
+
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):
|
2007
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2008
|
+
else:
|
2009
|
+
cred = credential.Credential(
|
2010
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2011
|
+
)
|
2012
|
+
http_profile = HttpProfile(
|
2013
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2014
|
+
reqMethod="POST",
|
2015
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2016
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2017
|
+
)
|
2018
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2019
|
+
if g_param[OptionsDefine.Language]:
|
2020
|
+
profile.language = g_param[OptionsDefine.Language]
|
2021
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2022
|
+
client = mod.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
2023
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2024
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2025
|
+
model = models.DescribeDiagnoseRequest()
|
2026
|
+
model.from_json_string(json.dumps(args))
|
2027
|
+
start_time = time.time()
|
2028
|
+
while True:
|
2029
|
+
rsp = client.DescribeDiagnose(model)
|
2030
|
+
result = rsp.to_json_string()
|
2031
|
+
try:
|
2032
|
+
json_obj = json.loads(result)
|
2033
|
+
except TypeError as e:
|
2034
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2035
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2036
|
+
break
|
2037
|
+
cur_time = time.time()
|
2038
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2039
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2040
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2041
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2042
|
+
else:
|
2043
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2044
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2045
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2046
|
+
|
2047
|
+
|
2048
|
+
def doCreateClusterSnapshot(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.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
2075
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2076
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2077
|
+
model = models.CreateClusterSnapshotRequest()
|
2078
|
+
model.from_json_string(json.dumps(args))
|
2079
|
+
start_time = time.time()
|
2080
|
+
while True:
|
2081
|
+
rsp = client.CreateClusterSnapshot(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
|
+
|
2100
|
+
def doUpdateDictionaries(args, parsed_globals):
|
2101
|
+
g_param = parse_global_arg(parsed_globals)
|
2102
|
+
|
2103
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2104
|
+
cred = credential.CVMRoleCredential()
|
2105
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2106
|
+
cred = credential.STSAssumeRoleCredential(
|
2107
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2108
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2109
|
+
)
|
2110
|
+
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):
|
2111
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2112
|
+
else:
|
2113
|
+
cred = credential.Credential(
|
2114
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2115
|
+
)
|
2116
|
+
http_profile = HttpProfile(
|
2117
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2118
|
+
reqMethod="POST",
|
2119
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2120
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2121
|
+
)
|
2122
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2123
|
+
if g_param[OptionsDefine.Language]:
|
2124
|
+
profile.language = g_param[OptionsDefine.Language]
|
2125
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2126
|
+
client = mod.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
2127
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2128
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2129
|
+
model = models.UpdateDictionariesRequest()
|
2130
|
+
model.from_json_string(json.dumps(args))
|
2131
|
+
start_time = time.time()
|
2132
|
+
while True:
|
2133
|
+
rsp = client.UpdateDictionaries(model)
|
2134
|
+
result = rsp.to_json_string()
|
2135
|
+
try:
|
2136
|
+
json_obj = json.loads(result)
|
2137
|
+
except TypeError as e:
|
2138
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2139
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2140
|
+
break
|
2141
|
+
cur_time = time.time()
|
2142
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2143
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2144
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2145
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2146
|
+
else:
|
2147
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2148
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2149
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2150
|
+
|
2151
|
+
|
1996
2152
|
def doUpdateIndex(args, parsed_globals):
|
1997
2153
|
g_param = parse_global_arg(parsed_globals)
|
1998
2154
|
|
@@ -2305,6 +2461,58 @@ def doDeleteServerlessSpaceUser(args, parsed_globals):
|
|
2305
2461
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2306
2462
|
|
2307
2463
|
|
2464
|
+
def doDeleteClusterSnapshot(args, parsed_globals):
|
2465
|
+
g_param = parse_global_arg(parsed_globals)
|
2466
|
+
|
2467
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2468
|
+
cred = credential.CVMRoleCredential()
|
2469
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2470
|
+
cred = credential.STSAssumeRoleCredential(
|
2471
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2472
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2473
|
+
)
|
2474
|
+
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):
|
2475
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2476
|
+
else:
|
2477
|
+
cred = credential.Credential(
|
2478
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2479
|
+
)
|
2480
|
+
http_profile = HttpProfile(
|
2481
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2482
|
+
reqMethod="POST",
|
2483
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2484
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2485
|
+
)
|
2486
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2487
|
+
if g_param[OptionsDefine.Language]:
|
2488
|
+
profile.language = g_param[OptionsDefine.Language]
|
2489
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2490
|
+
client = mod.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
2491
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2492
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2493
|
+
model = models.DeleteClusterSnapshotRequest()
|
2494
|
+
model.from_json_string(json.dumps(args))
|
2495
|
+
start_time = time.time()
|
2496
|
+
while True:
|
2497
|
+
rsp = client.DeleteClusterSnapshot(model)
|
2498
|
+
result = rsp.to_json_string()
|
2499
|
+
try:
|
2500
|
+
json_obj = json.loads(result)
|
2501
|
+
except TypeError as e:
|
2502
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2503
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2504
|
+
break
|
2505
|
+
cur_time = time.time()
|
2506
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2507
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2508
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2509
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2510
|
+
else:
|
2511
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2512
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2513
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2514
|
+
|
2515
|
+
|
2308
2516
|
def doDescribeLogstashInstanceLogs(args, parsed_globals):
|
2309
2517
|
g_param = parse_global_arg(parsed_globals)
|
2310
2518
|
|
@@ -2617,7 +2825,7 @@ def doSaveAndDeployLogstashPipeline(args, parsed_globals):
|
|
2617
2825
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2618
2826
|
|
2619
2827
|
|
2620
|
-
def
|
2828
|
+
def doDeleteLogstashPipelines(args, parsed_globals):
|
2621
2829
|
g_param = parse_global_arg(parsed_globals)
|
2622
2830
|
|
2623
2831
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2646,11 +2854,11 @@ def doUpdateDictionaries(args, parsed_globals):
|
|
2646
2854
|
client = mod.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
2647
2855
|
client._sdkVersion += ("_CLI_" + __version__)
|
2648
2856
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2649
|
-
model = models.
|
2857
|
+
model = models.DeleteLogstashPipelinesRequest()
|
2650
2858
|
model.from_json_string(json.dumps(args))
|
2651
2859
|
start_time = time.time()
|
2652
2860
|
while True:
|
2653
|
-
rsp = client.
|
2861
|
+
rsp = client.DeleteLogstashPipelines(model)
|
2654
2862
|
result = rsp.to_json_string()
|
2655
2863
|
try:
|
2656
2864
|
json_obj = json.loads(result)
|
@@ -2877,7 +3085,7 @@ def doDescribeIndexMeta(args, parsed_globals):
|
|
2877
3085
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2878
3086
|
|
2879
3087
|
|
2880
|
-
def
|
3088
|
+
def doDescribeLogstashInstanceOperations(args, parsed_globals):
|
2881
3089
|
g_param = parse_global_arg(parsed_globals)
|
2882
3090
|
|
2883
3091
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2906,11 +3114,11 @@ def doCreateServerlessInstance(args, parsed_globals):
|
|
2906
3114
|
client = mod.EsClient(cred, g_param[OptionsDefine.Region], profile)
|
2907
3115
|
client._sdkVersion += ("_CLI_" + __version__)
|
2908
3116
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2909
|
-
model = models.
|
3117
|
+
model = models.DescribeLogstashInstanceOperationsRequest()
|
2910
3118
|
model.from_json_string(json.dumps(args))
|
2911
3119
|
start_time = time.time()
|
2912
3120
|
while True:
|
2913
|
-
rsp = client.
|
3121
|
+
rsp = client.DescribeLogstashInstanceOperations(model)
|
2914
3122
|
result = rsp.to_json_string()
|
2915
3123
|
try:
|
2916
3124
|
json_obj = json.loads(result)
|
@@ -2994,7 +3202,7 @@ MODELS_MAP = {
|
|
2994
3202
|
ACTION_MAP = {
|
2995
3203
|
"DiagnoseInstance": doDiagnoseInstance,
|
2996
3204
|
"DeleteLogstashInstance": doDeleteLogstashInstance,
|
2997
|
-
"
|
3205
|
+
"RestoreClusterSnapshot": doRestoreClusterSnapshot,
|
2998
3206
|
"GetRequestTargetNodeTypes": doGetRequestTargetNodeTypes,
|
2999
3207
|
"StopLogstashPipelines": doStopLogstashPipelines,
|
3000
3208
|
"DescribeServerlessSpaces": doDescribeServerlessSpaces,
|
@@ -3009,16 +3217,16 @@ ACTION_MAP = {
|
|
3009
3217
|
"UpdatePlugins": doUpdatePlugins,
|
3010
3218
|
"CheckMigrateIndexMetaData": doCheckMigrateIndexMetaData,
|
3011
3219
|
"UpdateJdk": doUpdateJdk,
|
3012
|
-
"CreateServerlessSpaceV2": doCreateServerlessSpaceV2,
|
3013
3220
|
"DeleteServerlessInstance": doDeleteServerlessInstance,
|
3014
|
-
"
|
3015
|
-
"
|
3221
|
+
"CreateServerlessSpaceV2": doCreateServerlessSpaceV2,
|
3222
|
+
"DescribeClusterSnapshot": doDescribeClusterSnapshot,
|
3016
3223
|
"CreateLogstashInstance": doCreateLogstashInstance,
|
3017
3224
|
"RestartInstance": doRestartInstance,
|
3225
|
+
"UpdateInstance": doUpdateInstance,
|
3018
3226
|
"DescribeInstanceLogs": doDescribeInstanceLogs,
|
3019
3227
|
"RestartKibana": doRestartKibana,
|
3020
3228
|
"UpdateLogstashPipelineDesc": doUpdateLogstashPipelineDesc,
|
3021
|
-
"
|
3229
|
+
"CreateServerlessInstance": doCreateServerlessInstance,
|
3022
3230
|
"DescribeViews": doDescribeViews,
|
3023
3231
|
"UpdateLogstashInstance": doUpdateLogstashInstance,
|
3024
3232
|
"DescribeInstanceOperations": doDescribeInstanceOperations,
|
@@ -3030,24 +3238,28 @@ ACTION_MAP = {
|
|
3030
3238
|
"CreateInstance": doCreateInstance,
|
3031
3239
|
"UpdateServerlessInstance": doUpdateServerlessInstance,
|
3032
3240
|
"RestartLogstashInstance": doRestartLogstashInstance,
|
3241
|
+
"DescribeDiagnose": doDescribeDiagnose,
|
3242
|
+
"CreateClusterSnapshot": doCreateClusterSnapshot,
|
3243
|
+
"UpdateDictionaries": doUpdateDictionaries,
|
3033
3244
|
"UpdateIndex": doUpdateIndex,
|
3034
3245
|
"DescribeInstances": doDescribeInstances,
|
3035
3246
|
"UpdateServerlessSpace": doUpdateServerlessSpace,
|
3036
3247
|
"StartLogstashPipelines": doStartLogstashPipelines,
|
3037
3248
|
"UpgradeInstance": doUpgradeInstance,
|
3038
3249
|
"DeleteServerlessSpaceUser": doDeleteServerlessSpaceUser,
|
3250
|
+
"DeleteClusterSnapshot": doDeleteClusterSnapshot,
|
3039
3251
|
"DescribeLogstashInstanceLogs": doDescribeLogstashInstanceLogs,
|
3040
3252
|
"DescribeServerlessMetrics": doDescribeServerlessMetrics,
|
3041
3253
|
"RestartNodes": doRestartNodes,
|
3042
3254
|
"DescribeServerlessSpaceUser": doDescribeServerlessSpaceUser,
|
3043
3255
|
"DeleteIndex": doDeleteIndex,
|
3044
3256
|
"SaveAndDeployLogstashPipeline": doSaveAndDeployLogstashPipeline,
|
3045
|
-
"
|
3257
|
+
"DeleteLogstashPipelines": doDeleteLogstashPipelines,
|
3046
3258
|
"UpgradeLicense": doUpgradeLicense,
|
3047
3259
|
"DescribeInstancePluginList": doDescribeInstancePluginList,
|
3048
3260
|
"DescribeServerlessInstances": doDescribeServerlessInstances,
|
3049
3261
|
"DescribeIndexMeta": doDescribeIndexMeta,
|
3050
|
-
"
|
3262
|
+
"DescribeLogstashInstanceOperations": doDescribeLogstashInstanceOperations,
|
3051
3263
|
"InquirePriceRenewInstance": doInquirePriceRenewInstance,
|
3052
3264
|
|
3053
3265
|
}
|