tccli 3.0.1184.1__py2.py3-none-any.whl → 3.0.1186.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/bi/v20220105/api.json +9 -0
- tccli/services/cdb/v20170320/api.json +2 -2
- tccli/services/cdwch/v20200915/api.json +5 -9
- tccli/services/cls/v20201016/api.json +1 -1
- tccli/services/cynosdb/cynosdb_client.py +65 -12
- tccli/services/cynosdb/v20190107/api.json +100 -1
- tccli/services/cynosdb/v20190107/examples.json +8 -0
- tccli/services/dlc/v20210125/api.json +48 -11
- tccli/services/dlc/v20210125/examples.json +4 -4
- tccli/services/dsgc/v20190723/api.json +9 -0
- tccli/services/ecc/v20181213/api.json +14 -12
- tccli/services/ecc/v20181213/examples.json +3 -3
- tccli/services/ess/v20201111/api.json +1 -1
- tccli/services/ess/v20201111/examples.json +5 -5
- tccli/services/facefusion/v20220927/api.json +8 -10
- tccli/services/hunyuan/v20230901/api.json +1 -1
- tccli/services/redis/v20180412/api.json +18 -13
- tccli/services/redis/v20180412/examples.json +2 -2
- tccli/services/tcr/v20190924/api.json +3 -3
- tccli/services/tcr/v20190924/examples.json +1 -1
- tccli/services/thpc/thpc_client.py +227 -68
- tccli/services/thpc/v20230321/api.json +313 -0
- tccli/services/thpc/v20230321/examples.json +24 -0
- tccli/services/tse/v20201207/api.json +1 -1
- tccli/services/vclm/v20240523/api.json +19 -7
- tccli/services/vrs/v20200824/api.json +4 -4
- tccli/services/vtc/v20240223/api.json +15 -6
- tccli/services/waf/v20180125/api.json +3 -3
- tccli/services/waf/v20180125/examples.json +1 -1
- {tccli-3.0.1184.1.dist-info → tccli-3.0.1186.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1184.1.dist-info → tccli-3.0.1186.1.dist-info}/RECORD +35 -35
- {tccli-3.0.1184.1.dist-info → tccli-3.0.1186.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1184.1.dist-info → tccli-3.0.1186.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1184.1.dist-info → tccli-3.0.1186.1.dist-info}/license_files/LICENSE +0 -0
@@ -21,7 +21,7 @@ from tencentcloud.thpc.v20211109 import models as models_v20211109
|
|
21
21
|
from jmespath import search
|
22
22
|
import time
|
23
23
|
|
24
|
-
def
|
24
|
+
def doDeleteNodes(args, parsed_globals):
|
25
25
|
g_param = parse_global_arg(parsed_globals)
|
26
26
|
|
27
27
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -50,11 +50,11 @@ def doDescribeClusterStorageOption(args, parsed_globals):
|
|
50
50
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
51
51
|
client._sdkVersion += ("_CLI_" + __version__)
|
52
52
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
53
|
-
model = models.
|
53
|
+
model = models.DeleteNodesRequest()
|
54
54
|
model.from_json_string(json.dumps(args))
|
55
55
|
start_time = time.time()
|
56
56
|
while True:
|
57
|
-
rsp = client.
|
57
|
+
rsp = client.DeleteNodes(model)
|
58
58
|
result = rsp.to_json_string()
|
59
59
|
try:
|
60
60
|
json_obj = json.loads(result)
|
@@ -73,7 +73,7 @@ def doDescribeClusterStorageOption(args, parsed_globals):
|
|
73
73
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
74
74
|
|
75
75
|
|
76
|
-
def
|
76
|
+
def doTerminateWorkspaces(args, parsed_globals):
|
77
77
|
g_param = parse_global_arg(parsed_globals)
|
78
78
|
|
79
79
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -102,11 +102,11 @@ def doDeleteNodes(args, parsed_globals):
|
|
102
102
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
103
103
|
client._sdkVersion += ("_CLI_" + __version__)
|
104
104
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
105
|
-
model = models.
|
105
|
+
model = models.TerminateWorkspacesRequest()
|
106
106
|
model.from_json_string(json.dumps(args))
|
107
107
|
start_time = time.time()
|
108
108
|
while True:
|
109
|
-
rsp = client.
|
109
|
+
rsp = client.TerminateWorkspaces(model)
|
110
110
|
result = rsp.to_json_string()
|
111
111
|
try:
|
112
112
|
json_obj = json.loads(result)
|
@@ -125,7 +125,7 @@ def doDeleteNodes(args, parsed_globals):
|
|
125
125
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
126
126
|
|
127
127
|
|
128
|
-
def
|
128
|
+
def doModifyWorkspacesAttribute(args, parsed_globals):
|
129
129
|
g_param = parse_global_arg(parsed_globals)
|
130
130
|
|
131
131
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -154,11 +154,11 @@ def doBindAutoScalingGroup(args, parsed_globals):
|
|
154
154
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
155
155
|
client._sdkVersion += ("_CLI_" + __version__)
|
156
156
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
157
|
-
model = models.
|
157
|
+
model = models.ModifyWorkspacesAttributeRequest()
|
158
158
|
model.from_json_string(json.dumps(args))
|
159
159
|
start_time = time.time()
|
160
160
|
while True:
|
161
|
-
rsp = client.
|
161
|
+
rsp = client.ModifyWorkspacesAttribute(model)
|
162
162
|
result = rsp.to_json_string()
|
163
163
|
try:
|
164
164
|
json_obj = json.loads(result)
|
@@ -177,7 +177,7 @@ def doBindAutoScalingGroup(args, parsed_globals):
|
|
177
177
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
178
178
|
|
179
179
|
|
180
|
-
def
|
180
|
+
def doCreateCluster(args, parsed_globals):
|
181
181
|
g_param = parse_global_arg(parsed_globals)
|
182
182
|
|
183
183
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -206,11 +206,11 @@ def doModifyInitNodeScripts(args, parsed_globals):
|
|
206
206
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
207
207
|
client._sdkVersion += ("_CLI_" + __version__)
|
208
208
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
209
|
-
model = models.
|
209
|
+
model = models.CreateClusterRequest()
|
210
210
|
model.from_json_string(json.dumps(args))
|
211
211
|
start_time = time.time()
|
212
212
|
while True:
|
213
|
-
rsp = client.
|
213
|
+
rsp = client.CreateCluster(model)
|
214
214
|
result = rsp.to_json_string()
|
215
215
|
try:
|
216
216
|
json_obj = json.loads(result)
|
@@ -229,7 +229,7 @@ def doModifyInitNodeScripts(args, parsed_globals):
|
|
229
229
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
230
230
|
|
231
231
|
|
232
|
-
def
|
232
|
+
def doCreateWorkspaces(args, parsed_globals):
|
233
233
|
g_param = parse_global_arg(parsed_globals)
|
234
234
|
|
235
235
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -258,11 +258,11 @@ def doCreateCluster(args, parsed_globals):
|
|
258
258
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
259
259
|
client._sdkVersion += ("_CLI_" + __version__)
|
260
260
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
261
|
-
model = models.
|
261
|
+
model = models.CreateWorkspacesRequest()
|
262
262
|
model.from_json_string(json.dumps(args))
|
263
263
|
start_time = time.time()
|
264
264
|
while True:
|
265
|
-
rsp = client.
|
265
|
+
rsp = client.CreateWorkspaces(model)
|
266
266
|
result = rsp.to_json_string()
|
267
267
|
try:
|
268
268
|
json_obj = json.loads(result)
|
@@ -281,7 +281,7 @@ def doCreateCluster(args, parsed_globals):
|
|
281
281
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
282
282
|
|
283
283
|
|
284
|
-
def
|
284
|
+
def doDescribeQueues(args, parsed_globals):
|
285
285
|
g_param = parse_global_arg(parsed_globals)
|
286
286
|
|
287
287
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -310,11 +310,11 @@ def doDeleteClusterStorageOption(args, parsed_globals):
|
|
310
310
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
311
311
|
client._sdkVersion += ("_CLI_" + __version__)
|
312
312
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
313
|
-
model = models.
|
313
|
+
model = models.DescribeQueuesRequest()
|
314
314
|
model.from_json_string(json.dumps(args))
|
315
315
|
start_time = time.time()
|
316
316
|
while True:
|
317
|
-
rsp = client.
|
317
|
+
rsp = client.DescribeQueues(model)
|
318
318
|
result = rsp.to_json_string()
|
319
319
|
try:
|
320
320
|
json_obj = json.loads(result)
|
@@ -333,7 +333,7 @@ def doDeleteClusterStorageOption(args, parsed_globals):
|
|
333
333
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
334
334
|
|
335
335
|
|
336
|
-
def
|
336
|
+
def doAddNodes(args, parsed_globals):
|
337
337
|
g_param = parse_global_arg(parsed_globals)
|
338
338
|
|
339
339
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -362,11 +362,11 @@ def doSetAutoScalingConfiguration(args, parsed_globals):
|
|
362
362
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
363
363
|
client._sdkVersion += ("_CLI_" + __version__)
|
364
364
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
365
|
-
model = models.
|
365
|
+
model = models.AddNodesRequest()
|
366
366
|
model.from_json_string(json.dumps(args))
|
367
367
|
start_time = time.time()
|
368
368
|
while True:
|
369
|
-
rsp = client.
|
369
|
+
rsp = client.AddNodes(model)
|
370
370
|
result = rsp.to_json_string()
|
371
371
|
try:
|
372
372
|
json_obj = json.loads(result)
|
@@ -385,7 +385,7 @@ def doSetAutoScalingConfiguration(args, parsed_globals):
|
|
385
385
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
386
386
|
|
387
387
|
|
388
|
-
def
|
388
|
+
def doDescribeNodes(args, parsed_globals):
|
389
389
|
g_param = parse_global_arg(parsed_globals)
|
390
390
|
|
391
391
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -414,11 +414,11 @@ def doAddQueue(args, parsed_globals):
|
|
414
414
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
415
415
|
client._sdkVersion += ("_CLI_" + __version__)
|
416
416
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
417
|
-
model = models.
|
417
|
+
model = models.DescribeNodesRequest()
|
418
418
|
model.from_json_string(json.dumps(args))
|
419
419
|
start_time = time.time()
|
420
420
|
while True:
|
421
|
-
rsp = client.
|
421
|
+
rsp = client.DescribeNodes(model)
|
422
422
|
result = rsp.to_json_string()
|
423
423
|
try:
|
424
424
|
json_obj = json.loads(result)
|
@@ -437,7 +437,7 @@ def doAddQueue(args, parsed_globals):
|
|
437
437
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
438
438
|
|
439
439
|
|
440
|
-
def
|
440
|
+
def doAddClusterStorageOption(args, parsed_globals):
|
441
441
|
g_param = parse_global_arg(parsed_globals)
|
442
442
|
|
443
443
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -466,11 +466,11 @@ def doDescribeNodes(args, parsed_globals):
|
|
466
466
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
467
467
|
client._sdkVersion += ("_CLI_" + __version__)
|
468
468
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
469
|
-
model = models.
|
469
|
+
model = models.AddClusterStorageOptionRequest()
|
470
470
|
model.from_json_string(json.dumps(args))
|
471
471
|
start_time = time.time()
|
472
472
|
while True:
|
473
|
-
rsp = client.
|
473
|
+
rsp = client.AddClusterStorageOption(model)
|
474
474
|
result = rsp.to_json_string()
|
475
475
|
try:
|
476
476
|
json_obj = json.loads(result)
|
@@ -489,7 +489,7 @@ def doDescribeNodes(args, parsed_globals):
|
|
489
489
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
490
490
|
|
491
491
|
|
492
|
-
def
|
492
|
+
def doDeleteClusterStorageOption(args, parsed_globals):
|
493
493
|
g_param = parse_global_arg(parsed_globals)
|
494
494
|
|
495
495
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -518,11 +518,11 @@ def doCreateWorkspaces(args, parsed_globals):
|
|
518
518
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
519
519
|
client._sdkVersion += ("_CLI_" + __version__)
|
520
520
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
521
|
-
model = models.
|
521
|
+
model = models.DeleteClusterStorageOptionRequest()
|
522
522
|
model.from_json_string(json.dumps(args))
|
523
523
|
start_time = time.time()
|
524
524
|
while True:
|
525
|
-
rsp = client.
|
525
|
+
rsp = client.DeleteClusterStorageOption(model)
|
526
526
|
result = rsp.to_json_string()
|
527
527
|
try:
|
528
528
|
json_obj = json.loads(result)
|
@@ -541,7 +541,7 @@ def doCreateWorkspaces(args, parsed_globals):
|
|
541
541
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
542
542
|
|
543
543
|
|
544
|
-
def
|
544
|
+
def doDescribeWorkspaces(args, parsed_globals):
|
545
545
|
g_param = parse_global_arg(parsed_globals)
|
546
546
|
|
547
547
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -570,11 +570,11 @@ def doDescribeInitNodeScripts(args, parsed_globals):
|
|
570
570
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
571
571
|
client._sdkVersion += ("_CLI_" + __version__)
|
572
572
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
573
|
-
model = models.
|
573
|
+
model = models.DescribeWorkspacesRequest()
|
574
574
|
model.from_json_string(json.dumps(args))
|
575
575
|
start_time = time.time()
|
576
576
|
while True:
|
577
|
-
rsp = client.
|
577
|
+
rsp = client.DescribeWorkspaces(model)
|
578
578
|
result = rsp.to_json_string()
|
579
579
|
try:
|
580
580
|
json_obj = json.loads(result)
|
@@ -593,7 +593,7 @@ def doDescribeInitNodeScripts(args, parsed_globals):
|
|
593
593
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
594
594
|
|
595
595
|
|
596
|
-
def
|
596
|
+
def doDetachNodes(args, parsed_globals):
|
597
597
|
g_param = parse_global_arg(parsed_globals)
|
598
598
|
|
599
599
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -622,11 +622,11 @@ def doAttachNodes(args, parsed_globals):
|
|
622
622
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
623
623
|
client._sdkVersion += ("_CLI_" + __version__)
|
624
624
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
625
|
-
model = models.
|
625
|
+
model = models.DetachNodesRequest()
|
626
626
|
model.from_json_string(json.dumps(args))
|
627
627
|
start_time = time.time()
|
628
628
|
while True:
|
629
|
-
rsp = client.
|
629
|
+
rsp = client.DetachNodes(model)
|
630
630
|
result = rsp.to_json_string()
|
631
631
|
try:
|
632
632
|
json_obj = json.loads(result)
|
@@ -645,7 +645,7 @@ def doAttachNodes(args, parsed_globals):
|
|
645
645
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
646
646
|
|
647
647
|
|
648
|
-
def
|
648
|
+
def doDescribeClusters(args, parsed_globals):
|
649
649
|
g_param = parse_global_arg(parsed_globals)
|
650
650
|
|
651
651
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -674,11 +674,11 @@ def doDescribeQueues(args, parsed_globals):
|
|
674
674
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
675
675
|
client._sdkVersion += ("_CLI_" + __version__)
|
676
676
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
677
|
-
model = models.
|
677
|
+
model = models.DescribeClustersRequest()
|
678
678
|
model.from_json_string(json.dumps(args))
|
679
679
|
start_time = time.time()
|
680
680
|
while True:
|
681
|
-
rsp = client.
|
681
|
+
rsp = client.DescribeClusters(model)
|
682
682
|
result = rsp.to_json_string()
|
683
683
|
try:
|
684
684
|
json_obj = json.loads(result)
|
@@ -697,7 +697,7 @@ def doDescribeQueues(args, parsed_globals):
|
|
697
697
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
698
698
|
|
699
699
|
|
700
|
-
def
|
700
|
+
def doSetAutoScalingConfiguration(args, parsed_globals):
|
701
701
|
g_param = parse_global_arg(parsed_globals)
|
702
702
|
|
703
703
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -726,11 +726,11 @@ def doAddNodes(args, parsed_globals):
|
|
726
726
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
727
727
|
client._sdkVersion += ("_CLI_" + __version__)
|
728
728
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
729
|
-
model = models.
|
729
|
+
model = models.SetAutoScalingConfigurationRequest()
|
730
730
|
model.from_json_string(json.dumps(args))
|
731
731
|
start_time = time.time()
|
732
732
|
while True:
|
733
|
-
rsp = client.
|
733
|
+
rsp = client.SetAutoScalingConfiguration(model)
|
734
734
|
result = rsp.to_json_string()
|
735
735
|
try:
|
736
736
|
json_obj = json.loads(result)
|
@@ -749,7 +749,7 @@ def doAddNodes(args, parsed_globals):
|
|
749
749
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
750
750
|
|
751
751
|
|
752
|
-
def
|
752
|
+
def doAddQueue(args, parsed_globals):
|
753
753
|
g_param = parse_global_arg(parsed_globals)
|
754
754
|
|
755
755
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -778,11 +778,11 @@ def doDescribeAutoScalingConfiguration(args, parsed_globals):
|
|
778
778
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
779
779
|
client._sdkVersion += ("_CLI_" + __version__)
|
780
780
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
781
|
-
model = models.
|
781
|
+
model = models.AddQueueRequest()
|
782
782
|
model.from_json_string(json.dumps(args))
|
783
783
|
start_time = time.time()
|
784
784
|
while True:
|
785
|
-
rsp = client.
|
785
|
+
rsp = client.AddQueue(model)
|
786
786
|
result = rsp.to_json_string()
|
787
787
|
try:
|
788
788
|
json_obj = json.loads(result)
|
@@ -801,7 +801,7 @@ def doDescribeAutoScalingConfiguration(args, parsed_globals):
|
|
801
801
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
802
802
|
|
803
803
|
|
804
|
-
def
|
804
|
+
def doDescribeInitNodeScripts(args, parsed_globals):
|
805
805
|
g_param = parse_global_arg(parsed_globals)
|
806
806
|
|
807
807
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -830,11 +830,11 @@ def doDescribeClusters(args, parsed_globals):
|
|
830
830
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
831
831
|
client._sdkVersion += ("_CLI_" + __version__)
|
832
832
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
833
|
-
model = models.
|
833
|
+
model = models.DescribeInitNodeScriptsRequest()
|
834
834
|
model.from_json_string(json.dumps(args))
|
835
835
|
start_time = time.time()
|
836
836
|
while True:
|
837
|
-
rsp = client.
|
837
|
+
rsp = client.DescribeInitNodeScripts(model)
|
838
838
|
result = rsp.to_json_string()
|
839
839
|
try:
|
840
840
|
json_obj = json.loads(result)
|
@@ -853,7 +853,7 @@ def doDescribeClusters(args, parsed_globals):
|
|
853
853
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
854
854
|
|
855
855
|
|
856
|
-
def
|
856
|
+
def doAttachNodes(args, parsed_globals):
|
857
857
|
g_param = parse_global_arg(parsed_globals)
|
858
858
|
|
859
859
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -882,11 +882,11 @@ def doDetachNodes(args, parsed_globals):
|
|
882
882
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
883
883
|
client._sdkVersion += ("_CLI_" + __version__)
|
884
884
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
885
|
-
model = models.
|
885
|
+
model = models.AttachNodesRequest()
|
886
886
|
model.from_json_string(json.dumps(args))
|
887
887
|
start_time = time.time()
|
888
888
|
while True:
|
889
|
-
rsp = client.
|
889
|
+
rsp = client.AttachNodes(model)
|
890
890
|
result = rsp.to_json_string()
|
891
891
|
try:
|
892
892
|
json_obj = json.loads(result)
|
@@ -905,7 +905,7 @@ def doDetachNodes(args, parsed_globals):
|
|
905
905
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
906
906
|
|
907
907
|
|
908
|
-
def
|
908
|
+
def doDescribeAutoScalingConfiguration(args, parsed_globals):
|
909
909
|
g_param = parse_global_arg(parsed_globals)
|
910
910
|
|
911
911
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -934,11 +934,11 @@ def doAddClusterStorageOption(args, parsed_globals):
|
|
934
934
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
935
935
|
client._sdkVersion += ("_CLI_" + __version__)
|
936
936
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
937
|
-
model = models.
|
937
|
+
model = models.DescribeAutoScalingConfigurationRequest()
|
938
938
|
model.from_json_string(json.dumps(args))
|
939
939
|
start_time = time.time()
|
940
940
|
while True:
|
941
|
-
rsp = client.
|
941
|
+
rsp = client.DescribeAutoScalingConfiguration(model)
|
942
942
|
result = rsp.to_json_string()
|
943
943
|
try:
|
944
944
|
json_obj = json.loads(result)
|
@@ -1009,7 +1009,7 @@ def doDescribeClusterActivities(args, parsed_globals):
|
|
1009
1009
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1010
1010
|
|
1011
1011
|
|
1012
|
-
def
|
1012
|
+
def doDescribeClusterStorageOption(args, parsed_globals):
|
1013
1013
|
g_param = parse_global_arg(parsed_globals)
|
1014
1014
|
|
1015
1015
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1038,11 +1038,115 @@ def doDeleteCluster(args, parsed_globals):
|
|
1038
1038
|
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
1039
1039
|
client._sdkVersion += ("_CLI_" + __version__)
|
1040
1040
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1041
|
-
model = models.
|
1041
|
+
model = models.DescribeClusterStorageOptionRequest()
|
1042
1042
|
model.from_json_string(json.dumps(args))
|
1043
1043
|
start_time = time.time()
|
1044
1044
|
while True:
|
1045
|
-
rsp = client.
|
1045
|
+
rsp = client.DescribeClusterStorageOption(model)
|
1046
|
+
result = rsp.to_json_string()
|
1047
|
+
try:
|
1048
|
+
json_obj = json.loads(result)
|
1049
|
+
except TypeError as e:
|
1050
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1051
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1052
|
+
break
|
1053
|
+
cur_time = time.time()
|
1054
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1055
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1056
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1057
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1058
|
+
else:
|
1059
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1060
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1061
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1062
|
+
|
1063
|
+
|
1064
|
+
def doBindAutoScalingGroup(args, parsed_globals):
|
1065
|
+
g_param = parse_global_arg(parsed_globals)
|
1066
|
+
|
1067
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1068
|
+
cred = credential.CVMRoleCredential()
|
1069
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1070
|
+
cred = credential.STSAssumeRoleCredential(
|
1071
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1072
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1073
|
+
)
|
1074
|
+
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):
|
1075
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1076
|
+
else:
|
1077
|
+
cred = credential.Credential(
|
1078
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1079
|
+
)
|
1080
|
+
http_profile = HttpProfile(
|
1081
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1082
|
+
reqMethod="POST",
|
1083
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1084
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1085
|
+
)
|
1086
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1087
|
+
if g_param[OptionsDefine.Language]:
|
1088
|
+
profile.language = g_param[OptionsDefine.Language]
|
1089
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1090
|
+
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
1091
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1092
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1093
|
+
model = models.BindAutoScalingGroupRequest()
|
1094
|
+
model.from_json_string(json.dumps(args))
|
1095
|
+
start_time = time.time()
|
1096
|
+
while True:
|
1097
|
+
rsp = client.BindAutoScalingGroup(model)
|
1098
|
+
result = rsp.to_json_string()
|
1099
|
+
try:
|
1100
|
+
json_obj = json.loads(result)
|
1101
|
+
except TypeError as e:
|
1102
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1103
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1104
|
+
break
|
1105
|
+
cur_time = time.time()
|
1106
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1107
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1108
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1109
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1110
|
+
else:
|
1111
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1112
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1113
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1114
|
+
|
1115
|
+
|
1116
|
+
def doModifyInitNodeScripts(args, parsed_globals):
|
1117
|
+
g_param = parse_global_arg(parsed_globals)
|
1118
|
+
|
1119
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1120
|
+
cred = credential.CVMRoleCredential()
|
1121
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1122
|
+
cred = credential.STSAssumeRoleCredential(
|
1123
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1124
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1125
|
+
)
|
1126
|
+
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):
|
1127
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1128
|
+
else:
|
1129
|
+
cred = credential.Credential(
|
1130
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1131
|
+
)
|
1132
|
+
http_profile = HttpProfile(
|
1133
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1134
|
+
reqMethod="POST",
|
1135
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1136
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1137
|
+
)
|
1138
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1139
|
+
if g_param[OptionsDefine.Language]:
|
1140
|
+
profile.language = g_param[OptionsDefine.Language]
|
1141
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1142
|
+
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
1143
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1144
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1145
|
+
model = models.ModifyInitNodeScriptsRequest()
|
1146
|
+
model.from_json_string(json.dumps(args))
|
1147
|
+
start_time = time.time()
|
1148
|
+
while True:
|
1149
|
+
rsp = client.ModifyInitNodeScripts(model)
|
1046
1150
|
result = rsp.to_json_string()
|
1047
1151
|
try:
|
1048
1152
|
json_obj = json.loads(result)
|
@@ -1113,6 +1217,58 @@ def doDeleteQueue(args, parsed_globals):
|
|
1113
1217
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1114
1218
|
|
1115
1219
|
|
1220
|
+
def doDeleteCluster(args, parsed_globals):
|
1221
|
+
g_param = parse_global_arg(parsed_globals)
|
1222
|
+
|
1223
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1224
|
+
cred = credential.CVMRoleCredential()
|
1225
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1226
|
+
cred = credential.STSAssumeRoleCredential(
|
1227
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1228
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1229
|
+
)
|
1230
|
+
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):
|
1231
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1232
|
+
else:
|
1233
|
+
cred = credential.Credential(
|
1234
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1235
|
+
)
|
1236
|
+
http_profile = HttpProfile(
|
1237
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1238
|
+
reqMethod="POST",
|
1239
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1240
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1241
|
+
)
|
1242
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1243
|
+
if g_param[OptionsDefine.Language]:
|
1244
|
+
profile.language = g_param[OptionsDefine.Language]
|
1245
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1246
|
+
client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
|
1247
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1248
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1249
|
+
model = models.DeleteClusterRequest()
|
1250
|
+
model.from_json_string(json.dumps(args))
|
1251
|
+
start_time = time.time()
|
1252
|
+
while True:
|
1253
|
+
rsp = client.DeleteCluster(model)
|
1254
|
+
result = rsp.to_json_string()
|
1255
|
+
try:
|
1256
|
+
json_obj = json.loads(result)
|
1257
|
+
except TypeError as e:
|
1258
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1259
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1260
|
+
break
|
1261
|
+
cur_time = time.time()
|
1262
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1263
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1264
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1265
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1266
|
+
else:
|
1267
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1268
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1269
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1270
|
+
|
1271
|
+
|
1116
1272
|
CLIENT_MAP = {
|
1117
1273
|
"v20230321": thpc_client_v20230321,
|
1118
1274
|
"v20220401": thpc_client_v20220401,
|
@@ -1128,27 +1284,30 @@ MODELS_MAP = {
|
|
1128
1284
|
}
|
1129
1285
|
|
1130
1286
|
ACTION_MAP = {
|
1131
|
-
"DescribeClusterStorageOption": doDescribeClusterStorageOption,
|
1132
1287
|
"DeleteNodes": doDeleteNodes,
|
1133
|
-
"
|
1134
|
-
"
|
1288
|
+
"TerminateWorkspaces": doTerminateWorkspaces,
|
1289
|
+
"ModifyWorkspacesAttribute": doModifyWorkspacesAttribute,
|
1135
1290
|
"CreateCluster": doCreateCluster,
|
1291
|
+
"CreateWorkspaces": doCreateWorkspaces,
|
1292
|
+
"DescribeQueues": doDescribeQueues,
|
1293
|
+
"AddNodes": doAddNodes,
|
1294
|
+
"DescribeNodes": doDescribeNodes,
|
1295
|
+
"AddClusterStorageOption": doAddClusterStorageOption,
|
1136
1296
|
"DeleteClusterStorageOption": doDeleteClusterStorageOption,
|
1297
|
+
"DescribeWorkspaces": doDescribeWorkspaces,
|
1298
|
+
"DetachNodes": doDetachNodes,
|
1299
|
+
"DescribeClusters": doDescribeClusters,
|
1137
1300
|
"SetAutoScalingConfiguration": doSetAutoScalingConfiguration,
|
1138
1301
|
"AddQueue": doAddQueue,
|
1139
|
-
"DescribeNodes": doDescribeNodes,
|
1140
|
-
"CreateWorkspaces": doCreateWorkspaces,
|
1141
1302
|
"DescribeInitNodeScripts": doDescribeInitNodeScripts,
|
1142
1303
|
"AttachNodes": doAttachNodes,
|
1143
|
-
"DescribeQueues": doDescribeQueues,
|
1144
|
-
"AddNodes": doAddNodes,
|
1145
1304
|
"DescribeAutoScalingConfiguration": doDescribeAutoScalingConfiguration,
|
1146
|
-
"DescribeClusters": doDescribeClusters,
|
1147
|
-
"DetachNodes": doDetachNodes,
|
1148
|
-
"AddClusterStorageOption": doAddClusterStorageOption,
|
1149
1305
|
"DescribeClusterActivities": doDescribeClusterActivities,
|
1150
|
-
"
|
1306
|
+
"DescribeClusterStorageOption": doDescribeClusterStorageOption,
|
1307
|
+
"BindAutoScalingGroup": doBindAutoScalingGroup,
|
1308
|
+
"ModifyInitNodeScripts": doModifyInitNodeScripts,
|
1151
1309
|
"DeleteQueue": doDeleteQueue,
|
1310
|
+
"DeleteCluster": doDeleteCluster,
|
1152
1311
|
|
1153
1312
|
}
|
1154
1313
|
|