tccli 3.0.1186.1__py2.py3-none-any.whl → 3.0.1188.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/cfw/cfw_client.py +0 -53
- tccli/services/cfw/v20190904/api.json +0 -24
- tccli/services/cfw/v20190904/examples.json +0 -8
- tccli/services/cvm/cvm_client.py +53 -0
- tccli/services/cvm/v20170312/api.json +107 -0
- tccli/services/cvm/v20170312/examples.json +8 -0
- tccli/services/cwp/v20180228/api.json +1 -1
- tccli/services/dc/v20180410/api.json +19 -19
- tccli/services/dc/v20180410/examples.json +5 -5
- tccli/services/dcdb/v20180411/api.json +20 -2
- tccli/services/dlc/dlc_client.py +106 -0
- tccli/services/dlc/v20210125/api.json +87 -0
- tccli/services/dlc/v20210125/examples.json +16 -0
- tccli/services/dts/v20211206/api.json +1 -0
- tccli/services/emr/emr_client.py +277 -12
- tccli/services/emr/v20190103/api.json +650 -21
- tccli/services/emr/v20190103/examples.json +47 -7
- tccli/services/es/v20180416/api.json +101 -0
- tccli/services/ess/ess_client.py +53 -0
- tccli/services/ess/v20201111/api.json +176 -29
- tccli/services/ess/v20201111/examples.json +11 -3
- tccli/services/gme/v20180711/api.json +12 -12
- tccli/services/mariadb/v20170312/api.json +21 -3
- tccli/services/rce/v20201103/api.json +2 -2
- tccli/services/sms/v20190711/api.json +2 -2
- tccli/services/sms/v20210111/api.json +2 -2
- tccli/services/teo/v20220901/api.json +2 -2
- tccli/services/trocket/v20230308/api.json +9 -0
- tccli/services/trtc/v20190722/api.json +11 -0
- tccli/services/tse/v20201207/api.json +18 -18
- tccli/services/vclm/v20240523/api.json +10 -10
- tccli/services/vclm/v20240523/examples.json +17 -5
- tccli/services/vpc/v20170312/api.json +1 -1
- tccli/services/vtc/v20240223/api.json +8 -8
- tccli/services/vtc/v20240223/examples.json +19 -7
- {tccli-3.0.1186.1.dist-info → tccli-3.0.1188.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1186.1.dist-info → tccli-3.0.1188.1.dist-info}/RECORD +41 -41
- {tccli-3.0.1186.1.dist-info → tccli-3.0.1188.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1186.1.dist-info → tccli-3.0.1188.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1186.1.dist-info → tccli-3.0.1188.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/emr/emr_client.py
CHANGED
@@ -329,7 +329,7 @@ def doDescribeImpalaQueries(args, parsed_globals):
|
|
329
329
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
330
330
|
|
331
331
|
|
332
|
-
def
|
332
|
+
def doDescribeYarnQueue(args, parsed_globals):
|
333
333
|
g_param = parse_global_arg(parsed_globals)
|
334
334
|
|
335
335
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -358,11 +358,11 @@ def doDescribeJobFlow(args, parsed_globals):
|
|
358
358
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
359
359
|
client._sdkVersion += ("_CLI_" + __version__)
|
360
360
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
-
model = models.
|
361
|
+
model = models.DescribeYarnQueueRequest()
|
362
362
|
model.from_json_string(json.dumps(args))
|
363
363
|
start_time = time.time()
|
364
364
|
while True:
|
365
|
-
rsp = client.
|
365
|
+
rsp = client.DescribeYarnQueue(model)
|
366
366
|
result = rsp.to_json_string()
|
367
367
|
try:
|
368
368
|
json_obj = json.loads(result)
|
@@ -381,7 +381,7 @@ def doDescribeJobFlow(args, parsed_globals):
|
|
381
381
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
382
382
|
|
383
383
|
|
384
|
-
def
|
384
|
+
def doModifyYarnQueueV2(args, parsed_globals):
|
385
385
|
g_param = parse_global_arg(parsed_globals)
|
386
386
|
|
387
387
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -410,11 +410,63 @@ def doInquirePriceRenewEmr(args, parsed_globals):
|
|
410
410
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
411
411
|
client._sdkVersion += ("_CLI_" + __version__)
|
412
412
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
413
|
-
model = models.
|
413
|
+
model = models.ModifyYarnQueueV2Request()
|
414
414
|
model.from_json_string(json.dumps(args))
|
415
415
|
start_time = time.time()
|
416
416
|
while True:
|
417
|
-
rsp = client.
|
417
|
+
rsp = client.ModifyYarnQueueV2(model)
|
418
|
+
result = rsp.to_json_string()
|
419
|
+
try:
|
420
|
+
json_obj = json.loads(result)
|
421
|
+
except TypeError as e:
|
422
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
423
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
424
|
+
break
|
425
|
+
cur_time = time.time()
|
426
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
427
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
428
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
429
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
430
|
+
else:
|
431
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
432
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
433
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
|
+
|
435
|
+
|
436
|
+
def doDeployYarnConf(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.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
463
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
464
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
+
model = models.DeployYarnConfRequest()
|
466
|
+
model.from_json_string(json.dumps(args))
|
467
|
+
start_time = time.time()
|
468
|
+
while True:
|
469
|
+
rsp = client.DeployYarnConf(model)
|
418
470
|
result = rsp.to_json_string()
|
419
471
|
try:
|
420
472
|
json_obj = json.loads(result)
|
@@ -1005,7 +1057,7 @@ def doTerminateClusterNodes(args, parsed_globals):
|
|
1005
1057
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
1058
|
|
1007
1059
|
|
1008
|
-
def
|
1060
|
+
def doResetYarnConfig(args, parsed_globals):
|
1009
1061
|
g_param = parse_global_arg(parsed_globals)
|
1010
1062
|
|
1011
1063
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1034,11 +1086,11 @@ def doDescribeEmrOverviewMetrics(args, parsed_globals):
|
|
1034
1086
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
1087
|
client._sdkVersion += ("_CLI_" + __version__)
|
1036
1088
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
-
model = models.
|
1089
|
+
model = models.ResetYarnConfigRequest()
|
1038
1090
|
model.from_json_string(json.dumps(args))
|
1039
1091
|
start_time = time.time()
|
1040
1092
|
while True:
|
1041
|
-
rsp = client.
|
1093
|
+
rsp = client.ResetYarnConfig(model)
|
1042
1094
|
result = rsp.to_json_string()
|
1043
1095
|
try:
|
1044
1096
|
json_obj = json.loads(result)
|
@@ -1265,6 +1317,58 @@ def doModifyAutoRenewFlag(args, parsed_globals):
|
|
1265
1317
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1266
1318
|
|
1267
1319
|
|
1320
|
+
def doDescribeJobFlow(args, parsed_globals):
|
1321
|
+
g_param = parse_global_arg(parsed_globals)
|
1322
|
+
|
1323
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1324
|
+
cred = credential.CVMRoleCredential()
|
1325
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1326
|
+
cred = credential.STSAssumeRoleCredential(
|
1327
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1328
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1329
|
+
)
|
1330
|
+
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):
|
1331
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1332
|
+
else:
|
1333
|
+
cred = credential.Credential(
|
1334
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1335
|
+
)
|
1336
|
+
http_profile = HttpProfile(
|
1337
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1338
|
+
reqMethod="POST",
|
1339
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1340
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1341
|
+
)
|
1342
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1343
|
+
if g_param[OptionsDefine.Language]:
|
1344
|
+
profile.language = g_param[OptionsDefine.Language]
|
1345
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1346
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
1347
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1348
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1349
|
+
model = models.DescribeJobFlowRequest()
|
1350
|
+
model.from_json_string(json.dumps(args))
|
1351
|
+
start_time = time.time()
|
1352
|
+
while True:
|
1353
|
+
rsp = client.DescribeJobFlow(model)
|
1354
|
+
result = rsp.to_json_string()
|
1355
|
+
try:
|
1356
|
+
json_obj = json.loads(result)
|
1357
|
+
except TypeError as e:
|
1358
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1359
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1360
|
+
break
|
1361
|
+
cur_time = time.time()
|
1362
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1363
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1364
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1365
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1366
|
+
else:
|
1367
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1368
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1369
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1370
|
+
|
1371
|
+
|
1268
1372
|
def doModifyAutoScaleStrategy(args, parsed_globals):
|
1269
1373
|
g_param = parse_global_arg(parsed_globals)
|
1270
1374
|
|
@@ -1525,6 +1629,58 @@ def doModifyResourceScheduler(args, parsed_globals):
|
|
1525
1629
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1526
1630
|
|
1527
1631
|
|
1632
|
+
def doDescribeResourceScheduleDiffDetail(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.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
1659
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1660
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1661
|
+
model = models.DescribeResourceScheduleDiffDetailRequest()
|
1662
|
+
model.from_json_string(json.dumps(args))
|
1663
|
+
start_time = time.time()
|
1664
|
+
while True:
|
1665
|
+
rsp = client.DescribeResourceScheduleDiffDetail(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
|
+
|
1528
1684
|
def doSyncPodState(args, parsed_globals):
|
1529
1685
|
g_param = parse_global_arg(parsed_globals)
|
1530
1686
|
|
@@ -1681,6 +1837,58 @@ def doInquiryPriceCreateInstance(args, parsed_globals):
|
|
1681
1837
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1682
1838
|
|
1683
1839
|
|
1840
|
+
def doInquirePriceRenewEmr(args, parsed_globals):
|
1841
|
+
g_param = parse_global_arg(parsed_globals)
|
1842
|
+
|
1843
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1844
|
+
cred = credential.CVMRoleCredential()
|
1845
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1846
|
+
cred = credential.STSAssumeRoleCredential(
|
1847
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1848
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1849
|
+
)
|
1850
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
1851
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1852
|
+
else:
|
1853
|
+
cred = credential.Credential(
|
1854
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1855
|
+
)
|
1856
|
+
http_profile = HttpProfile(
|
1857
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1858
|
+
reqMethod="POST",
|
1859
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1860
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1861
|
+
)
|
1862
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1863
|
+
if g_param[OptionsDefine.Language]:
|
1864
|
+
profile.language = g_param[OptionsDefine.Language]
|
1865
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1866
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
1867
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1868
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1869
|
+
model = models.InquirePriceRenewEmrRequest()
|
1870
|
+
model.from_json_string(json.dumps(args))
|
1871
|
+
start_time = time.time()
|
1872
|
+
while True:
|
1873
|
+
rsp = client.InquirePriceRenewEmr(model)
|
1874
|
+
result = rsp.to_json_string()
|
1875
|
+
try:
|
1876
|
+
json_obj = json.loads(result)
|
1877
|
+
except TypeError as e:
|
1878
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1879
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1880
|
+
break
|
1881
|
+
cur_time = time.time()
|
1882
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1883
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1884
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1885
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1886
|
+
else:
|
1887
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1888
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1889
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1890
|
+
|
1891
|
+
|
1684
1892
|
def doAddMetricScaleStrategy(args, parsed_globals):
|
1685
1893
|
g_param = parse_global_arg(parsed_globals)
|
1686
1894
|
|
@@ -2461,6 +2669,58 @@ def doDescribeInsightList(args, parsed_globals):
|
|
2461
2669
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
2670
|
|
2463
2671
|
|
2672
|
+
def doDescribeEmrOverviewMetrics(args, parsed_globals):
|
2673
|
+
g_param = parse_global_arg(parsed_globals)
|
2674
|
+
|
2675
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2676
|
+
cred = credential.CVMRoleCredential()
|
2677
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2678
|
+
cred = credential.STSAssumeRoleCredential(
|
2679
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2680
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2681
|
+
)
|
2682
|
+
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):
|
2683
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2684
|
+
else:
|
2685
|
+
cred = credential.Credential(
|
2686
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2687
|
+
)
|
2688
|
+
http_profile = HttpProfile(
|
2689
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2690
|
+
reqMethod="POST",
|
2691
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2692
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2693
|
+
)
|
2694
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2695
|
+
if g_param[OptionsDefine.Language]:
|
2696
|
+
profile.language = g_param[OptionsDefine.Language]
|
2697
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2698
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
2699
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2700
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2701
|
+
model = models.DescribeEmrOverviewMetricsRequest()
|
2702
|
+
model.from_json_string(json.dumps(args))
|
2703
|
+
start_time = time.time()
|
2704
|
+
while True:
|
2705
|
+
rsp = client.DescribeEmrOverviewMetrics(model)
|
2706
|
+
result = rsp.to_json_string()
|
2707
|
+
try:
|
2708
|
+
json_obj = json.loads(result)
|
2709
|
+
except TypeError as e:
|
2710
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2711
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2712
|
+
break
|
2713
|
+
cur_time = time.time()
|
2714
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2715
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2716
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2717
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2718
|
+
else:
|
2719
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2720
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2721
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2722
|
+
|
2723
|
+
|
2464
2724
|
def doScaleOutCluster(args, parsed_globals):
|
2465
2725
|
g_param = parse_global_arg(parsed_globals)
|
2466
2726
|
|
@@ -2582,8 +2842,9 @@ ACTION_MAP = {
|
|
2582
2842
|
"CreateCluster": doCreateCluster,
|
2583
2843
|
"InquiryPriceRenewInstance": doInquiryPriceRenewInstance,
|
2584
2844
|
"DescribeImpalaQueries": doDescribeImpalaQueries,
|
2585
|
-
"
|
2586
|
-
"
|
2845
|
+
"DescribeYarnQueue": doDescribeYarnQueue,
|
2846
|
+
"ModifyYarnQueueV2": doModifyYarnQueueV2,
|
2847
|
+
"DeployYarnConf": doDeployYarnConf,
|
2587
2848
|
"DescribeClusterFlowStatusDetail": doDescribeClusterFlowStatusDetail,
|
2588
2849
|
"InquiryPriceScaleOutInstance": doInquiryPriceScaleOutInstance,
|
2589
2850
|
"DescribeAutoScaleRecords": doDescribeAutoScaleRecords,
|
@@ -2595,19 +2856,22 @@ ACTION_MAP = {
|
|
2595
2856
|
"DescribeInstances": doDescribeInstances,
|
2596
2857
|
"ModifyYarnDeploy": doModifyYarnDeploy,
|
2597
2858
|
"TerminateClusterNodes": doTerminateClusterNodes,
|
2598
|
-
"
|
2859
|
+
"ResetYarnConfig": doResetYarnConfig,
|
2599
2860
|
"DescribeUsersForUserManager": doDescribeUsersForUserManager,
|
2600
2861
|
"DeleteUserManagerUserList": doDeleteUserManagerUserList,
|
2601
2862
|
"AddUsersForUserManager": doAddUsersForUserManager,
|
2602
2863
|
"ModifyAutoRenewFlag": doModifyAutoRenewFlag,
|
2864
|
+
"DescribeJobFlow": doDescribeJobFlow,
|
2603
2865
|
"ModifyAutoScaleStrategy": doModifyAutoScaleStrategy,
|
2604
2866
|
"DeleteAutoScaleStrategy": doDeleteAutoScaleStrategy,
|
2605
2867
|
"DescribeEmrApplicationStatics": doDescribeEmrApplicationStatics,
|
2606
2868
|
"DescribeInstanceRenewNodes": doDescribeInstanceRenewNodes,
|
2607
2869
|
"ModifyResourceScheduler": doModifyResourceScheduler,
|
2870
|
+
"DescribeResourceScheduleDiffDetail": doDescribeResourceScheduleDiffDetail,
|
2608
2871
|
"SyncPodState": doSyncPodState,
|
2609
2872
|
"CreateInstance": doCreateInstance,
|
2610
2873
|
"InquiryPriceCreateInstance": doInquiryPriceCreateInstance,
|
2874
|
+
"InquirePriceRenewEmr": doInquirePriceRenewEmr,
|
2611
2875
|
"AddMetricScaleStrategy": doAddMetricScaleStrategy,
|
2612
2876
|
"DescribeYarnScheduleHistory": doDescribeYarnScheduleHistory,
|
2613
2877
|
"ModifyResourceScheduleConfig": doModifyResourceScheduleConfig,
|
@@ -2623,6 +2887,7 @@ ACTION_MAP = {
|
|
2623
2887
|
"DescribeInstancesList": doDescribeInstancesList,
|
2624
2888
|
"ModifyResourcePools": doModifyResourcePools,
|
2625
2889
|
"DescribeInsightList": doDescribeInsightList,
|
2890
|
+
"DescribeEmrOverviewMetrics": doDescribeEmrOverviewMetrics,
|
2626
2891
|
"ScaleOutCluster": doScaleOutCluster,
|
2627
2892
|
"RunJobFlow": doRunJobFlow,
|
2628
2893
|
|