tccli 3.0.1386.1__py2.py3-none-any.whl → 3.0.1388.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/apm/v20210622/api.json +20 -10
- tccli/services/apm/v20210622/examples.json +2 -2
- tccli/services/asr/v20190614/api.json +2 -2
- tccli/services/bh/v20230418/api.json +9 -0
- tccli/services/ccc/ccc_client.py +134 -28
- tccli/services/ccc/v20200210/api.json +514 -0
- tccli/services/ccc/v20200210/examples.json +16 -0
- tccli/services/cdwpg/v20201230/api.json +22 -4
- tccli/services/ckafka/v20190819/api.json +83 -85
- tccli/services/ckafka/v20190819/examples.json +6 -6
- tccli/services/cls/v20201016/api.json +1 -1
- tccli/services/csip/v20221121/api.json +66 -16
- tccli/services/cynosdb/v20190107/api.json +36 -36
- tccli/services/dlc/v20210125/api.json +342 -1
- tccli/services/dlc/v20210125/examples.json +8 -2
- tccli/services/dnspod/v20210323/api.json +22 -12
- tccli/services/es/v20180416/api.json +7 -7
- tccli/services/faceid/v20180301/api.json +12 -2
- tccli/services/gs/gs_client.py +57 -4
- tccli/services/gs/v20191118/api.json +34 -0
- tccli/services/gs/v20191118/examples.json +8 -0
- tccli/services/ioa/ioa_client.py +267 -55
- tccli/services/ioa/v20220601/api.json +963 -98
- tccli/services/ioa/v20220601/examples.json +39 -1
- tccli/services/iotexplorer/v20190423/api.json +154 -2
- tccli/services/lke/v20231130/api.json +57 -19
- tccli/services/mongodb/mongodb_client.py +53 -0
- tccli/services/mongodb/v20190725/api.json +46 -2
- tccli/services/mongodb/v20190725/examples.json +8 -0
- tccli/services/ocr/v20181119/api.json +25 -25
- tccli/services/ocr/v20181119/examples.json +2 -2
- tccli/services/omics/v20221128/api.json +163 -13
- tccli/services/redis/v20180412/api.json +124 -42
- tccli/services/redis/v20180412/examples.json +6 -6
- tccli/services/tcaplusdb/v20190823/api.json +23 -3
- tccli/services/tione/v20211111/api.json +65 -15
- tccli/services/tione/v20211111/examples.json +1 -1
- tccli/services/trtc/v20190722/api.json +97 -14
- tccli/services/vdb/v20230616/api.json +2 -2
- tccli/services/vpc/v20170312/api.json +39 -10
- tccli/services/vpc/v20170312/examples.json +2 -2
- {tccli-3.0.1386.1.dist-info → tccli-3.0.1388.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1386.1.dist-info → tccli-3.0.1388.1.dist-info}/RECORD +47 -47
- {tccli-3.0.1386.1.dist-info → tccli-3.0.1388.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1386.1.dist-info → tccli-3.0.1388.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1386.1.dist-info → tccli-3.0.1388.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/ioa/ioa_client.py
CHANGED
@@ -17,7 +17,7 @@ from tencentcloud.ioa.v20220601 import models as models_v20220601
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
-
def
|
20
|
+
def doDescribeAggrSoftDeviceList(args, parsed_globals):
|
21
21
|
g_param = parse_global_arg(parsed_globals)
|
22
22
|
|
23
23
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -46,11 +46,11 @@ def doCreateDeviceVirtualGroup(args, parsed_globals):
|
|
46
46
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
47
47
|
client._sdkVersion += ("_CLI_" + __version__)
|
48
48
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
-
model = models.
|
49
|
+
model = models.DescribeAggrSoftDeviceListRequest()
|
50
50
|
model.from_json_string(json.dumps(args))
|
51
51
|
start_time = time.time()
|
52
52
|
while True:
|
53
|
-
rsp = client.
|
53
|
+
rsp = client.DescribeAggrSoftDeviceList(model)
|
54
54
|
result = rsp.to_json_string()
|
55
55
|
try:
|
56
56
|
json_obj = json.loads(result)
|
@@ -69,7 +69,7 @@ def doCreateDeviceVirtualGroup(args, parsed_globals):
|
|
69
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
70
|
|
71
71
|
|
72
|
-
def
|
72
|
+
def doCreateDeviceTask(args, parsed_globals):
|
73
73
|
g_param = parse_global_arg(parsed_globals)
|
74
74
|
|
75
75
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -98,11 +98,11 @@ def doDescribeLocalAccounts(args, parsed_globals):
|
|
98
98
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
99
99
|
client._sdkVersion += ("_CLI_" + __version__)
|
100
100
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
-
model = models.
|
101
|
+
model = models.CreateDeviceTaskRequest()
|
102
102
|
model.from_json_string(json.dumps(args))
|
103
103
|
start_time = time.time()
|
104
104
|
while True:
|
105
|
-
rsp = client.
|
105
|
+
rsp = client.CreateDeviceTask(model)
|
106
106
|
result = rsp.to_json_string()
|
107
107
|
try:
|
108
108
|
json_obj = json.loads(result)
|
@@ -121,7 +121,7 @@ def doDescribeLocalAccounts(args, parsed_globals):
|
|
121
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
122
|
|
123
123
|
|
124
|
-
def
|
124
|
+
def doDescribeSoftwareInformation(args, parsed_globals):
|
125
125
|
g_param = parse_global_arg(parsed_globals)
|
126
126
|
|
127
127
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -150,11 +150,11 @@ def doDescribeVirtualDevices(args, parsed_globals):
|
|
150
150
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
151
151
|
client._sdkVersion += ("_CLI_" + __version__)
|
152
152
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.
|
153
|
+
model = models.DescribeSoftwareInformationRequest()
|
154
154
|
model.from_json_string(json.dumps(args))
|
155
155
|
start_time = time.time()
|
156
156
|
while True:
|
157
|
-
rsp = client.
|
157
|
+
rsp = client.DescribeSoftwareInformation(model)
|
158
158
|
result = rsp.to_json_string()
|
159
159
|
try:
|
160
160
|
json_obj = json.loads(result)
|
@@ -173,7 +173,7 @@ def doDescribeVirtualDevices(args, parsed_globals):
|
|
173
173
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
174
|
|
175
175
|
|
176
|
-
def
|
176
|
+
def doCreateDeviceVirtualGroup(args, parsed_globals):
|
177
177
|
g_param = parse_global_arg(parsed_globals)
|
178
178
|
|
179
179
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -202,11 +202,11 @@ def doDescribeAggrSoftCategorySoftList(args, parsed_globals):
|
|
202
202
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
203
203
|
client._sdkVersion += ("_CLI_" + __version__)
|
204
204
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
205
|
-
model = models.
|
205
|
+
model = models.CreateDeviceVirtualGroupRequest()
|
206
206
|
model.from_json_string(json.dumps(args))
|
207
207
|
start_time = time.time()
|
208
208
|
while True:
|
209
|
-
rsp = client.
|
209
|
+
rsp = client.CreateDeviceVirtualGroup(model)
|
210
210
|
result = rsp.to_json_string()
|
211
211
|
try:
|
212
212
|
json_obj = json.loads(result)
|
@@ -225,7 +225,7 @@ def doDescribeAggrSoftCategorySoftList(args, parsed_globals):
|
|
225
225
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
226
|
|
227
227
|
|
228
|
-
def
|
228
|
+
def doDescribeVirtualDevices(args, parsed_globals):
|
229
229
|
g_param = parse_global_arg(parsed_globals)
|
230
230
|
|
231
231
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -254,11 +254,11 @@ def doDescribeDevices(args, parsed_globals):
|
|
254
254
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
255
255
|
client._sdkVersion += ("_CLI_" + __version__)
|
256
256
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
-
model = models.
|
257
|
+
model = models.DescribeVirtualDevicesRequest()
|
258
258
|
model.from_json_string(json.dumps(args))
|
259
259
|
start_time = time.time()
|
260
260
|
while True:
|
261
|
-
rsp = client.
|
261
|
+
rsp = client.DescribeVirtualDevices(model)
|
262
262
|
result = rsp.to_json_string()
|
263
263
|
try:
|
264
264
|
json_obj = json.loads(result)
|
@@ -277,7 +277,7 @@ def doDescribeDevices(args, parsed_globals):
|
|
277
277
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
278
|
|
279
279
|
|
280
|
-
def
|
280
|
+
def doExportSoftwareInformationList(args, parsed_globals):
|
281
281
|
g_param = parse_global_arg(parsed_globals)
|
282
282
|
|
283
283
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -306,11 +306,11 @@ def doDescribeDeviceVirtualGroups(args, parsed_globals):
|
|
306
306
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
307
307
|
client._sdkVersion += ("_CLI_" + __version__)
|
308
308
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
-
model = models.
|
309
|
+
model = models.ExportSoftwareInformationListRequest()
|
310
310
|
model.from_json_string(json.dumps(args))
|
311
311
|
start_time = time.time()
|
312
312
|
while True:
|
313
|
-
rsp = client.
|
313
|
+
rsp = client.ExportSoftwareInformationList(model)
|
314
314
|
result = rsp.to_json_string()
|
315
315
|
try:
|
316
316
|
json_obj = json.loads(result)
|
@@ -433,7 +433,7 @@ def doCreatePrivilegeCode(args, parsed_globals):
|
|
433
433
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
434
|
|
435
435
|
|
436
|
-
def
|
436
|
+
def doDescribeRootAccountGroup(args, parsed_globals):
|
437
437
|
g_param = parse_global_arg(parsed_globals)
|
438
438
|
|
439
439
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -462,11 +462,11 @@ def doDescribeDeviceInfo(args, parsed_globals):
|
|
462
462
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
463
463
|
client._sdkVersion += ("_CLI_" + __version__)
|
464
464
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
-
model = models.
|
465
|
+
model = models.DescribeRootAccountGroupRequest()
|
466
466
|
model.from_json_string(json.dumps(args))
|
467
467
|
start_time = time.time()
|
468
468
|
while True:
|
469
|
-
rsp = client.
|
469
|
+
rsp = client.DescribeRootAccountGroup(model)
|
470
470
|
result = rsp.to_json_string()
|
471
471
|
try:
|
472
472
|
json_obj = json.loads(result)
|
@@ -485,7 +485,7 @@ def doDescribeDeviceInfo(args, parsed_globals):
|
|
485
485
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
486
486
|
|
487
487
|
|
488
|
-
def
|
488
|
+
def doDescribeDLPFileDetectResult(args, parsed_globals):
|
489
489
|
g_param = parse_global_arg(parsed_globals)
|
490
490
|
|
491
491
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -514,11 +514,11 @@ def doDescribeSoftwareInformation(args, parsed_globals):
|
|
514
514
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
515
515
|
client._sdkVersion += ("_CLI_" + __version__)
|
516
516
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
517
|
-
model = models.
|
517
|
+
model = models.DescribeDLPFileDetectResultRequest()
|
518
518
|
model.from_json_string(json.dumps(args))
|
519
519
|
start_time = time.time()
|
520
520
|
while True:
|
521
|
-
rsp = client.
|
521
|
+
rsp = client.DescribeDLPFileDetectResult(model)
|
522
522
|
result = rsp.to_json_string()
|
523
523
|
try:
|
524
524
|
json_obj = json.loads(result)
|
@@ -537,7 +537,7 @@ def doDescribeSoftwareInformation(args, parsed_globals):
|
|
537
537
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
538
538
|
|
539
539
|
|
540
|
-
def
|
540
|
+
def doDescribeAggrSoftCategorySoftList(args, parsed_globals):
|
541
541
|
g_param = parse_global_arg(parsed_globals)
|
542
542
|
|
543
543
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -566,11 +566,115 @@ def doDescribeSoftCensusListByDevice(args, parsed_globals):
|
|
566
566
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
567
567
|
client._sdkVersion += ("_CLI_" + __version__)
|
568
568
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
569
|
-
model = models.
|
569
|
+
model = models.DescribeAggrSoftCategorySoftListRequest()
|
570
570
|
model.from_json_string(json.dumps(args))
|
571
571
|
start_time = time.time()
|
572
572
|
while True:
|
573
|
-
rsp = client.
|
573
|
+
rsp = client.DescribeAggrSoftCategorySoftList(model)
|
574
|
+
result = rsp.to_json_string()
|
575
|
+
try:
|
576
|
+
json_obj = json.loads(result)
|
577
|
+
except TypeError as e:
|
578
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
579
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
580
|
+
break
|
581
|
+
cur_time = time.time()
|
582
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
583
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
584
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
585
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
586
|
+
else:
|
587
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
588
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
589
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
590
|
+
|
591
|
+
|
592
|
+
def doDescribeAggrSoftDetail(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.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
619
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
620
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
621
|
+
model = models.DescribeAggrSoftDetailRequest()
|
622
|
+
model.from_json_string(json.dumps(args))
|
623
|
+
start_time = time.time()
|
624
|
+
while True:
|
625
|
+
rsp = client.DescribeAggrSoftDetail(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
|
+
|
644
|
+
def doDescribeDeviceInfo(args, parsed_globals):
|
645
|
+
g_param = parse_global_arg(parsed_globals)
|
646
|
+
|
647
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
648
|
+
cred = credential.CVMRoleCredential()
|
649
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
650
|
+
cred = credential.STSAssumeRoleCredential(
|
651
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
652
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
653
|
+
)
|
654
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
655
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
656
|
+
else:
|
657
|
+
cred = credential.Credential(
|
658
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
659
|
+
)
|
660
|
+
http_profile = HttpProfile(
|
661
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
662
|
+
reqMethod="POST",
|
663
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
664
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
665
|
+
)
|
666
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
667
|
+
if g_param[OptionsDefine.Language]:
|
668
|
+
profile.language = g_param[OptionsDefine.Language]
|
669
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
670
|
+
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
671
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
672
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
+
model = models.DescribeDeviceInfoRequest()
|
674
|
+
model.from_json_string(json.dumps(args))
|
675
|
+
start_time = time.time()
|
676
|
+
while True:
|
677
|
+
rsp = client.DescribeDeviceInfo(model)
|
574
678
|
result = rsp.to_json_string()
|
575
679
|
try:
|
576
680
|
json_obj = json.loads(result)
|
@@ -641,7 +745,7 @@ def doDescribeDeviceHardwareInfoList(args, parsed_globals):
|
|
641
745
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
642
746
|
|
643
747
|
|
644
|
-
def
|
748
|
+
def doDescribeDeviceChildGroups(args, parsed_globals):
|
645
749
|
g_param = parse_global_arg(parsed_globals)
|
646
750
|
|
647
751
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -670,11 +774,11 @@ def doModifyVirtualDeviceGroups(args, parsed_globals):
|
|
670
774
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
671
775
|
client._sdkVersion += ("_CLI_" + __version__)
|
672
776
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
-
model = models.
|
777
|
+
model = models.DescribeDeviceChildGroupsRequest()
|
674
778
|
model.from_json_string(json.dumps(args))
|
675
779
|
start_time = time.time()
|
676
780
|
while True:
|
677
|
-
rsp = client.
|
781
|
+
rsp = client.DescribeDeviceChildGroups(model)
|
678
782
|
result = rsp.to_json_string()
|
679
783
|
try:
|
680
784
|
json_obj = json.loads(result)
|
@@ -693,7 +797,7 @@ def doModifyVirtualDeviceGroups(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 doDescribeAccountGroups(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 doDescribeRootAccountGroup(args, parsed_globals):
|
|
722
826
|
client = mod.IoaClient(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.DescribeAccountGroupsRequest()
|
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.DescribeAccountGroups(model)
|
730
834
|
result = rsp.to_json_string()
|
731
835
|
try:
|
732
836
|
json_obj = json.loads(result)
|
@@ -745,7 +849,7 @@ def doDescribeRootAccountGroup(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 doDescribeDeviceDetailList(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,11 @@ def doDescribeDLPFileDetectResult(args, parsed_globals):
|
|
774
878
|
client = mod.IoaClient(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.DescribeDeviceDetailListRequest()
|
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.DescribeDeviceDetailList(model)
|
782
886
|
result = rsp.to_json_string()
|
783
887
|
try:
|
784
888
|
json_obj = json.loads(result)
|
@@ -797,7 +901,7 @@ def doDescribeDLPFileDetectResult(args, parsed_globals):
|
|
797
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
902
|
|
799
903
|
|
800
|
-
def
|
904
|
+
def doDescribeLocalAccounts(args, parsed_globals):
|
801
905
|
g_param = parse_global_arg(parsed_globals)
|
802
906
|
|
803
907
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -826,11 +930,11 @@ def doDescribeDeviceChildGroups(args, parsed_globals):
|
|
826
930
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
827
931
|
client._sdkVersion += ("_CLI_" + __version__)
|
828
932
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
-
model = models.
|
933
|
+
model = models.DescribeLocalAccountsRequest()
|
830
934
|
model.from_json_string(json.dumps(args))
|
831
935
|
start_time = time.time()
|
832
936
|
while True:
|
833
|
-
rsp = client.
|
937
|
+
rsp = client.DescribeLocalAccounts(model)
|
834
938
|
result = rsp.to_json_string()
|
835
939
|
try:
|
836
940
|
json_obj = json.loads(result)
|
@@ -849,7 +953,7 @@ def doDescribeDeviceChildGroups(args, parsed_globals):
|
|
849
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
954
|
|
851
955
|
|
852
|
-
def
|
956
|
+
def doDescribeDevices(args, parsed_globals):
|
853
957
|
g_param = parse_global_arg(parsed_globals)
|
854
958
|
|
855
959
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -878,11 +982,11 @@ def doCreateDeviceTask(args, parsed_globals):
|
|
878
982
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
879
983
|
client._sdkVersion += ("_CLI_" + __version__)
|
880
984
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
-
model = models.
|
985
|
+
model = models.DescribeDevicesRequest()
|
882
986
|
model.from_json_string(json.dumps(args))
|
883
987
|
start_time = time.time()
|
884
988
|
while True:
|
885
|
-
rsp = client.
|
989
|
+
rsp = client.DescribeDevices(model)
|
886
990
|
result = rsp.to_json_string()
|
887
991
|
try:
|
888
992
|
json_obj = json.loads(result)
|
@@ -901,7 +1005,7 @@ def doCreateDeviceTask(args, parsed_globals):
|
|
901
1005
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
1006
|
|
903
1007
|
|
904
|
-
def
|
1008
|
+
def doDescribeDeviceVirtualGroups(args, parsed_globals):
|
905
1009
|
g_param = parse_global_arg(parsed_globals)
|
906
1010
|
|
907
1011
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -930,11 +1034,115 @@ def doDescribeAccountGroups(args, parsed_globals):
|
|
930
1034
|
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
931
1035
|
client._sdkVersion += ("_CLI_" + __version__)
|
932
1036
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
-
model = models.
|
1037
|
+
model = models.DescribeDeviceVirtualGroupsRequest()
|
934
1038
|
model.from_json_string(json.dumps(args))
|
935
1039
|
start_time = time.time()
|
936
1040
|
while True:
|
937
|
-
rsp = client.
|
1041
|
+
rsp = client.DescribeDeviceVirtualGroups(model)
|
1042
|
+
result = rsp.to_json_string()
|
1043
|
+
try:
|
1044
|
+
json_obj = json.loads(result)
|
1045
|
+
except TypeError as e:
|
1046
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1047
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1048
|
+
break
|
1049
|
+
cur_time = time.time()
|
1050
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1051
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1052
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1053
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1054
|
+
else:
|
1055
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1056
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1057
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
|
+
|
1059
|
+
|
1060
|
+
def doDescribeSoftCensusListByDevice(args, parsed_globals):
|
1061
|
+
g_param = parse_global_arg(parsed_globals)
|
1062
|
+
|
1063
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1064
|
+
cred = credential.CVMRoleCredential()
|
1065
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1066
|
+
cred = credential.STSAssumeRoleCredential(
|
1067
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1068
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1069
|
+
)
|
1070
|
+
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):
|
1071
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1072
|
+
else:
|
1073
|
+
cred = credential.Credential(
|
1074
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1075
|
+
)
|
1076
|
+
http_profile = HttpProfile(
|
1077
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1078
|
+
reqMethod="POST",
|
1079
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1080
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1081
|
+
)
|
1082
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1083
|
+
if g_param[OptionsDefine.Language]:
|
1084
|
+
profile.language = g_param[OptionsDefine.Language]
|
1085
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1086
|
+
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1088
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
+
model = models.DescribeSoftCensusListByDeviceRequest()
|
1090
|
+
model.from_json_string(json.dumps(args))
|
1091
|
+
start_time = time.time()
|
1092
|
+
while True:
|
1093
|
+
rsp = client.DescribeSoftCensusListByDevice(model)
|
1094
|
+
result = rsp.to_json_string()
|
1095
|
+
try:
|
1096
|
+
json_obj = json.loads(result)
|
1097
|
+
except TypeError as e:
|
1098
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1099
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1100
|
+
break
|
1101
|
+
cur_time = time.time()
|
1102
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1103
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1104
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1105
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1106
|
+
else:
|
1107
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1108
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1109
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1110
|
+
|
1111
|
+
|
1112
|
+
def doModifyVirtualDeviceGroups(args, parsed_globals):
|
1113
|
+
g_param = parse_global_arg(parsed_globals)
|
1114
|
+
|
1115
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1116
|
+
cred = credential.CVMRoleCredential()
|
1117
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1118
|
+
cred = credential.STSAssumeRoleCredential(
|
1119
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1120
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1121
|
+
)
|
1122
|
+
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):
|
1123
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1124
|
+
else:
|
1125
|
+
cred = credential.Credential(
|
1126
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1127
|
+
)
|
1128
|
+
http_profile = HttpProfile(
|
1129
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1130
|
+
reqMethod="POST",
|
1131
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1132
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1133
|
+
)
|
1134
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1135
|
+
if g_param[OptionsDefine.Language]:
|
1136
|
+
profile.language = g_param[OptionsDefine.Language]
|
1137
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1138
|
+
client = mod.IoaClient(cred, g_param[OptionsDefine.Region], profile)
|
1139
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1140
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1141
|
+
model = models.ModifyVirtualDeviceGroupsRequest()
|
1142
|
+
model.from_json_string(json.dumps(args))
|
1143
|
+
start_time = time.time()
|
1144
|
+
while True:
|
1145
|
+
rsp = client.ModifyVirtualDeviceGroups(model)
|
938
1146
|
result = rsp.to_json_string()
|
939
1147
|
try:
|
940
1148
|
json_obj = json.loads(result)
|
@@ -964,24 +1172,28 @@ MODELS_MAP = {
|
|
964
1172
|
}
|
965
1173
|
|
966
1174
|
ACTION_MAP = {
|
1175
|
+
"DescribeAggrSoftDeviceList": doDescribeAggrSoftDeviceList,
|
1176
|
+
"CreateDeviceTask": doCreateDeviceTask,
|
1177
|
+
"DescribeSoftwareInformation": doDescribeSoftwareInformation,
|
967
1178
|
"CreateDeviceVirtualGroup": doCreateDeviceVirtualGroup,
|
968
|
-
"DescribeLocalAccounts": doDescribeLocalAccounts,
|
969
1179
|
"DescribeVirtualDevices": doDescribeVirtualDevices,
|
970
|
-
"
|
971
|
-
"DescribeDevices": doDescribeDevices,
|
972
|
-
"DescribeDeviceVirtualGroups": doDescribeDeviceVirtualGroups,
|
1180
|
+
"ExportSoftwareInformationList": doExportSoftwareInformationList,
|
973
1181
|
"CreateDLPFileDetectionTask": doCreateDLPFileDetectionTask,
|
974
1182
|
"CreatePrivilegeCode": doCreatePrivilegeCode,
|
975
|
-
"DescribeDeviceInfo": doDescribeDeviceInfo,
|
976
|
-
"DescribeSoftwareInformation": doDescribeSoftwareInformation,
|
977
|
-
"DescribeSoftCensusListByDevice": doDescribeSoftCensusListByDevice,
|
978
|
-
"DescribeDeviceHardwareInfoList": doDescribeDeviceHardwareInfoList,
|
979
|
-
"ModifyVirtualDeviceGroups": doModifyVirtualDeviceGroups,
|
980
1183
|
"DescribeRootAccountGroup": doDescribeRootAccountGroup,
|
981
1184
|
"DescribeDLPFileDetectResult": doDescribeDLPFileDetectResult,
|
1185
|
+
"DescribeAggrSoftCategorySoftList": doDescribeAggrSoftCategorySoftList,
|
1186
|
+
"DescribeAggrSoftDetail": doDescribeAggrSoftDetail,
|
1187
|
+
"DescribeDeviceInfo": doDescribeDeviceInfo,
|
1188
|
+
"DescribeDeviceHardwareInfoList": doDescribeDeviceHardwareInfoList,
|
982
1189
|
"DescribeDeviceChildGroups": doDescribeDeviceChildGroups,
|
983
|
-
"CreateDeviceTask": doCreateDeviceTask,
|
984
1190
|
"DescribeAccountGroups": doDescribeAccountGroups,
|
1191
|
+
"DescribeDeviceDetailList": doDescribeDeviceDetailList,
|
1192
|
+
"DescribeLocalAccounts": doDescribeLocalAccounts,
|
1193
|
+
"DescribeDevices": doDescribeDevices,
|
1194
|
+
"DescribeDeviceVirtualGroups": doDescribeDeviceVirtualGroups,
|
1195
|
+
"DescribeSoftCensusListByDevice": doDescribeSoftCensusListByDevice,
|
1196
|
+
"ModifyVirtualDeviceGroups": doModifyVirtualDeviceGroups,
|
985
1197
|
|
986
1198
|
}
|
987
1199
|
|