tccli 3.0.1183.1__py2.py3-none-any.whl → 3.0.1185.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/bi/v20220105/api.json +9 -0
  3. tccli/services/cdb/v20170320/api.json +2 -2
  4. tccli/services/cdwdoris/v20211228/api.json +137 -0
  5. tccli/services/cdwdoris/v20211228/examples.json +1 -1
  6. tccli/services/cls/v20201016/api.json +1 -1
  7. tccli/services/cynosdb/cynosdb_client.py +65 -12
  8. tccli/services/cynosdb/v20190107/api.json +99 -0
  9. tccli/services/cynosdb/v20190107/examples.json +8 -0
  10. tccli/services/dlc/v20210125/api.json +48 -11
  11. tccli/services/dlc/v20210125/examples.json +4 -4
  12. tccli/services/dsgc/v20190723/api.json +9 -0
  13. tccli/services/ecc/v20181213/api.json +14 -12
  14. tccli/services/ecc/v20181213/examples.json +3 -3
  15. tccli/services/ess/v20201111/api.json +1 -1
  16. tccli/services/ess/v20201111/examples.json +4 -4
  17. tccli/services/essbasic/v20210526/examples.json +9 -9
  18. tccli/services/hunyuan/v20230901/api.json +1 -1
  19. tccli/services/lke/v20231130/api.json +1 -1
  20. tccli/services/oceanus/v20190422/api.json +9 -0
  21. tccli/services/oceanus/v20190422/examples.json +1 -1
  22. tccli/services/redis/v20180412/api.json +18 -13
  23. tccli/services/redis/v20180412/examples.json +2 -2
  24. tccli/services/ssl/ssl_client.py +65 -12
  25. tccli/services/ssl/v20191205/api.json +130 -0
  26. tccli/services/ssl/v20191205/examples.json +8 -0
  27. tccli/services/tcr/v20190924/api.json +3 -3
  28. tccli/services/tcr/v20190924/examples.json +1 -1
  29. tccli/services/thpc/thpc_client.py +276 -64
  30. tccli/services/thpc/v20230321/api.json +886 -12
  31. tccli/services/thpc/v20230321/examples.json +32 -0
  32. tccli/services/trtc/v20190722/api.json +2 -2
  33. tccli/services/waf/v20180125/api.json +3 -3
  34. tccli/services/waf/v20180125/examples.json +1 -1
  35. {tccli-3.0.1183.1.dist-info → tccli-3.0.1185.1.dist-info}/METADATA +2 -2
  36. {tccli-3.0.1183.1.dist-info → tccli-3.0.1185.1.dist-info}/RECORD +39 -39
  37. {tccli-3.0.1183.1.dist-info → tccli-3.0.1185.1.dist-info}/WHEEL +0 -0
  38. {tccli-3.0.1183.1.dist-info → tccli-3.0.1185.1.dist-info}/entry_points.txt +0 -0
  39. {tccli-3.0.1183.1.dist-info → tccli-3.0.1185.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 doDescribeClusterStorageOption(args, parsed_globals):
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.DescribeClusterStorageOptionRequest()
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.DescribeClusterStorageOption(model)
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 doDeleteNodes(args, parsed_globals):
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.DeleteNodesRequest()
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.DeleteNodes(model)
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 doBindAutoScalingGroup(args, parsed_globals):
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.BindAutoScalingGroupRequest()
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.BindAutoScalingGroup(model)
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 doModifyInitNodeScripts(args, parsed_globals):
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.ModifyInitNodeScriptsRequest()
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.ModifyInitNodeScripts(model)
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 doCreateCluster(args, parsed_globals):
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.CreateClusterRequest()
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.CreateCluster(model)
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 doDeleteClusterStorageOption(args, parsed_globals):
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.DeleteClusterStorageOptionRequest()
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.DeleteClusterStorageOption(model)
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 doSetAutoScalingConfiguration(args, parsed_globals):
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.SetAutoScalingConfigurationRequest()
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.SetAutoScalingConfiguration(model)
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 doAddQueue(args, parsed_globals):
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.AddQueueRequest()
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.AddQueue(model)
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 doDescribeNodes(args, parsed_globals):
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.DescribeNodesRequest()
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.DescribeNodes(model)
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 doDescribeInitNodeScripts(args, parsed_globals):
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 doDescribeInitNodeScripts(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.DescribeInitNodeScriptsRequest()
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.DescribeInitNodeScripts(model)
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 doDescribeInitNodeScripts(args, parsed_globals):
541
541
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
542
542
 
543
543
 
544
- def doAttachNodes(args, parsed_globals):
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 doAttachNodes(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.AttachNodesRequest()
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.AttachNodes(model)
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 doAttachNodes(args, parsed_globals):
593
593
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
594
594
 
595
595
 
596
- def doDescribeQueues(args, parsed_globals):
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 doDescribeQueues(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.DescribeQueuesRequest()
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.DescribeQueues(model)
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 doDescribeQueues(args, parsed_globals):
645
645
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
646
646
 
647
647
 
648
- def doAddNodes(args, parsed_globals):
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 doAddNodes(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.AddNodesRequest()
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.AddNodes(model)
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 doAddNodes(args, parsed_globals):
697
697
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
698
698
 
699
699
 
700
- def doDescribeAutoScalingConfiguration(args, parsed_globals):
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 doDescribeAutoScalingConfiguration(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.DescribeAutoScalingConfigurationRequest()
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.DescribeAutoScalingConfiguration(model)
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 doDescribeAutoScalingConfiguration(args, parsed_globals):
749
749
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
750
750
 
751
751
 
752
- def doDescribeClusters(args, parsed_globals):
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 doDescribeClusters(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.DescribeClustersRequest()
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.DescribeClusters(model)
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 doDescribeClusters(args, parsed_globals):
801
801
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
802
802
 
803
803
 
804
- def doDetachNodes(args, parsed_globals):
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 doDetachNodes(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.DetachNodesRequest()
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.DetachNodes(model)
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 doDetachNodes(args, parsed_globals):
853
853
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
854
854
 
855
855
 
856
- def doAddClusterStorageOption(args, parsed_globals):
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,63 @@ def doAddClusterStorageOption(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.AddClusterStorageOptionRequest()
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.AddClusterStorageOption(model)
889
+ rsp = client.AttachNodes(model)
890
+ result = rsp.to_json_string()
891
+ try:
892
+ json_obj = json.loads(result)
893
+ except TypeError as e:
894
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
895
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
896
+ break
897
+ cur_time = time.time()
898
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
899
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
900
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
901
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
902
+ else:
903
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
904
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
905
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
906
+
907
+
908
+ def doDescribeAutoScalingConfiguration(args, parsed_globals):
909
+ g_param = parse_global_arg(parsed_globals)
910
+
911
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
912
+ cred = credential.CVMRoleCredential()
913
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
914
+ cred = credential.STSAssumeRoleCredential(
915
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
916
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
917
+ )
918
+ 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):
919
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
920
+ else:
921
+ cred = credential.Credential(
922
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
923
+ )
924
+ http_profile = HttpProfile(
925
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
926
+ reqMethod="POST",
927
+ endpoint=g_param[OptionsDefine.Endpoint],
928
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
929
+ )
930
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
931
+ if g_param[OptionsDefine.Language]:
932
+ profile.language = g_param[OptionsDefine.Language]
933
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
934
+ client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
935
+ client._sdkVersion += ("_CLI_" + __version__)
936
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
937
+ model = models.DescribeAutoScalingConfigurationRequest()
938
+ model.from_json_string(json.dumps(args))
939
+ start_time = time.time()
940
+ while True:
941
+ rsp = client.DescribeAutoScalingConfiguration(model)
890
942
  result = rsp.to_json_string()
891
943
  try:
892
944
  json_obj = json.loads(result)
@@ -957,7 +1009,7 @@ def doDescribeClusterActivities(args, parsed_globals):
957
1009
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
958
1010
 
959
1011
 
960
- def doDeleteCluster(args, parsed_globals):
1012
+ def doDescribeClusterStorageOption(args, parsed_globals):
961
1013
  g_param = parse_global_arg(parsed_globals)
962
1014
 
963
1015
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -986,11 +1038,115 @@ def doDeleteCluster(args, parsed_globals):
986
1038
  client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
987
1039
  client._sdkVersion += ("_CLI_" + __version__)
988
1040
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
989
- model = models.DeleteClusterRequest()
1041
+ model = models.DescribeClusterStorageOptionRequest()
990
1042
  model.from_json_string(json.dumps(args))
991
1043
  start_time = time.time()
992
1044
  while True:
993
- rsp = client.DeleteCluster(model)
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)
994
1150
  result = rsp.to_json_string()
995
1151
  try:
996
1152
  json_obj = json.loads(result)
@@ -1061,6 +1217,58 @@ def doDeleteQueue(args, parsed_globals):
1061
1217
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1062
1218
 
1063
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
+
1064
1272
  CLIENT_MAP = {
1065
1273
  "v20230321": thpc_client_v20230321,
1066
1274
  "v20220401": thpc_client_v20220401,
@@ -1076,26 +1284,30 @@ MODELS_MAP = {
1076
1284
  }
1077
1285
 
1078
1286
  ACTION_MAP = {
1079
- "DescribeClusterStorageOption": doDescribeClusterStorageOption,
1080
1287
  "DeleteNodes": doDeleteNodes,
1081
- "BindAutoScalingGroup": doBindAutoScalingGroup,
1082
- "ModifyInitNodeScripts": doModifyInitNodeScripts,
1288
+ "TerminateWorkspaces": doTerminateWorkspaces,
1289
+ "ModifyWorkspacesAttribute": doModifyWorkspacesAttribute,
1083
1290
  "CreateCluster": doCreateCluster,
1291
+ "CreateWorkspaces": doCreateWorkspaces,
1292
+ "DescribeQueues": doDescribeQueues,
1293
+ "AddNodes": doAddNodes,
1294
+ "DescribeNodes": doDescribeNodes,
1295
+ "AddClusterStorageOption": doAddClusterStorageOption,
1084
1296
  "DeleteClusterStorageOption": doDeleteClusterStorageOption,
1297
+ "DescribeWorkspaces": doDescribeWorkspaces,
1298
+ "DetachNodes": doDetachNodes,
1299
+ "DescribeClusters": doDescribeClusters,
1085
1300
  "SetAutoScalingConfiguration": doSetAutoScalingConfiguration,
1086
1301
  "AddQueue": doAddQueue,
1087
- "DescribeNodes": doDescribeNodes,
1088
1302
  "DescribeInitNodeScripts": doDescribeInitNodeScripts,
1089
1303
  "AttachNodes": doAttachNodes,
1090
- "DescribeQueues": doDescribeQueues,
1091
- "AddNodes": doAddNodes,
1092
1304
  "DescribeAutoScalingConfiguration": doDescribeAutoScalingConfiguration,
1093
- "DescribeClusters": doDescribeClusters,
1094
- "DetachNodes": doDetachNodes,
1095
- "AddClusterStorageOption": doAddClusterStorageOption,
1096
1305
  "DescribeClusterActivities": doDescribeClusterActivities,
1097
- "DeleteCluster": doDeleteCluster,
1306
+ "DescribeClusterStorageOption": doDescribeClusterStorageOption,
1307
+ "BindAutoScalingGroup": doBindAutoScalingGroup,
1308
+ "ModifyInitNodeScripts": doModifyInitNodeScripts,
1098
1309
  "DeleteQueue": doDeleteQueue,
1310
+ "DeleteCluster": doDeleteCluster,
1099
1311
 
1100
1312
  }
1101
1313