tccli 3.0.1268.1__py2.py3-none-any.whl → 3.0.1269.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/__init__.py +5 -1
- tccli/services/aiart/aiart_client.py +106 -0
- tccli/services/aiart/v20221229/api.json +275 -0
- tccli/services/aiart/v20221229/examples.json +16 -0
- tccli/services/billing/billing_client.py +4 -163
- tccli/services/billing/v20180709/api.json +0 -489
- tccli/services/billing/v20180709/examples.json +0 -24
- tccli/services/cat/v20180409/api.json +3 -1
- tccli/services/cbs/v20170312/api.json +9 -0
- tccli/services/ccc/v20200210/api.json +11 -11
- tccli/services/ccc/v20200210/examples.json +2 -2
- tccli/services/cdb/v20170320/api.json +48 -18
- tccli/services/cfw/v20190904/api.json +30 -30
- tccli/services/ckafka/v20190819/api.json +10 -0
- tccli/services/csip/v20221121/api.json +38 -38
- tccli/services/cwp/cwp_client.py +4 -57
- tccli/services/cwp/v20180228/api.json +0 -184
- tccli/services/cwp/v20180228/examples.json +0 -8
- tccli/services/cynosdb/v20190107/api.json +1 -1
- tccli/services/cynosdb/v20190107/examples.json +1 -1
- tccli/services/dcdb/dcdb_client.py +122 -16
- tccli/services/dcdb/v20180411/api.json +222 -0
- tccli/services/dcdb/v20180411/examples.json +16 -0
- tccli/services/dlc/v20210125/api.json +145 -26
- tccli/services/dlc/v20210125/examples.json +18 -18
- tccli/services/domain/v20180808/api.json +8 -8
- tccli/services/domain/v20180808/examples.json +3 -3
- tccli/services/es/v20180416/api.json +9 -9
- tccli/services/ess/v20201111/api.json +1 -1
- tccli/services/essbasic/v20210526/api.json +3 -3
- tccli/services/essbasic/v20210526/examples.json +2 -2
- tccli/services/facefusion/v20220927/api.json +4 -4
- tccli/services/faceid/v20180301/api.json +5 -5
- tccli/services/faceid/v20180301/examples.json +6 -0
- tccli/services/gme/v20180711/api.json +118 -115
- tccli/services/gme/v20180711/examples.json +6 -6
- tccli/services/hunyuan/v20230901/api.json +9 -0
- tccli/services/iotexplorer/v20190423/api.json +4 -4
- tccli/services/iotexplorer/v20190423/examples.json +5 -5
- tccli/services/keewidb/v20220308/api.json +2 -2
- tccli/services/lcic/v20220817/api.json +177 -177
- tccli/services/lcic/v20220817/examples.json +2 -2
- tccli/services/lighthouse/v20200324/api.json +76 -67
- tccli/services/live/v20180801/api.json +1 -1
- tccli/services/lke/v20231130/api.json +31 -0
- tccli/services/lkeap/v20240522/api.json +55 -9
- tccli/services/lkeap/v20240522/examples.json +1 -1
- tccli/services/mna/mna_client.py +106 -0
- tccli/services/mna/v20210119/api.json +246 -0
- tccli/services/mna/v20210119/examples.json +16 -0
- tccli/services/monitor/monitor_client.py +62 -57
- tccli/services/monitor/v20230616/api.json +266 -0
- tccli/services/monitor/v20230616/examples.json +19 -0
- tccli/services/mqtt/mqtt_client.py +489 -12
- tccli/services/mqtt/v20240516/api.json +864 -3
- tccli/services/mqtt/v20240516/examples.json +72 -0
- tccli/services/ocr/ocr_client.py +53 -0
- tccli/services/ocr/v20181119/api.json +246 -1
- tccli/services/ocr/v20181119/examples.json +8 -0
- tccli/services/postgres/postgres_client.py +334 -16
- tccli/services/postgres/v20170312/api.json +717 -34
- tccli/services/postgres/v20170312/examples.json +72 -0
- tccli/services/ssl/v20191205/api.json +496 -493
- tccli/services/ssl/v20191205/examples.json +144 -24
- tccli/services/taf/taf_client.py +0 -159
- tccli/services/taf/v20200210/api.json +0 -665
- tccli/services/taf/v20200210/examples.json +0 -24
- tccli/services/teo/v20220901/api.json +2 -2
- tccli/services/tione/v20211111/api.json +14 -3
- tccli/services/trabbit/__init__.py +4 -0
- tccli/services/trabbit/trabbit_client.py +1691 -0
- tccli/services/trabbit/v20230418/api.json +4773 -0
- tccli/services/trabbit/v20230418/examples.json +237 -0
- tccli/services/trtc/v20190722/api.json +8 -8
- tccli/services/trtc/v20190722/examples.json +2 -2
- tccli/services/vclm/v20240523/api.json +0 -450
- tccli/services/vclm/v20240523/examples.json +0 -48
- tccli/services/vclm/vclm_client.py +0 -159
- tccli/services/wedata/v20210820/api.json +211 -33
- tccli/services/wedata/v20210820/examples.json +14 -0
- tccli/services/wedata/wedata_client.py +53 -0
- {tccli-3.0.1268.1.dist-info → tccli-3.0.1269.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1268.1.dist-info → tccli-3.0.1269.1.dist-info}/RECORD +87 -81
- {tccli-3.0.1268.1.dist-info → tccli-3.0.1269.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1268.1.dist-info → tccli-3.0.1269.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1268.1.dist-info → tccli-3.0.1269.1.dist-info}/license_files/LICENSE +0 -0
@@ -173,6 +173,58 @@ def doModifyTopic(args, parsed_globals):
|
|
173
173
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
174
|
|
175
175
|
|
176
|
+
def doDeleteCaCertificate(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.DeleteCaCertificateRequest()
|
206
|
+
model.from_json_string(json.dumps(args))
|
207
|
+
start_time = time.time()
|
208
|
+
while True:
|
209
|
+
rsp = client.DeleteCaCertificate(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
|
+
|
176
228
|
def doDeactivateDeviceCertificate(args, parsed_globals):
|
177
229
|
g_param = parse_global_arg(parsed_globals)
|
178
230
|
|
@@ -277,6 +329,58 @@ def doDeleteAuthenticator(args, parsed_globals):
|
|
277
329
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
330
|
|
279
331
|
|
332
|
+
def doDeactivateCaCertificate(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.DeactivateCaCertificateRequest()
|
362
|
+
model.from_json_string(json.dumps(args))
|
363
|
+
start_time = time.time()
|
364
|
+
while True:
|
365
|
+
rsp = client.DeactivateCaCertificate(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
|
+
|
280
384
|
def doCreateJWTAuthenticator(args, parsed_globals):
|
281
385
|
g_param = parse_global_arg(parsed_globals)
|
282
386
|
|
@@ -485,7 +589,7 @@ def doModifyJWTAuthenticator(args, parsed_globals):
|
|
485
589
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
486
590
|
|
487
591
|
|
488
|
-
def
|
592
|
+
def doDescribeDeviceCertificates(args, parsed_globals):
|
489
593
|
g_param = parse_global_arg(parsed_globals)
|
490
594
|
|
491
595
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -514,11 +618,11 @@ def doDescribeAuthorizationPolicies(args, parsed_globals):
|
|
514
618
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
515
619
|
client._sdkVersion += ("_CLI_" + __version__)
|
516
620
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
517
|
-
model = models.
|
621
|
+
model = models.DescribeDeviceCertificatesRequest()
|
518
622
|
model.from_json_string(json.dumps(args))
|
519
623
|
start_time = time.time()
|
520
624
|
while True:
|
521
|
-
rsp = client.
|
625
|
+
rsp = client.DescribeDeviceCertificates(model)
|
522
626
|
result = rsp.to_json_string()
|
523
627
|
try:
|
524
628
|
json_obj = json.loads(result)
|
@@ -693,7 +797,7 @@ def doRegisterDeviceCertificate(args, parsed_globals):
|
|
693
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
798
|
|
695
799
|
|
696
|
-
def
|
800
|
+
def doModifyInstanceCertBinding(args, parsed_globals):
|
697
801
|
g_param = parse_global_arg(parsed_globals)
|
698
802
|
|
699
803
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -722,11 +826,11 @@ def doDescribeDeviceCertificates(args, parsed_globals):
|
|
722
826
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
723
827
|
client._sdkVersion += ("_CLI_" + __version__)
|
724
828
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
-
model = models.
|
829
|
+
model = models.ModifyInstanceCertBindingRequest()
|
726
830
|
model.from_json_string(json.dumps(args))
|
727
831
|
start_time = time.time()
|
728
832
|
while True:
|
729
|
-
rsp = client.
|
833
|
+
rsp = client.ModifyInstanceCertBinding(model)
|
730
834
|
result = rsp.to_json_string()
|
731
835
|
try:
|
732
836
|
json_obj = json.loads(result)
|
@@ -745,7 +849,7 @@ def doDescribeDeviceCertificates(args, parsed_globals):
|
|
745
849
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
746
850
|
|
747
851
|
|
748
|
-
def
|
852
|
+
def doApplyRegistrationCode(args, parsed_globals):
|
749
853
|
g_param = parse_global_arg(parsed_globals)
|
750
854
|
|
751
855
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -774,11 +878,167 @@ def doDeleteUser(args, parsed_globals):
|
|
774
878
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
775
879
|
client._sdkVersion += ("_CLI_" + __version__)
|
776
880
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
777
|
-
model = models.
|
881
|
+
model = models.ApplyRegistrationCodeRequest()
|
778
882
|
model.from_json_string(json.dumps(args))
|
779
883
|
start_time = time.time()
|
780
884
|
while True:
|
781
|
-
rsp = client.
|
885
|
+
rsp = client.ApplyRegistrationCode(model)
|
886
|
+
result = rsp.to_json_string()
|
887
|
+
try:
|
888
|
+
json_obj = json.loads(result)
|
889
|
+
except TypeError as e:
|
890
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
891
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
892
|
+
break
|
893
|
+
cur_time = time.time()
|
894
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
895
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
896
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
897
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
898
|
+
else:
|
899
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
900
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
901
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
|
+
|
903
|
+
|
904
|
+
def doDescribeProductSKUList(args, parsed_globals):
|
905
|
+
g_param = parse_global_arg(parsed_globals)
|
906
|
+
|
907
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
908
|
+
cred = credential.CVMRoleCredential()
|
909
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
910
|
+
cred = credential.STSAssumeRoleCredential(
|
911
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
912
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
913
|
+
)
|
914
|
+
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):
|
915
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
916
|
+
else:
|
917
|
+
cred = credential.Credential(
|
918
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
919
|
+
)
|
920
|
+
http_profile = HttpProfile(
|
921
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
922
|
+
reqMethod="POST",
|
923
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
924
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
925
|
+
)
|
926
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
927
|
+
if g_param[OptionsDefine.Language]:
|
928
|
+
profile.language = g_param[OptionsDefine.Language]
|
929
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
930
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
931
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
932
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
+
model = models.DescribeProductSKUListRequest()
|
934
|
+
model.from_json_string(json.dumps(args))
|
935
|
+
start_time = time.time()
|
936
|
+
while True:
|
937
|
+
rsp = client.DescribeProductSKUList(model)
|
938
|
+
result = rsp.to_json_string()
|
939
|
+
try:
|
940
|
+
json_obj = json.loads(result)
|
941
|
+
except TypeError as e:
|
942
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
943
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
944
|
+
break
|
945
|
+
cur_time = time.time()
|
946
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
947
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
948
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
949
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
950
|
+
else:
|
951
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
952
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
953
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
954
|
+
|
955
|
+
|
956
|
+
def doDescribeCaCertificates(args, parsed_globals):
|
957
|
+
g_param = parse_global_arg(parsed_globals)
|
958
|
+
|
959
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
960
|
+
cred = credential.CVMRoleCredential()
|
961
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
962
|
+
cred = credential.STSAssumeRoleCredential(
|
963
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
964
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
965
|
+
)
|
966
|
+
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):
|
967
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
968
|
+
else:
|
969
|
+
cred = credential.Credential(
|
970
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
971
|
+
)
|
972
|
+
http_profile = HttpProfile(
|
973
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
974
|
+
reqMethod="POST",
|
975
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
976
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
977
|
+
)
|
978
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
979
|
+
if g_param[OptionsDefine.Language]:
|
980
|
+
profile.language = g_param[OptionsDefine.Language]
|
981
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
982
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
983
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
984
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
+
model = models.DescribeCaCertificatesRequest()
|
986
|
+
model.from_json_string(json.dumps(args))
|
987
|
+
start_time = time.time()
|
988
|
+
while True:
|
989
|
+
rsp = client.DescribeCaCertificates(model)
|
990
|
+
result = rsp.to_json_string()
|
991
|
+
try:
|
992
|
+
json_obj = json.loads(result)
|
993
|
+
except TypeError as e:
|
994
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
995
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
996
|
+
break
|
997
|
+
cur_time = time.time()
|
998
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
999
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1000
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1001
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1002
|
+
else:
|
1003
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1004
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1005
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
|
+
|
1007
|
+
|
1008
|
+
def doActivateCaCertificate(args, parsed_globals):
|
1009
|
+
g_param = parse_global_arg(parsed_globals)
|
1010
|
+
|
1011
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1012
|
+
cred = credential.CVMRoleCredential()
|
1013
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1014
|
+
cred = credential.STSAssumeRoleCredential(
|
1015
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1016
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1017
|
+
)
|
1018
|
+
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):
|
1019
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1020
|
+
else:
|
1021
|
+
cred = credential.Credential(
|
1022
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1023
|
+
)
|
1024
|
+
http_profile = HttpProfile(
|
1025
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1026
|
+
reqMethod="POST",
|
1027
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1028
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1029
|
+
)
|
1030
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1031
|
+
if g_param[OptionsDefine.Language]:
|
1032
|
+
profile.language = g_param[OptionsDefine.Language]
|
1033
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1034
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1036
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
+
model = models.ActivateCaCertificateRequest()
|
1038
|
+
model.from_json_string(json.dumps(args))
|
1039
|
+
start_time = time.time()
|
1040
|
+
while True:
|
1041
|
+
rsp = client.ActivateCaCertificate(model)
|
782
1042
|
result = rsp.to_json_string()
|
783
1043
|
try:
|
784
1044
|
json_obj = json.loads(result)
|
@@ -1213,6 +1473,110 @@ def doDeleteTopic(args, parsed_globals):
|
|
1213
1473
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
1474
|
|
1215
1475
|
|
1476
|
+
def doDeleteUser(args, parsed_globals):
|
1477
|
+
g_param = parse_global_arg(parsed_globals)
|
1478
|
+
|
1479
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1480
|
+
cred = credential.CVMRoleCredential()
|
1481
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1482
|
+
cred = credential.STSAssumeRoleCredential(
|
1483
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1484
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1485
|
+
)
|
1486
|
+
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):
|
1487
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1488
|
+
else:
|
1489
|
+
cred = credential.Credential(
|
1490
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1491
|
+
)
|
1492
|
+
http_profile = HttpProfile(
|
1493
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1494
|
+
reqMethod="POST",
|
1495
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1496
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1497
|
+
)
|
1498
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1499
|
+
if g_param[OptionsDefine.Language]:
|
1500
|
+
profile.language = g_param[OptionsDefine.Language]
|
1501
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1502
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1503
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1504
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1505
|
+
model = models.DeleteUserRequest()
|
1506
|
+
model.from_json_string(json.dumps(args))
|
1507
|
+
start_time = time.time()
|
1508
|
+
while True:
|
1509
|
+
rsp = client.DeleteUser(model)
|
1510
|
+
result = rsp.to_json_string()
|
1511
|
+
try:
|
1512
|
+
json_obj = json.loads(result)
|
1513
|
+
except TypeError as e:
|
1514
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1515
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1516
|
+
break
|
1517
|
+
cur_time = time.time()
|
1518
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1519
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1520
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1521
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1522
|
+
else:
|
1523
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1524
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1525
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1526
|
+
|
1527
|
+
|
1528
|
+
def doDescribeCaCertificate(args, parsed_globals):
|
1529
|
+
g_param = parse_global_arg(parsed_globals)
|
1530
|
+
|
1531
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1532
|
+
cred = credential.CVMRoleCredential()
|
1533
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1534
|
+
cred = credential.STSAssumeRoleCredential(
|
1535
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1536
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1537
|
+
)
|
1538
|
+
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):
|
1539
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1540
|
+
else:
|
1541
|
+
cred = credential.Credential(
|
1542
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1543
|
+
)
|
1544
|
+
http_profile = HttpProfile(
|
1545
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1546
|
+
reqMethod="POST",
|
1547
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1548
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1549
|
+
)
|
1550
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1551
|
+
if g_param[OptionsDefine.Language]:
|
1552
|
+
profile.language = g_param[OptionsDefine.Language]
|
1553
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1554
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1555
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1556
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1557
|
+
model = models.DescribeCaCertificateRequest()
|
1558
|
+
model.from_json_string(json.dumps(args))
|
1559
|
+
start_time = time.time()
|
1560
|
+
while True:
|
1561
|
+
rsp = client.DescribeCaCertificate(model)
|
1562
|
+
result = rsp.to_json_string()
|
1563
|
+
try:
|
1564
|
+
json_obj = json.loads(result)
|
1565
|
+
except TypeError as e:
|
1566
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1567
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1568
|
+
break
|
1569
|
+
cur_time = time.time()
|
1570
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1571
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1572
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1573
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1574
|
+
else:
|
1575
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1576
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1577
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1578
|
+
|
1579
|
+
|
1216
1580
|
def doCreateJWKSAuthenticator(args, parsed_globals):
|
1217
1581
|
g_param = parse_global_arg(parsed_globals)
|
1218
1582
|
|
@@ -1525,6 +1889,58 @@ def doDescribeTopic(args, parsed_globals):
|
|
1525
1889
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1526
1890
|
|
1527
1891
|
|
1892
|
+
def doRegisterCaCertificate(args, parsed_globals):
|
1893
|
+
g_param = parse_global_arg(parsed_globals)
|
1894
|
+
|
1895
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1896
|
+
cred = credential.CVMRoleCredential()
|
1897
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1898
|
+
cred = credential.STSAssumeRoleCredential(
|
1899
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1900
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1901
|
+
)
|
1902
|
+
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):
|
1903
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1904
|
+
else:
|
1905
|
+
cred = credential.Credential(
|
1906
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1907
|
+
)
|
1908
|
+
http_profile = HttpProfile(
|
1909
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1910
|
+
reqMethod="POST",
|
1911
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1912
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1913
|
+
)
|
1914
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1915
|
+
if g_param[OptionsDefine.Language]:
|
1916
|
+
profile.language = g_param[OptionsDefine.Language]
|
1917
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1918
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1919
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1920
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1921
|
+
model = models.RegisterCaCertificateRequest()
|
1922
|
+
model.from_json_string(json.dumps(args))
|
1923
|
+
start_time = time.time()
|
1924
|
+
while True:
|
1925
|
+
rsp = client.RegisterCaCertificate(model)
|
1926
|
+
result = rsp.to_json_string()
|
1927
|
+
try:
|
1928
|
+
json_obj = json.loads(result)
|
1929
|
+
except TypeError as e:
|
1930
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1931
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1932
|
+
break
|
1933
|
+
cur_time = time.time()
|
1934
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1935
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1936
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1937
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1938
|
+
else:
|
1939
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1940
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1941
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1942
|
+
|
1943
|
+
|
1528
1944
|
def doModifyInsPublicEndpoint(args, parsed_globals):
|
1529
1945
|
g_param = parse_global_arg(parsed_globals)
|
1530
1946
|
|
@@ -1629,6 +2045,58 @@ def doUpdateAuthorizationPolicyPriority(args, parsed_globals):
|
|
1629
2045
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1630
2046
|
|
1631
2047
|
|
2048
|
+
def doDescribeAuthorizationPolicies(args, parsed_globals):
|
2049
|
+
g_param = parse_global_arg(parsed_globals)
|
2050
|
+
|
2051
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2052
|
+
cred = credential.CVMRoleCredential()
|
2053
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2054
|
+
cred = credential.STSAssumeRoleCredential(
|
2055
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2056
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2057
|
+
)
|
2058
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
2059
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2060
|
+
else:
|
2061
|
+
cred = credential.Credential(
|
2062
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2063
|
+
)
|
2064
|
+
http_profile = HttpProfile(
|
2065
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2066
|
+
reqMethod="POST",
|
2067
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2068
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2069
|
+
)
|
2070
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2071
|
+
if g_param[OptionsDefine.Language]:
|
2072
|
+
profile.language = g_param[OptionsDefine.Language]
|
2073
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2074
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
2075
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2076
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2077
|
+
model = models.DescribeAuthorizationPoliciesRequest()
|
2078
|
+
model.from_json_string(json.dumps(args))
|
2079
|
+
start_time = time.time()
|
2080
|
+
while True:
|
2081
|
+
rsp = client.DescribeAuthorizationPolicies(model)
|
2082
|
+
result = rsp.to_json_string()
|
2083
|
+
try:
|
2084
|
+
json_obj = json.loads(result)
|
2085
|
+
except TypeError as e:
|
2086
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2087
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2088
|
+
break
|
2089
|
+
cur_time = time.time()
|
2090
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2091
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2092
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2093
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2094
|
+
else:
|
2095
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2096
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2097
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2098
|
+
|
2099
|
+
|
1632
2100
|
def doCreateUser(args, parsed_globals):
|
1633
2101
|
g_param = parse_global_arg(parsed_globals)
|
1634
2102
|
|
@@ -1903,18 +2371,23 @@ ACTION_MAP = {
|
|
1903
2371
|
"DescribeUserList": doDescribeUserList,
|
1904
2372
|
"CreateInsPublicEndpoint": doCreateInsPublicEndpoint,
|
1905
2373
|
"ModifyTopic": doModifyTopic,
|
2374
|
+
"DeleteCaCertificate": doDeleteCaCertificate,
|
1906
2375
|
"DeactivateDeviceCertificate": doDeactivateDeviceCertificate,
|
1907
2376
|
"DeleteAuthenticator": doDeleteAuthenticator,
|
2377
|
+
"DeactivateCaCertificate": doDeactivateCaCertificate,
|
1908
2378
|
"CreateJWTAuthenticator": doCreateJWTAuthenticator,
|
1909
2379
|
"ActivateDeviceCertificate": doActivateDeviceCertificate,
|
1910
2380
|
"DeleteInstance": doDeleteInstance,
|
1911
2381
|
"ModifyJWTAuthenticator": doModifyJWTAuthenticator,
|
1912
|
-
"
|
2382
|
+
"DescribeDeviceCertificates": doDescribeDeviceCertificates,
|
1913
2383
|
"DescribeInsPublicEndpoints": doDescribeInsPublicEndpoints,
|
1914
2384
|
"DescribeAuthenticator": doDescribeAuthenticator,
|
1915
2385
|
"RegisterDeviceCertificate": doRegisterDeviceCertificate,
|
1916
|
-
"
|
1917
|
-
"
|
2386
|
+
"ModifyInstanceCertBinding": doModifyInstanceCertBinding,
|
2387
|
+
"ApplyRegistrationCode": doApplyRegistrationCode,
|
2388
|
+
"DescribeProductSKUList": doDescribeProductSKUList,
|
2389
|
+
"DescribeCaCertificates": doDescribeCaCertificates,
|
2390
|
+
"ActivateCaCertificate": doActivateCaCertificate,
|
1918
2391
|
"CreateTopic": doCreateTopic,
|
1919
2392
|
"DeleteDeviceCertificate": doDeleteDeviceCertificate,
|
1920
2393
|
"ModifyJWKSAuthenticator": doModifyJWKSAuthenticator,
|
@@ -1923,14 +2396,18 @@ ACTION_MAP = {
|
|
1923
2396
|
"RevokedDeviceCertificate": doRevokedDeviceCertificate,
|
1924
2397
|
"DescribeInstance": doDescribeInstance,
|
1925
2398
|
"DeleteTopic": doDeleteTopic,
|
2399
|
+
"DeleteUser": doDeleteUser,
|
2400
|
+
"DescribeCaCertificate": doDescribeCaCertificate,
|
1926
2401
|
"CreateJWKSAuthenticator": doCreateJWKSAuthenticator,
|
1927
2402
|
"ModifyUser": doModifyUser,
|
1928
2403
|
"DescribeInstanceList": doDescribeInstanceList,
|
1929
2404
|
"ModifyAuthorizationPolicy": doModifyAuthorizationPolicy,
|
1930
2405
|
"DeleteAuthorizationPolicy": doDeleteAuthorizationPolicy,
|
1931
2406
|
"DescribeTopic": doDescribeTopic,
|
2407
|
+
"RegisterCaCertificate": doRegisterCaCertificate,
|
1932
2408
|
"ModifyInsPublicEndpoint": doModifyInsPublicEndpoint,
|
1933
2409
|
"UpdateAuthorizationPolicyPriority": doUpdateAuthorizationPolicyPriority,
|
2410
|
+
"DescribeAuthorizationPolicies": doDescribeAuthorizationPolicies,
|
1934
2411
|
"CreateUser": doCreateUser,
|
1935
2412
|
"CreateInstance": doCreateInstance,
|
1936
2413
|
"DescribeTopicList": doDescribeTopicList,
|