tccli 3.0.1297.2__py2.py3-none-any.whl → 3.0.1298.2__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.
Potentially problematic release.
This version of tccli might be problematic. Click here for more details.
- tccli/__init__.py +1 -1
- tccli/services/cbs/v20170312/api.json +1 -1
- tccli/services/cls/cls_client.py +235 -23
- tccli/services/cls/v20201016/api.json +457 -3
- tccli/services/cls/v20201016/examples.json +32 -0
- tccli/services/cvm/v20170312/api.json +2 -2
- tccli/services/dbbrain/v20191016/api.json +146 -6
- tccli/services/dbbrain/v20210527/api.json +156 -20
- tccli/services/dlc/dlc_client.py +53 -0
- tccli/services/dlc/v20210125/api.json +162 -0
- tccli/services/dlc/v20210125/examples.json +8 -0
- tccli/services/ess/v20201111/api.json +1 -1
- tccli/services/essbasic/v20210526/api.json +5 -5
- tccli/services/gs/v20191118/api.json +19 -0
- tccli/services/gs/v20191118/examples.json +1 -1
- tccli/services/hai/v20230812/api.json +16 -16
- tccli/services/iotcloud/v20210408/api.json +2 -2
- tccli/services/iotcloud/v20210408/examples.json +3 -3
- tccli/services/iotexplorer/v20190423/api.json +398 -341
- tccli/services/iotexplorer/v20190423/examples.json +50 -50
- tccli/services/live/v20180801/api.json +2 -2
- tccli/services/mps/v20190612/api.json +55 -53
- tccli/services/mps/v20190612/examples.json +40 -40
- tccli/services/mqtt/v20240516/api.json +56 -6
- tccli/services/mqtt/v20240516/examples.json +6 -6
- tccli/services/ocr/v20181119/api.json +73 -3
- tccli/services/partners/v20180321/api.json +10 -0
- tccli/services/tdmq/v20200217/api.json +30 -0
- tccli/services/teo/v20220901/api.json +48 -7
- tccli/services/teo/v20220901/examples.json +51 -15
- tccli/services/tke/v20180525/api.json +2 -2
- tccli/services/trro/trro_client.py +269 -4
- tccli/services/trro/v20220325/api.json +504 -0
- tccli/services/trro/v20220325/examples.json +40 -0
- tccli/services/vdb/v20230616/api.json +738 -15
- tccli/services/vdb/v20230616/examples.json +64 -0
- tccli/services/vdb/vdb_client.py +428 -4
- tccli/services/vod/v20180717/api.json +9 -0
- tccli/services/vod/v20240718/api.json +985 -0
- tccli/services/vod/v20240718/examples.json +66 -0
- tccli/services/vod/vod_client.py +330 -12
- tccli/services/wedata/v20210820/api.json +453 -0
- tccli/services/wedata/v20210820/examples.json +22 -0
- tccli/services/wedata/wedata_client.py +114 -8
- tccli/services/weilingwith/v20230427/api.json +10 -10
- {tccli-3.0.1297.2.dist-info → tccli-3.0.1298.2.dist-info}/METADATA +2 -2
- {tccli-3.0.1297.2.dist-info → tccli-3.0.1298.2.dist-info}/RECORD +50 -50
- {tccli-3.0.1297.2.dist-info → tccli-3.0.1298.2.dist-info}/WHEEL +0 -0
- {tccli-3.0.1297.2.dist-info → tccli-3.0.1298.2.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1297.2.dist-info → tccli-3.0.1298.2.dist-info}/license_files/LICENSE +0 -0
|
@@ -17,6 +17,58 @@ from tencentcloud.trro.v20220325 import models as models_v20220325
|
|
|
17
17
|
from jmespath import search
|
|
18
18
|
import time
|
|
19
19
|
|
|
20
|
+
def doModifyCallbackUrl(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.TrroClient(cred, g_param[OptionsDefine.Region], profile)
|
|
47
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
48
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
49
|
+
model = models.ModifyCallbackUrlRequest()
|
|
50
|
+
model.from_json_string(json.dumps(args))
|
|
51
|
+
start_time = time.time()
|
|
52
|
+
while True:
|
|
53
|
+
rsp = client.ModifyCallbackUrl(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 doDescribeProjectInfo(args, parsed_globals):
|
|
21
73
|
g_param = parse_global_arg(parsed_globals)
|
|
22
74
|
|
|
@@ -121,6 +173,58 @@ def doGetDevices(args, parsed_globals):
|
|
|
121
173
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
122
174
|
|
|
123
175
|
|
|
176
|
+
def doStopPublishLiveStream(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.TrroClient(cred, g_param[OptionsDefine.Region], profile)
|
|
203
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
204
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
205
|
+
model = models.StopPublishLiveStreamRequest()
|
|
206
|
+
model.from_json_string(json.dumps(args))
|
|
207
|
+
start_time = time.time()
|
|
208
|
+
while True:
|
|
209
|
+
rsp = client.StopPublishLiveStream(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
|
+
|
|
124
228
|
def doModifyDevice(args, parsed_globals):
|
|
125
229
|
g_param = parse_global_arg(parsed_globals)
|
|
126
230
|
|
|
@@ -485,6 +589,58 @@ def doGetLicenses(args, parsed_globals):
|
|
|
485
589
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
486
590
|
|
|
487
591
|
|
|
592
|
+
def doStartPublishLiveStream(args, parsed_globals):
|
|
593
|
+
g_param = parse_global_arg(parsed_globals)
|
|
594
|
+
|
|
595
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
596
|
+
cred = credential.CVMRoleCredential()
|
|
597
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
598
|
+
cred = credential.STSAssumeRoleCredential(
|
|
599
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
600
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
601
|
+
)
|
|
602
|
+
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):
|
|
603
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
604
|
+
else:
|
|
605
|
+
cred = credential.Credential(
|
|
606
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
607
|
+
)
|
|
608
|
+
http_profile = HttpProfile(
|
|
609
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
610
|
+
reqMethod="POST",
|
|
611
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
612
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
613
|
+
)
|
|
614
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
615
|
+
if g_param[OptionsDefine.Language]:
|
|
616
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
617
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
618
|
+
client = mod.TrroClient(cred, g_param[OptionsDefine.Region], profile)
|
|
619
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
620
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
621
|
+
model = models.StartPublishLiveStreamRequest()
|
|
622
|
+
model.from_json_string(json.dumps(args))
|
|
623
|
+
start_time = time.time()
|
|
624
|
+
while True:
|
|
625
|
+
rsp = client.StartPublishLiveStream(model)
|
|
626
|
+
result = rsp.to_json_string()
|
|
627
|
+
try:
|
|
628
|
+
json_obj = json.loads(result)
|
|
629
|
+
except TypeError as e:
|
|
630
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
631
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
632
|
+
break
|
|
633
|
+
cur_time = time.time()
|
|
634
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
635
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
636
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
637
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
638
|
+
else:
|
|
639
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
640
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
641
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
642
|
+
|
|
643
|
+
|
|
488
644
|
def doDescribeDeviceList(args, parsed_globals):
|
|
489
645
|
g_param = parse_global_arg(parsed_globals)
|
|
490
646
|
|
|
@@ -745,7 +901,7 @@ def doCreateDevice(args, parsed_globals):
|
|
|
745
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
746
902
|
|
|
747
903
|
|
|
748
|
-
def
|
|
904
|
+
def doCreateCloudRecording(args, parsed_globals):
|
|
749
905
|
g_param = parse_global_arg(parsed_globals)
|
|
750
906
|
|
|
751
907
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -774,11 +930,11 @@ def doBatchDeleteDevices(args, parsed_globals):
|
|
|
774
930
|
client = mod.TrroClient(cred, g_param[OptionsDefine.Region], profile)
|
|
775
931
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
776
932
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
777
|
-
model = models.
|
|
933
|
+
model = models.CreateCloudRecordingRequest()
|
|
778
934
|
model.from_json_string(json.dumps(args))
|
|
779
935
|
start_time = time.time()
|
|
780
936
|
while True:
|
|
781
|
-
rsp = client.
|
|
937
|
+
rsp = client.CreateCloudRecording(model)
|
|
782
938
|
result = rsp.to_json_string()
|
|
783
939
|
try:
|
|
784
940
|
json_obj = json.loads(result)
|
|
@@ -1005,6 +1161,58 @@ def doDescribeDeviceSessionList(args, parsed_globals):
|
|
|
1005
1161
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1006
1162
|
|
|
1007
1163
|
|
|
1164
|
+
def doDeleteCloudRecording(args, parsed_globals):
|
|
1165
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1166
|
+
|
|
1167
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1168
|
+
cred = credential.CVMRoleCredential()
|
|
1169
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1170
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1171
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1172
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1173
|
+
)
|
|
1174
|
+
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):
|
|
1175
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1176
|
+
else:
|
|
1177
|
+
cred = credential.Credential(
|
|
1178
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1179
|
+
)
|
|
1180
|
+
http_profile = HttpProfile(
|
|
1181
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1182
|
+
reqMethod="POST",
|
|
1183
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1184
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1185
|
+
)
|
|
1186
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
1187
|
+
if g_param[OptionsDefine.Language]:
|
|
1188
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1189
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1190
|
+
client = mod.TrroClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1191
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1192
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1193
|
+
model = models.DeleteCloudRecordingRequest()
|
|
1194
|
+
model.from_json_string(json.dumps(args))
|
|
1195
|
+
start_time = time.time()
|
|
1196
|
+
while True:
|
|
1197
|
+
rsp = client.DeleteCloudRecording(model)
|
|
1198
|
+
result = rsp.to_json_string()
|
|
1199
|
+
try:
|
|
1200
|
+
json_obj = json.loads(result)
|
|
1201
|
+
except TypeError as e:
|
|
1202
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1203
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1204
|
+
break
|
|
1205
|
+
cur_time = time.time()
|
|
1206
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1207
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1208
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1209
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1210
|
+
else:
|
|
1211
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1212
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1213
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1214
|
+
|
|
1215
|
+
|
|
1008
1216
|
def doCreateProject(args, parsed_globals):
|
|
1009
1217
|
g_param = parse_global_arg(parsed_globals)
|
|
1010
1218
|
|
|
@@ -1265,6 +1473,58 @@ def doDescribeProjectList(args, parsed_globals):
|
|
|
1265
1473
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1266
1474
|
|
|
1267
1475
|
|
|
1476
|
+
def doBatchDeleteDevices(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.TrroClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1503
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1504
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1505
|
+
model = models.BatchDeleteDevicesRequest()
|
|
1506
|
+
model.from_json_string(json.dumps(args))
|
|
1507
|
+
start_time = time.time()
|
|
1508
|
+
while True:
|
|
1509
|
+
rsp = client.BatchDeleteDevices(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
|
+
|
|
1268
1528
|
CLIENT_MAP = {
|
|
1269
1529
|
"v20220325": trro_client_v20220325,
|
|
1270
1530
|
|
|
@@ -1276,8 +1536,10 @@ MODELS_MAP = {
|
|
|
1276
1536
|
}
|
|
1277
1537
|
|
|
1278
1538
|
ACTION_MAP = {
|
|
1539
|
+
"ModifyCallbackUrl": doModifyCallbackUrl,
|
|
1279
1540
|
"DescribeProjectInfo": doDescribeProjectInfo,
|
|
1280
1541
|
"GetDevices": doGetDevices,
|
|
1542
|
+
"StopPublishLiveStream": doStopPublishLiveStream,
|
|
1281
1543
|
"ModifyDevice": doModifyDevice,
|
|
1282
1544
|
"DescribeDeviceSessionDetails": doDescribeDeviceSessionDetails,
|
|
1283
1545
|
"GetLicenseStat": doGetLicenseStat,
|
|
@@ -1285,21 +1547,24 @@ ACTION_MAP = {
|
|
|
1285
1547
|
"BoundLicenses": doBoundLicenses,
|
|
1286
1548
|
"BatchDeletePolicy": doBatchDeletePolicy,
|
|
1287
1549
|
"GetLicenses": doGetLicenses,
|
|
1550
|
+
"StartPublishLiveStream": doStartPublishLiveStream,
|
|
1288
1551
|
"DescribeDeviceList": doDescribeDeviceList,
|
|
1289
1552
|
"ModifyProject": doModifyProject,
|
|
1290
1553
|
"DescribePolicy": doDescribePolicy,
|
|
1291
1554
|
"ModifyPolicy": doModifyPolicy,
|
|
1292
1555
|
"CreateDevice": doCreateDevice,
|
|
1293
|
-
"
|
|
1556
|
+
"CreateCloudRecording": doCreateCloudRecording,
|
|
1294
1557
|
"DescribeSessionStatistics": doDescribeSessionStatistics,
|
|
1295
1558
|
"DescribeDeviceInfo": doDescribeDeviceInfo,
|
|
1296
1559
|
"ModifyProjectSecMode": doModifyProjectSecMode,
|
|
1297
1560
|
"DescribeDeviceSessionList": doDescribeDeviceSessionList,
|
|
1561
|
+
"DeleteCloudRecording": doDeleteCloudRecording,
|
|
1298
1562
|
"CreateProject": doCreateProject,
|
|
1299
1563
|
"DescribeRecentSessionList": doDescribeRecentSessionList,
|
|
1300
1564
|
"GetDeviceLicense": doGetDeviceLicense,
|
|
1301
1565
|
"DeleteProject": doDeleteProject,
|
|
1302
1566
|
"DescribeProjectList": doDescribeProjectList,
|
|
1567
|
+
"BatchDeleteDevices": doBatchDeleteDevices,
|
|
1303
1568
|
|
|
1304
1569
|
}
|
|
1305
1570
|
|