tccli 3.0.1185.1__py2.py3-none-any.whl → 3.0.1187.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 CHANGED
@@ -1 +1 @@
1
- __version__ = '3.0.1185.1'
1
+ __version__ = '3.0.1187.1'
@@ -487,8 +487,7 @@
487
487
  "member": "string",
488
488
  "name": "InstanceId",
489
489
  "required": true,
490
- "type": "string",
491
- "value_allowed_null": false
490
+ "type": "string"
492
491
  },
493
492
  {
494
493
  "disabled": false,
@@ -497,18 +496,16 @@
497
496
  "member": "string",
498
497
  "name": "UserName",
499
498
  "required": true,
500
- "type": "string",
501
- "value_allowed_null": false
499
+ "type": "string"
502
500
  },
503
501
  {
504
502
  "disabled": false,
505
- "document": "密码",
503
+ "document": "base64加密后的密码",
506
504
  "example": "password",
507
505
  "member": "string",
508
506
  "name": "PassWord",
509
507
  "required": true,
510
- "type": "string",
511
- "value_allowed_null": false
508
+ "type": "string"
512
509
  },
513
510
  {
514
511
  "disabled": false,
@@ -517,8 +514,7 @@
517
514
  "member": "string",
518
515
  "name": "Describe",
519
516
  "required": false,
520
- "type": "string",
521
- "value_allowed_null": false
517
+ "type": "string"
522
518
  }
523
519
  ],
524
520
  "usage": "in"
@@ -849,58 +849,6 @@ def doModifyNatSequenceRules(args, parsed_globals):
849
849
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
850
850
 
851
851
 
852
- def doDeleteVpcInstance(args, parsed_globals):
853
- g_param = parse_global_arg(parsed_globals)
854
-
855
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
856
- cred = credential.CVMRoleCredential()
857
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
858
- cred = credential.STSAssumeRoleCredential(
859
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
860
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
861
- )
862
- 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):
863
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
864
- else:
865
- cred = credential.Credential(
866
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
867
- )
868
- http_profile = HttpProfile(
869
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
870
- reqMethod="POST",
871
- endpoint=g_param[OptionsDefine.Endpoint],
872
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
873
- )
874
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
875
- if g_param[OptionsDefine.Language]:
876
- profile.language = g_param[OptionsDefine.Language]
877
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
878
- client = mod.CfwClient(cred, g_param[OptionsDefine.Region], profile)
879
- client._sdkVersion += ("_CLI_" + __version__)
880
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
881
- model = models.DeleteVpcInstanceRequest()
882
- model.from_json_string(json.dumps(args))
883
- start_time = time.time()
884
- while True:
885
- rsp = client.DeleteVpcInstance(model)
886
- result = rsp.to_json_string()
887
- try:
888
- json_obj = json.loads(result)
889
- except TypeError as e:
890
- json_obj = json.loads(result.decode('utf-8')) # python3.3
891
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
892
- break
893
- cur_time = time.time()
894
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
895
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
896
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
897
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
898
- else:
899
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
900
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
901
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
902
-
903
-
904
852
  def doDescribeUnHandleEventTabList(args, parsed_globals):
905
853
  g_param = parse_global_arg(parsed_globals)
906
854
 
@@ -6024,7 +5972,6 @@ ACTION_MAP = {
6024
5972
  "ModifySecurityGroupSequenceRules": doModifySecurityGroupSequenceRules,
6025
5973
  "RemoveEnterpriseSecurityGroupRule": doRemoveEnterpriseSecurityGroupRule,
6026
5974
  "ModifyNatSequenceRules": doModifyNatSequenceRules,
6027
- "DeleteVpcInstance": doDeleteVpcInstance,
6028
5975
  "DescribeUnHandleEventTabList": doDescribeUnHandleEventTabList,
6029
5976
  "CreateNatFwInstance": doCreateNatFwInstance,
6030
5977
  "ModifyBlockTop": doModifyBlockTop,
@@ -210,13 +210,6 @@
210
210
  "output": "DeleteVpcFwGroupResponse",
211
211
  "status": "online"
212
212
  },
213
- "DeleteVpcInstance": {
214
- "document": "接口废弃\n\n删除防火墙实例",
215
- "input": "DeleteVpcInstanceRequest",
216
- "name": "删除防火墙实例",
217
- "output": "DeleteVpcInstanceResponse",
218
- "status": "deprecated"
219
- },
220
213
  "DescribeAcLists": {
221
214
  "document": "访问控制列表",
222
215
  "input": "DescribeAcListsRequest",
@@ -4060,23 +4053,6 @@
4060
4053
  ],
4061
4054
  "type": "object"
4062
4055
  },
4063
- "DeleteVpcInstanceRequest": {
4064
- "document": "DeleteVpcInstance请求参数结构体",
4065
- "members": [],
4066
- "type": "object"
4067
- },
4068
- "DeleteVpcInstanceResponse": {
4069
- "document": "DeleteVpcInstance返回参数结构体",
4070
- "members": [
4071
- {
4072
- "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
4073
- "member": "string",
4074
- "name": "RequestId",
4075
- "type": "string"
4076
- }
4077
- ],
4078
- "type": "object"
4079
- },
4080
4056
  "DescAcItem": {
4081
4057
  "document": "访问控制列表对象",
4082
4058
  "members": [
@@ -258,14 +258,6 @@
258
258
  "title": "删除防火墙(组)"
259
259
  }
260
260
  ],
261
- "DeleteVpcInstance": [
262
- {
263
- "document": "",
264
- "input": "POST / HTTP/1.1\nHost: cfw.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DeleteVpcInstance\n<公共请求参数>\n\n{}",
265
- "output": "{\n \"Response\": {\n \"RequestId\": \"3c140219-cfe9-470e-b241-907877d6fb03\"\n }\n}",
266
- "title": "创建、选择vpc"
267
- }
268
- ],
269
261
  "DescribeAcLists": [
270
262
  {
271
263
  "document": "",
@@ -46851,7 +46851,7 @@
46851
46851
  },
46852
46852
  {
46853
46853
  "disabled": false,
46854
- "document": "0:待处理 1:已处理 2: 已加白 3: 已忽略 4:已删除 ",
46854
+ "document": "0:待处理 1:已处理 3: 已忽略 4:已删除 ",
46855
46855
  "example": "1",
46856
46856
  "member": "uint64",
46857
46857
  "name": "Status",
@@ -4987,7 +4987,7 @@
4987
4987
  {
4988
4988
  "disabled": false,
4989
4989
  "document": "资源包大小,计算资源单位:万个;存储资源:GB",
4990
- "example": "100",
4990
+ "example": "2000",
4991
4991
  "member": "float",
4992
4992
  "name": "PackageSpec",
4993
4993
  "required": true,
@@ -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 doDescribeJobFlow(args, parsed_globals):
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.DescribeJobFlowRequest()
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.DescribeJobFlow(model)
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 doInquirePriceRenewEmr(args, parsed_globals):
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.InquirePriceRenewEmrRequest()
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.InquirePriceRenewEmr(model)
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 doDescribeEmrOverviewMetrics(args, parsed_globals):
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.DescribeEmrOverviewMetricsRequest()
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.DescribeEmrOverviewMetrics(model)
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
 
@@ -1681,6 +1785,58 @@ def doInquiryPriceCreateInstance(args, parsed_globals):
1681
1785
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1682
1786
 
1683
1787
 
1788
+ def doInquirePriceRenewEmr(args, parsed_globals):
1789
+ g_param = parse_global_arg(parsed_globals)
1790
+
1791
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1792
+ cred = credential.CVMRoleCredential()
1793
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1794
+ cred = credential.STSAssumeRoleCredential(
1795
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1796
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1797
+ )
1798
+ 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):
1799
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1800
+ else:
1801
+ cred = credential.Credential(
1802
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1803
+ )
1804
+ http_profile = HttpProfile(
1805
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1806
+ reqMethod="POST",
1807
+ endpoint=g_param[OptionsDefine.Endpoint],
1808
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1809
+ )
1810
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1811
+ if g_param[OptionsDefine.Language]:
1812
+ profile.language = g_param[OptionsDefine.Language]
1813
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1814
+ client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
1815
+ client._sdkVersion += ("_CLI_" + __version__)
1816
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1817
+ model = models.InquirePriceRenewEmrRequest()
1818
+ model.from_json_string(json.dumps(args))
1819
+ start_time = time.time()
1820
+ while True:
1821
+ rsp = client.InquirePriceRenewEmr(model)
1822
+ result = rsp.to_json_string()
1823
+ try:
1824
+ json_obj = json.loads(result)
1825
+ except TypeError as e:
1826
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1827
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1828
+ break
1829
+ cur_time = time.time()
1830
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1831
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1832
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1833
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1834
+ else:
1835
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1836
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1837
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1838
+
1839
+
1684
1840
  def doAddMetricScaleStrategy(args, parsed_globals):
1685
1841
  g_param = parse_global_arg(parsed_globals)
1686
1842
 
@@ -2461,6 +2617,58 @@ def doDescribeInsightList(args, parsed_globals):
2461
2617
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2462
2618
 
2463
2619
 
2620
+ def doDescribeEmrOverviewMetrics(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.EmrClient(cred, g_param[OptionsDefine.Region], profile)
2647
+ client._sdkVersion += ("_CLI_" + __version__)
2648
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2649
+ model = models.DescribeEmrOverviewMetricsRequest()
2650
+ model.from_json_string(json.dumps(args))
2651
+ start_time = time.time()
2652
+ while True:
2653
+ rsp = client.DescribeEmrOverviewMetrics(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 doScaleOutCluster(args, parsed_globals):
2465
2673
  g_param = parse_global_arg(parsed_globals)
2466
2674
 
@@ -2582,8 +2790,9 @@ ACTION_MAP = {
2582
2790
  "CreateCluster": doCreateCluster,
2583
2791
  "InquiryPriceRenewInstance": doInquiryPriceRenewInstance,
2584
2792
  "DescribeImpalaQueries": doDescribeImpalaQueries,
2585
- "DescribeJobFlow": doDescribeJobFlow,
2586
- "InquirePriceRenewEmr": doInquirePriceRenewEmr,
2793
+ "DescribeYarnQueue": doDescribeYarnQueue,
2794
+ "ModifyYarnQueueV2": doModifyYarnQueueV2,
2795
+ "DeployYarnConf": doDeployYarnConf,
2587
2796
  "DescribeClusterFlowStatusDetail": doDescribeClusterFlowStatusDetail,
2588
2797
  "InquiryPriceScaleOutInstance": doInquiryPriceScaleOutInstance,
2589
2798
  "DescribeAutoScaleRecords": doDescribeAutoScaleRecords,
@@ -2595,11 +2804,12 @@ ACTION_MAP = {
2595
2804
  "DescribeInstances": doDescribeInstances,
2596
2805
  "ModifyYarnDeploy": doModifyYarnDeploy,
2597
2806
  "TerminateClusterNodes": doTerminateClusterNodes,
2598
- "DescribeEmrOverviewMetrics": doDescribeEmrOverviewMetrics,
2807
+ "ResetYarnConfig": doResetYarnConfig,
2599
2808
  "DescribeUsersForUserManager": doDescribeUsersForUserManager,
2600
2809
  "DeleteUserManagerUserList": doDeleteUserManagerUserList,
2601
2810
  "AddUsersForUserManager": doAddUsersForUserManager,
2602
2811
  "ModifyAutoRenewFlag": doModifyAutoRenewFlag,
2812
+ "DescribeJobFlow": doDescribeJobFlow,
2603
2813
  "ModifyAutoScaleStrategy": doModifyAutoScaleStrategy,
2604
2814
  "DeleteAutoScaleStrategy": doDeleteAutoScaleStrategy,
2605
2815
  "DescribeEmrApplicationStatics": doDescribeEmrApplicationStatics,
@@ -2608,6 +2818,7 @@ ACTION_MAP = {
2608
2818
  "SyncPodState": doSyncPodState,
2609
2819
  "CreateInstance": doCreateInstance,
2610
2820
  "InquiryPriceCreateInstance": doInquiryPriceCreateInstance,
2821
+ "InquirePriceRenewEmr": doInquirePriceRenewEmr,
2611
2822
  "AddMetricScaleStrategy": doAddMetricScaleStrategy,
2612
2823
  "DescribeYarnScheduleHistory": doDescribeYarnScheduleHistory,
2613
2824
  "ModifyResourceScheduleConfig": doModifyResourceScheduleConfig,
@@ -2623,6 +2834,7 @@ ACTION_MAP = {
2623
2834
  "DescribeInstancesList": doDescribeInstancesList,
2624
2835
  "ModifyResourcePools": doModifyResourcePools,
2625
2836
  "DescribeInsightList": doDescribeInsightList,
2837
+ "DescribeEmrOverviewMetrics": doDescribeEmrOverviewMetrics,
2626
2838
  "ScaleOutCluster": doScaleOutCluster,
2627
2839
  "RunJobFlow": doRunJobFlow,
2628
2840