tccli 3.0.1376.1__py2.py3-none-any.whl → 3.0.1378.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/autoscaling/v20180419/api.json +3 -3
- tccli/services/bi/bi_client.py +53 -0
- tccli/services/bi/v20220105/api.json +101 -0
- tccli/services/bi/v20220105/examples.json +8 -0
- tccli/services/cdb/v20170320/api.json +16 -6
- tccli/services/cdb/v20170320/examples.json +1 -1
- tccli/services/cfs/v20190719/api.json +1 -1
- tccli/services/cls/v20201016/api.json +19 -17
- tccli/services/cls/v20201016/examples.json +1 -1
- tccli/services/csip/v20221121/api.json +12 -12
- tccli/services/cwp/v20180228/api.json +39 -9
- tccli/services/cwp/v20180228/examples.json +6 -0
- tccli/services/cynosdb/v20190107/api.json +12 -12
- tccli/services/dc/v20180410/api.json +18 -0
- tccli/services/dlc/v20210125/api.json +28 -9
- tccli/services/dlc/v20210125/examples.json +2 -2
- tccli/services/dts/dts_client.py +79 -26
- tccli/services/dts/v20211206/api.json +34 -0
- tccli/services/dts/v20211206/examples.json +8 -0
- tccli/services/ess/ess_client.py +106 -0
- tccli/services/ess/v20201111/api.json +267 -11
- tccli/services/ess/v20201111/examples.json +16 -0
- tccli/services/essbasic/v20210526/api.json +6 -6
- tccli/services/faceid/v20180301/api.json +1 -1
- tccli/services/ioa/ioa_client.py +106 -0
- tccli/services/ioa/v20220601/api.json +498 -0
- tccli/services/ioa/v20220601/examples.json +16 -0
- tccli/services/iotexplorer/iotexplorer_client.py +53 -0
- tccli/services/iotexplorer/v20190423/api.json +261 -1
- tccli/services/iotexplorer/v20190423/examples.json +86 -6
- tccli/services/live/v20180801/api.json +1 -1
- tccli/services/lkeap/v20240522/api.json +17 -7
- tccli/services/mna/v20210119/api.json +1 -1
- tccli/services/mongodb/v20190725/api.json +22 -10
- tccli/services/mps/v20190612/api.json +112 -2
- tccli/services/mqtt/mqtt_client.py +265 -0
- tccli/services/mqtt/v20240516/api.json +480 -0
- tccli/services/mqtt/v20240516/examples.json +40 -0
- tccli/services/ocr/v20181119/api.json +5 -5
- tccli/services/partners/v20180321/api.json +15 -15
- tccli/services/rce/v20201103/api.json +1 -1
- tccli/services/tdmq/tdmq_client.py +53 -0
- tccli/services/tdmq/v20200217/api.json +156 -1
- tccli/services/tdmq/v20200217/examples.json +8 -0
- tccli/services/tione/v20211111/api.json +200 -20
- tccli/services/tione/v20211111/examples.json +1 -1
- tccli/services/tke/v20180525/api.json +10 -0
- tccli/services/tke/v20220501/api.json +20 -2
- tccli/services/trtc/v20190722/api.json +22 -11
- tccli/services/tsf/v20180326/api.json +4 -4
- tccli/services/vclm/v20240523/api.json +9 -0
- tccli/services/vpc/v20170312/api.json +11 -2
- {tccli-3.0.1376.1.dist-info → tccli-3.0.1378.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1376.1.dist-info → tccli-3.0.1378.1.dist-info}/RECORD +58 -58
- {tccli-3.0.1376.1.dist-info → tccli-3.0.1378.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1376.1.dist-info → tccli-3.0.1378.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1376.1.dist-info → tccli-3.0.1378.1.dist-info}/license_files/LICENSE +0 -0
@@ -17,6 +17,58 @@ from tencentcloud.mqtt.v20240516 import models as models_v20240516
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
+
def doCreateDeviceIdentity(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.CreateDeviceIdentityRequest()
|
50
|
+
model.from_json_string(json.dumps(args))
|
51
|
+
start_time = time.time()
|
52
|
+
while True:
|
53
|
+
rsp = client.CreateDeviceIdentity(model)
|
54
|
+
result = rsp.to_json_string()
|
55
|
+
try:
|
56
|
+
json_obj = json.loads(result)
|
57
|
+
except TypeError as e:
|
58
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
59
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
60
|
+
break
|
61
|
+
cur_time = time.time()
|
62
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
63
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
64
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
65
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
66
|
+
else:
|
67
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
68
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
69
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
|
+
|
71
|
+
|
20
72
|
def doDescribeUserList(args, parsed_globals):
|
21
73
|
g_param = parse_global_arg(parsed_globals)
|
22
74
|
|
@@ -1161,6 +1213,58 @@ def doActivateCaCertificate(args, parsed_globals):
|
|
1161
1213
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1162
1214
|
|
1163
1215
|
|
1216
|
+
def doDeleteDeviceIdentity(args, parsed_globals):
|
1217
|
+
g_param = parse_global_arg(parsed_globals)
|
1218
|
+
|
1219
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1220
|
+
cred = credential.CVMRoleCredential()
|
1221
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1222
|
+
cred = credential.STSAssumeRoleCredential(
|
1223
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1224
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1225
|
+
)
|
1226
|
+
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):
|
1227
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1228
|
+
else:
|
1229
|
+
cred = credential.Credential(
|
1230
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1231
|
+
)
|
1232
|
+
http_profile = HttpProfile(
|
1233
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1234
|
+
reqMethod="POST",
|
1235
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1236
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1237
|
+
)
|
1238
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1239
|
+
if g_param[OptionsDefine.Language]:
|
1240
|
+
profile.language = g_param[OptionsDefine.Language]
|
1241
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1242
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1243
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1244
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1245
|
+
model = models.DeleteDeviceIdentityRequest()
|
1246
|
+
model.from_json_string(json.dumps(args))
|
1247
|
+
start_time = time.time()
|
1248
|
+
while True:
|
1249
|
+
rsp = client.DeleteDeviceIdentity(model)
|
1250
|
+
result = rsp.to_json_string()
|
1251
|
+
try:
|
1252
|
+
json_obj = json.loads(result)
|
1253
|
+
except TypeError as e:
|
1254
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1255
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1256
|
+
break
|
1257
|
+
cur_time = time.time()
|
1258
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1259
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1260
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1261
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1262
|
+
else:
|
1263
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1264
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1265
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1266
|
+
|
1267
|
+
|
1164
1268
|
def doDescribeMessageByTopic(args, parsed_globals):
|
1165
1269
|
g_param = parse_global_arg(parsed_globals)
|
1166
1270
|
|
@@ -1733,6 +1837,58 @@ def doDescribeMessageDetails(args, parsed_globals):
|
|
1733
1837
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1734
1838
|
|
1735
1839
|
|
1840
|
+
def doDescribeDeviceIdentity(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.DescribeDeviceIdentityRequest()
|
1870
|
+
model.from_json_string(json.dumps(args))
|
1871
|
+
start_time = time.time()
|
1872
|
+
while True:
|
1873
|
+
rsp = client.DescribeDeviceIdentity(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
|
+
|
1736
1892
|
def doDeleteTopic(args, parsed_globals):
|
1737
1893
|
g_param = parse_global_arg(parsed_globals)
|
1738
1894
|
|
@@ -2409,6 +2565,58 @@ def doModifyInsPublicEndpoint(args, parsed_globals):
|
|
2409
2565
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2410
2566
|
|
2411
2567
|
|
2568
|
+
def doModifyDeviceIdentity(args, parsed_globals):
|
2569
|
+
g_param = parse_global_arg(parsed_globals)
|
2570
|
+
|
2571
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2572
|
+
cred = credential.CVMRoleCredential()
|
2573
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2574
|
+
cred = credential.STSAssumeRoleCredential(
|
2575
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2576
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2577
|
+
)
|
2578
|
+
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):
|
2579
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2580
|
+
else:
|
2581
|
+
cred = credential.Credential(
|
2582
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2583
|
+
)
|
2584
|
+
http_profile = HttpProfile(
|
2585
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2586
|
+
reqMethod="POST",
|
2587
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2588
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2589
|
+
)
|
2590
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2591
|
+
if g_param[OptionsDefine.Language]:
|
2592
|
+
profile.language = g_param[OptionsDefine.Language]
|
2593
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2594
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
2595
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2596
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2597
|
+
model = models.ModifyDeviceIdentityRequest()
|
2598
|
+
model.from_json_string(json.dumps(args))
|
2599
|
+
start_time = time.time()
|
2600
|
+
while True:
|
2601
|
+
rsp = client.ModifyDeviceIdentity(model)
|
2602
|
+
result = rsp.to_json_string()
|
2603
|
+
try:
|
2604
|
+
json_obj = json.loads(result)
|
2605
|
+
except TypeError as e:
|
2606
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2607
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2608
|
+
break
|
2609
|
+
cur_time = time.time()
|
2610
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2611
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2612
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2613
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2614
|
+
else:
|
2615
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2616
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2617
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2618
|
+
|
2619
|
+
|
2412
2620
|
def doUpdateAuthorizationPolicyPriority(args, parsed_globals):
|
2413
2621
|
g_param = parse_global_arg(parsed_globals)
|
2414
2622
|
|
@@ -2825,6 +3033,58 @@ def doCreateHttpAuthenticator(args, parsed_globals):
|
|
2825
3033
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2826
3034
|
|
2827
3035
|
|
3036
|
+
def doDescribeDeviceIdentities(args, parsed_globals):
|
3037
|
+
g_param = parse_global_arg(parsed_globals)
|
3038
|
+
|
3039
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3040
|
+
cred = credential.CVMRoleCredential()
|
3041
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3042
|
+
cred = credential.STSAssumeRoleCredential(
|
3043
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3044
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3045
|
+
)
|
3046
|
+
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):
|
3047
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3048
|
+
else:
|
3049
|
+
cred = credential.Credential(
|
3050
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3051
|
+
)
|
3052
|
+
http_profile = HttpProfile(
|
3053
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3054
|
+
reqMethod="POST",
|
3055
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3056
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3057
|
+
)
|
3058
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3059
|
+
if g_param[OptionsDefine.Language]:
|
3060
|
+
profile.language = g_param[OptionsDefine.Language]
|
3061
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3062
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
3063
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3064
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3065
|
+
model = models.DescribeDeviceIdentitiesRequest()
|
3066
|
+
model.from_json_string(json.dumps(args))
|
3067
|
+
start_time = time.time()
|
3068
|
+
while True:
|
3069
|
+
rsp = client.DescribeDeviceIdentities(model)
|
3070
|
+
result = rsp.to_json_string()
|
3071
|
+
try:
|
3072
|
+
json_obj = json.loads(result)
|
3073
|
+
except TypeError as e:
|
3074
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3075
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3076
|
+
break
|
3077
|
+
cur_time = time.time()
|
3078
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3079
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3080
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3081
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3082
|
+
else:
|
3083
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3084
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3085
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3086
|
+
|
3087
|
+
|
2828
3088
|
CLIENT_MAP = {
|
2829
3089
|
"v20240516": mqtt_client_v20240516,
|
2830
3090
|
|
@@ -2836,6 +3096,7 @@ MODELS_MAP = {
|
|
2836
3096
|
}
|
2837
3097
|
|
2838
3098
|
ACTION_MAP = {
|
3099
|
+
"CreateDeviceIdentity": doCreateDeviceIdentity,
|
2839
3100
|
"DescribeUserList": doDescribeUserList,
|
2840
3101
|
"CreateInsPublicEndpoint": doCreateInsPublicEndpoint,
|
2841
3102
|
"ModifyTopic": doModifyTopic,
|
@@ -2858,6 +3119,7 @@ ACTION_MAP = {
|
|
2858
3119
|
"DescribeProductSKUList": doDescribeProductSKUList,
|
2859
3120
|
"DescribeCaCertificates": doDescribeCaCertificates,
|
2860
3121
|
"ActivateCaCertificate": doActivateCaCertificate,
|
3122
|
+
"DeleteDeviceIdentity": doDeleteDeviceIdentity,
|
2861
3123
|
"DescribeMessageByTopic": doDescribeMessageByTopic,
|
2862
3124
|
"DeleteDeviceCertificate": doDeleteDeviceCertificate,
|
2863
3125
|
"ApplyRegistrationCode": doApplyRegistrationCode,
|
@@ -2869,6 +3131,7 @@ ACTION_MAP = {
|
|
2869
3131
|
"DescribeSharedSubscriptionLag": doDescribeSharedSubscriptionLag,
|
2870
3132
|
"DescribeInstance": doDescribeInstance,
|
2871
3133
|
"DescribeMessageDetails": doDescribeMessageDetails,
|
3134
|
+
"DescribeDeviceIdentity": doDescribeDeviceIdentity,
|
2872
3135
|
"DeleteTopic": doDeleteTopic,
|
2873
3136
|
"DeleteUser": doDeleteUser,
|
2874
3137
|
"DescribeCaCertificate": doDescribeCaCertificate,
|
@@ -2882,6 +3145,7 @@ ACTION_MAP = {
|
|
2882
3145
|
"DescribeTopic": doDescribeTopic,
|
2883
3146
|
"RegisterCaCertificate": doRegisterCaCertificate,
|
2884
3147
|
"ModifyInsPublicEndpoint": doModifyInsPublicEndpoint,
|
3148
|
+
"ModifyDeviceIdentity": doModifyDeviceIdentity,
|
2885
3149
|
"UpdateAuthorizationPolicyPriority": doUpdateAuthorizationPolicyPriority,
|
2886
3150
|
"DescribeAuthorizationPolicies": doDescribeAuthorizationPolicies,
|
2887
3151
|
"CreateUser": doCreateUser,
|
@@ -2890,6 +3154,7 @@ ACTION_MAP = {
|
|
2890
3154
|
"CreateAuthorizationPolicy": doCreateAuthorizationPolicy,
|
2891
3155
|
"ModifyInstance": doModifyInstance,
|
2892
3156
|
"CreateHttpAuthenticator": doCreateHttpAuthenticator,
|
3157
|
+
"DescribeDeviceIdentities": doDescribeDeviceIdentities,
|
2893
3158
|
|
2894
3159
|
}
|
2895
3160
|
|