tccli 3.0.1229.1__py2.py3-none-any.whl → 3.0.1230.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tccli/__init__.py +1 -1
- tccli/services/aiart/aiart_client.py +57 -4
- tccli/services/aiart/v20221229/api.json +99 -10
- tccli/services/aiart/v20221229/examples.json +8 -0
- tccli/services/batch/v20170312/api.json +15 -8
- tccli/services/cfw/v20190904/api.json +1 -1
- tccli/services/cwp/v20180228/api.json +1 -1
- tccli/services/cynosdb/cynosdb_client.py +110 -57
- tccli/services/cynosdb/v20190107/api.json +166 -18
- tccli/services/cynosdb/v20190107/examples.json +14 -0
- tccli/services/dbbrain/v20210527/api.json +3 -1
- tccli/services/emr/emr_client.py +110 -4
- tccli/services/emr/v20190103/api.json +645 -0
- tccli/services/emr/v20190103/examples.json +16 -0
- tccli/services/iotexplorer/v20190423/api.json +10 -0
- tccli/services/ivld/v20210903/api.json +25 -25
- tccli/services/ivld/v20210903/examples.json +1 -1
- tccli/services/lcic/v20220817/api.json +2 -2
- tccli/services/lke/v20231130/api.json +4 -4
- tccli/services/mps/v20190612/api.json +54 -1
- tccli/services/ocr/v20181119/api.json +108 -28
- tccli/services/postgres/v20170312/api.json +221 -219
- tccli/services/postgres/v20170312/examples.json +36 -36
- tccli/services/tdmq/v20200217/api.json +2 -2
- tccli/services/trtc/v20190722/api.json +4 -8
- tccli/services/vclm/v20240523/api.json +3 -3
- tccli/services/vod/v20180717/api.json +17 -17
- tccli/services/vpc/v20170312/api.json +493 -27
- tccli/services/vpc/v20170312/examples.json +67 -11
- tccli/services/vpc/vpc_client.py +475 -104
- {tccli-3.0.1229.1.dist-info → tccli-3.0.1230.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1229.1.dist-info → tccli-3.0.1230.1.dist-info}/RECORD +35 -35
- {tccli-3.0.1229.1.dist-info → tccli-3.0.1230.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1229.1.dist-info → tccli-3.0.1230.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1229.1.dist-info → tccli-3.0.1230.1.dist-info}/license_files/LICENSE +0 -0
@@ -546,6 +546,13 @@
|
|
546
546
|
"output": "DescribeRollbackTimeRangeResponse",
|
547
547
|
"status": "online"
|
548
548
|
},
|
549
|
+
"DescribeServerlessInstanceSpecs": {
|
550
|
+
"document": "查询Serverless实例可选规格",
|
551
|
+
"input": "DescribeServerlessInstanceSpecsRequest",
|
552
|
+
"name": "查询Serverless实例可选规格",
|
553
|
+
"output": "DescribeServerlessInstanceSpecsResponse",
|
554
|
+
"status": "online"
|
555
|
+
},
|
549
556
|
"DescribeServerlessStrategy": {
|
550
557
|
"document": "查询serverless策略",
|
551
558
|
"input": "DescribeServerlessStrategyRequest",
|
@@ -11808,6 +11815,43 @@
|
|
11808
11815
|
],
|
11809
11816
|
"type": "object"
|
11810
11817
|
},
|
11818
|
+
"DescribeServerlessInstanceSpecsRequest": {
|
11819
|
+
"document": "DescribeServerlessInstanceSpecs请求参数结构体",
|
11820
|
+
"members": [
|
11821
|
+
{
|
11822
|
+
"disabled": false,
|
11823
|
+
"document": "可用区",
|
11824
|
+
"example": "ap-guangzhou-3",
|
11825
|
+
"member": "string",
|
11826
|
+
"name": "Zone",
|
11827
|
+
"required": false,
|
11828
|
+
"type": "string"
|
11829
|
+
}
|
11830
|
+
],
|
11831
|
+
"type": "object"
|
11832
|
+
},
|
11833
|
+
"DescribeServerlessInstanceSpecsResponse": {
|
11834
|
+
"document": "DescribeServerlessInstanceSpecs返回参数结构体",
|
11835
|
+
"members": [
|
11836
|
+
{
|
11837
|
+
"disabled": false,
|
11838
|
+
"document": "Serverless实例可选规格",
|
11839
|
+
"example": "无",
|
11840
|
+
"member": "ServerlessSpec",
|
11841
|
+
"name": "Specs",
|
11842
|
+
"output_required": true,
|
11843
|
+
"type": "list",
|
11844
|
+
"value_allowed_null": false
|
11845
|
+
},
|
11846
|
+
{
|
11847
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
11848
|
+
"member": "string",
|
11849
|
+
"name": "RequestId",
|
11850
|
+
"type": "string"
|
11851
|
+
}
|
11852
|
+
],
|
11853
|
+
"type": "object"
|
11854
|
+
},
|
11811
11855
|
"DescribeServerlessStrategyRequest": {
|
11812
11856
|
"document": "DescribeServerlessStrategy请求参数结构体",
|
11813
11857
|
"members": [
|
@@ -15939,24 +15983,6 @@
|
|
15939
15983
|
"name": "MaxRoCount",
|
15940
15984
|
"required": false,
|
15941
15985
|
"type": "int"
|
15942
|
-
},
|
15943
|
-
{
|
15944
|
-
"disabled": false,
|
15945
|
-
"document": "集群是否允许扩容,可选范围<li>yes</li><li>no</li>",
|
15946
|
-
"example": "yes",
|
15947
|
-
"member": "string",
|
15948
|
-
"name": "AutoScaleUp",
|
15949
|
-
"required": false,
|
15950
|
-
"type": "string"
|
15951
|
-
},
|
15952
|
-
{
|
15953
|
-
"disabled": false,
|
15954
|
-
"document": "集群是否允许缩容,可选范围<li>yes</li><li>no</li>",
|
15955
|
-
"example": "yes",
|
15956
|
-
"member": "string",
|
15957
|
-
"name": "AutoScaleDown",
|
15958
|
-
"required": false,
|
15959
|
-
"type": "string"
|
15960
15986
|
}
|
15961
15987
|
],
|
15962
15988
|
"type": "object"
|
@@ -20398,6 +20424,128 @@
|
|
20398
20424
|
],
|
20399
20425
|
"usage": "out"
|
20400
20426
|
},
|
20427
|
+
"ServerlessSpec": {
|
20428
|
+
"document": "serverless规格",
|
20429
|
+
"members": [
|
20430
|
+
{
|
20431
|
+
"disabled": false,
|
20432
|
+
"document": "cpu最小值",
|
20433
|
+
"example": "1",
|
20434
|
+
"member": "float",
|
20435
|
+
"name": "MinCpu",
|
20436
|
+
"output_required": true,
|
20437
|
+
"type": "float",
|
20438
|
+
"value_allowed_null": false
|
20439
|
+
},
|
20440
|
+
{
|
20441
|
+
"disabled": false,
|
20442
|
+
"document": "cpu最大值",
|
20443
|
+
"example": "1",
|
20444
|
+
"member": "float",
|
20445
|
+
"name": "MaxCpu",
|
20446
|
+
"output_required": true,
|
20447
|
+
"type": "float",
|
20448
|
+
"value_allowed_null": false
|
20449
|
+
},
|
20450
|
+
{
|
20451
|
+
"disabled": false,
|
20452
|
+
"document": "最大存储空间",
|
20453
|
+
"example": "1",
|
20454
|
+
"member": "int64",
|
20455
|
+
"name": "MaxStorageSize",
|
20456
|
+
"output_required": true,
|
20457
|
+
"type": "int",
|
20458
|
+
"value_allowed_null": false
|
20459
|
+
},
|
20460
|
+
{
|
20461
|
+
"disabled": false,
|
20462
|
+
"document": "是否为默认规格",
|
20463
|
+
"example": "1",
|
20464
|
+
"member": "int64",
|
20465
|
+
"name": "IsDefault",
|
20466
|
+
"output_required": true,
|
20467
|
+
"type": "int",
|
20468
|
+
"value_allowed_null": false
|
20469
|
+
},
|
20470
|
+
{
|
20471
|
+
"disabled": false,
|
20472
|
+
"document": "是否有库存",
|
20473
|
+
"example": "false",
|
20474
|
+
"member": "bool",
|
20475
|
+
"name": "HasStock",
|
20476
|
+
"output_required": true,
|
20477
|
+
"type": "bool",
|
20478
|
+
"value_allowed_null": false
|
20479
|
+
},
|
20480
|
+
{
|
20481
|
+
"disabled": false,
|
20482
|
+
"document": "库存数量",
|
20483
|
+
"example": "1",
|
20484
|
+
"member": "int64",
|
20485
|
+
"name": "StockCount",
|
20486
|
+
"output_required": true,
|
20487
|
+
"type": "int",
|
20488
|
+
"value_allowed_null": false
|
20489
|
+
},
|
20490
|
+
{
|
20491
|
+
"disabled": false,
|
20492
|
+
"document": "可用区库存信息\n注意:此字段可能返回 null,表示取不到有效值。",
|
20493
|
+
"example": "无",
|
20494
|
+
"member": "ServerlessZoneStockInfo",
|
20495
|
+
"name": "ZoneStockInfos",
|
20496
|
+
"output_required": false,
|
20497
|
+
"type": "list",
|
20498
|
+
"value_allowed_null": true
|
20499
|
+
}
|
20500
|
+
],
|
20501
|
+
"usage": "out"
|
20502
|
+
},
|
20503
|
+
"ServerlessZoneStockInfo": {
|
20504
|
+
"document": "serverless类型的可用区库存信息",
|
20505
|
+
"members": [
|
20506
|
+
{
|
20507
|
+
"disabled": false,
|
20508
|
+
"document": "可用区\n注意:此字段可能返回 null,表示取不到有效值。",
|
20509
|
+
"example": "无",
|
20510
|
+
"member": "string",
|
20511
|
+
"name": "Zone",
|
20512
|
+
"output_required": false,
|
20513
|
+
"type": "string",
|
20514
|
+
"value_allowed_null": true
|
20515
|
+
},
|
20516
|
+
{
|
20517
|
+
"disabled": false,
|
20518
|
+
"document": "存储量\n注意:此字段可能返回 null,表示取不到有效值。",
|
20519
|
+
"example": "无",
|
20520
|
+
"member": "int64",
|
20521
|
+
"name": "StockCount",
|
20522
|
+
"output_required": false,
|
20523
|
+
"type": "int",
|
20524
|
+
"value_allowed_null": true
|
20525
|
+
},
|
20526
|
+
{
|
20527
|
+
"disabled": false,
|
20528
|
+
"document": "是否包含库存\n注意:此字段可能返回 null,表示取不到有效值。",
|
20529
|
+
"example": "无",
|
20530
|
+
"member": "bool",
|
20531
|
+
"name": "HasStock",
|
20532
|
+
"output_required": false,
|
20533
|
+
"type": "bool",
|
20534
|
+
"value_allowed_null": true
|
20535
|
+
},
|
20536
|
+
{
|
20537
|
+
"disabled": false,
|
20538
|
+
"document": "从可用区库存信息\n注意:此字段可能返回 null,表示取不到有效值。",
|
20539
|
+
"example": "无",
|
20540
|
+
"member": "SlaveZoneStockInfo",
|
20541
|
+
"name": "SlaveZoneStockInfos",
|
20542
|
+
"output_required": false,
|
20543
|
+
"type": "list",
|
20544
|
+
"value_allowed_null": true
|
20545
|
+
}
|
20546
|
+
],
|
20547
|
+
"usage": "out"
|
20548
|
+
},
|
20401
20549
|
"SetRenewFlagRequest": {
|
20402
20550
|
"document": "SetRenewFlag请求参数结构体",
|
20403
20551
|
"members": [
|
@@ -648,6 +648,14 @@
|
|
648
648
|
"title": "查询回档时间范围"
|
649
649
|
}
|
650
650
|
],
|
651
|
+
"DescribeServerlessInstanceSpecs": [
|
652
|
+
{
|
653
|
+
"document": "",
|
654
|
+
"input": "POST / HTTP/1.1\nHost: cynosdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeServerlessInstanceSpecs\n<公共请求参数>\n\n{}",
|
655
|
+
"output": "{\n \"Response\": {\n \"Specs\": [\n {\n \"MaxStorageSize\": 1000,\n \"MinCpu\": 0.25,\n \"StockCount\": 0,\n \"MaxCpu\": 0.5,\n \"HasStock\": true,\n \"IsDefault\": 0\n },\n {\n \"MaxStorageSize\": 1000,\n \"MinCpu\": 0.25,\n \"StockCount\": 0,\n \"MaxCpu\": 0.0,\n \"HasStock\": true,\n \"IsDefault\": 0\n },\n {\n \"MaxStorageSize\": 5000,\n \"MinCpu\": 0.25,\n \"StockCount\": 0,\n \"MaxCpu\": 0.0,\n \"HasStock\": true,\n \"IsDefault\": 0\n },\n {\n \"MaxStorageSize\": 10000,\n \"MinCpu\": 0.25,\n \"StockCount\": 0,\n \"MaxCpu\": 0.0,\n \"HasStock\": true,\n \"IsDefault\": 0\n },\n {\n \"MaxStorageSize\": 1000,\n \"MinCpu\": 0.5,\n \"StockCount\": 0,\n \"MaxCpu\": 0.0,\n \"HasStock\": true,\n \"IsDefault\": 0\n },\n {\n \"MaxStorageSize\": 5000,\n \"MinCpu\": 0.5,\n \"StockCount\": 0,\n \"MaxCpu\": 0.0,\n \"HasStock\": true,\n \"IsDefault\": 1\n },\n {\n \"MaxStorageSize\": 10000,\n \"MinCpu\": 0.5,\n \"StockCount\": 0,\n \"MaxCpu\": 0.0,\n \"HasStock\": true,\n \"IsDefault\": 0\n },\n {\n \"MaxStorageSize\": 5000,\n \"MinCpu\": 0.0,\n \"StockCount\": 0,\n \"MaxCpu\": 0.0,\n \"HasStock\": true,\n \"IsDefault\": 0\n },\n {\n \"MaxStorageSize\": 10000,\n \"MinCpu\": 0.0,\n \"StockCount\": 0,\n \"MaxCpu\": 0.0,\n \"HasStock\": true,\n \"IsDefault\": 0\n },\n {\n \"MaxStorageSize\": 10000,\n \"MinCpu\": 0.0,\n \"StockCount\": 0,\n \"MaxCpu\": 0.0,\n \"HasStock\": true,\n \"IsDefault\": 0\n }\n ],\n \"RequestId\": \"52-a341-4269-bce2-221ec952ea16|m\"\n }\n}",
|
656
|
+
"title": "查询Serverless实例可选规格"
|
657
|
+
}
|
658
|
+
],
|
651
659
|
"DescribeServerlessStrategy": [
|
652
660
|
{
|
653
661
|
"document": "",
|
@@ -982,6 +990,12 @@
|
|
982
990
|
"input": "POST / HTTP/1.1\nHost: cynosdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyServerlessStrategy\n<公共请求参数>\n\n{\n \"AutoPause\": \"no\",\n \"AutoScaleUpDelay\": 200,\n \"AutoPauseDelay\": 100,\n \"MinCpu\": 0.25,\n \"MaxCpu\": 2,\n \"ClusterId\": \"cynosdbmysql-8vcxoq75\",\n \"AutoScaleDownDelay\": 300\n}",
|
983
991
|
"output": "{\n \"Response\": {\n \"FlowId\": 1008300,\n \"RequestId\": \"c3da7958-23e8-11eb-8e52-525400b7dd5a\"\n }\n}",
|
984
992
|
"title": "修改serverless策略"
|
993
|
+
},
|
994
|
+
{
|
995
|
+
"document": "调整主节点",
|
996
|
+
"input": "POST / HTTP/1.1\nHost: cynosdb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyServerlessStrategy\n<公共请求参数>\n\n{\n \"ClusterId\": \"cynosdbmysql-92oecwyv\",\n \"MinCpu\": 2,\n \"MaxCpu\": 2\n}",
|
997
|
+
"output": "{\n \"Response\": {\n \"FlowId\": 917319,\n \"RequestId\": \"a7ef1e81-e306-45fd-ab3d-37a6ae7ecf96\"\n }\n}",
|
998
|
+
"title": "变更serverless策略"
|
985
999
|
}
|
986
1000
|
],
|
987
1001
|
"ModifyVipVport": [
|
@@ -6686,7 +6686,7 @@
|
|
6686
6686
|
},
|
6687
6687
|
{
|
6688
6688
|
"disabled": false,
|
6689
|
-
"document": "默认是
|
6689
|
+
"document": "默认是true,会记录下kill的记录;该参数为true, 则在kill操作前校验目标会话是否存在,存在则继续kill,否则取消kill。为了加快kill速度,可设置为false。",
|
6690
6690
|
"example": "false",
|
6691
6691
|
"member": "bool",
|
6692
6692
|
"name": "RecordHistory",
|
@@ -6705,6 +6705,7 @@
|
|
6705
6705
|
"example": "[536284]",
|
6706
6706
|
"member": "int64",
|
6707
6707
|
"name": "Threads",
|
6708
|
+
"output_required": true,
|
6708
6709
|
"type": "list",
|
6709
6710
|
"value_allowed_null": false
|
6710
6711
|
},
|
@@ -6714,6 +6715,7 @@
|
|
6714
6715
|
"example": "\"AEnnKexGijsX\"",
|
6715
6716
|
"member": "string",
|
6716
6717
|
"name": "SqlExecId",
|
6718
|
+
"output_required": true,
|
6717
6719
|
"type": "string",
|
6718
6720
|
"value_allowed_null": true
|
6719
6721
|
},
|
tccli/services/emr/emr_client.py
CHANGED
@@ -433,7 +433,7 @@ def doModifyYarnQueueV2(args, parsed_globals):
|
|
433
433
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
434
|
|
435
435
|
|
436
|
-
def
|
436
|
+
def doCreateCloudInstance(args, parsed_globals):
|
437
437
|
g_param = parse_global_arg(parsed_globals)
|
438
438
|
|
439
439
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -462,11 +462,11 @@ def doDescribeHDFSStorageInfo(args, parsed_globals):
|
|
462
462
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
463
463
|
client._sdkVersion += ("_CLI_" + __version__)
|
464
464
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
-
model = models.
|
465
|
+
model = models.CreateCloudInstanceRequest()
|
466
466
|
model.from_json_string(json.dumps(args))
|
467
467
|
start_time = time.time()
|
468
468
|
while True:
|
469
|
-
rsp = client.
|
469
|
+
rsp = client.CreateCloudInstance(model)
|
470
470
|
result = rsp.to_json_string()
|
471
471
|
try:
|
472
472
|
json_obj = json.loads(result)
|
@@ -1993,6 +1993,58 @@ def doDescribeInstanceRenewNodes(args, parsed_globals):
|
|
1993
1993
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1994
1994
|
|
1995
1995
|
|
1996
|
+
def doDescribeHDFSStorageInfo(args, parsed_globals):
|
1997
|
+
g_param = parse_global_arg(parsed_globals)
|
1998
|
+
|
1999
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2000
|
+
cred = credential.CVMRoleCredential()
|
2001
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2002
|
+
cred = credential.STSAssumeRoleCredential(
|
2003
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2004
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2005
|
+
)
|
2006
|
+
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):
|
2007
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2008
|
+
else:
|
2009
|
+
cred = credential.Credential(
|
2010
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2011
|
+
)
|
2012
|
+
http_profile = HttpProfile(
|
2013
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2014
|
+
reqMethod="POST",
|
2015
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2016
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2017
|
+
)
|
2018
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2019
|
+
if g_param[OptionsDefine.Language]:
|
2020
|
+
profile.language = g_param[OptionsDefine.Language]
|
2021
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2022
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
2023
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2024
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2025
|
+
model = models.DescribeHDFSStorageInfoRequest()
|
2026
|
+
model.from_json_string(json.dumps(args))
|
2027
|
+
start_time = time.time()
|
2028
|
+
while True:
|
2029
|
+
rsp = client.DescribeHDFSStorageInfo(model)
|
2030
|
+
result = rsp.to_json_string()
|
2031
|
+
try:
|
2032
|
+
json_obj = json.loads(result)
|
2033
|
+
except TypeError as e:
|
2034
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2035
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2036
|
+
break
|
2037
|
+
cur_time = time.time()
|
2038
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2039
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2040
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2041
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2042
|
+
else:
|
2043
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2044
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2045
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2046
|
+
|
2047
|
+
|
1996
2048
|
def doModifyResourceScheduler(args, parsed_globals):
|
1997
2049
|
g_param = parse_global_arg(parsed_globals)
|
1998
2050
|
|
@@ -3293,6 +3345,58 @@ def doDescribeEmrOverviewMetrics(args, parsed_globals):
|
|
3293
3345
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3294
3346
|
|
3295
3347
|
|
3348
|
+
def doModifyPodNum(args, parsed_globals):
|
3349
|
+
g_param = parse_global_arg(parsed_globals)
|
3350
|
+
|
3351
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3352
|
+
cred = credential.CVMRoleCredential()
|
3353
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3354
|
+
cred = credential.STSAssumeRoleCredential(
|
3355
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3356
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3357
|
+
)
|
3358
|
+
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):
|
3359
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3360
|
+
else:
|
3361
|
+
cred = credential.Credential(
|
3362
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3363
|
+
)
|
3364
|
+
http_profile = HttpProfile(
|
3365
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3366
|
+
reqMethod="POST",
|
3367
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3368
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3369
|
+
)
|
3370
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3371
|
+
if g_param[OptionsDefine.Language]:
|
3372
|
+
profile.language = g_param[OptionsDefine.Language]
|
3373
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3374
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
3375
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3376
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3377
|
+
model = models.ModifyPodNumRequest()
|
3378
|
+
model.from_json_string(json.dumps(args))
|
3379
|
+
start_time = time.time()
|
3380
|
+
while True:
|
3381
|
+
rsp = client.ModifyPodNum(model)
|
3382
|
+
result = rsp.to_json_string()
|
3383
|
+
try:
|
3384
|
+
json_obj = json.loads(result)
|
3385
|
+
except TypeError as e:
|
3386
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3387
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3388
|
+
break
|
3389
|
+
cur_time = time.time()
|
3390
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3391
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3392
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3393
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3394
|
+
else:
|
3395
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3396
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3397
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3398
|
+
|
3399
|
+
|
3296
3400
|
def doScaleOutCluster(args, parsed_globals):
|
3297
3401
|
g_param = parse_global_arg(parsed_globals)
|
3298
3402
|
|
@@ -3416,7 +3520,7 @@ ACTION_MAP = {
|
|
3416
3520
|
"DescribeImpalaQueries": doDescribeImpalaQueries,
|
3417
3521
|
"DescribeYarnQueue": doDescribeYarnQueue,
|
3418
3522
|
"ModifyYarnQueueV2": doModifyYarnQueueV2,
|
3419
|
-
"
|
3523
|
+
"CreateCloudInstance": doCreateCloudInstance,
|
3420
3524
|
"DeployYarnConf": doDeployYarnConf,
|
3421
3525
|
"DescribeClusterFlowStatusDetail": doDescribeClusterFlowStatusDetail,
|
3422
3526
|
"InquiryPriceScaleOutInstance": doInquiryPriceScaleOutInstance,
|
@@ -3446,6 +3550,7 @@ ACTION_MAP = {
|
|
3446
3550
|
"DeleteAutoScaleStrategy": doDeleteAutoScaleStrategy,
|
3447
3551
|
"DescribeEmrApplicationStatics": doDescribeEmrApplicationStatics,
|
3448
3552
|
"DescribeInstanceRenewNodes": doDescribeInstanceRenewNodes,
|
3553
|
+
"DescribeHDFSStorageInfo": doDescribeHDFSStorageInfo,
|
3449
3554
|
"ModifyResourceScheduler": doModifyResourceScheduler,
|
3450
3555
|
"DescribeResourceScheduleDiffDetail": doDescribeResourceScheduleDiffDetail,
|
3451
3556
|
"DescribeSLInstance": doDescribeSLInstance,
|
@@ -3471,6 +3576,7 @@ ACTION_MAP = {
|
|
3471
3576
|
"ModifyResourcePools": doModifyResourcePools,
|
3472
3577
|
"DescribeInsightList": doDescribeInsightList,
|
3473
3578
|
"DescribeEmrOverviewMetrics": doDescribeEmrOverviewMetrics,
|
3579
|
+
"ModifyPodNum": doModifyPodNum,
|
3474
3580
|
"ScaleOutCluster": doScaleOutCluster,
|
3475
3581
|
"RunJobFlow": doRunJobFlow,
|
3476
3582
|
|