tccli 3.0.1340.1__py2.py3-none-any.whl → 3.0.1341.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/bh/bh_client.py +326 -8
- tccli/services/bh/v20230418/api.json +537 -0
- tccli/services/bh/v20230418/examples.json +48 -0
- tccli/services/ccc/v20200210/api.json +1 -1
- tccli/services/cdb/v20170320/api.json +144 -144
- tccli/services/cdb/v20170320/examples.json +19 -19
- tccli/services/cdn/v20180606/examples.json +1 -1
- tccli/services/cwp/v20180228/api.json +106 -2
- tccli/services/cwp/v20180228/examples.json +12 -0
- tccli/services/cynosdb/v20190107/api.json +29 -2
- tccli/services/cynosdb/v20190107/examples.json +1 -1
- tccli/services/dsgc/v20190723/api.json +215 -17
- tccli/services/emr/v20190103/api.json +93 -0
- tccli/services/ess/v20201111/api.json +14 -3
- tccli/services/ims/v20200713/api.json +1 -1
- tccli/services/ims/v20200713/examples.json +1 -1
- tccli/services/kms/kms_client.py +915 -120
- tccli/services/kms/v20190118/api.json +1104 -27
- tccli/services/kms/v20190118/examples.json +126 -0
- tccli/services/lke/lke_client.py +228 -16
- tccli/services/lke/v20231130/api.json +1490 -217
- tccli/services/lke/v20231130/examples.json +33 -1
- tccli/services/ses/v20201002/api.json +8 -8
- tccli/services/tcss/v20201101/api.json +10 -0
- tccli/services/thpc/v20230321/api.json +32 -2
- tccli/services/tione/v20211111/api.json +11 -0
- tccli/services/trocket/trocket_client.py +53 -0
- tccli/services/trocket/v20230308/api.json +228 -138
- tccli/services/trocket/v20230308/examples.json +14 -6
- tccli/services/vpc/v20170312/api.json +9 -0
- tccli/services/waf/v20180125/api.json +59 -21
- tccli/services/wedata/v20210820/api.json +432 -10
- tccli/services/wedata/v20210820/examples.json +17 -1
- tccli/services/wedata/wedata_client.py +114 -8
- {tccli-3.0.1340.1.dist-info → tccli-3.0.1341.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1340.1.dist-info → tccli-3.0.1341.1.dist-info}/RECORD +40 -40
- {tccli-3.0.1340.1.dist-info → tccli-3.0.1341.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1340.1.dist-info → tccli-3.0.1341.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1340.1.dist-info → tccli-3.0.1341.1.dist-info}/license_files/LICENSE +0 -0
tccli/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '3.0.
|
1
|
+
__version__ = '3.0.1341.1'
|
tccli/services/bh/bh_client.py
CHANGED
@@ -433,6 +433,58 @@ def doDeleteDeviceAccounts(args, parsed_globals):
|
|
433
433
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
434
|
|
435
435
|
|
436
|
+
def doCheckLDAPConnection(args, parsed_globals):
|
437
|
+
g_param = parse_global_arg(parsed_globals)
|
438
|
+
|
439
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
440
|
+
cred = credential.CVMRoleCredential()
|
441
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
442
|
+
cred = credential.STSAssumeRoleCredential(
|
443
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
444
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
445
|
+
)
|
446
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
447
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
448
|
+
else:
|
449
|
+
cred = credential.Credential(
|
450
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
451
|
+
)
|
452
|
+
http_profile = HttpProfile(
|
453
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
454
|
+
reqMethod="POST",
|
455
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
456
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
457
|
+
)
|
458
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
459
|
+
if g_param[OptionsDefine.Language]:
|
460
|
+
profile.language = g_param[OptionsDefine.Language]
|
461
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
462
|
+
client = mod.BhClient(cred, g_param[OptionsDefine.Region], profile)
|
463
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
464
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
+
model = models.CheckLDAPConnectionRequest()
|
466
|
+
model.from_json_string(json.dumps(args))
|
467
|
+
start_time = time.time()
|
468
|
+
while True:
|
469
|
+
rsp = client.CheckLDAPConnection(model)
|
470
|
+
result = rsp.to_json_string()
|
471
|
+
try:
|
472
|
+
json_obj = json.loads(result)
|
473
|
+
except TypeError as e:
|
474
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
475
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
476
|
+
break
|
477
|
+
cur_time = time.time()
|
478
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
479
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
480
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
481
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
482
|
+
else:
|
483
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
484
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
485
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
486
|
+
|
487
|
+
|
436
488
|
def doResetUser(args, parsed_globals):
|
437
489
|
g_param = parse_global_arg(parsed_globals)
|
438
490
|
|
@@ -589,6 +641,58 @@ def doCreateChangePwdTask(args, parsed_globals):
|
|
589
641
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
590
642
|
|
591
643
|
|
644
|
+
def doSetLDAPSyncFlag(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.BhClient(cred, g_param[OptionsDefine.Region], profile)
|
671
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
672
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
+
model = models.SetLDAPSyncFlagRequest()
|
674
|
+
model.from_json_string(json.dumps(args))
|
675
|
+
start_time = time.time()
|
676
|
+
while True:
|
677
|
+
rsp = client.SetLDAPSyncFlag(model)
|
678
|
+
result = rsp.to_json_string()
|
679
|
+
try:
|
680
|
+
json_obj = json.loads(result)
|
681
|
+
except TypeError as e:
|
682
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
683
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
684
|
+
break
|
685
|
+
cur_time = time.time()
|
686
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
687
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
688
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
689
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
690
|
+
else:
|
691
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
692
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
693
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
|
+
|
695
|
+
|
592
696
|
def doDescribeUserGroups(args, parsed_globals):
|
593
697
|
g_param = parse_global_arg(parsed_globals)
|
594
698
|
|
@@ -901,6 +1005,58 @@ def doBindDeviceAccountPassword(args, parsed_globals):
|
|
901
1005
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
1006
|
|
903
1007
|
|
1008
|
+
def doDescribeLDAPUnitSet(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.BhClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1036
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
+
model = models.DescribeLDAPUnitSetRequest()
|
1038
|
+
model.from_json_string(json.dumps(args))
|
1039
|
+
start_time = time.time()
|
1040
|
+
while True:
|
1041
|
+
rsp = client.DescribeLDAPUnitSet(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
|
+
|
904
1060
|
def doCreateCmdTemplate(args, parsed_globals):
|
905
1061
|
g_param = parse_global_arg(parsed_globals)
|
906
1062
|
|
@@ -2461,6 +2617,58 @@ def doModifyOperationTask(args, parsed_globals):
|
|
2461
2617
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
2618
|
|
2463
2619
|
|
2620
|
+
def doModifyLDAPSetting(args, parsed_globals):
|
2621
|
+
g_param = parse_global_arg(parsed_globals)
|
2622
|
+
|
2623
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2624
|
+
cred = credential.CVMRoleCredential()
|
2625
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2626
|
+
cred = credential.STSAssumeRoleCredential(
|
2627
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2628
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2629
|
+
)
|
2630
|
+
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):
|
2631
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2632
|
+
else:
|
2633
|
+
cred = credential.Credential(
|
2634
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2635
|
+
)
|
2636
|
+
http_profile = HttpProfile(
|
2637
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2638
|
+
reqMethod="POST",
|
2639
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2640
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2641
|
+
)
|
2642
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2643
|
+
if g_param[OptionsDefine.Language]:
|
2644
|
+
profile.language = g_param[OptionsDefine.Language]
|
2645
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2646
|
+
client = mod.BhClient(cred, g_param[OptionsDefine.Region], profile)
|
2647
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2648
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2649
|
+
model = models.ModifyLDAPSettingRequest()
|
2650
|
+
model.from_json_string(json.dumps(args))
|
2651
|
+
start_time = time.time()
|
2652
|
+
while True:
|
2653
|
+
rsp = client.ModifyLDAPSetting(model)
|
2654
|
+
result = rsp.to_json_string()
|
2655
|
+
try:
|
2656
|
+
json_obj = json.loads(result)
|
2657
|
+
except TypeError as e:
|
2658
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2659
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2660
|
+
break
|
2661
|
+
cur_time = time.time()
|
2662
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2663
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2664
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2665
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2666
|
+
else:
|
2667
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2668
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2669
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2670
|
+
|
2671
|
+
|
2464
2672
|
def doDescribeDeviceAccounts(args, parsed_globals):
|
2465
2673
|
g_param = parse_global_arg(parsed_globals)
|
2466
2674
|
|
@@ -3189,7 +3397,7 @@ def doDescribeUserGroupMembers(args, parsed_globals):
|
|
3189
3397
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3190
3398
|
|
3191
3399
|
|
3192
|
-
def
|
3400
|
+
def doSearchCommand(args, parsed_globals):
|
3193
3401
|
g_param = parse_global_arg(parsed_globals)
|
3194
3402
|
|
3195
3403
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3218,11 +3426,115 @@ def doSearchSubtaskResultById(args, parsed_globals):
|
|
3218
3426
|
client = mod.BhClient(cred, g_param[OptionsDefine.Region], profile)
|
3219
3427
|
client._sdkVersion += ("_CLI_" + __version__)
|
3220
3428
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3221
|
-
model = models.
|
3429
|
+
model = models.SearchCommandRequest()
|
3222
3430
|
model.from_json_string(json.dumps(args))
|
3223
3431
|
start_time = time.time()
|
3224
3432
|
while True:
|
3225
|
-
rsp = client.
|
3433
|
+
rsp = client.SearchCommand(model)
|
3434
|
+
result = rsp.to_json_string()
|
3435
|
+
try:
|
3436
|
+
json_obj = json.loads(result)
|
3437
|
+
except TypeError as e:
|
3438
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3439
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3440
|
+
break
|
3441
|
+
cur_time = time.time()
|
3442
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3443
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3444
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3445
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3446
|
+
else:
|
3447
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3448
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3449
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3450
|
+
|
3451
|
+
|
3452
|
+
def doReplaySession(args, parsed_globals):
|
3453
|
+
g_param = parse_global_arg(parsed_globals)
|
3454
|
+
|
3455
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3456
|
+
cred = credential.CVMRoleCredential()
|
3457
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3458
|
+
cred = credential.STSAssumeRoleCredential(
|
3459
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3460
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3461
|
+
)
|
3462
|
+
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):
|
3463
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3464
|
+
else:
|
3465
|
+
cred = credential.Credential(
|
3466
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3467
|
+
)
|
3468
|
+
http_profile = HttpProfile(
|
3469
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3470
|
+
reqMethod="POST",
|
3471
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3472
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3473
|
+
)
|
3474
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3475
|
+
if g_param[OptionsDefine.Language]:
|
3476
|
+
profile.language = g_param[OptionsDefine.Language]
|
3477
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3478
|
+
client = mod.BhClient(cred, g_param[OptionsDefine.Region], profile)
|
3479
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3480
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3481
|
+
model = models.ReplaySessionRequest()
|
3482
|
+
model.from_json_string(json.dumps(args))
|
3483
|
+
start_time = time.time()
|
3484
|
+
while True:
|
3485
|
+
rsp = client.ReplaySession(model)
|
3486
|
+
result = rsp.to_json_string()
|
3487
|
+
try:
|
3488
|
+
json_obj = json.loads(result)
|
3489
|
+
except TypeError as e:
|
3490
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3491
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3492
|
+
break
|
3493
|
+
cur_time = time.time()
|
3494
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3495
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3496
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3497
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3498
|
+
else:
|
3499
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3500
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3501
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3502
|
+
|
3503
|
+
|
3504
|
+
def doUnlockUser(args, parsed_globals):
|
3505
|
+
g_param = parse_global_arg(parsed_globals)
|
3506
|
+
|
3507
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3508
|
+
cred = credential.CVMRoleCredential()
|
3509
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3510
|
+
cred = credential.STSAssumeRoleCredential(
|
3511
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3512
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3513
|
+
)
|
3514
|
+
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):
|
3515
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3516
|
+
else:
|
3517
|
+
cred = credential.Credential(
|
3518
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3519
|
+
)
|
3520
|
+
http_profile = HttpProfile(
|
3521
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3522
|
+
reqMethod="POST",
|
3523
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3524
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3525
|
+
)
|
3526
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3527
|
+
if g_param[OptionsDefine.Language]:
|
3528
|
+
profile.language = g_param[OptionsDefine.Language]
|
3529
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3530
|
+
client = mod.BhClient(cred, g_param[OptionsDefine.Region], profile)
|
3531
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3532
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3533
|
+
model = models.UnlockUserRequest()
|
3534
|
+
model.from_json_string(json.dumps(args))
|
3535
|
+
start_time = time.time()
|
3536
|
+
while True:
|
3537
|
+
rsp = client.UnlockUser(model)
|
3226
3538
|
result = rsp.to_json_string()
|
3227
3539
|
try:
|
3228
3540
|
json_obj = json.loads(result)
|
@@ -3709,7 +4021,7 @@ def doBindDeviceAccountPrivateKey(args, parsed_globals):
|
|
3709
4021
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3710
4022
|
|
3711
4023
|
|
3712
|
-
def
|
4024
|
+
def doSearchSubtaskResultById(args, parsed_globals):
|
3713
4025
|
g_param = parse_global_arg(parsed_globals)
|
3714
4026
|
|
3715
4027
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3738,11 +4050,11 @@ def doSearchCommand(args, parsed_globals):
|
|
3738
4050
|
client = mod.BhClient(cred, g_param[OptionsDefine.Region], profile)
|
3739
4051
|
client._sdkVersion += ("_CLI_" + __version__)
|
3740
4052
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3741
|
-
model = models.
|
4053
|
+
model = models.SearchSubtaskResultByIdRequest()
|
3742
4054
|
model.from_json_string(json.dumps(args))
|
3743
4055
|
start_time = time.time()
|
3744
4056
|
while True:
|
3745
|
-
rsp = client.
|
4057
|
+
rsp = client.SearchSubtaskResultById(model)
|
3746
4058
|
result = rsp.to_json_string()
|
3747
4059
|
try:
|
3748
4060
|
json_obj = json.loads(result)
|
@@ -3832,15 +4144,18 @@ ACTION_MAP = {
|
|
3832
4144
|
"DeleteUserGroupMembers": doDeleteUserGroupMembers,
|
3833
4145
|
"CreateDeviceGroup": doCreateDeviceGroup,
|
3834
4146
|
"DeleteDeviceAccounts": doDeleteDeviceAccounts,
|
4147
|
+
"CheckLDAPConnection": doCheckLDAPConnection,
|
3835
4148
|
"ResetUser": doResetUser,
|
3836
4149
|
"CreateOperationTask": doCreateOperationTask,
|
3837
4150
|
"CreateChangePwdTask": doCreateChangePwdTask,
|
4151
|
+
"SetLDAPSyncFlag": doSetLDAPSyncFlag,
|
3838
4152
|
"DescribeUserGroups": doDescribeUserGroups,
|
3839
4153
|
"DescribeDomains": doDescribeDomains,
|
3840
4154
|
"DeployResource": doDeployResource,
|
3841
4155
|
"ModifyDevice": doModifyDevice,
|
3842
4156
|
"BindDeviceResource": doBindDeviceResource,
|
3843
4157
|
"BindDeviceAccountPassword": doBindDeviceAccountPassword,
|
4158
|
+
"DescribeLDAPUnitSet": doDescribeLDAPUnitSet,
|
3844
4159
|
"CreateCmdTemplate": doCreateCmdTemplate,
|
3845
4160
|
"SearchSession": doSearchSession,
|
3846
4161
|
"DeleteAcls": doDeleteAcls,
|
@@ -3871,6 +4186,7 @@ ACTION_MAP = {
|
|
3871
4186
|
"DeleteChangePwdTask": doDeleteChangePwdTask,
|
3872
4187
|
"DescribeOperationEvent": doDescribeOperationEvent,
|
3873
4188
|
"ModifyOperationTask": doModifyOperationTask,
|
4189
|
+
"ModifyLDAPSetting": doModifyLDAPSetting,
|
3874
4190
|
"DescribeDeviceAccounts": doDescribeDeviceAccounts,
|
3875
4191
|
"DeleteUserGroups": doDeleteUserGroups,
|
3876
4192
|
"RunOperationTask": doRunOperationTask,
|
@@ -3885,7 +4201,9 @@ ACTION_MAP = {
|
|
3885
4201
|
"DescribeUsers": doDescribeUsers,
|
3886
4202
|
"DescribeDevices": doDescribeDevices,
|
3887
4203
|
"DescribeUserGroupMembers": doDescribeUserGroupMembers,
|
3888
|
-
"
|
4204
|
+
"SearchCommand": doSearchCommand,
|
4205
|
+
"ReplaySession": doReplaySession,
|
4206
|
+
"UnlockUser": doUnlockUser,
|
3889
4207
|
"SearchFileBySid": doSearchFileBySid,
|
3890
4208
|
"ImportExternalDevice": doImportExternalDevice,
|
3891
4209
|
"DescribeChangePwdTask": doDescribeChangePwdTask,
|
@@ -3895,7 +4213,7 @@ ACTION_MAP = {
|
|
3895
4213
|
"DescribeChangePwdTaskDetail": doDescribeChangePwdTaskDetail,
|
3896
4214
|
"SearchTaskResult": doSearchTaskResult,
|
3897
4215
|
"BindDeviceAccountPrivateKey": doBindDeviceAccountPrivateKey,
|
3898
|
-
"
|
4216
|
+
"SearchSubtaskResultById": doSearchSubtaskResultById,
|
3899
4217
|
"SearchSessionCommand": doSearchSessionCommand,
|
3900
4218
|
|
3901
4219
|
}
|