tccli 3.0.1123.1__py2.py3-none-any.whl → 3.0.1125.1__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tccli/__init__.py +1 -1
- tccli/services/aiart/v20221229/api.json +2 -2
- tccli/services/asr/v20190614/api.json +1 -1
- tccli/services/ccc/ccc_client.py +53 -0
- tccli/services/ccc/v20200210/api.json +89 -0
- tccli/services/ccc/v20200210/examples.json +8 -0
- tccli/services/cdb/v20170320/api.json +2 -2
- tccli/services/cfw/v20190904/api.json +6 -5
- tccli/services/cfw/v20190904/examples.json +1 -1
- tccli/services/cls/v20201016/api.json +1 -1
- tccli/services/csip/v20221121/api.json +1 -0
- tccli/services/cynosdb/v20190107/api.json +56 -26
- tccli/services/cynosdb/v20190107/examples.json +7 -7
- tccli/services/dlc/dlc_client.py +602 -72
- tccli/services/dlc/v20210125/api.json +856 -25
- tccli/services/dlc/v20210125/examples.json +86 -0
- tccli/services/dts/v20180330/api.json +62 -37
- tccli/services/dts/v20180330/examples.json +1 -1
- tccli/services/dts/v20211206/api.json +9 -0
- tccli/services/eb/v20210416/api.json +63 -45
- tccli/services/eb/v20210416/examples.json +3 -9
- tccli/services/ess/v20201111/api.json +1 -1
- tccli/services/essbasic/v20210526/api.json +1 -1
- tccli/services/facefusion/facefusion_client.py +53 -0
- tccli/services/facefusion/v20220927/api.json +168 -0
- tccli/services/facefusion/v20220927/examples.json +14 -0
- tccli/services/hunyuan/v20230901/api.json +15 -15
- tccli/services/hunyuan/v20230901/examples.json +5 -5
- tccli/services/iotexplorer/iotexplorer_client.py +53 -0
- tccli/services/iotexplorer/v20190423/api.json +136 -0
- tccli/services/iotexplorer/v20190423/examples.json +8 -0
- tccli/services/mongodb/v20190725/api.json +18 -13
- tccli/services/monitor/v20180724/api.json +2 -2
- tccli/services/mps/v20190612/api.json +22 -22
- tccli/services/ocr/v20181119/api.json +4 -4
- tccli/services/ocr/v20181119/examples.json +1 -1
- tccli/services/postgres/postgres_client.py +57 -4
- tccli/services/postgres/v20170312/api.json +404 -273
- tccli/services/postgres/v20170312/examples.json +29 -15
- tccli/services/pts/v20210728/api.json +1 -1
- tccli/services/pts/v20210728/examples.json +1 -1
- tccli/services/rum/v20210622/api.json +2 -2
- tccli/services/rum/v20210622/examples.json +2 -2
- tccli/services/smh/v20210712/api.json +2 -2
- tccli/services/sqlserver/v20180328/api.json +41 -29
- tccli/services/tcss/v20201101/api.json +3 -2
- tccli/services/tcss/v20201101/examples.json +1 -1
- tccli/services/teo/v20220901/api.json +5 -5
- tccli/services/tione/v20211111/api.json +70 -3
- tccli/services/tione/v20211111/examples.json +1 -1
- tccli/services/trp/trp_client.py +53 -0
- tccli/services/trp/v20210515/api.json +110 -0
- tccli/services/trp/v20210515/examples.json +8 -0
- tccli/services/vcg/v20240404/api.json +8 -8
- tccli/services/vtc/v20240223/api.json +20 -0
- tccli/services/waf/v20180125/api.json +11 -1
- tccli/services/waf/v20180125/examples.json +2 -2
- tccli/services/wedata/v20210820/api.json +60 -7
- {tccli-3.0.1123.1.dist-info → tccli-3.0.1125.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1123.1.dist-info → tccli-3.0.1125.1.dist-info}/RECORD +63 -63
- {tccli-3.0.1123.1.dist-info → tccli-3.0.1125.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1123.1.dist-info → tccli-3.0.1125.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1123.1.dist-info → tccli-3.0.1125.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/dlc/dlc_client.py
CHANGED
@@ -849,7 +849,7 @@ def doSwitchDataEngine(args, parsed_globals):
|
|
849
849
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
850
|
|
851
851
|
|
852
|
-
def
|
852
|
+
def doDescribeDataEngines(args, parsed_globals):
|
853
853
|
g_param = parse_global_arg(parsed_globals)
|
854
854
|
|
855
855
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -878,11 +878,11 @@ def doAlterDMSDatabase(args, parsed_globals):
|
|
878
878
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
879
879
|
client._sdkVersion += ("_CLI_" + __version__)
|
880
880
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
-
model = models.
|
881
|
+
model = models.DescribeDataEnginesRequest()
|
882
882
|
model.from_json_string(json.dumps(args))
|
883
883
|
start_time = time.time()
|
884
884
|
while True:
|
885
|
-
rsp = client.
|
885
|
+
rsp = client.DescribeDataEngines(model)
|
886
886
|
result = rsp.to_json_string()
|
887
887
|
try:
|
888
888
|
json_obj = json.loads(result)
|
@@ -953,7 +953,7 @@ def doDescribeDMSPartitions(args, parsed_globals):
|
|
953
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
954
954
|
|
955
955
|
|
956
|
-
def
|
956
|
+
def doCancelTask(args, parsed_globals):
|
957
957
|
g_param = parse_global_arg(parsed_globals)
|
958
958
|
|
959
959
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -982,11 +982,63 @@ def doDescribeSparkSessionBatchSqlLog(args, parsed_globals):
|
|
982
982
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
983
983
|
client._sdkVersion += ("_CLI_" + __version__)
|
984
984
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
-
model = models.
|
985
|
+
model = models.CancelTaskRequest()
|
986
986
|
model.from_json_string(json.dumps(args))
|
987
987
|
start_time = time.time()
|
988
988
|
while True:
|
989
|
-
rsp = client.
|
989
|
+
rsp = client.CancelTask(model)
|
990
|
+
result = rsp.to_json_string()
|
991
|
+
try:
|
992
|
+
json_obj = json.loads(result)
|
993
|
+
except TypeError as e:
|
994
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
995
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
996
|
+
break
|
997
|
+
cur_time = time.time()
|
998
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
999
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1000
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1001
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1002
|
+
else:
|
1003
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1004
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1005
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
|
+
|
1007
|
+
|
1008
|
+
def doDescribeDLCCatalogAccess(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.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1036
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
+
model = models.DescribeDLCCatalogAccessRequest()
|
1038
|
+
model.from_json_string(json.dumps(args))
|
1039
|
+
start_time = time.time()
|
1040
|
+
while True:
|
1041
|
+
rsp = client.DescribeDLCCatalogAccess(model)
|
990
1042
|
result = rsp.to_json_string()
|
991
1043
|
try:
|
992
1044
|
json_obj = json.loads(result)
|
@@ -1213,7 +1265,7 @@ def doDeleteScript(args, parsed_globals):
|
|
1213
1265
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
1266
|
|
1215
1267
|
|
1216
|
-
def
|
1268
|
+
def doSwitchDataEngineImage(args, parsed_globals):
|
1217
1269
|
g_param = parse_global_arg(parsed_globals)
|
1218
1270
|
|
1219
1271
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1242,11 +1294,11 @@ def doDescribeLakeFsDirSummary(args, parsed_globals):
|
|
1242
1294
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
1243
1295
|
client._sdkVersion += ("_CLI_" + __version__)
|
1244
1296
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1245
|
-
model = models.
|
1297
|
+
model = models.SwitchDataEngineImageRequest()
|
1246
1298
|
model.from_json_string(json.dumps(args))
|
1247
1299
|
start_time = time.time()
|
1248
1300
|
while True:
|
1249
|
-
rsp = client.
|
1301
|
+
rsp = client.SwitchDataEngineImage(model)
|
1250
1302
|
result = rsp.to_json_string()
|
1251
1303
|
try:
|
1252
1304
|
json_obj = json.loads(result)
|
@@ -1317,7 +1369,7 @@ def doCreateSparkAppTask(args, parsed_globals):
|
|
1317
1369
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1318
1370
|
|
1319
1371
|
|
1320
|
-
def
|
1372
|
+
def doDescribeOtherCHDFSBindingList(args, parsed_globals):
|
1321
1373
|
g_param = parse_global_arg(parsed_globals)
|
1322
1374
|
|
1323
1375
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1346,11 +1398,63 @@ def doSwitchDataEngineImage(args, parsed_globals):
|
|
1346
1398
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
1347
1399
|
client._sdkVersion += ("_CLI_" + __version__)
|
1348
1400
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1349
|
-
model = models.
|
1401
|
+
model = models.DescribeOtherCHDFSBindingListRequest()
|
1350
1402
|
model.from_json_string(json.dumps(args))
|
1351
1403
|
start_time = time.time()
|
1352
1404
|
while True:
|
1353
|
-
rsp = client.
|
1405
|
+
rsp = client.DescribeOtherCHDFSBindingList(model)
|
1406
|
+
result = rsp.to_json_string()
|
1407
|
+
try:
|
1408
|
+
json_obj = json.loads(result)
|
1409
|
+
except TypeError as e:
|
1410
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1411
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1412
|
+
break
|
1413
|
+
cur_time = time.time()
|
1414
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1415
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1416
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1417
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1418
|
+
else:
|
1419
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1420
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1421
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
|
+
|
1423
|
+
|
1424
|
+
def doDescribeLakeFsDirSummary(args, parsed_globals):
|
1425
|
+
g_param = parse_global_arg(parsed_globals)
|
1426
|
+
|
1427
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1428
|
+
cred = credential.CVMRoleCredential()
|
1429
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1430
|
+
cred = credential.STSAssumeRoleCredential(
|
1431
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1432
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1433
|
+
)
|
1434
|
+
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):
|
1435
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1436
|
+
else:
|
1437
|
+
cred = credential.Credential(
|
1438
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1439
|
+
)
|
1440
|
+
http_profile = HttpProfile(
|
1441
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1442
|
+
reqMethod="POST",
|
1443
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1444
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1445
|
+
)
|
1446
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1447
|
+
if g_param[OptionsDefine.Language]:
|
1448
|
+
profile.language = g_param[OptionsDefine.Language]
|
1449
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1450
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
1451
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1452
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1453
|
+
model = models.DescribeLakeFsDirSummaryRequest()
|
1454
|
+
model.from_json_string(json.dumps(args))
|
1455
|
+
start_time = time.time()
|
1456
|
+
while True:
|
1457
|
+
rsp = client.DescribeLakeFsDirSummary(model)
|
1354
1458
|
result = rsp.to_json_string()
|
1355
1459
|
try:
|
1356
1460
|
json_obj = json.loads(result)
|
@@ -1473,6 +1577,110 @@ def doAlterDMSPartition(args, parsed_globals):
|
|
1473
1577
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1474
1578
|
|
1475
1579
|
|
1580
|
+
def doCreateDatabase(args, parsed_globals):
|
1581
|
+
g_param = parse_global_arg(parsed_globals)
|
1582
|
+
|
1583
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1584
|
+
cred = credential.CVMRoleCredential()
|
1585
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1586
|
+
cred = credential.STSAssumeRoleCredential(
|
1587
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1588
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1589
|
+
)
|
1590
|
+
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):
|
1591
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1592
|
+
else:
|
1593
|
+
cred = credential.Credential(
|
1594
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1595
|
+
)
|
1596
|
+
http_profile = HttpProfile(
|
1597
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1598
|
+
reqMethod="POST",
|
1599
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1600
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1601
|
+
)
|
1602
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1603
|
+
if g_param[OptionsDefine.Language]:
|
1604
|
+
profile.language = g_param[OptionsDefine.Language]
|
1605
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1606
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
1607
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1608
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1609
|
+
model = models.CreateDatabaseRequest()
|
1610
|
+
model.from_json_string(json.dumps(args))
|
1611
|
+
start_time = time.time()
|
1612
|
+
while True:
|
1613
|
+
rsp = client.CreateDatabase(model)
|
1614
|
+
result = rsp.to_json_string()
|
1615
|
+
try:
|
1616
|
+
json_obj = json.loads(result)
|
1617
|
+
except TypeError as e:
|
1618
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1619
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1620
|
+
break
|
1621
|
+
cur_time = time.time()
|
1622
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1623
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1624
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1625
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1626
|
+
else:
|
1627
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1628
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1629
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1630
|
+
|
1631
|
+
|
1632
|
+
def doRevokeDLCCatalogAccess(args, parsed_globals):
|
1633
|
+
g_param = parse_global_arg(parsed_globals)
|
1634
|
+
|
1635
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1636
|
+
cred = credential.CVMRoleCredential()
|
1637
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1638
|
+
cred = credential.STSAssumeRoleCredential(
|
1639
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1640
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1641
|
+
)
|
1642
|
+
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):
|
1643
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1644
|
+
else:
|
1645
|
+
cred = credential.Credential(
|
1646
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1647
|
+
)
|
1648
|
+
http_profile = HttpProfile(
|
1649
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1650
|
+
reqMethod="POST",
|
1651
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1652
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1653
|
+
)
|
1654
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1655
|
+
if g_param[OptionsDefine.Language]:
|
1656
|
+
profile.language = g_param[OptionsDefine.Language]
|
1657
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1658
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
1659
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1660
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1661
|
+
model = models.RevokeDLCCatalogAccessRequest()
|
1662
|
+
model.from_json_string(json.dumps(args))
|
1663
|
+
start_time = time.time()
|
1664
|
+
while True:
|
1665
|
+
rsp = client.RevokeDLCCatalogAccess(model)
|
1666
|
+
result = rsp.to_json_string()
|
1667
|
+
try:
|
1668
|
+
json_obj = json.loads(result)
|
1669
|
+
except TypeError as e:
|
1670
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1671
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1672
|
+
break
|
1673
|
+
cur_time = time.time()
|
1674
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1675
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1676
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1677
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1678
|
+
else:
|
1679
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1680
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1681
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1682
|
+
|
1683
|
+
|
1476
1684
|
def doCreateUser(args, parsed_globals):
|
1477
1685
|
g_param = parse_global_arg(parsed_globals)
|
1478
1686
|
|
@@ -1970,11 +2178,167 @@ def doDescribeSparkAppJobs(args, parsed_globals):
|
|
1970
2178
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
1971
2179
|
client._sdkVersion += ("_CLI_" + __version__)
|
1972
2180
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1973
|
-
model = models.DescribeSparkAppJobsRequest()
|
2181
|
+
model = models.DescribeSparkAppJobsRequest()
|
2182
|
+
model.from_json_string(json.dumps(args))
|
2183
|
+
start_time = time.time()
|
2184
|
+
while True:
|
2185
|
+
rsp = client.DescribeSparkAppJobs(model)
|
2186
|
+
result = rsp.to_json_string()
|
2187
|
+
try:
|
2188
|
+
json_obj = json.loads(result)
|
2189
|
+
except TypeError as e:
|
2190
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2191
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2192
|
+
break
|
2193
|
+
cur_time = time.time()
|
2194
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2195
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2196
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2197
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2198
|
+
else:
|
2199
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2200
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2201
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2202
|
+
|
2203
|
+
|
2204
|
+
def doDescribeUsers(args, parsed_globals):
|
2205
|
+
g_param = parse_global_arg(parsed_globals)
|
2206
|
+
|
2207
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2208
|
+
cred = credential.CVMRoleCredential()
|
2209
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2210
|
+
cred = credential.STSAssumeRoleCredential(
|
2211
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2212
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2213
|
+
)
|
2214
|
+
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):
|
2215
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2216
|
+
else:
|
2217
|
+
cred = credential.Credential(
|
2218
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2219
|
+
)
|
2220
|
+
http_profile = HttpProfile(
|
2221
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2222
|
+
reqMethod="POST",
|
2223
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2224
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2225
|
+
)
|
2226
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2227
|
+
if g_param[OptionsDefine.Language]:
|
2228
|
+
profile.language = g_param[OptionsDefine.Language]
|
2229
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2230
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2231
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2232
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2233
|
+
model = models.DescribeUsersRequest()
|
2234
|
+
model.from_json_string(json.dumps(args))
|
2235
|
+
start_time = time.time()
|
2236
|
+
while True:
|
2237
|
+
rsp = client.DescribeUsers(model)
|
2238
|
+
result = rsp.to_json_string()
|
2239
|
+
try:
|
2240
|
+
json_obj = json.loads(result)
|
2241
|
+
except TypeError as e:
|
2242
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2243
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2244
|
+
break
|
2245
|
+
cur_time = time.time()
|
2246
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2247
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2248
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2249
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2250
|
+
else:
|
2251
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2252
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2253
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2254
|
+
|
2255
|
+
|
2256
|
+
def doCreateTasks(args, parsed_globals):
|
2257
|
+
g_param = parse_global_arg(parsed_globals)
|
2258
|
+
|
2259
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2260
|
+
cred = credential.CVMRoleCredential()
|
2261
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2262
|
+
cred = credential.STSAssumeRoleCredential(
|
2263
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2264
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2265
|
+
)
|
2266
|
+
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):
|
2267
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2268
|
+
else:
|
2269
|
+
cred = credential.Credential(
|
2270
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2271
|
+
)
|
2272
|
+
http_profile = HttpProfile(
|
2273
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2274
|
+
reqMethod="POST",
|
2275
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2276
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2277
|
+
)
|
2278
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2279
|
+
if g_param[OptionsDefine.Language]:
|
2280
|
+
profile.language = g_param[OptionsDefine.Language]
|
2281
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2282
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2283
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2284
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2285
|
+
model = models.CreateTasksRequest()
|
2286
|
+
model.from_json_string(json.dumps(args))
|
2287
|
+
start_time = time.time()
|
2288
|
+
while True:
|
2289
|
+
rsp = client.CreateTasks(model)
|
2290
|
+
result = rsp.to_json_string()
|
2291
|
+
try:
|
2292
|
+
json_obj = json.loads(result)
|
2293
|
+
except TypeError as e:
|
2294
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2295
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2296
|
+
break
|
2297
|
+
cur_time = time.time()
|
2298
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2299
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2300
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2301
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2302
|
+
else:
|
2303
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2304
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2305
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2306
|
+
|
2307
|
+
|
2308
|
+
def doDescribeScripts(args, parsed_globals):
|
2309
|
+
g_param = parse_global_arg(parsed_globals)
|
2310
|
+
|
2311
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2312
|
+
cred = credential.CVMRoleCredential()
|
2313
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2314
|
+
cred = credential.STSAssumeRoleCredential(
|
2315
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2316
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2317
|
+
)
|
2318
|
+
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):
|
2319
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2320
|
+
else:
|
2321
|
+
cred = credential.Credential(
|
2322
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2323
|
+
)
|
2324
|
+
http_profile = HttpProfile(
|
2325
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2326
|
+
reqMethod="POST",
|
2327
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2328
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2329
|
+
)
|
2330
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2331
|
+
if g_param[OptionsDefine.Language]:
|
2332
|
+
profile.language = g_param[OptionsDefine.Language]
|
2333
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2334
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2335
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2336
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2337
|
+
model = models.DescribeScriptsRequest()
|
1974
2338
|
model.from_json_string(json.dumps(args))
|
1975
2339
|
start_time = time.time()
|
1976
2340
|
while True:
|
1977
|
-
rsp = client.
|
2341
|
+
rsp = client.DescribeScripts(model)
|
1978
2342
|
result = rsp.to_json_string()
|
1979
2343
|
try:
|
1980
2344
|
json_obj = json.loads(result)
|
@@ -1993,7 +2357,7 @@ def doDescribeSparkAppJobs(args, parsed_globals):
|
|
1993
2357
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1994
2358
|
|
1995
2359
|
|
1996
|
-
def
|
2360
|
+
def doModifyWorkGroup(args, parsed_globals):
|
1997
2361
|
g_param = parse_global_arg(parsed_globals)
|
1998
2362
|
|
1999
2363
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2022,11 +2386,11 @@ def doDescribeUsers(args, parsed_globals):
|
|
2022
2386
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2023
2387
|
client._sdkVersion += ("_CLI_" + __version__)
|
2024
2388
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2025
|
-
model = models.
|
2389
|
+
model = models.ModifyWorkGroupRequest()
|
2026
2390
|
model.from_json_string(json.dumps(args))
|
2027
2391
|
start_time = time.time()
|
2028
2392
|
while True:
|
2029
|
-
rsp = client.
|
2393
|
+
rsp = client.ModifyWorkGroup(model)
|
2030
2394
|
result = rsp.to_json_string()
|
2031
2395
|
try:
|
2032
2396
|
json_obj = json.loads(result)
|
@@ -2045,7 +2409,7 @@ def doDescribeUsers(args, parsed_globals):
|
|
2045
2409
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2046
2410
|
|
2047
2411
|
|
2048
|
-
def
|
2412
|
+
def doDescribeTablesName(args, parsed_globals):
|
2049
2413
|
g_param = parse_global_arg(parsed_globals)
|
2050
2414
|
|
2051
2415
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2074,11 +2438,11 @@ def doCreateTasks(args, parsed_globals):
|
|
2074
2438
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2075
2439
|
client._sdkVersion += ("_CLI_" + __version__)
|
2076
2440
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2077
|
-
model = models.
|
2441
|
+
model = models.DescribeTablesNameRequest()
|
2078
2442
|
model.from_json_string(json.dumps(args))
|
2079
2443
|
start_time = time.time()
|
2080
2444
|
while True:
|
2081
|
-
rsp = client.
|
2445
|
+
rsp = client.DescribeTablesName(model)
|
2082
2446
|
result = rsp.to_json_string()
|
2083
2447
|
try:
|
2084
2448
|
json_obj = json.loads(result)
|
@@ -2097,7 +2461,7 @@ def doCreateTasks(args, parsed_globals):
|
|
2097
2461
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2098
2462
|
|
2099
2463
|
|
2100
|
-
def
|
2464
|
+
def doDeleteCHDFSBindingProduct(args, parsed_globals):
|
2101
2465
|
g_param = parse_global_arg(parsed_globals)
|
2102
2466
|
|
2103
2467
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2126,11 +2490,11 @@ def doDescribeScripts(args, parsed_globals):
|
|
2126
2490
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2127
2491
|
client._sdkVersion += ("_CLI_" + __version__)
|
2128
2492
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2129
|
-
model = models.
|
2493
|
+
model = models.DeleteCHDFSBindingProductRequest()
|
2130
2494
|
model.from_json_string(json.dumps(args))
|
2131
2495
|
start_time = time.time()
|
2132
2496
|
while True:
|
2133
|
-
rsp = client.
|
2497
|
+
rsp = client.DeleteCHDFSBindingProduct(model)
|
2134
2498
|
result = rsp.to_json_string()
|
2135
2499
|
try:
|
2136
2500
|
json_obj = json.loads(result)
|
@@ -2149,7 +2513,7 @@ def doDescribeScripts(args, parsed_globals):
|
|
2149
2513
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2150
2514
|
|
2151
2515
|
|
2152
|
-
def
|
2516
|
+
def doReportHeartbeatMetaData(args, parsed_globals):
|
2153
2517
|
g_param = parse_global_arg(parsed_globals)
|
2154
2518
|
|
2155
2519
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2178,11 +2542,11 @@ def doModifyWorkGroup(args, parsed_globals):
|
|
2178
2542
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2179
2543
|
client._sdkVersion += ("_CLI_" + __version__)
|
2180
2544
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2181
|
-
model = models.
|
2545
|
+
model = models.ReportHeartbeatMetaDataRequest()
|
2182
2546
|
model.from_json_string(json.dumps(args))
|
2183
2547
|
start_time = time.time()
|
2184
2548
|
while True:
|
2185
|
-
rsp = client.
|
2549
|
+
rsp = client.ReportHeartbeatMetaData(model)
|
2186
2550
|
result = rsp.to_json_string()
|
2187
2551
|
try:
|
2188
2552
|
json_obj = json.loads(result)
|
@@ -2201,7 +2565,7 @@ def doModifyWorkGroup(args, parsed_globals):
|
|
2201
2565
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2202
2566
|
|
2203
2567
|
|
2204
|
-
def
|
2568
|
+
def doDescribeUpdatableDataEngines(args, parsed_globals):
|
2205
2569
|
g_param = parse_global_arg(parsed_globals)
|
2206
2570
|
|
2207
2571
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2230,11 +2594,11 @@ def doDescribeTablesName(args, parsed_globals):
|
|
2230
2594
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2231
2595
|
client._sdkVersion += ("_CLI_" + __version__)
|
2232
2596
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2233
|
-
model = models.
|
2597
|
+
model = models.DescribeUpdatableDataEnginesRequest()
|
2234
2598
|
model.from_json_string(json.dumps(args))
|
2235
2599
|
start_time = time.time()
|
2236
2600
|
while True:
|
2237
|
-
rsp = client.
|
2601
|
+
rsp = client.DescribeUpdatableDataEngines(model)
|
2238
2602
|
result = rsp.to_json_string()
|
2239
2603
|
try:
|
2240
2604
|
json_obj = json.loads(result)
|
@@ -2253,7 +2617,7 @@ def doDescribeTablesName(args, parsed_globals):
|
|
2253
2617
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2254
2618
|
|
2255
2619
|
|
2256
|
-
def
|
2620
|
+
def doCreateInternalTable(args, parsed_globals):
|
2257
2621
|
g_param = parse_global_arg(parsed_globals)
|
2258
2622
|
|
2259
2623
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2282,11 +2646,11 @@ def doReportHeartbeatMetaData(args, parsed_globals):
|
|
2282
2646
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2283
2647
|
client._sdkVersion += ("_CLI_" + __version__)
|
2284
2648
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2285
|
-
model = models.
|
2649
|
+
model = models.CreateInternalTableRequest()
|
2286
2650
|
model.from_json_string(json.dumps(args))
|
2287
2651
|
start_time = time.time()
|
2288
2652
|
while True:
|
2289
|
-
rsp = client.
|
2653
|
+
rsp = client.CreateInternalTable(model)
|
2290
2654
|
result = rsp.to_json_string()
|
2291
2655
|
try:
|
2292
2656
|
json_obj = json.loads(result)
|
@@ -2305,7 +2669,7 @@ def doReportHeartbeatMetaData(args, parsed_globals):
|
|
2305
2669
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2306
2670
|
|
2307
2671
|
|
2308
|
-
def
|
2672
|
+
def doGenerateCreateMangedTableSql(args, parsed_globals):
|
2309
2673
|
g_param = parse_global_arg(parsed_globals)
|
2310
2674
|
|
2311
2675
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2334,11 +2698,11 @@ def doDescribeUpdatableDataEngines(args, parsed_globals):
|
|
2334
2698
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2335
2699
|
client._sdkVersion += ("_CLI_" + __version__)
|
2336
2700
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2337
|
-
model = models.
|
2701
|
+
model = models.GenerateCreateMangedTableSqlRequest()
|
2338
2702
|
model.from_json_string(json.dumps(args))
|
2339
2703
|
start_time = time.time()
|
2340
2704
|
while True:
|
2341
|
-
rsp = client.
|
2705
|
+
rsp = client.GenerateCreateMangedTableSql(model)
|
2342
2706
|
result = rsp.to_json_string()
|
2343
2707
|
try:
|
2344
2708
|
json_obj = json.loads(result)
|
@@ -2357,7 +2721,7 @@ def doDescribeUpdatableDataEngines(args, parsed_globals):
|
|
2357
2721
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2358
2722
|
|
2359
2723
|
|
2360
|
-
def
|
2724
|
+
def doAttachWorkGroupPolicy(args, parsed_globals):
|
2361
2725
|
g_param = parse_global_arg(parsed_globals)
|
2362
2726
|
|
2363
2727
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2386,11 +2750,11 @@ def doCreateInternalTable(args, parsed_globals):
|
|
2386
2750
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2387
2751
|
client._sdkVersion += ("_CLI_" + __version__)
|
2388
2752
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2389
|
-
model = models.
|
2753
|
+
model = models.AttachWorkGroupPolicyRequest()
|
2390
2754
|
model.from_json_string(json.dumps(args))
|
2391
2755
|
start_time = time.time()
|
2392
2756
|
while True:
|
2393
|
-
rsp = client.
|
2757
|
+
rsp = client.AttachWorkGroupPolicy(model)
|
2394
2758
|
result = rsp.to_json_string()
|
2395
2759
|
try:
|
2396
2760
|
json_obj = json.loads(result)
|
@@ -2409,7 +2773,7 @@ def doCreateInternalTable(args, parsed_globals):
|
|
2409
2773
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2410
2774
|
|
2411
2775
|
|
2412
|
-
def
|
2776
|
+
def doCreateSparkApp(args, parsed_globals):
|
2413
2777
|
g_param = parse_global_arg(parsed_globals)
|
2414
2778
|
|
2415
2779
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2438,11 +2802,11 @@ def doGenerateCreateMangedTableSql(args, parsed_globals):
|
|
2438
2802
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2439
2803
|
client._sdkVersion += ("_CLI_" + __version__)
|
2440
2804
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2441
|
-
model = models.
|
2805
|
+
model = models.CreateSparkAppRequest()
|
2442
2806
|
model.from_json_string(json.dumps(args))
|
2443
2807
|
start_time = time.time()
|
2444
2808
|
while True:
|
2445
|
-
rsp = client.
|
2809
|
+
rsp = client.CreateSparkApp(model)
|
2446
2810
|
result = rsp.to_json_string()
|
2447
2811
|
try:
|
2448
2812
|
json_obj = json.loads(result)
|
@@ -2461,7 +2825,7 @@ def doGenerateCreateMangedTableSql(args, parsed_globals):
|
|
2461
2825
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
2826
|
|
2463
2827
|
|
2464
|
-
def
|
2828
|
+
def doDescribeThirdPartyAccessUser(args, parsed_globals):
|
2465
2829
|
g_param = parse_global_arg(parsed_globals)
|
2466
2830
|
|
2467
2831
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2490,11 +2854,11 @@ def doAttachWorkGroupPolicy(args, parsed_globals):
|
|
2490
2854
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2491
2855
|
client._sdkVersion += ("_CLI_" + __version__)
|
2492
2856
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2493
|
-
model = models.
|
2857
|
+
model = models.DescribeThirdPartyAccessUserRequest()
|
2494
2858
|
model.from_json_string(json.dumps(args))
|
2495
2859
|
start_time = time.time()
|
2496
2860
|
while True:
|
2497
|
-
rsp = client.
|
2861
|
+
rsp = client.DescribeThirdPartyAccessUser(model)
|
2498
2862
|
result = rsp.to_json_string()
|
2499
2863
|
try:
|
2500
2864
|
json_obj = json.loads(result)
|
@@ -2513,7 +2877,7 @@ def doAttachWorkGroupPolicy(args, parsed_globals):
|
|
2513
2877
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2514
2878
|
|
2515
2879
|
|
2516
|
-
def
|
2880
|
+
def doRollbackDataEngineImage(args, parsed_globals):
|
2517
2881
|
g_param = parse_global_arg(parsed_globals)
|
2518
2882
|
|
2519
2883
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2542,11 +2906,11 @@ def doCreateSparkApp(args, parsed_globals):
|
|
2542
2906
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2543
2907
|
client._sdkVersion += ("_CLI_" + __version__)
|
2544
2908
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2545
|
-
model = models.
|
2909
|
+
model = models.RollbackDataEngineImageRequest()
|
2546
2910
|
model.from_json_string(json.dumps(args))
|
2547
2911
|
start_time = time.time()
|
2548
2912
|
while True:
|
2549
|
-
rsp = client.
|
2913
|
+
rsp = client.RollbackDataEngineImage(model)
|
2550
2914
|
result = rsp.to_json_string()
|
2551
2915
|
try:
|
2552
2916
|
json_obj = json.loads(result)
|
@@ -2565,7 +2929,7 @@ def doCreateSparkApp(args, parsed_globals):
|
|
2565
2929
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2566
2930
|
|
2567
2931
|
|
2568
|
-
def
|
2932
|
+
def doDescribeSubUserAccessPolicy(args, parsed_globals):
|
2569
2933
|
g_param = parse_global_arg(parsed_globals)
|
2570
2934
|
|
2571
2935
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2594,11 +2958,11 @@ def doCreateDatabase(args, parsed_globals):
|
|
2594
2958
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2595
2959
|
client._sdkVersion += ("_CLI_" + __version__)
|
2596
2960
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2597
|
-
model = models.
|
2961
|
+
model = models.DescribeSubUserAccessPolicyRequest()
|
2598
2962
|
model.from_json_string(json.dumps(args))
|
2599
2963
|
start_time = time.time()
|
2600
2964
|
while True:
|
2601
|
-
rsp = client.
|
2965
|
+
rsp = client.DescribeSubUserAccessPolicy(model)
|
2602
2966
|
result = rsp.to_json_string()
|
2603
2967
|
try:
|
2604
2968
|
json_obj = json.loads(result)
|
@@ -2617,7 +2981,7 @@ def doCreateDatabase(args, parsed_globals):
|
|
2617
2981
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2618
2982
|
|
2619
2983
|
|
2620
|
-
def
|
2984
|
+
def doCreateSparkSessionBatchSQL(args, parsed_globals):
|
2621
2985
|
g_param = parse_global_arg(parsed_globals)
|
2622
2986
|
|
2623
2987
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2646,11 +3010,11 @@ def doRollbackDataEngineImage(args, parsed_globals):
|
|
2646
3010
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2647
3011
|
client._sdkVersion += ("_CLI_" + __version__)
|
2648
3012
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2649
|
-
model = models.
|
3013
|
+
model = models.CreateSparkSessionBatchSQLRequest()
|
2650
3014
|
model.from_json_string(json.dumps(args))
|
2651
3015
|
start_time = time.time()
|
2652
3016
|
while True:
|
2653
|
-
rsp = client.
|
3017
|
+
rsp = client.CreateSparkSessionBatchSQL(model)
|
2654
3018
|
result = rsp.to_json_string()
|
2655
3019
|
try:
|
2656
3020
|
json_obj = json.loads(result)
|
@@ -2669,7 +3033,7 @@ def doRollbackDataEngineImage(args, parsed_globals):
|
|
2669
3033
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2670
3034
|
|
2671
3035
|
|
2672
|
-
def
|
3036
|
+
def doDescribeNotebookSessionStatements(args, parsed_globals):
|
2673
3037
|
g_param = parse_global_arg(parsed_globals)
|
2674
3038
|
|
2675
3039
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2698,11 +3062,11 @@ def doCreateSparkSessionBatchSQL(args, parsed_globals):
|
|
2698
3062
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2699
3063
|
client._sdkVersion += ("_CLI_" + __version__)
|
2700
3064
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2701
|
-
model = models.
|
3065
|
+
model = models.DescribeNotebookSessionStatementsRequest()
|
2702
3066
|
model.from_json_string(json.dumps(args))
|
2703
3067
|
start_time = time.time()
|
2704
3068
|
while True:
|
2705
|
-
rsp = client.
|
3069
|
+
rsp = client.DescribeNotebookSessionStatements(model)
|
2706
3070
|
result = rsp.to_json_string()
|
2707
3071
|
try:
|
2708
3072
|
json_obj = json.loads(result)
|
@@ -2721,7 +3085,7 @@ def doCreateSparkSessionBatchSQL(args, parsed_globals):
|
|
2721
3085
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2722
3086
|
|
2723
3087
|
|
2724
|
-
def
|
3088
|
+
def doGrantDLCCatalogAccess(args, parsed_globals):
|
2725
3089
|
g_param = parse_global_arg(parsed_globals)
|
2726
3090
|
|
2727
3091
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2750,11 +3114,11 @@ def doDescribeNotebookSessionStatements(args, parsed_globals):
|
|
2750
3114
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2751
3115
|
client._sdkVersion += ("_CLI_" + __version__)
|
2752
3116
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2753
|
-
model = models.
|
3117
|
+
model = models.GrantDLCCatalogAccessRequest()
|
2754
3118
|
model.from_json_string(json.dumps(args))
|
2755
3119
|
start_time = time.time()
|
2756
3120
|
while True:
|
2757
|
-
rsp = client.
|
3121
|
+
rsp = client.GrantDLCCatalogAccess(model)
|
2758
3122
|
result = rsp.to_json_string()
|
2759
3123
|
try:
|
2760
3124
|
json_obj = json.loads(result)
|
@@ -3189,7 +3553,7 @@ def doCreateNotebookSessionStatement(args, parsed_globals):
|
|
3189
3553
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3190
3554
|
|
3191
3555
|
|
3192
|
-
def
|
3556
|
+
def doAlterDMSDatabase(args, parsed_globals):
|
3193
3557
|
g_param = parse_global_arg(parsed_globals)
|
3194
3558
|
|
3195
3559
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3218,11 +3582,11 @@ def doDescribeDataEngines(args, parsed_globals):
|
|
3218
3582
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
3219
3583
|
client._sdkVersion += ("_CLI_" + __version__)
|
3220
3584
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3221
|
-
model = models.
|
3585
|
+
model = models.AlterDMSDatabaseRequest()
|
3222
3586
|
model.from_json_string(json.dumps(args))
|
3223
3587
|
start_time = time.time()
|
3224
3588
|
while True:
|
3225
|
-
rsp = client.
|
3589
|
+
rsp = client.AlterDMSDatabase(model)
|
3226
3590
|
result = rsp.to_json_string()
|
3227
3591
|
try:
|
3228
3592
|
json_obj = json.loads(result)
|
@@ -3969,6 +4333,58 @@ def doCreateWorkGroup(args, parsed_globals):
|
|
3969
4333
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3970
4334
|
|
3971
4335
|
|
4336
|
+
def doCreateCHDFSBindingProduct(args, parsed_globals):
|
4337
|
+
g_param = parse_global_arg(parsed_globals)
|
4338
|
+
|
4339
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
4340
|
+
cred = credential.CVMRoleCredential()
|
4341
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
4342
|
+
cred = credential.STSAssumeRoleCredential(
|
4343
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
4344
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
4345
|
+
)
|
4346
|
+
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):
|
4347
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
4348
|
+
else:
|
4349
|
+
cred = credential.Credential(
|
4350
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
4351
|
+
)
|
4352
|
+
http_profile = HttpProfile(
|
4353
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
4354
|
+
reqMethod="POST",
|
4355
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
4356
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
4357
|
+
)
|
4358
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
4359
|
+
if g_param[OptionsDefine.Language]:
|
4360
|
+
profile.language = g_param[OptionsDefine.Language]
|
4361
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
4362
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
4363
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
4364
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4365
|
+
model = models.CreateCHDFSBindingProductRequest()
|
4366
|
+
model.from_json_string(json.dumps(args))
|
4367
|
+
start_time = time.time()
|
4368
|
+
while True:
|
4369
|
+
rsp = client.CreateCHDFSBindingProduct(model)
|
4370
|
+
result = rsp.to_json_string()
|
4371
|
+
try:
|
4372
|
+
json_obj = json.loads(result)
|
4373
|
+
except TypeError as e:
|
4374
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
4375
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
4376
|
+
break
|
4377
|
+
cur_time = time.time()
|
4378
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
4379
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
4380
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
4381
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
4382
|
+
else:
|
4383
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
4384
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
4385
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4386
|
+
|
4387
|
+
|
3972
4388
|
def doDescribeDatasourceConnection(args, parsed_globals):
|
3973
4389
|
g_param = parse_global_arg(parsed_globals)
|
3974
4390
|
|
@@ -4177,7 +4593,7 @@ def doDescribeTaskLog(args, parsed_globals):
|
|
4177
4593
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4178
4594
|
|
4179
4595
|
|
4180
|
-
def
|
4596
|
+
def doDescribeSparkSessionBatchSqlLog(args, parsed_globals):
|
4181
4597
|
g_param = parse_global_arg(parsed_globals)
|
4182
4598
|
|
4183
4599
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -4206,11 +4622,11 @@ def doCancelTask(args, parsed_globals):
|
|
4206
4622
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
4207
4623
|
client._sdkVersion += ("_CLI_" + __version__)
|
4208
4624
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4209
|
-
model = models.
|
4625
|
+
model = models.DescribeSparkSessionBatchSqlLogRequest()
|
4210
4626
|
model.from_json_string(json.dumps(args))
|
4211
4627
|
start_time = time.time()
|
4212
4628
|
while True:
|
4213
|
-
rsp = client.
|
4629
|
+
rsp = client.DescribeSparkSessionBatchSqlLog(model)
|
4214
4630
|
result = rsp.to_json_string()
|
4215
4631
|
try:
|
4216
4632
|
json_obj = json.loads(result)
|
@@ -5477,6 +5893,58 @@ def doCreateExportTask(args, parsed_globals):
|
|
5477
5893
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5478
5894
|
|
5479
5895
|
|
5896
|
+
def doRegisterThirdPartyAccessUser(args, parsed_globals):
|
5897
|
+
g_param = parse_global_arg(parsed_globals)
|
5898
|
+
|
5899
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
5900
|
+
cred = credential.CVMRoleCredential()
|
5901
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
5902
|
+
cred = credential.STSAssumeRoleCredential(
|
5903
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
5904
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
5905
|
+
)
|
5906
|
+
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):
|
5907
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
5908
|
+
else:
|
5909
|
+
cred = credential.Credential(
|
5910
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
5911
|
+
)
|
5912
|
+
http_profile = HttpProfile(
|
5913
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
5914
|
+
reqMethod="POST",
|
5915
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
5916
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
5917
|
+
)
|
5918
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
5919
|
+
if g_param[OptionsDefine.Language]:
|
5920
|
+
profile.language = g_param[OptionsDefine.Language]
|
5921
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
5922
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
5923
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
5924
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
5925
|
+
model = models.RegisterThirdPartyAccessUserRequest()
|
5926
|
+
model.from_json_string(json.dumps(args))
|
5927
|
+
start_time = time.time()
|
5928
|
+
while True:
|
5929
|
+
rsp = client.RegisterThirdPartyAccessUser(model)
|
5930
|
+
result = rsp.to_json_string()
|
5931
|
+
try:
|
5932
|
+
json_obj = json.loads(result)
|
5933
|
+
except TypeError as e:
|
5934
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
5935
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
5936
|
+
break
|
5937
|
+
cur_time = time.time()
|
5938
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
5939
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
5940
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
5941
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
5942
|
+
else:
|
5943
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
5944
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
5945
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5946
|
+
|
5947
|
+
|
5480
5948
|
def doDeleteUsersFromWorkGroup(args, parsed_globals):
|
5481
5949
|
g_param = parse_global_arg(parsed_globals)
|
5482
5950
|
|
@@ -5997,6 +6465,58 @@ def doDescribeViews(args, parsed_globals):
|
|
5997
6465
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5998
6466
|
|
5999
6467
|
|
6468
|
+
def doDeleteThirdPartyAccessUser(args, parsed_globals):
|
6469
|
+
g_param = parse_global_arg(parsed_globals)
|
6470
|
+
|
6471
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
6472
|
+
cred = credential.CVMRoleCredential()
|
6473
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
6474
|
+
cred = credential.STSAssumeRoleCredential(
|
6475
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
6476
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
6477
|
+
)
|
6478
|
+
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):
|
6479
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
6480
|
+
else:
|
6481
|
+
cred = credential.Credential(
|
6482
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
6483
|
+
)
|
6484
|
+
http_profile = HttpProfile(
|
6485
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
6486
|
+
reqMethod="POST",
|
6487
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
6488
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
6489
|
+
)
|
6490
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
6491
|
+
if g_param[OptionsDefine.Language]:
|
6492
|
+
profile.language = g_param[OptionsDefine.Language]
|
6493
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
6494
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
6495
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
6496
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
6497
|
+
model = models.DeleteThirdPartyAccessUserRequest()
|
6498
|
+
model.from_json_string(json.dumps(args))
|
6499
|
+
start_time = time.time()
|
6500
|
+
while True:
|
6501
|
+
rsp = client.DeleteThirdPartyAccessUser(model)
|
6502
|
+
result = rsp.to_json_string()
|
6503
|
+
try:
|
6504
|
+
json_obj = json.loads(result)
|
6505
|
+
except TypeError as e:
|
6506
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
6507
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
6508
|
+
break
|
6509
|
+
cur_time = time.time()
|
6510
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
6511
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
6512
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
6513
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
6514
|
+
else:
|
6515
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
6516
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
6517
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
6518
|
+
|
6519
|
+
|
6000
6520
|
def doDescribeDMSDatabase(args, parsed_globals):
|
6001
6521
|
g_param = parse_global_arg(parsed_globals)
|
6002
6522
|
|
@@ -6700,18 +7220,22 @@ ACTION_MAP = {
|
|
6700
7220
|
"CreateStoreLocation": doCreateStoreLocation,
|
6701
7221
|
"CreateNotebookSessionStatementSupportBatchSQL": doCreateNotebookSessionStatementSupportBatchSQL,
|
6702
7222
|
"SwitchDataEngine": doSwitchDataEngine,
|
6703
|
-
"
|
7223
|
+
"DescribeDataEngines": doDescribeDataEngines,
|
6704
7224
|
"DescribeDMSPartitions": doDescribeDMSPartitions,
|
6705
|
-
"
|
7225
|
+
"CancelTask": doCancelTask,
|
7226
|
+
"DescribeDLCCatalogAccess": doDescribeDLCCatalogAccess,
|
6706
7227
|
"DescribeDMSTables": doDescribeDMSTables,
|
6707
7228
|
"DescribeUserType": doDescribeUserType,
|
6708
7229
|
"DescribeTasks": doDescribeTasks,
|
6709
7230
|
"DeleteScript": doDeleteScript,
|
6710
|
-
"DescribeLakeFsDirSummary": doDescribeLakeFsDirSummary,
|
6711
|
-
"CreateSparkAppTask": doCreateSparkAppTask,
|
6712
7231
|
"SwitchDataEngineImage": doSwitchDataEngineImage,
|
7232
|
+
"CreateSparkAppTask": doCreateSparkAppTask,
|
7233
|
+
"DescribeOtherCHDFSBindingList": doDescribeOtherCHDFSBindingList,
|
7234
|
+
"DescribeLakeFsDirSummary": doDescribeLakeFsDirSummary,
|
6713
7235
|
"DescribeDatabases": doDescribeDatabases,
|
6714
7236
|
"AlterDMSPartition": doAlterDMSPartition,
|
7237
|
+
"CreateDatabase": doCreateDatabase,
|
7238
|
+
"RevokeDLCCatalogAccess": doRevokeDLCCatalogAccess,
|
6715
7239
|
"CreateUser": doCreateUser,
|
6716
7240
|
"DescribeTables": doDescribeTables,
|
6717
7241
|
"ModifySparkAppBatch": doModifySparkAppBatch,
|
@@ -6727,16 +7251,19 @@ ACTION_MAP = {
|
|
6727
7251
|
"DescribeScripts": doDescribeScripts,
|
6728
7252
|
"ModifyWorkGroup": doModifyWorkGroup,
|
6729
7253
|
"DescribeTablesName": doDescribeTablesName,
|
7254
|
+
"DeleteCHDFSBindingProduct": doDeleteCHDFSBindingProduct,
|
6730
7255
|
"ReportHeartbeatMetaData": doReportHeartbeatMetaData,
|
6731
7256
|
"DescribeUpdatableDataEngines": doDescribeUpdatableDataEngines,
|
6732
7257
|
"CreateInternalTable": doCreateInternalTable,
|
6733
7258
|
"GenerateCreateMangedTableSql": doGenerateCreateMangedTableSql,
|
6734
7259
|
"AttachWorkGroupPolicy": doAttachWorkGroupPolicy,
|
6735
7260
|
"CreateSparkApp": doCreateSparkApp,
|
6736
|
-
"
|
7261
|
+
"DescribeThirdPartyAccessUser": doDescribeThirdPartyAccessUser,
|
6737
7262
|
"RollbackDataEngineImage": doRollbackDataEngineImage,
|
7263
|
+
"DescribeSubUserAccessPolicy": doDescribeSubUserAccessPolicy,
|
6738
7264
|
"CreateSparkSessionBatchSQL": doCreateSparkSessionBatchSQL,
|
6739
7265
|
"DescribeNotebookSessionStatements": doDescribeNotebookSessionStatements,
|
7266
|
+
"GrantDLCCatalogAccess": doGrantDLCCatalogAccess,
|
6740
7267
|
"SuspendResumeDataEngine": doSuspendResumeDataEngine,
|
6741
7268
|
"CreateDMSDatabase": doCreateDMSDatabase,
|
6742
7269
|
"AttachUserPolicy": doAttachUserPolicy,
|
@@ -6745,7 +7272,7 @@ ACTION_MAP = {
|
|
6745
7272
|
"ModifyAdvancedStoreLocation": doModifyAdvancedStoreLocation,
|
6746
7273
|
"DescribeNotebookSessionStatementSqlResult": doDescribeNotebookSessionStatementSqlResult,
|
6747
7274
|
"CreateNotebookSessionStatement": doCreateNotebookSessionStatement,
|
6748
|
-
"
|
7275
|
+
"AlterDMSDatabase": doAlterDMSDatabase,
|
6749
7276
|
"DescribeSparkSessionBatchSQL": doDescribeSparkSessionBatchSQL,
|
6750
7277
|
"DropDMSDatabase": doDropDMSDatabase,
|
6751
7278
|
"AddDMSPartitions": doAddDMSPartitions,
|
@@ -6760,11 +7287,12 @@ ACTION_MAP = {
|
|
6760
7287
|
"QueryTaskCostDetail": doQueryTaskCostDetail,
|
6761
7288
|
"DropDMSPartitions": doDropDMSPartitions,
|
6762
7289
|
"CreateWorkGroup": doCreateWorkGroup,
|
7290
|
+
"CreateCHDFSBindingProduct": doCreateCHDFSBindingProduct,
|
6763
7291
|
"DescribeDatasourceConnection": doDescribeDatasourceConnection,
|
6764
7292
|
"CheckDataEngineImageCanBeRollback": doCheckDataEngineImageCanBeRollback,
|
6765
7293
|
"CancelSparkSessionBatchSQL": doCancelSparkSessionBatchSQL,
|
6766
7294
|
"DescribeTaskLog": doDescribeTaskLog,
|
6767
|
-
"
|
7295
|
+
"DescribeSparkSessionBatchSqlLog": doDescribeSparkSessionBatchSqlLog,
|
6768
7296
|
"DescribeTable": doDescribeTable,
|
6769
7297
|
"GetOptimizerPolicy": doGetOptimizerPolicy,
|
6770
7298
|
"DescribeUserInfo": doDescribeUserInfo,
|
@@ -6789,6 +7317,7 @@ ACTION_MAP = {
|
|
6789
7317
|
"CreateTable": doCreateTable,
|
6790
7318
|
"DescribeTaskResult": doDescribeTaskResult,
|
6791
7319
|
"CreateExportTask": doCreateExportTask,
|
7320
|
+
"RegisterThirdPartyAccessUser": doRegisterThirdPartyAccessUser,
|
6792
7321
|
"DeleteUsersFromWorkGroup": doDeleteUsersFromWorkGroup,
|
6793
7322
|
"DescribeSparkAppTasks": doDescribeSparkAppTasks,
|
6794
7323
|
"UnbindWorkGroupsFromUser": doUnbindWorkGroupsFromUser,
|
@@ -6799,6 +7328,7 @@ ACTION_MAP = {
|
|
6799
7328
|
"RenewDataEngine": doRenewDataEngine,
|
6800
7329
|
"ModifySparkApp": doModifySparkApp,
|
6801
7330
|
"DescribeViews": doDescribeViews,
|
7331
|
+
"DeleteThirdPartyAccessUser": doDeleteThirdPartyAccessUser,
|
6802
7332
|
"DescribeDMSDatabase": doDescribeDMSDatabase,
|
6803
7333
|
"BindWorkGroupsToUser": doBindWorkGroupsToUser,
|
6804
7334
|
"DescribeUserDataEngineConfig": doDescribeUserDataEngineConfig,
|