tccli 3.0.1297.1__py2.py3-none-any.whl → 3.0.1299.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/batch/batch_client.py +4 -110
- tccli/services/batch/v20170312/api.json +0 -527
- tccli/services/batch/v20170312/examples.json +0 -16
- tccli/services/bi/v20220105/api.json +87 -1
- tccli/services/bi/v20220105/examples.json +7 -7
- tccli/services/cam/v20190116/api.json +84 -84
- tccli/services/cbs/v20170312/api.json +24 -24
- tccli/services/cdn/v20180606/api.json +240 -179
- tccli/services/cdn/v20180606/examples.json +1 -1
- tccli/services/cfg/v20210820/api.json +5 -3
- tccli/services/cfg/v20210820/examples.json +1 -1
- tccli/services/chdfs/v20201112/api.json +7 -1
- tccli/services/cls/cls_client.py +235 -23
- tccli/services/cls/v20201016/api.json +457 -3
- tccli/services/cls/v20201016/examples.json +32 -0
- tccli/services/controlcenter/v20230110/api.json +63 -58
- tccli/services/cvm/v20170312/api.json +2 -2
- tccli/services/dbbrain/dbbrain_client.py +106 -0
- tccli/services/dbbrain/v20191016/api.json +365 -6
- tccli/services/dbbrain/v20191016/examples.json +8 -0
- tccli/services/dbbrain/v20210527/api.json +550 -21
- tccli/services/dbbrain/v20210527/examples.json +16 -0
- tccli/services/dcdb/v20180411/api.json +102 -6
- tccli/services/dcdb/v20180411/examples.json +4 -4
- tccli/services/dlc/dlc_client.py +53 -0
- tccli/services/dlc/v20210125/api.json +162 -0
- tccli/services/dlc/v20210125/examples.json +8 -0
- tccli/services/dnspod/v20210323/api.json +128 -127
- tccli/services/ess/v20201111/api.json +1 -1
- tccli/services/essbasic/v20210526/api.json +5 -5
- tccli/services/facefusion/v20220927/api.json +2 -2
- tccli/services/facefusion/v20220927/examples.json +1 -1
- tccli/services/gs/v20191118/api.json +22 -3
- tccli/services/gs/v20191118/examples.json +1 -1
- tccli/services/hai/v20230812/api.json +16 -16
- tccli/services/iotcloud/v20210408/api.json +2 -2
- tccli/services/iotcloud/v20210408/examples.json +3 -3
- tccli/services/iotexplorer/v20190423/api.json +947 -857
- tccli/services/iotexplorer/v20190423/examples.json +83 -83
- tccli/services/live/v20180801/api.json +2 -2
- tccli/services/lkeap/v20240522/api.json +3 -3
- tccli/services/mariadb/v20170312/api.json +84 -8
- tccli/services/mariadb/v20170312/examples.json +3 -3
- tccli/services/mps/v20190612/api.json +63 -61
- tccli/services/mps/v20190612/examples.json +48 -48
- tccli/services/mqtt/v20240516/api.json +62 -12
- tccli/services/mqtt/v20240516/examples.json +6 -6
- tccli/services/ocr/ocr_client.py +307 -360
- tccli/services/ocr/v20181119/api.json +73 -289
- tccli/services/ocr/v20181119/examples.json +0 -8
- tccli/services/organization/v20210331/api.json +9 -0
- tccli/services/partners/v20180321/api.json +10 -0
- tccli/services/sqlserver/v20180328/api.json +9 -0
- tccli/services/sqlserver/v20180328/examples.json +1 -1
- tccli/services/tcb/v20180608/api.json +11 -1
- tccli/services/tdmq/v20200217/api.json +30 -0
- tccli/services/teo/v20220106/api.json +4 -4
- tccli/services/teo/v20220901/api.json +48 -7
- tccli/services/teo/v20220901/examples.json +51 -15
- tccli/services/tione/v20211111/api.json +25 -5
- tccli/services/tke/v20180525/api.json +2 -2
- tccli/services/trro/trro_client.py +269 -4
- tccli/services/trro/v20220325/api.json +504 -0
- tccli/services/trro/v20220325/examples.json +40 -0
- tccli/services/tse/v20201207/api.json +34 -34
- tccli/services/vdb/v20230616/api.json +738 -15
- tccli/services/vdb/v20230616/examples.json +64 -0
- tccli/services/vdb/vdb_client.py +428 -4
- tccli/services/vod/v20180717/api.json +9 -0
- tccli/services/vod/v20240718/api.json +985 -0
- tccli/services/vod/v20240718/examples.json +66 -0
- tccli/services/vod/vod_client.py +330 -12
- tccli/services/vpc/v20170312/api.json +175 -0
- tccli/services/vpc/v20170312/examples.json +8 -0
- tccli/services/vpc/vpc_client.py +53 -0
- tccli/services/wedata/v20210820/api.json +464 -1
- tccli/services/wedata/v20210820/examples.json +22 -0
- tccli/services/wedata/wedata_client.py +114 -8
- tccli/services/weilingwith/v20230427/api.json +10 -10
- {tccli-3.0.1297.1.dist-info → tccli-3.0.1299.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1297.1.dist-info → tccli-3.0.1299.1.dist-info}/RECORD +85 -85
- {tccli-3.0.1297.1.dist-info → tccli-3.0.1299.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1297.1.dist-info → tccli-3.0.1299.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1297.1.dist-info → tccli-3.0.1299.1.dist-info}/license_files/LICENSE +0 -0
@@ -8,6 +8,14 @@
|
|
8
8
|
"title": "示例1"
|
9
9
|
}
|
10
10
|
],
|
11
|
+
"CreateInstance": [
|
12
|
+
{
|
13
|
+
"document": "",
|
14
|
+
"input": "POST / HTTP/1.1\nHost: vdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateInstance\n<公共请求参数>\n\n{\n \"VpcId\": \"vpc-68mjxcwm\",\n \"SubnetId\": \"subnet-1m1hnqav\",\n \"PayMode\": 0,\n \"InstanceName\": \"test-base\",\n \"SecurityGroupIds\": [\n \"sg-b85lwctl\"\n ],\n \"InstanceType\": \"base\"\n}",
|
15
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"0d7fa142-011a-4416-be8c-320e44c9c3a9\"\n }\n}",
|
16
|
+
"title": "免费版创建"
|
17
|
+
}
|
18
|
+
],
|
11
19
|
"DescribeDBSecurityGroups": [
|
12
20
|
{
|
13
21
|
"document": "查询实例安全组",
|
@@ -16,6 +24,14 @@
|
|
16
24
|
"title": "示例1"
|
17
25
|
}
|
18
26
|
],
|
27
|
+
"DescribeInstanceMaintenanceWindow": [
|
28
|
+
{
|
29
|
+
"document": "查询维护时间窗口",
|
30
|
+
"input": "POST / HTTP/1.1\nHost: vdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeInstanceMaintenanceWindow\n<公共请求参数>\n\n{\n \"InstanceId\": \"vdb-bmz0****\"\n}",
|
31
|
+
"output": "{\n \"Response\": {\n \"EndTime\": \"03:00\",\n \"InstanceId\": \"vdb-bmz0****\",\n \"RequestId\": \"19265be4-5202-4740-a7b8-5ab602eb3677\",\n \"StartTime\": \"00:00\",\n \"TimeSpan\": 3\n }\n}",
|
32
|
+
"title": "查询维护时间窗口"
|
33
|
+
}
|
34
|
+
],
|
19
35
|
"DescribeInstanceNodes": [
|
20
36
|
{
|
21
37
|
"document": "调用接口成功",
|
@@ -44,6 +60,14 @@
|
|
44
60
|
"title": "查询实例列表"
|
45
61
|
}
|
46
62
|
],
|
63
|
+
"DestroyInstances": [
|
64
|
+
{
|
65
|
+
"document": "销毁实例",
|
66
|
+
"input": "POST / HTTP/1.1\nHost: vdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DestroyInstances\n<公共请求参数>\n\n{\n \"InstanceIds\": [\n \"vdb-77qt****\"\n ]\n}",
|
67
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"12c3d181-6cdf-4e58-a01c-3537df8b125e\"\n }\n}",
|
68
|
+
"title": "销毁实例"
|
69
|
+
}
|
70
|
+
],
|
47
71
|
"DisassociateSecurityGroups": [
|
48
72
|
{
|
49
73
|
"document": "用于安全组批量解绑实例。",
|
@@ -52,6 +76,14 @@
|
|
52
76
|
"title": "示例1"
|
53
77
|
}
|
54
78
|
],
|
79
|
+
"IsolateInstance": [
|
80
|
+
{
|
81
|
+
"document": "",
|
82
|
+
"input": "POST / HTTP/1.1\nHost: vdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: IsolateInstance\n<公共请求参数>\n\n{\n \"InstanceId\": \"vdb-77qt****\"\n}",
|
83
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"12c3d181-6cdf-4e58-a01c-3537df8b125e\"\n }\n}",
|
84
|
+
"title": "隔离实例"
|
85
|
+
}
|
86
|
+
],
|
55
87
|
"ModifyDBInstanceSecurityGroups": [
|
56
88
|
{
|
57
89
|
"document": "修改实例绑定的安全组",
|
@@ -59,6 +91,38 @@
|
|
59
91
|
"output": "{\n \"Response\": {\n \"RequestId\": \"b3a86195-eee7-4e17-8405-e1fc5810c55b\"\n }\n}",
|
60
92
|
"title": "示例1"
|
61
93
|
}
|
94
|
+
],
|
95
|
+
"ModifyInstanceMaintenanceWindow": [
|
96
|
+
{
|
97
|
+
"document": "修改指定实例的维护时间窗",
|
98
|
+
"input": "POST / HTTP/1.1\nHost: vdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyInstanceMaintenanceWindow\n<公共请求参数>\n\n{\n \"InstanceId\": \"vdb-jnaj****\",\n \"StartTime\": \"01:00\",\n \"TimeSpan\": 2\n}",
|
99
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"21e24cbd-0013-42c3-a2f5-81e5cae0b442\"\n }\n}",
|
100
|
+
"title": "设置维护时间窗"
|
101
|
+
}
|
102
|
+
],
|
103
|
+
"RecoverInstance": [
|
104
|
+
{
|
105
|
+
"document": "",
|
106
|
+
"input": "POST / HTTP/1.1\nHost: vdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: RecoverInstance\n<公共请求参数>\n\n{\n \"InstanceId\": \"vdb-77qt****\"\n}",
|
107
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"12c3d181-6cdf-4e58-a01c-3537df8b125e\"\n }\n}",
|
108
|
+
"title": "恢复实例"
|
109
|
+
}
|
110
|
+
],
|
111
|
+
"ScaleOutInstance": [
|
112
|
+
{
|
113
|
+
"document": "水平扩容节点数量",
|
114
|
+
"input": "POST / HTTP/1.1\nHost: vdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ScaleOutInstance\n<公共请求参数>\n\n{\n \"InstanceId\": \"vdb-jnaj****\",\n \"ReplicaNum\": 3\n}",
|
115
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"4a1162e1-e631-44c2-9ad4-ba2cf9f2cddc\"\n }\n}",
|
116
|
+
"title": "增加节点数量"
|
117
|
+
}
|
118
|
+
],
|
119
|
+
"ScaleUpInstance": [
|
120
|
+
{
|
121
|
+
"document": "垂直扩容,升级指定实例的节点规格",
|
122
|
+
"input": "POST / HTTP/1.1\nHost: vdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ScaleUpInstance\n<公共请求参数>\n\n{\n \"Cpu\": 4,\n \"Memory\": 8,\n \"InstanceId\": \"vdb-jnaj****\",\n \"StorageSize\": 40\n}",
|
123
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"3b9204cd-6946-4688-8489-5707960ff6d3\"\n }\n}",
|
124
|
+
"title": "升配节点规格"
|
125
|
+
}
|
62
126
|
]
|
63
127
|
},
|
64
128
|
"version": "1.0"
|
tccli/services/vdb/vdb_client.py
CHANGED
@@ -17,6 +17,58 @@ from tencentcloud.vdb.v20230616 import models as models_v20230616
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
+
def doDescribeInstanceMaintenanceWindow(args, parsed_globals):
|
21
|
+
g_param = parse_global_arg(parsed_globals)
|
22
|
+
|
23
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
24
|
+
cred = credential.CVMRoleCredential()
|
25
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
26
|
+
cred = credential.STSAssumeRoleCredential(
|
27
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
28
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
29
|
+
)
|
30
|
+
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):
|
31
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
32
|
+
else:
|
33
|
+
cred = credential.Credential(
|
34
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
35
|
+
)
|
36
|
+
http_profile = HttpProfile(
|
37
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
38
|
+
reqMethod="POST",
|
39
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
40
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
41
|
+
)
|
42
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
43
|
+
if g_param[OptionsDefine.Language]:
|
44
|
+
profile.language = g_param[OptionsDefine.Language]
|
45
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
46
|
+
client = mod.VdbClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
+
model = models.DescribeInstanceMaintenanceWindowRequest()
|
50
|
+
model.from_json_string(json.dumps(args))
|
51
|
+
start_time = time.time()
|
52
|
+
while True:
|
53
|
+
rsp = client.DescribeInstanceMaintenanceWindow(model)
|
54
|
+
result = rsp.to_json_string()
|
55
|
+
try:
|
56
|
+
json_obj = json.loads(result)
|
57
|
+
except TypeError as e:
|
58
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
59
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
60
|
+
break
|
61
|
+
cur_time = time.time()
|
62
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
63
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
64
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
65
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
66
|
+
else:
|
67
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
68
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
69
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
|
+
|
71
|
+
|
20
72
|
def doAssociateSecurityGroups(args, parsed_globals):
|
21
73
|
g_param = parse_global_arg(parsed_globals)
|
22
74
|
|
@@ -121,7 +173,7 @@ def doDescribeInstances(args, parsed_globals):
|
|
121
173
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
174
|
|
123
175
|
|
124
|
-
def
|
176
|
+
def doModifyInstanceMaintenanceWindow(args, parsed_globals):
|
125
177
|
g_param = parse_global_arg(parsed_globals)
|
126
178
|
|
127
179
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -150,11 +202,63 @@ def doDescribeDBSecurityGroups(args, parsed_globals):
|
|
150
202
|
client = mod.VdbClient(cred, g_param[OptionsDefine.Region], profile)
|
151
203
|
client._sdkVersion += ("_CLI_" + __version__)
|
152
204
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.
|
205
|
+
model = models.ModifyInstanceMaintenanceWindowRequest()
|
154
206
|
model.from_json_string(json.dumps(args))
|
155
207
|
start_time = time.time()
|
156
208
|
while True:
|
157
|
-
rsp = client.
|
209
|
+
rsp = client.ModifyInstanceMaintenanceWindow(model)
|
210
|
+
result = rsp.to_json_string()
|
211
|
+
try:
|
212
|
+
json_obj = json.loads(result)
|
213
|
+
except TypeError as e:
|
214
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
215
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
216
|
+
break
|
217
|
+
cur_time = time.time()
|
218
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
219
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
220
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
221
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
222
|
+
else:
|
223
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
224
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
225
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
|
+
|
227
|
+
|
228
|
+
def doCreateInstance(args, parsed_globals):
|
229
|
+
g_param = parse_global_arg(parsed_globals)
|
230
|
+
|
231
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
232
|
+
cred = credential.CVMRoleCredential()
|
233
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
234
|
+
cred = credential.STSAssumeRoleCredential(
|
235
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
236
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
237
|
+
)
|
238
|
+
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):
|
239
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
240
|
+
else:
|
241
|
+
cred = credential.Credential(
|
242
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
243
|
+
)
|
244
|
+
http_profile = HttpProfile(
|
245
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
246
|
+
reqMethod="POST",
|
247
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
248
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
249
|
+
)
|
250
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
251
|
+
if g_param[OptionsDefine.Language]:
|
252
|
+
profile.language = g_param[OptionsDefine.Language]
|
253
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
254
|
+
client = mod.VdbClient(cred, g_param[OptionsDefine.Region], profile)
|
255
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
256
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
+
model = models.CreateInstanceRequest()
|
258
|
+
model.from_json_string(json.dumps(args))
|
259
|
+
start_time = time.time()
|
260
|
+
while True:
|
261
|
+
rsp = client.CreateInstance(model)
|
158
262
|
result = rsp.to_json_string()
|
159
263
|
try:
|
160
264
|
json_obj = json.loads(result)
|
@@ -225,6 +329,110 @@ def doModifyDBInstanceSecurityGroups(args, parsed_globals):
|
|
225
329
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
330
|
|
227
331
|
|
332
|
+
def doScaleOutInstance(args, parsed_globals):
|
333
|
+
g_param = parse_global_arg(parsed_globals)
|
334
|
+
|
335
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
336
|
+
cred = credential.CVMRoleCredential()
|
337
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
338
|
+
cred = credential.STSAssumeRoleCredential(
|
339
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
340
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
341
|
+
)
|
342
|
+
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):
|
343
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
344
|
+
else:
|
345
|
+
cred = credential.Credential(
|
346
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
347
|
+
)
|
348
|
+
http_profile = HttpProfile(
|
349
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
350
|
+
reqMethod="POST",
|
351
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
352
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
353
|
+
)
|
354
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
355
|
+
if g_param[OptionsDefine.Language]:
|
356
|
+
profile.language = g_param[OptionsDefine.Language]
|
357
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
358
|
+
client = mod.VdbClient(cred, g_param[OptionsDefine.Region], profile)
|
359
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
360
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
+
model = models.ScaleOutInstanceRequest()
|
362
|
+
model.from_json_string(json.dumps(args))
|
363
|
+
start_time = time.time()
|
364
|
+
while True:
|
365
|
+
rsp = client.ScaleOutInstance(model)
|
366
|
+
result = rsp.to_json_string()
|
367
|
+
try:
|
368
|
+
json_obj = json.loads(result)
|
369
|
+
except TypeError as e:
|
370
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
371
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
372
|
+
break
|
373
|
+
cur_time = time.time()
|
374
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
375
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
376
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
377
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
378
|
+
else:
|
379
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
380
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
381
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
382
|
+
|
383
|
+
|
384
|
+
def doDescribeDBSecurityGroups(args, parsed_globals):
|
385
|
+
g_param = parse_global_arg(parsed_globals)
|
386
|
+
|
387
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
388
|
+
cred = credential.CVMRoleCredential()
|
389
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
390
|
+
cred = credential.STSAssumeRoleCredential(
|
391
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
392
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
393
|
+
)
|
394
|
+
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):
|
395
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
396
|
+
else:
|
397
|
+
cred = credential.Credential(
|
398
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
399
|
+
)
|
400
|
+
http_profile = HttpProfile(
|
401
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
402
|
+
reqMethod="POST",
|
403
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
404
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
405
|
+
)
|
406
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
407
|
+
if g_param[OptionsDefine.Language]:
|
408
|
+
profile.language = g_param[OptionsDefine.Language]
|
409
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
410
|
+
client = mod.VdbClient(cred, g_param[OptionsDefine.Region], profile)
|
411
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
412
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
413
|
+
model = models.DescribeDBSecurityGroupsRequest()
|
414
|
+
model.from_json_string(json.dumps(args))
|
415
|
+
start_time = time.time()
|
416
|
+
while True:
|
417
|
+
rsp = client.DescribeDBSecurityGroups(model)
|
418
|
+
result = rsp.to_json_string()
|
419
|
+
try:
|
420
|
+
json_obj = json.loads(result)
|
421
|
+
except TypeError as e:
|
422
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
423
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
424
|
+
break
|
425
|
+
cur_time = time.time()
|
426
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
427
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
428
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
429
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
430
|
+
else:
|
431
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
432
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
433
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
|
+
|
435
|
+
|
228
436
|
def doDescribeInstanceNodes(args, parsed_globals):
|
229
437
|
g_param = parse_global_arg(parsed_globals)
|
230
438
|
|
@@ -277,6 +485,110 @@ def doDescribeInstanceNodes(args, parsed_globals):
|
|
277
485
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
486
|
|
279
487
|
|
488
|
+
def doIsolateInstance(args, parsed_globals):
|
489
|
+
g_param = parse_global_arg(parsed_globals)
|
490
|
+
|
491
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
492
|
+
cred = credential.CVMRoleCredential()
|
493
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
494
|
+
cred = credential.STSAssumeRoleCredential(
|
495
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
496
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
497
|
+
)
|
498
|
+
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):
|
499
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
500
|
+
else:
|
501
|
+
cred = credential.Credential(
|
502
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
503
|
+
)
|
504
|
+
http_profile = HttpProfile(
|
505
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
506
|
+
reqMethod="POST",
|
507
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
508
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
509
|
+
)
|
510
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
511
|
+
if g_param[OptionsDefine.Language]:
|
512
|
+
profile.language = g_param[OptionsDefine.Language]
|
513
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
514
|
+
client = mod.VdbClient(cred, g_param[OptionsDefine.Region], profile)
|
515
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
516
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
517
|
+
model = models.IsolateInstanceRequest()
|
518
|
+
model.from_json_string(json.dumps(args))
|
519
|
+
start_time = time.time()
|
520
|
+
while True:
|
521
|
+
rsp = client.IsolateInstance(model)
|
522
|
+
result = rsp.to_json_string()
|
523
|
+
try:
|
524
|
+
json_obj = json.loads(result)
|
525
|
+
except TypeError as e:
|
526
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
527
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
528
|
+
break
|
529
|
+
cur_time = time.time()
|
530
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
531
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
532
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
533
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
534
|
+
else:
|
535
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
536
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
537
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
538
|
+
|
539
|
+
|
540
|
+
def doDestroyInstances(args, parsed_globals):
|
541
|
+
g_param = parse_global_arg(parsed_globals)
|
542
|
+
|
543
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
544
|
+
cred = credential.CVMRoleCredential()
|
545
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
546
|
+
cred = credential.STSAssumeRoleCredential(
|
547
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
548
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
549
|
+
)
|
550
|
+
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):
|
551
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
552
|
+
else:
|
553
|
+
cred = credential.Credential(
|
554
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
555
|
+
)
|
556
|
+
http_profile = HttpProfile(
|
557
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
558
|
+
reqMethod="POST",
|
559
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
560
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
561
|
+
)
|
562
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
563
|
+
if g_param[OptionsDefine.Language]:
|
564
|
+
profile.language = g_param[OptionsDefine.Language]
|
565
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
566
|
+
client = mod.VdbClient(cred, g_param[OptionsDefine.Region], profile)
|
567
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
568
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
569
|
+
model = models.DestroyInstancesRequest()
|
570
|
+
model.from_json_string(json.dumps(args))
|
571
|
+
start_time = time.time()
|
572
|
+
while True:
|
573
|
+
rsp = client.DestroyInstances(model)
|
574
|
+
result = rsp.to_json_string()
|
575
|
+
try:
|
576
|
+
json_obj = json.loads(result)
|
577
|
+
except TypeError as e:
|
578
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
579
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
580
|
+
break
|
581
|
+
cur_time = time.time()
|
582
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
583
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
584
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
585
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
586
|
+
else:
|
587
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
588
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
589
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
590
|
+
|
591
|
+
|
280
592
|
def doDisassociateSecurityGroups(args, parsed_globals):
|
281
593
|
g_param = parse_global_arg(parsed_globals)
|
282
594
|
|
@@ -329,6 +641,110 @@ def doDisassociateSecurityGroups(args, parsed_globals):
|
|
329
641
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
330
642
|
|
331
643
|
|
644
|
+
def doScaleUpInstance(args, parsed_globals):
|
645
|
+
g_param = parse_global_arg(parsed_globals)
|
646
|
+
|
647
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
648
|
+
cred = credential.CVMRoleCredential()
|
649
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
650
|
+
cred = credential.STSAssumeRoleCredential(
|
651
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
652
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
653
|
+
)
|
654
|
+
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):
|
655
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
656
|
+
else:
|
657
|
+
cred = credential.Credential(
|
658
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
659
|
+
)
|
660
|
+
http_profile = HttpProfile(
|
661
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
662
|
+
reqMethod="POST",
|
663
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
664
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
665
|
+
)
|
666
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
667
|
+
if g_param[OptionsDefine.Language]:
|
668
|
+
profile.language = g_param[OptionsDefine.Language]
|
669
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
670
|
+
client = mod.VdbClient(cred, g_param[OptionsDefine.Region], profile)
|
671
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
672
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
+
model = models.ScaleUpInstanceRequest()
|
674
|
+
model.from_json_string(json.dumps(args))
|
675
|
+
start_time = time.time()
|
676
|
+
while True:
|
677
|
+
rsp = client.ScaleUpInstance(model)
|
678
|
+
result = rsp.to_json_string()
|
679
|
+
try:
|
680
|
+
json_obj = json.loads(result)
|
681
|
+
except TypeError as e:
|
682
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
683
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
684
|
+
break
|
685
|
+
cur_time = time.time()
|
686
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
687
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
688
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
689
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
690
|
+
else:
|
691
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
692
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
693
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
|
+
|
695
|
+
|
696
|
+
def doRecoverInstance(args, parsed_globals):
|
697
|
+
g_param = parse_global_arg(parsed_globals)
|
698
|
+
|
699
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
700
|
+
cred = credential.CVMRoleCredential()
|
701
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
702
|
+
cred = credential.STSAssumeRoleCredential(
|
703
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
704
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
705
|
+
)
|
706
|
+
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):
|
707
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
708
|
+
else:
|
709
|
+
cred = credential.Credential(
|
710
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
711
|
+
)
|
712
|
+
http_profile = HttpProfile(
|
713
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
714
|
+
reqMethod="POST",
|
715
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
716
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
717
|
+
)
|
718
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
719
|
+
if g_param[OptionsDefine.Language]:
|
720
|
+
profile.language = g_param[OptionsDefine.Language]
|
721
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
722
|
+
client = mod.VdbClient(cred, g_param[OptionsDefine.Region], profile)
|
723
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
724
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
+
model = models.RecoverInstanceRequest()
|
726
|
+
model.from_json_string(json.dumps(args))
|
727
|
+
start_time = time.time()
|
728
|
+
while True:
|
729
|
+
rsp = client.RecoverInstance(model)
|
730
|
+
result = rsp.to_json_string()
|
731
|
+
try:
|
732
|
+
json_obj = json.loads(result)
|
733
|
+
except TypeError as e:
|
734
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
735
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
736
|
+
break
|
737
|
+
cur_time = time.time()
|
738
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
739
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
740
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
741
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
742
|
+
else:
|
743
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
744
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
745
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
746
|
+
|
747
|
+
|
332
748
|
CLIENT_MAP = {
|
333
749
|
"v20230616": vdb_client_v20230616,
|
334
750
|
|
@@ -340,12 +756,20 @@ MODELS_MAP = {
|
|
340
756
|
}
|
341
757
|
|
342
758
|
ACTION_MAP = {
|
759
|
+
"DescribeInstanceMaintenanceWindow": doDescribeInstanceMaintenanceWindow,
|
343
760
|
"AssociateSecurityGroups": doAssociateSecurityGroups,
|
344
761
|
"DescribeInstances": doDescribeInstances,
|
345
|
-
"
|
762
|
+
"ModifyInstanceMaintenanceWindow": doModifyInstanceMaintenanceWindow,
|
763
|
+
"CreateInstance": doCreateInstance,
|
346
764
|
"ModifyDBInstanceSecurityGroups": doModifyDBInstanceSecurityGroups,
|
765
|
+
"ScaleOutInstance": doScaleOutInstance,
|
766
|
+
"DescribeDBSecurityGroups": doDescribeDBSecurityGroups,
|
347
767
|
"DescribeInstanceNodes": doDescribeInstanceNodes,
|
768
|
+
"IsolateInstance": doIsolateInstance,
|
769
|
+
"DestroyInstances": doDestroyInstances,
|
348
770
|
"DisassociateSecurityGroups": doDisassociateSecurityGroups,
|
771
|
+
"ScaleUpInstance": doScaleUpInstance,
|
772
|
+
"RecoverInstance": doRecoverInstance,
|
349
773
|
|
350
774
|
}
|
351
775
|
|
@@ -11825,6 +11825,15 @@
|
|
11825
11825
|
"name": "Description",
|
11826
11826
|
"required": false,
|
11827
11827
|
"type": "string"
|
11828
|
+
},
|
11829
|
+
{
|
11830
|
+
"disabled": false,
|
11831
|
+
"document": "应用类型, 取值有:<li>AllInOne:一体化;</li><li>Professional:专业版。</li>默认值为 AllInOne。",
|
11832
|
+
"example": "AllInOne",
|
11833
|
+
"member": "string",
|
11834
|
+
"name": "Type",
|
11835
|
+
"required": false,
|
11836
|
+
"type": "string"
|
11828
11837
|
}
|
11829
11838
|
],
|
11830
11839
|
"type": "object"
|