tccli 3.0.1264.1__py2.py3-none-any.whl → 3.0.1265.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/v20170312/api.json +1 -1
- tccli/services/bh/v20230418/api.json +490 -5
- tccli/services/bh/v20230418/examples.json +2 -2
- tccli/services/cbs/v20170312/api.json +12 -2
- tccli/services/cbs/v20170312/examples.json +2 -2
- tccli/services/chdfs/v20201112/api.json +7 -7
- tccli/services/cls/v20201016/api.json +10 -1
- tccli/services/cvm/v20170312/api.json +1 -1
- tccli/services/facefusion/v20220927/api.json +2 -2
- tccli/services/lighthouse/v20200324/api.json +7 -7
- tccli/services/mna/v20210119/api.json +21 -21
- tccli/services/mps/v20190612/api.json +84 -8
- tccli/services/mqtt/mqtt_client.py +658 -75
- tccli/services/mqtt/v20240516/api.json +1038 -54
- tccli/services/mqtt/v20240516/examples.json +88 -0
- tccli/services/ocr/v20181119/api.json +52 -22
- tccli/services/ssl/ssl_client.py +122 -16
- tccli/services/ssl/v20191205/api.json +448 -2
- tccli/services/ssl/v20191205/examples.json +18 -2
- tccli/services/tcr/v20190924/api.json +2 -2
- tccli/services/tmt/v20180321/api.json +1 -1
- tccli/services/trtc/v20190722/api.json +26 -28
- tccli/services/trtc/v20190722/examples.json +9 -9
- {tccli-3.0.1264.1.dist-info → tccli-3.0.1265.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1264.1.dist-info → tccli-3.0.1265.1.dist-info}/RECORD +29 -29
- {tccli-3.0.1264.1.dist-info → tccli-3.0.1265.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1264.1.dist-info → tccli-3.0.1265.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1264.1.dist-info → tccli-3.0.1265.1.dist-info}/license_files/LICENSE +0 -0
@@ -17,6 +17,110 @@ from tencentcloud.mqtt.v20240516 import models as models_v20240516
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
+
def doDescribeUserList(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.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
+
model = models.DescribeUserListRequest()
|
50
|
+
model.from_json_string(json.dumps(args))
|
51
|
+
start_time = time.time()
|
52
|
+
while True:
|
53
|
+
rsp = client.DescribeUserList(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
|
+
|
72
|
+
def doCreateInsPublicEndpoint(args, parsed_globals):
|
73
|
+
g_param = parse_global_arg(parsed_globals)
|
74
|
+
|
75
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
76
|
+
cred = credential.CVMRoleCredential()
|
77
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
78
|
+
cred = credential.STSAssumeRoleCredential(
|
79
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
80
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
81
|
+
)
|
82
|
+
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):
|
83
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
84
|
+
else:
|
85
|
+
cred = credential.Credential(
|
86
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
87
|
+
)
|
88
|
+
http_profile = HttpProfile(
|
89
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
90
|
+
reqMethod="POST",
|
91
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
92
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
93
|
+
)
|
94
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
95
|
+
if g_param[OptionsDefine.Language]:
|
96
|
+
profile.language = g_param[OptionsDefine.Language]
|
97
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
98
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
99
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
100
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
+
model = models.CreateInsPublicEndpointRequest()
|
102
|
+
model.from_json_string(json.dumps(args))
|
103
|
+
start_time = time.time()
|
104
|
+
while True:
|
105
|
+
rsp = client.CreateInsPublicEndpoint(model)
|
106
|
+
result = rsp.to_json_string()
|
107
|
+
try:
|
108
|
+
json_obj = json.loads(result)
|
109
|
+
except TypeError as e:
|
110
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
111
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
112
|
+
break
|
113
|
+
cur_time = time.time()
|
114
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
115
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
116
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
117
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
118
|
+
else:
|
119
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
120
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
121
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
|
+
|
123
|
+
|
20
124
|
def doModifyTopic(args, parsed_globals):
|
21
125
|
g_param = parse_global_arg(parsed_globals)
|
22
126
|
|
@@ -46,11 +150,375 @@ def doModifyTopic(args, parsed_globals):
|
|
46
150
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
47
151
|
client._sdkVersion += ("_CLI_" + __version__)
|
48
152
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
-
model = models.ModifyTopicRequest()
|
153
|
+
model = models.ModifyTopicRequest()
|
154
|
+
model.from_json_string(json.dumps(args))
|
155
|
+
start_time = time.time()
|
156
|
+
while True:
|
157
|
+
rsp = client.ModifyTopic(model)
|
158
|
+
result = rsp.to_json_string()
|
159
|
+
try:
|
160
|
+
json_obj = json.loads(result)
|
161
|
+
except TypeError as e:
|
162
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
163
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
164
|
+
break
|
165
|
+
cur_time = time.time()
|
166
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
167
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
168
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
169
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
170
|
+
else:
|
171
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
172
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
173
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
|
+
|
175
|
+
|
176
|
+
def doDeactivateDeviceCertificate(args, parsed_globals):
|
177
|
+
g_param = parse_global_arg(parsed_globals)
|
178
|
+
|
179
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
180
|
+
cred = credential.CVMRoleCredential()
|
181
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
182
|
+
cred = credential.STSAssumeRoleCredential(
|
183
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
184
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
185
|
+
)
|
186
|
+
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):
|
187
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
188
|
+
else:
|
189
|
+
cred = credential.Credential(
|
190
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
191
|
+
)
|
192
|
+
http_profile = HttpProfile(
|
193
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
194
|
+
reqMethod="POST",
|
195
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
196
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
197
|
+
)
|
198
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
199
|
+
if g_param[OptionsDefine.Language]:
|
200
|
+
profile.language = g_param[OptionsDefine.Language]
|
201
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
202
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
203
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
204
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
205
|
+
model = models.DeactivateDeviceCertificateRequest()
|
206
|
+
model.from_json_string(json.dumps(args))
|
207
|
+
start_time = time.time()
|
208
|
+
while True:
|
209
|
+
rsp = client.DeactivateDeviceCertificate(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 doDeleteAuthenticator(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.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
255
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
256
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
+
model = models.DeleteAuthenticatorRequest()
|
258
|
+
model.from_json_string(json.dumps(args))
|
259
|
+
start_time = time.time()
|
260
|
+
while True:
|
261
|
+
rsp = client.DeleteAuthenticator(model)
|
262
|
+
result = rsp.to_json_string()
|
263
|
+
try:
|
264
|
+
json_obj = json.loads(result)
|
265
|
+
except TypeError as e:
|
266
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
267
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
268
|
+
break
|
269
|
+
cur_time = time.time()
|
270
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
271
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
272
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
273
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
274
|
+
else:
|
275
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
276
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
277
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
|
+
|
279
|
+
|
280
|
+
def doCreateJWTAuthenticator(args, parsed_globals):
|
281
|
+
g_param = parse_global_arg(parsed_globals)
|
282
|
+
|
283
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
284
|
+
cred = credential.CVMRoleCredential()
|
285
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
286
|
+
cred = credential.STSAssumeRoleCredential(
|
287
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
288
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
289
|
+
)
|
290
|
+
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):
|
291
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
292
|
+
else:
|
293
|
+
cred = credential.Credential(
|
294
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
295
|
+
)
|
296
|
+
http_profile = HttpProfile(
|
297
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
298
|
+
reqMethod="POST",
|
299
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
300
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
301
|
+
)
|
302
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
303
|
+
if g_param[OptionsDefine.Language]:
|
304
|
+
profile.language = g_param[OptionsDefine.Language]
|
305
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
306
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
307
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
308
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
+
model = models.CreateJWTAuthenticatorRequest()
|
310
|
+
model.from_json_string(json.dumps(args))
|
311
|
+
start_time = time.time()
|
312
|
+
while True:
|
313
|
+
rsp = client.CreateJWTAuthenticator(model)
|
314
|
+
result = rsp.to_json_string()
|
315
|
+
try:
|
316
|
+
json_obj = json.loads(result)
|
317
|
+
except TypeError as e:
|
318
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
319
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
320
|
+
break
|
321
|
+
cur_time = time.time()
|
322
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
323
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
324
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
325
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
326
|
+
else:
|
327
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
328
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
329
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
330
|
+
|
331
|
+
|
332
|
+
def doActivateDeviceCertificate(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.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
359
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
360
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
+
model = models.ActivateDeviceCertificateRequest()
|
362
|
+
model.from_json_string(json.dumps(args))
|
363
|
+
start_time = time.time()
|
364
|
+
while True:
|
365
|
+
rsp = client.ActivateDeviceCertificate(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 doDeleteInstance(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.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
411
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
412
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
413
|
+
model = models.DeleteInstanceRequest()
|
414
|
+
model.from_json_string(json.dumps(args))
|
415
|
+
start_time = time.time()
|
416
|
+
while True:
|
417
|
+
rsp = client.DeleteInstance(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
|
+
|
436
|
+
def doModifyJWTAuthenticator(args, parsed_globals):
|
437
|
+
g_param = parse_global_arg(parsed_globals)
|
438
|
+
|
439
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
440
|
+
cred = credential.CVMRoleCredential()
|
441
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
442
|
+
cred = credential.STSAssumeRoleCredential(
|
443
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
444
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
445
|
+
)
|
446
|
+
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):
|
447
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
448
|
+
else:
|
449
|
+
cred = credential.Credential(
|
450
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
451
|
+
)
|
452
|
+
http_profile = HttpProfile(
|
453
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
454
|
+
reqMethod="POST",
|
455
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
456
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
457
|
+
)
|
458
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
459
|
+
if g_param[OptionsDefine.Language]:
|
460
|
+
profile.language = g_param[OptionsDefine.Language]
|
461
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
462
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
463
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
464
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
+
model = models.ModifyJWTAuthenticatorRequest()
|
466
|
+
model.from_json_string(json.dumps(args))
|
467
|
+
start_time = time.time()
|
468
|
+
while True:
|
469
|
+
rsp = client.ModifyJWTAuthenticator(model)
|
470
|
+
result = rsp.to_json_string()
|
471
|
+
try:
|
472
|
+
json_obj = json.loads(result)
|
473
|
+
except TypeError as e:
|
474
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
475
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
476
|
+
break
|
477
|
+
cur_time = time.time()
|
478
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
479
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
480
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
481
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
482
|
+
else:
|
483
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
484
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
485
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
486
|
+
|
487
|
+
|
488
|
+
def doDescribeAuthorizationPolicies(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.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
515
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
516
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
517
|
+
model = models.DescribeAuthorizationPoliciesRequest()
|
50
518
|
model.from_json_string(json.dumps(args))
|
51
519
|
start_time = time.time()
|
52
520
|
while True:
|
53
|
-
rsp = client.
|
521
|
+
rsp = client.DescribeAuthorizationPolicies(model)
|
54
522
|
result = rsp.to_json_string()
|
55
523
|
try:
|
56
524
|
json_obj = json.loads(result)
|
@@ -69,7 +537,7 @@ def doModifyTopic(args, parsed_globals):
|
|
69
537
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
538
|
|
71
539
|
|
72
|
-
def
|
540
|
+
def doDescribeInsPublicEndpoints(args, parsed_globals):
|
73
541
|
g_param = parse_global_arg(parsed_globals)
|
74
542
|
|
75
543
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -98,11 +566,11 @@ def doDeactivateDeviceCertificate(args, parsed_globals):
|
|
98
566
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
99
567
|
client._sdkVersion += ("_CLI_" + __version__)
|
100
568
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
-
model = models.
|
569
|
+
model = models.DescribeInsPublicEndpointsRequest()
|
102
570
|
model.from_json_string(json.dumps(args))
|
103
571
|
start_time = time.time()
|
104
572
|
while True:
|
105
|
-
rsp = client.
|
573
|
+
rsp = client.DescribeInsPublicEndpoints(model)
|
106
574
|
result = rsp.to_json_string()
|
107
575
|
try:
|
108
576
|
json_obj = json.loads(result)
|
@@ -121,7 +589,7 @@ def doDeactivateDeviceCertificate(args, parsed_globals):
|
|
121
589
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
590
|
|
123
591
|
|
124
|
-
def
|
592
|
+
def doDescribeAuthenticator(args, parsed_globals):
|
125
593
|
g_param = parse_global_arg(parsed_globals)
|
126
594
|
|
127
595
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -150,11 +618,11 @@ def doDeleteAuthenticator(args, parsed_globals):
|
|
150
618
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
151
619
|
client._sdkVersion += ("_CLI_" + __version__)
|
152
620
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.
|
621
|
+
model = models.DescribeAuthenticatorRequest()
|
154
622
|
model.from_json_string(json.dumps(args))
|
155
623
|
start_time = time.time()
|
156
624
|
while True:
|
157
|
-
rsp = client.
|
625
|
+
rsp = client.DescribeAuthenticator(model)
|
158
626
|
result = rsp.to_json_string()
|
159
627
|
try:
|
160
628
|
json_obj = json.loads(result)
|
@@ -173,7 +641,7 @@ def doDeleteAuthenticator(args, parsed_globals):
|
|
173
641
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
642
|
|
175
643
|
|
176
|
-
def
|
644
|
+
def doRegisterDeviceCertificate(args, parsed_globals):
|
177
645
|
g_param = parse_global_arg(parsed_globals)
|
178
646
|
|
179
647
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -202,11 +670,11 @@ def doCreateJWTAuthenticator(args, parsed_globals):
|
|
202
670
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
203
671
|
client._sdkVersion += ("_CLI_" + __version__)
|
204
672
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
205
|
-
model = models.
|
673
|
+
model = models.RegisterDeviceCertificateRequest()
|
206
674
|
model.from_json_string(json.dumps(args))
|
207
675
|
start_time = time.time()
|
208
676
|
while True:
|
209
|
-
rsp = client.
|
677
|
+
rsp = client.RegisterDeviceCertificate(model)
|
210
678
|
result = rsp.to_json_string()
|
211
679
|
try:
|
212
680
|
json_obj = json.loads(result)
|
@@ -225,7 +693,7 @@ def doCreateJWTAuthenticator(args, parsed_globals):
|
|
225
693
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
694
|
|
227
695
|
|
228
|
-
def
|
696
|
+
def doDescribeDeviceCertificates(args, parsed_globals):
|
229
697
|
g_param = parse_global_arg(parsed_globals)
|
230
698
|
|
231
699
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -254,11 +722,11 @@ def doActivateDeviceCertificate(args, parsed_globals):
|
|
254
722
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
255
723
|
client._sdkVersion += ("_CLI_" + __version__)
|
256
724
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
-
model = models.
|
725
|
+
model = models.DescribeDeviceCertificatesRequest()
|
258
726
|
model.from_json_string(json.dumps(args))
|
259
727
|
start_time = time.time()
|
260
728
|
while True:
|
261
|
-
rsp = client.
|
729
|
+
rsp = client.DescribeDeviceCertificates(model)
|
262
730
|
result = rsp.to_json_string()
|
263
731
|
try:
|
264
732
|
json_obj = json.loads(result)
|
@@ -277,7 +745,7 @@ def doActivateDeviceCertificate(args, parsed_globals):
|
|
277
745
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
746
|
|
279
747
|
|
280
|
-
def
|
748
|
+
def doDeleteUser(args, parsed_globals):
|
281
749
|
g_param = parse_global_arg(parsed_globals)
|
282
750
|
|
283
751
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -306,11 +774,11 @@ def doDescribeInstanceList(args, parsed_globals):
|
|
306
774
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
307
775
|
client._sdkVersion += ("_CLI_" + __version__)
|
308
776
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
-
model = models.
|
777
|
+
model = models.DeleteUserRequest()
|
310
778
|
model.from_json_string(json.dumps(args))
|
311
779
|
start_time = time.time()
|
312
780
|
while True:
|
313
|
-
rsp = client.
|
781
|
+
rsp = client.DeleteUser(model)
|
314
782
|
result = rsp.to_json_string()
|
315
783
|
try:
|
316
784
|
json_obj = json.loads(result)
|
@@ -329,7 +797,7 @@ def doDescribeInstanceList(args, parsed_globals):
|
|
329
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
330
798
|
|
331
799
|
|
332
|
-
def
|
800
|
+
def doCreateTopic(args, parsed_globals):
|
333
801
|
g_param = parse_global_arg(parsed_globals)
|
334
802
|
|
335
803
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -358,11 +826,11 @@ def doModifyJWTAuthenticator(args, parsed_globals):
|
|
358
826
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
359
827
|
client._sdkVersion += ("_CLI_" + __version__)
|
360
828
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
-
model = models.
|
829
|
+
model = models.CreateTopicRequest()
|
362
830
|
model.from_json_string(json.dumps(args))
|
363
831
|
start_time = time.time()
|
364
832
|
while True:
|
365
|
-
rsp = client.
|
833
|
+
rsp = client.CreateTopic(model)
|
366
834
|
result = rsp.to_json_string()
|
367
835
|
try:
|
368
836
|
json_obj = json.loads(result)
|
@@ -381,7 +849,7 @@ def doModifyJWTAuthenticator(args, parsed_globals):
|
|
381
849
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
382
850
|
|
383
851
|
|
384
|
-
def
|
852
|
+
def doDeleteDeviceCertificate(args, parsed_globals):
|
385
853
|
g_param = parse_global_arg(parsed_globals)
|
386
854
|
|
387
855
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -410,11 +878,11 @@ def doDescribeAuthorizationPolicies(args, parsed_globals):
|
|
410
878
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
411
879
|
client._sdkVersion += ("_CLI_" + __version__)
|
412
880
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
413
|
-
model = models.
|
881
|
+
model = models.DeleteDeviceCertificateRequest()
|
414
882
|
model.from_json_string(json.dumps(args))
|
415
883
|
start_time = time.time()
|
416
884
|
while True:
|
417
|
-
rsp = client.
|
885
|
+
rsp = client.DeleteDeviceCertificate(model)
|
418
886
|
result = rsp.to_json_string()
|
419
887
|
try:
|
420
888
|
json_obj = json.loads(result)
|
@@ -433,7 +901,7 @@ def doDescribeAuthorizationPolicies(args, parsed_globals):
|
|
433
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
902
|
|
435
903
|
|
436
|
-
def
|
904
|
+
def doModifyJWKSAuthenticator(args, parsed_globals):
|
437
905
|
g_param = parse_global_arg(parsed_globals)
|
438
906
|
|
439
907
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -462,11 +930,11 @@ def doRegisterDeviceCertificate(args, parsed_globals):
|
|
462
930
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
463
931
|
client._sdkVersion += ("_CLI_" + __version__)
|
464
932
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
-
model = models.
|
933
|
+
model = models.ModifyJWKSAuthenticatorRequest()
|
466
934
|
model.from_json_string(json.dumps(args))
|
467
935
|
start_time = time.time()
|
468
936
|
while True:
|
469
|
-
rsp = client.
|
937
|
+
rsp = client.ModifyJWKSAuthenticator(model)
|
470
938
|
result = rsp.to_json_string()
|
471
939
|
try:
|
472
940
|
json_obj = json.loads(result)
|
@@ -485,7 +953,7 @@ def doRegisterDeviceCertificate(args, parsed_globals):
|
|
485
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
486
954
|
|
487
955
|
|
488
|
-
def
|
956
|
+
def doDeleteInsPublicEndpoint(args, parsed_globals):
|
489
957
|
g_param = parse_global_arg(parsed_globals)
|
490
958
|
|
491
959
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -514,11 +982,11 @@ def doDescribeDeviceCertificates(args, parsed_globals):
|
|
514
982
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
515
983
|
client._sdkVersion += ("_CLI_" + __version__)
|
516
984
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
517
|
-
model = models.
|
985
|
+
model = models.DeleteInsPublicEndpointRequest()
|
518
986
|
model.from_json_string(json.dumps(args))
|
519
987
|
start_time = time.time()
|
520
988
|
while True:
|
521
|
-
rsp = client.
|
989
|
+
rsp = client.DeleteInsPublicEndpoint(model)
|
522
990
|
result = rsp.to_json_string()
|
523
991
|
try:
|
524
992
|
json_obj = json.loads(result)
|
@@ -537,7 +1005,7 @@ def doDescribeDeviceCertificates(args, parsed_globals):
|
|
537
1005
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
538
1006
|
|
539
1007
|
|
540
|
-
def
|
1008
|
+
def doDescribeDeviceCertificate(args, parsed_globals):
|
541
1009
|
g_param = parse_global_arg(parsed_globals)
|
542
1010
|
|
543
1011
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -566,11 +1034,11 @@ def doCreateTopic(args, parsed_globals):
|
|
566
1034
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
567
1035
|
client._sdkVersion += ("_CLI_" + __version__)
|
568
1036
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
569
|
-
model = models.
|
1037
|
+
model = models.DescribeDeviceCertificateRequest()
|
570
1038
|
model.from_json_string(json.dumps(args))
|
571
1039
|
start_time = time.time()
|
572
1040
|
while True:
|
573
|
-
rsp = client.
|
1041
|
+
rsp = client.DescribeDeviceCertificate(model)
|
574
1042
|
result = rsp.to_json_string()
|
575
1043
|
try:
|
576
1044
|
json_obj = json.loads(result)
|
@@ -589,7 +1057,7 @@ def doCreateTopic(args, parsed_globals):
|
|
589
1057
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
590
1058
|
|
591
1059
|
|
592
|
-
def
|
1060
|
+
def doRevokedDeviceCertificate(args, parsed_globals):
|
593
1061
|
g_param = parse_global_arg(parsed_globals)
|
594
1062
|
|
595
1063
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -618,11 +1086,11 @@ def doDeleteDeviceCertificate(args, parsed_globals):
|
|
618
1086
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
619
1087
|
client._sdkVersion += ("_CLI_" + __version__)
|
620
1088
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
621
|
-
model = models.
|
1089
|
+
model = models.RevokedDeviceCertificateRequest()
|
622
1090
|
model.from_json_string(json.dumps(args))
|
623
1091
|
start_time = time.time()
|
624
1092
|
while True:
|
625
|
-
rsp = client.
|
1093
|
+
rsp = client.RevokedDeviceCertificate(model)
|
626
1094
|
result = rsp.to_json_string()
|
627
1095
|
try:
|
628
1096
|
json_obj = json.loads(result)
|
@@ -641,7 +1109,7 @@ def doDeleteDeviceCertificate(args, parsed_globals):
|
|
641
1109
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
642
1110
|
|
643
1111
|
|
644
|
-
def
|
1112
|
+
def doDescribeInstance(args, parsed_globals):
|
645
1113
|
g_param = parse_global_arg(parsed_globals)
|
646
1114
|
|
647
1115
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -670,11 +1138,11 @@ def doModifyJWKSAuthenticator(args, parsed_globals):
|
|
670
1138
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
671
1139
|
client._sdkVersion += ("_CLI_" + __version__)
|
672
1140
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
-
model = models.
|
1141
|
+
model = models.DescribeInstanceRequest()
|
674
1142
|
model.from_json_string(json.dumps(args))
|
675
1143
|
start_time = time.time()
|
676
1144
|
while True:
|
677
|
-
rsp = client.
|
1145
|
+
rsp = client.DescribeInstance(model)
|
678
1146
|
result = rsp.to_json_string()
|
679
1147
|
try:
|
680
1148
|
json_obj = json.loads(result)
|
@@ -693,7 +1161,7 @@ def doModifyJWKSAuthenticator(args, parsed_globals):
|
|
693
1161
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
1162
|
|
695
1163
|
|
696
|
-
def
|
1164
|
+
def doDeleteTopic(args, parsed_globals):
|
697
1165
|
g_param = parse_global_arg(parsed_globals)
|
698
1166
|
|
699
1167
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -722,11 +1190,11 @@ def doDescribeDeviceCertificate(args, parsed_globals):
|
|
722
1190
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
723
1191
|
client._sdkVersion += ("_CLI_" + __version__)
|
724
1192
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
-
model = models.
|
1193
|
+
model = models.DeleteTopicRequest()
|
726
1194
|
model.from_json_string(json.dumps(args))
|
727
1195
|
start_time = time.time()
|
728
1196
|
while True:
|
729
|
-
rsp = client.
|
1197
|
+
rsp = client.DeleteTopic(model)
|
730
1198
|
result = rsp.to_json_string()
|
731
1199
|
try:
|
732
1200
|
json_obj = json.loads(result)
|
@@ -745,7 +1213,7 @@ def doDescribeDeviceCertificate(args, parsed_globals):
|
|
745
1213
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
746
1214
|
|
747
1215
|
|
748
|
-
def
|
1216
|
+
def doCreateJWKSAuthenticator(args, parsed_globals):
|
749
1217
|
g_param = parse_global_arg(parsed_globals)
|
750
1218
|
|
751
1219
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -774,11 +1242,11 @@ def doRevokedDeviceCertificate(args, parsed_globals):
|
|
774
1242
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
775
1243
|
client._sdkVersion += ("_CLI_" + __version__)
|
776
1244
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
777
|
-
model = models.
|
1245
|
+
model = models.CreateJWKSAuthenticatorRequest()
|
778
1246
|
model.from_json_string(json.dumps(args))
|
779
1247
|
start_time = time.time()
|
780
1248
|
while True:
|
781
|
-
rsp = client.
|
1249
|
+
rsp = client.CreateJWKSAuthenticator(model)
|
782
1250
|
result = rsp.to_json_string()
|
783
1251
|
try:
|
784
1252
|
json_obj = json.loads(result)
|
@@ -797,7 +1265,7 @@ def doRevokedDeviceCertificate(args, parsed_globals):
|
|
797
1265
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
1266
|
|
799
1267
|
|
800
|
-
def
|
1268
|
+
def doModifyUser(args, parsed_globals):
|
801
1269
|
g_param = parse_global_arg(parsed_globals)
|
802
1270
|
|
803
1271
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -826,11 +1294,11 @@ def doDescribeInstance(args, parsed_globals):
|
|
826
1294
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
827
1295
|
client._sdkVersion += ("_CLI_" + __version__)
|
828
1296
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
-
model = models.
|
1297
|
+
model = models.ModifyUserRequest()
|
830
1298
|
model.from_json_string(json.dumps(args))
|
831
1299
|
start_time = time.time()
|
832
1300
|
while True:
|
833
|
-
rsp = client.
|
1301
|
+
rsp = client.ModifyUser(model)
|
834
1302
|
result = rsp.to_json_string()
|
835
1303
|
try:
|
836
1304
|
json_obj = json.loads(result)
|
@@ -849,7 +1317,7 @@ def doDescribeInstance(args, parsed_globals):
|
|
849
1317
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
1318
|
|
851
1319
|
|
852
|
-
def
|
1320
|
+
def doDescribeInstanceList(args, parsed_globals):
|
853
1321
|
g_param = parse_global_arg(parsed_globals)
|
854
1322
|
|
855
1323
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -878,11 +1346,11 @@ def doDescribeTopicList(args, parsed_globals):
|
|
878
1346
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
879
1347
|
client._sdkVersion += ("_CLI_" + __version__)
|
880
1348
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
-
model = models.
|
1349
|
+
model = models.DescribeInstanceListRequest()
|
882
1350
|
model.from_json_string(json.dumps(args))
|
883
1351
|
start_time = time.time()
|
884
1352
|
while True:
|
885
|
-
rsp = client.
|
1353
|
+
rsp = client.DescribeInstanceList(model)
|
886
1354
|
result = rsp.to_json_string()
|
887
1355
|
try:
|
888
1356
|
json_obj = json.loads(result)
|
@@ -901,7 +1369,7 @@ def doDescribeTopicList(args, parsed_globals):
|
|
901
1369
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
1370
|
|
903
1371
|
|
904
|
-
def
|
1372
|
+
def doModifyAuthorizationPolicy(args, parsed_globals):
|
905
1373
|
g_param = parse_global_arg(parsed_globals)
|
906
1374
|
|
907
1375
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -930,11 +1398,11 @@ def doCreateJWKSAuthenticator(args, parsed_globals):
|
|
930
1398
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
931
1399
|
client._sdkVersion += ("_CLI_" + __version__)
|
932
1400
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
-
model = models.
|
1401
|
+
model = models.ModifyAuthorizationPolicyRequest()
|
934
1402
|
model.from_json_string(json.dumps(args))
|
935
1403
|
start_time = time.time()
|
936
1404
|
while True:
|
937
|
-
rsp = client.
|
1405
|
+
rsp = client.ModifyAuthorizationPolicy(model)
|
938
1406
|
result = rsp.to_json_string()
|
939
1407
|
try:
|
940
1408
|
json_obj = json.loads(result)
|
@@ -953,7 +1421,7 @@ def doCreateJWKSAuthenticator(args, parsed_globals):
|
|
953
1421
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
954
1422
|
|
955
1423
|
|
956
|
-
def
|
1424
|
+
def doDeleteAuthorizationPolicy(args, parsed_globals):
|
957
1425
|
g_param = parse_global_arg(parsed_globals)
|
958
1426
|
|
959
1427
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -982,11 +1450,11 @@ def doModifyAuthorizationPolicy(args, parsed_globals):
|
|
982
1450
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
983
1451
|
client._sdkVersion += ("_CLI_" + __version__)
|
984
1452
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
-
model = models.
|
1453
|
+
model = models.DeleteAuthorizationPolicyRequest()
|
986
1454
|
model.from_json_string(json.dumps(args))
|
987
1455
|
start_time = time.time()
|
988
1456
|
while True:
|
989
|
-
rsp = client.
|
1457
|
+
rsp = client.DeleteAuthorizationPolicy(model)
|
990
1458
|
result = rsp.to_json_string()
|
991
1459
|
try:
|
992
1460
|
json_obj = json.loads(result)
|
@@ -1005,7 +1473,7 @@ def doModifyAuthorizationPolicy(args, parsed_globals):
|
|
1005
1473
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
1474
|
|
1007
1475
|
|
1008
|
-
def
|
1476
|
+
def doDescribeTopic(args, parsed_globals):
|
1009
1477
|
g_param = parse_global_arg(parsed_globals)
|
1010
1478
|
|
1011
1479
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1034,11 +1502,11 @@ def doDeleteAuthorizationPolicy(args, parsed_globals):
|
|
1034
1502
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
1503
|
client._sdkVersion += ("_CLI_" + __version__)
|
1036
1504
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
-
model = models.
|
1505
|
+
model = models.DescribeTopicRequest()
|
1038
1506
|
model.from_json_string(json.dumps(args))
|
1039
1507
|
start_time = time.time()
|
1040
1508
|
while True:
|
1041
|
-
rsp = client.
|
1509
|
+
rsp = client.DescribeTopic(model)
|
1042
1510
|
result = rsp.to_json_string()
|
1043
1511
|
try:
|
1044
1512
|
json_obj = json.loads(result)
|
@@ -1057,7 +1525,7 @@ def doDeleteAuthorizationPolicy(args, parsed_globals):
|
|
1057
1525
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
1526
|
|
1059
1527
|
|
1060
|
-
def
|
1528
|
+
def doModifyInsPublicEndpoint(args, parsed_globals):
|
1061
1529
|
g_param = parse_global_arg(parsed_globals)
|
1062
1530
|
|
1063
1531
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1086,11 +1554,11 @@ def doDescribeTopic(args, parsed_globals):
|
|
1086
1554
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
1555
|
client._sdkVersion += ("_CLI_" + __version__)
|
1088
1556
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
-
model = models.
|
1557
|
+
model = models.ModifyInsPublicEndpointRequest()
|
1090
1558
|
model.from_json_string(json.dumps(args))
|
1091
1559
|
start_time = time.time()
|
1092
1560
|
while True:
|
1093
|
-
rsp = client.
|
1561
|
+
rsp = client.ModifyInsPublicEndpoint(model)
|
1094
1562
|
result = rsp.to_json_string()
|
1095
1563
|
try:
|
1096
1564
|
json_obj = json.loads(result)
|
@@ -1109,7 +1577,7 @@ def doDescribeTopic(args, parsed_globals):
|
|
1109
1577
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1110
1578
|
|
1111
1579
|
|
1112
|
-
def
|
1580
|
+
def doUpdateAuthorizationPolicyPriority(args, parsed_globals):
|
1113
1581
|
g_param = parse_global_arg(parsed_globals)
|
1114
1582
|
|
1115
1583
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1138,11 +1606,11 @@ def doDescribeAuthenticator(args, parsed_globals):
|
|
1138
1606
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1139
1607
|
client._sdkVersion += ("_CLI_" + __version__)
|
1140
1608
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1141
|
-
model = models.
|
1609
|
+
model = models.UpdateAuthorizationPolicyPriorityRequest()
|
1142
1610
|
model.from_json_string(json.dumps(args))
|
1143
1611
|
start_time = time.time()
|
1144
1612
|
while True:
|
1145
|
-
rsp = client.
|
1613
|
+
rsp = client.UpdateAuthorizationPolicyPriority(model)
|
1146
1614
|
result = rsp.to_json_string()
|
1147
1615
|
try:
|
1148
1616
|
json_obj = json.loads(result)
|
@@ -1161,7 +1629,7 @@ def doDescribeAuthenticator(args, parsed_globals):
|
|
1161
1629
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1162
1630
|
|
1163
1631
|
|
1164
|
-
def
|
1632
|
+
def doCreateUser(args, parsed_globals):
|
1165
1633
|
g_param = parse_global_arg(parsed_globals)
|
1166
1634
|
|
1167
1635
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1190,11 +1658,11 @@ def doUpdateAuthorizationPolicyPriority(args, parsed_globals):
|
|
1190
1658
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1191
1659
|
client._sdkVersion += ("_CLI_" + __version__)
|
1192
1660
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1193
|
-
model = models.
|
1661
|
+
model = models.CreateUserRequest()
|
1194
1662
|
model.from_json_string(json.dumps(args))
|
1195
1663
|
start_time = time.time()
|
1196
1664
|
while True:
|
1197
|
-
rsp = client.
|
1665
|
+
rsp = client.CreateUser(model)
|
1198
1666
|
result = rsp.to_json_string()
|
1199
1667
|
try:
|
1200
1668
|
json_obj = json.loads(result)
|
@@ -1213,7 +1681,7 @@ def doUpdateAuthorizationPolicyPriority(args, parsed_globals):
|
|
1213
1681
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
1682
|
|
1215
1683
|
|
1216
|
-
def
|
1684
|
+
def doCreateInstance(args, parsed_globals):
|
1217
1685
|
g_param = parse_global_arg(parsed_globals)
|
1218
1686
|
|
1219
1687
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1242,11 +1710,63 @@ def doDeleteTopic(args, parsed_globals):
|
|
1242
1710
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1243
1711
|
client._sdkVersion += ("_CLI_" + __version__)
|
1244
1712
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1245
|
-
model = models.
|
1713
|
+
model = models.CreateInstanceRequest()
|
1246
1714
|
model.from_json_string(json.dumps(args))
|
1247
1715
|
start_time = time.time()
|
1248
1716
|
while True:
|
1249
|
-
rsp = client.
|
1717
|
+
rsp = client.CreateInstance(model)
|
1718
|
+
result = rsp.to_json_string()
|
1719
|
+
try:
|
1720
|
+
json_obj = json.loads(result)
|
1721
|
+
except TypeError as e:
|
1722
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1723
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1724
|
+
break
|
1725
|
+
cur_time = time.time()
|
1726
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1727
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1728
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1729
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1730
|
+
else:
|
1731
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1732
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1733
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1734
|
+
|
1735
|
+
|
1736
|
+
def doDescribeTopicList(args, parsed_globals):
|
1737
|
+
g_param = parse_global_arg(parsed_globals)
|
1738
|
+
|
1739
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1740
|
+
cred = credential.CVMRoleCredential()
|
1741
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1742
|
+
cred = credential.STSAssumeRoleCredential(
|
1743
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1744
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1745
|
+
)
|
1746
|
+
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):
|
1747
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1748
|
+
else:
|
1749
|
+
cred = credential.Credential(
|
1750
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1751
|
+
)
|
1752
|
+
http_profile = HttpProfile(
|
1753
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1754
|
+
reqMethod="POST",
|
1755
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1756
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1757
|
+
)
|
1758
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1759
|
+
if g_param[OptionsDefine.Language]:
|
1760
|
+
profile.language = g_param[OptionsDefine.Language]
|
1761
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1762
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1763
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1764
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1765
|
+
model = models.DescribeTopicListRequest()
|
1766
|
+
model.from_json_string(json.dumps(args))
|
1767
|
+
start_time = time.time()
|
1768
|
+
while True:
|
1769
|
+
rsp = client.DescribeTopicList(model)
|
1250
1770
|
result = rsp.to_json_string()
|
1251
1771
|
try:
|
1252
1772
|
json_obj = json.loads(result)
|
@@ -1317,6 +1837,58 @@ def doCreateAuthorizationPolicy(args, parsed_globals):
|
|
1317
1837
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1318
1838
|
|
1319
1839
|
|
1840
|
+
def doModifyInstance(args, parsed_globals):
|
1841
|
+
g_param = parse_global_arg(parsed_globals)
|
1842
|
+
|
1843
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1844
|
+
cred = credential.CVMRoleCredential()
|
1845
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1846
|
+
cred = credential.STSAssumeRoleCredential(
|
1847
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1848
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1849
|
+
)
|
1850
|
+
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):
|
1851
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1852
|
+
else:
|
1853
|
+
cred = credential.Credential(
|
1854
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1855
|
+
)
|
1856
|
+
http_profile = HttpProfile(
|
1857
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1858
|
+
reqMethod="POST",
|
1859
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1860
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1861
|
+
)
|
1862
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1863
|
+
if g_param[OptionsDefine.Language]:
|
1864
|
+
profile.language = g_param[OptionsDefine.Language]
|
1865
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1866
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1867
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1868
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1869
|
+
model = models.ModifyInstanceRequest()
|
1870
|
+
model.from_json_string(json.dumps(args))
|
1871
|
+
start_time = time.time()
|
1872
|
+
while True:
|
1873
|
+
rsp = client.ModifyInstance(model)
|
1874
|
+
result = rsp.to_json_string()
|
1875
|
+
try:
|
1876
|
+
json_obj = json.loads(result)
|
1877
|
+
except TypeError as e:
|
1878
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1879
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1880
|
+
break
|
1881
|
+
cur_time = time.time()
|
1882
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1883
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1884
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1885
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1886
|
+
else:
|
1887
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1888
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1889
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1890
|
+
|
1891
|
+
|
1320
1892
|
CLIENT_MAP = {
|
1321
1893
|
"v20240516": mqtt_client_v20240516,
|
1322
1894
|
|
@@ -1328,31 +1900,42 @@ MODELS_MAP = {
|
|
1328
1900
|
}
|
1329
1901
|
|
1330
1902
|
ACTION_MAP = {
|
1903
|
+
"DescribeUserList": doDescribeUserList,
|
1904
|
+
"CreateInsPublicEndpoint": doCreateInsPublicEndpoint,
|
1331
1905
|
"ModifyTopic": doModifyTopic,
|
1332
1906
|
"DeactivateDeviceCertificate": doDeactivateDeviceCertificate,
|
1333
1907
|
"DeleteAuthenticator": doDeleteAuthenticator,
|
1334
1908
|
"CreateJWTAuthenticator": doCreateJWTAuthenticator,
|
1335
1909
|
"ActivateDeviceCertificate": doActivateDeviceCertificate,
|
1336
|
-
"
|
1910
|
+
"DeleteInstance": doDeleteInstance,
|
1337
1911
|
"ModifyJWTAuthenticator": doModifyJWTAuthenticator,
|
1338
1912
|
"DescribeAuthorizationPolicies": doDescribeAuthorizationPolicies,
|
1913
|
+
"DescribeInsPublicEndpoints": doDescribeInsPublicEndpoints,
|
1914
|
+
"DescribeAuthenticator": doDescribeAuthenticator,
|
1339
1915
|
"RegisterDeviceCertificate": doRegisterDeviceCertificate,
|
1340
1916
|
"DescribeDeviceCertificates": doDescribeDeviceCertificates,
|
1917
|
+
"DeleteUser": doDeleteUser,
|
1341
1918
|
"CreateTopic": doCreateTopic,
|
1342
1919
|
"DeleteDeviceCertificate": doDeleteDeviceCertificate,
|
1343
1920
|
"ModifyJWKSAuthenticator": doModifyJWKSAuthenticator,
|
1921
|
+
"DeleteInsPublicEndpoint": doDeleteInsPublicEndpoint,
|
1344
1922
|
"DescribeDeviceCertificate": doDescribeDeviceCertificate,
|
1345
1923
|
"RevokedDeviceCertificate": doRevokedDeviceCertificate,
|
1346
1924
|
"DescribeInstance": doDescribeInstance,
|
1347
|
-
"
|
1925
|
+
"DeleteTopic": doDeleteTopic,
|
1348
1926
|
"CreateJWKSAuthenticator": doCreateJWKSAuthenticator,
|
1927
|
+
"ModifyUser": doModifyUser,
|
1928
|
+
"DescribeInstanceList": doDescribeInstanceList,
|
1349
1929
|
"ModifyAuthorizationPolicy": doModifyAuthorizationPolicy,
|
1350
1930
|
"DeleteAuthorizationPolicy": doDeleteAuthorizationPolicy,
|
1351
1931
|
"DescribeTopic": doDescribeTopic,
|
1352
|
-
"
|
1932
|
+
"ModifyInsPublicEndpoint": doModifyInsPublicEndpoint,
|
1353
1933
|
"UpdateAuthorizationPolicyPriority": doUpdateAuthorizationPolicyPriority,
|
1354
|
-
"
|
1934
|
+
"CreateUser": doCreateUser,
|
1935
|
+
"CreateInstance": doCreateInstance,
|
1936
|
+
"DescribeTopicList": doDescribeTopicList,
|
1355
1937
|
"CreateAuthorizationPolicy": doCreateAuthorizationPolicy,
|
1938
|
+
"ModifyInstance": doModifyInstance,
|
1356
1939
|
|
1357
1940
|
}
|
1358
1941
|
|