tccli 3.0.1112.1__py2.py3-none-any.whl → 3.0.1113.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -123,7 +123,7 @@ def doDescribeModelService(args, parsed_globals):
123
123
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
124
124
 
125
125
 
126
- def doDescribeBillingSpecs(args, parsed_globals):
126
+ def doDeleteDataset(args, parsed_globals):
127
127
  g_param = parse_global_arg(parsed_globals)
128
128
 
129
129
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -152,11 +152,11 @@ def doDescribeBillingSpecs(args, parsed_globals):
152
152
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
153
153
  client._sdkVersion += ("_CLI_" + __version__)
154
154
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
155
- model = models.DescribeBillingSpecsRequest()
155
+ model = models.DeleteDatasetRequest()
156
156
  model.from_json_string(json.dumps(args))
157
157
  start_time = time.time()
158
158
  while True:
159
- rsp = client.DescribeBillingSpecs(model)
159
+ rsp = client.DeleteDataset(model)
160
160
  result = rsp.to_json_string()
161
161
  try:
162
162
  json_obj = json.loads(result)
@@ -175,7 +175,7 @@ def doDescribeBillingSpecs(args, parsed_globals):
175
175
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
176
176
 
177
177
 
178
- def doDescribeModelServiceGroup(args, parsed_globals):
178
+ def doDescribeModelServiceCallInfo(args, parsed_globals):
179
179
  g_param = parse_global_arg(parsed_globals)
180
180
 
181
181
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -204,11 +204,11 @@ def doDescribeModelServiceGroup(args, parsed_globals):
204
204
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
205
205
  client._sdkVersion += ("_CLI_" + __version__)
206
206
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
207
- model = models.DescribeModelServiceGroupRequest()
207
+ model = models.DescribeModelServiceCallInfoRequest()
208
208
  model.from_json_string(json.dumps(args))
209
209
  start_time = time.time()
210
210
  while True:
211
- rsp = client.DescribeModelServiceGroup(model)
211
+ rsp = client.DescribeModelServiceCallInfo(model)
212
212
  result = rsp.to_json_string()
213
213
  try:
214
214
  json_obj = json.loads(result)
@@ -227,7 +227,7 @@ def doDescribeModelServiceGroup(args, parsed_globals):
227
227
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
228
228
 
229
229
 
230
- def doDescribeNotebooks(args, parsed_globals):
230
+ def doUpdateNotebookInstance(args, parsed_globals):
231
231
  g_param = parse_global_arg(parsed_globals)
232
232
 
233
233
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -256,11 +256,11 @@ def doDescribeNotebooks(args, parsed_globals):
256
256
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
257
257
  client._sdkVersion += ("_CLI_" + __version__)
258
258
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
259
- model = models.DescribeNotebooksRequest()
259
+ model = models.UpdateNotebookInstanceRequest()
260
260
  model.from_json_string(json.dumps(args))
261
261
  start_time = time.time()
262
262
  while True:
263
- rsp = client.DescribeNotebooks(model)
263
+ rsp = client.UpdateNotebookInstance(model)
264
264
  result = rsp.to_json_string()
265
265
  try:
266
266
  json_obj = json.loads(result)
@@ -279,7 +279,7 @@ def doDescribeNotebooks(args, parsed_globals):
279
279
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
280
280
 
281
281
 
282
- def doDescribeDatasetDetailUnstructured(args, parsed_globals):
282
+ def doDescribeTrainingTasks(args, parsed_globals):
283
283
  g_param = parse_global_arg(parsed_globals)
284
284
 
285
285
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -308,11 +308,11 @@ def doDescribeDatasetDetailUnstructured(args, parsed_globals):
308
308
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
309
309
  client._sdkVersion += ("_CLI_" + __version__)
310
310
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
311
- model = models.DescribeDatasetDetailUnstructuredRequest()
311
+ model = models.DescribeTrainingTasksRequest()
312
312
  model.from_json_string(json.dumps(args))
313
313
  start_time = time.time()
314
314
  while True:
315
- rsp = client.DescribeDatasetDetailUnstructured(model)
315
+ rsp = client.DescribeTrainingTasks(model)
316
316
  result = rsp.to_json_string()
317
317
  try:
318
318
  json_obj = json.loads(result)
@@ -331,7 +331,7 @@ def doDescribeDatasetDetailUnstructured(args, parsed_globals):
331
331
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
332
332
 
333
333
 
334
- def doDeleteNotebook(args, parsed_globals):
334
+ def doDescribeBuildInImages(args, parsed_globals):
335
335
  g_param = parse_global_arg(parsed_globals)
336
336
 
337
337
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -360,11 +360,11 @@ def doDeleteNotebook(args, parsed_globals):
360
360
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
361
361
  client._sdkVersion += ("_CLI_" + __version__)
362
362
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
363
- model = models.DeleteNotebookRequest()
363
+ model = models.DescribeBuildInImagesRequest()
364
364
  model.from_json_string(json.dumps(args))
365
365
  start_time = time.time()
366
366
  while True:
367
- rsp = client.DeleteNotebook(model)
367
+ rsp = client.DescribeBuildInImages(model)
368
368
  result = rsp.to_json_string()
369
369
  try:
370
370
  json_obj = json.loads(result)
@@ -383,7 +383,7 @@ def doDeleteNotebook(args, parsed_globals):
383
383
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
384
384
 
385
385
 
386
- def doDescribeCodeRepository(args, parsed_globals):
386
+ def doDescribeNotebookLifecycleScripts(args, parsed_globals):
387
387
  g_param = parse_global_arg(parsed_globals)
388
388
 
389
389
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -412,11 +412,11 @@ def doDescribeCodeRepository(args, parsed_globals):
412
412
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
413
413
  client._sdkVersion += ("_CLI_" + __version__)
414
414
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
415
- model = models.DescribeCodeRepositoryRequest()
415
+ model = models.DescribeNotebookLifecycleScriptsRequest()
416
416
  model.from_json_string(json.dumps(args))
417
417
  start_time = time.time()
418
418
  while True:
419
- rsp = client.DescribeCodeRepository(model)
419
+ rsp = client.DescribeNotebookLifecycleScripts(model)
420
420
  result = rsp.to_json_string()
421
421
  try:
422
422
  json_obj = json.loads(result)
@@ -435,7 +435,7 @@ def doDescribeCodeRepository(args, parsed_globals):
435
435
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
436
436
 
437
437
 
438
- def doDescribeModelAccelerateVersions(args, parsed_globals):
438
+ def doStopTrainingJob(args, parsed_globals):
439
439
  g_param = parse_global_arg(parsed_globals)
440
440
 
441
441
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -464,11 +464,11 @@ def doDescribeModelAccelerateVersions(args, parsed_globals):
464
464
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
465
465
  client._sdkVersion += ("_CLI_" + __version__)
466
466
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
467
- model = models.DescribeModelAccelerateVersionsRequest()
467
+ model = models.StopTrainingJobRequest()
468
468
  model.from_json_string(json.dumps(args))
469
469
  start_time = time.time()
470
470
  while True:
471
- rsp = client.DescribeModelAccelerateVersions(model)
471
+ rsp = client.StopTrainingJob(model)
472
472
  result = rsp.to_json_string()
473
473
  try:
474
474
  json_obj = json.loads(result)
@@ -487,7 +487,7 @@ def doDescribeModelAccelerateVersions(args, parsed_globals):
487
487
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
488
488
 
489
489
 
490
- def doDeleteModelServiceGroup(args, parsed_globals):
490
+ def doStartNotebook(args, parsed_globals):
491
491
  g_param = parse_global_arg(parsed_globals)
492
492
 
493
493
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -516,11 +516,11 @@ def doDeleteModelServiceGroup(args, parsed_globals):
516
516
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
517
517
  client._sdkVersion += ("_CLI_" + __version__)
518
518
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
519
- model = models.DeleteModelServiceGroupRequest()
519
+ model = models.StartNotebookRequest()
520
520
  model.from_json_string(json.dumps(args))
521
521
  start_time = time.time()
522
522
  while True:
523
- rsp = client.DeleteModelServiceGroup(model)
523
+ rsp = client.StartNotebook(model)
524
524
  result = rsp.to_json_string()
525
525
  try:
526
526
  json_obj = json.loads(result)
@@ -539,7 +539,7 @@ def doDeleteModelServiceGroup(args, parsed_globals):
539
539
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
540
540
 
541
541
 
542
- def doDescribeBatchTasks(args, parsed_globals):
542
+ def doCreateTrainingModel(args, parsed_globals):
543
543
  g_param = parse_global_arg(parsed_globals)
544
544
 
545
545
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -568,11 +568,11 @@ def doDescribeBatchTasks(args, parsed_globals):
568
568
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
569
569
  client._sdkVersion += ("_CLI_" + __version__)
570
570
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
571
- model = models.DescribeBatchTasksRequest()
571
+ model = models.CreateTrainingModelRequest()
572
572
  model.from_json_string(json.dumps(args))
573
573
  start_time = time.time()
574
574
  while True:
575
- rsp = client.DescribeBatchTasks(model)
575
+ rsp = client.CreateTrainingModel(model)
576
576
  result = rsp.to_json_string()
577
577
  try:
578
578
  json_obj = json.loads(result)
@@ -591,7 +591,7 @@ def doDescribeBatchTasks(args, parsed_globals):
591
591
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
592
592
 
593
593
 
594
- def doCreateCodeRepository(args, parsed_globals):
594
+ def doStartNotebookInstance(args, parsed_globals):
595
595
  g_param = parse_global_arg(parsed_globals)
596
596
 
597
597
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -620,11 +620,11 @@ def doCreateCodeRepository(args, parsed_globals):
620
620
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
621
621
  client._sdkVersion += ("_CLI_" + __version__)
622
622
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
623
- model = models.CreateCodeRepositoryRequest()
623
+ model = models.StartNotebookInstanceRequest()
624
624
  model.from_json_string(json.dumps(args))
625
625
  start_time = time.time()
626
626
  while True:
627
- rsp = client.CreateCodeRepository(model)
627
+ rsp = client.StartNotebookInstance(model)
628
628
  result = rsp.to_json_string()
629
629
  try:
630
630
  json_obj = json.loads(result)
@@ -643,7 +643,7 @@ def doCreateCodeRepository(args, parsed_globals):
643
643
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
644
644
 
645
645
 
646
- def doCreatePresignedNotebookUrl(args, parsed_globals):
646
+ def doDeleteNotebook(args, parsed_globals):
647
647
  g_param = parse_global_arg(parsed_globals)
648
648
 
649
649
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -672,11 +672,11 @@ def doCreatePresignedNotebookUrl(args, parsed_globals):
672
672
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
673
673
  client._sdkVersion += ("_CLI_" + __version__)
674
674
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
675
- model = models.CreatePresignedNotebookUrlRequest()
675
+ model = models.DeleteNotebookRequest()
676
676
  model.from_json_string(json.dumps(args))
677
677
  start_time = time.time()
678
678
  while True:
679
- rsp = client.CreatePresignedNotebookUrl(model)
679
+ rsp = client.DeleteNotebook(model)
680
680
  result = rsp.to_json_string()
681
681
  try:
682
682
  json_obj = json.loads(result)
@@ -695,7 +695,7 @@ def doCreatePresignedNotebookUrl(args, parsed_globals):
695
695
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
696
696
 
697
697
 
698
- def doCreateNotebookInstance(args, parsed_globals):
698
+ def doDescribeTrainingTask(args, parsed_globals):
699
699
  g_param = parse_global_arg(parsed_globals)
700
700
 
701
701
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -724,11 +724,11 @@ def doCreateNotebookInstance(args, parsed_globals):
724
724
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
725
725
  client._sdkVersion += ("_CLI_" + __version__)
726
726
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
727
- model = models.CreateNotebookInstanceRequest()
727
+ model = models.DescribeTrainingTaskRequest()
728
728
  model.from_json_string(json.dumps(args))
729
729
  start_time = time.time()
730
730
  while True:
731
- rsp = client.CreateNotebookInstance(model)
731
+ rsp = client.DescribeTrainingTask(model)
732
732
  result = rsp.to_json_string()
733
733
  try:
734
734
  json_obj = json.loads(result)
@@ -747,7 +747,7 @@ def doCreateNotebookInstance(args, parsed_globals):
747
747
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
748
748
 
749
749
 
750
- def doCreateNotebookLifecycleScript(args, parsed_globals):
750
+ def doDescribeTrainingTaskPods(args, parsed_globals):
751
751
  g_param = parse_global_arg(parsed_globals)
752
752
 
753
753
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -776,11 +776,11 @@ def doCreateNotebookLifecycleScript(args, parsed_globals):
776
776
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
777
777
  client._sdkVersion += ("_CLI_" + __version__)
778
778
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
779
- model = models.CreateNotebookLifecycleScriptRequest()
779
+ model = models.DescribeTrainingTaskPodsRequest()
780
780
  model.from_json_string(json.dumps(args))
781
781
  start_time = time.time()
782
782
  while True:
783
- rsp = client.CreateNotebookLifecycleScript(model)
783
+ rsp = client.DescribeTrainingTaskPods(model)
784
784
  result = rsp.to_json_string()
785
785
  try:
786
786
  json_obj = json.loads(result)
@@ -799,7 +799,7 @@ def doCreateNotebookLifecycleScript(args, parsed_globals):
799
799
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
800
800
 
801
801
 
802
- def doStopModelAccelerateTask(args, parsed_globals):
802
+ def doDescribeModelServiceHotUpdated(args, parsed_globals):
803
803
  g_param = parse_global_arg(parsed_globals)
804
804
 
805
805
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -828,11 +828,11 @@ def doStopModelAccelerateTask(args, parsed_globals):
828
828
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
829
829
  client._sdkVersion += ("_CLI_" + __version__)
830
830
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
831
- model = models.StopModelAccelerateTaskRequest()
831
+ model = models.DescribeModelServiceHotUpdatedRequest()
832
832
  model.from_json_string(json.dumps(args))
833
833
  start_time = time.time()
834
834
  while True:
835
- rsp = client.StopModelAccelerateTask(model)
835
+ rsp = client.DescribeModelServiceHotUpdated(model)
836
836
  result = rsp.to_json_string()
837
837
  try:
838
838
  json_obj = json.loads(result)
@@ -851,7 +851,7 @@ def doStopModelAccelerateTask(args, parsed_globals):
851
851
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
852
852
 
853
853
 
854
- def doDescribeModelServices(args, parsed_globals):
854
+ def doDescribeModelAccelerateTask(args, parsed_globals):
855
855
  g_param = parse_global_arg(parsed_globals)
856
856
 
857
857
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -880,11 +880,11 @@ def doDescribeModelServices(args, parsed_globals):
880
880
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
881
881
  client._sdkVersion += ("_CLI_" + __version__)
882
882
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
883
- model = models.DescribeModelServicesRequest()
883
+ model = models.DescribeModelAccelerateTaskRequest()
884
884
  model.from_json_string(json.dumps(args))
885
885
  start_time = time.time()
886
886
  while True:
887
- rsp = client.DescribeModelServices(model)
887
+ rsp = client.DescribeModelAccelerateTask(model)
888
888
  result = rsp.to_json_string()
889
889
  try:
890
890
  json_obj = json.loads(result)
@@ -903,7 +903,7 @@ def doDescribeModelServices(args, parsed_globals):
903
903
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
904
904
 
905
905
 
906
- def doDeleteNotebookLifecycleScript(args, parsed_globals):
906
+ def doChatCompletion(args, parsed_globals):
907
907
  g_param = parse_global_arg(parsed_globals)
908
908
 
909
909
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -932,11 +932,11 @@ def doDeleteNotebookLifecycleScript(args, parsed_globals):
932
932
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
933
933
  client._sdkVersion += ("_CLI_" + __version__)
934
934
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
935
- model = models.DeleteNotebookLifecycleScriptRequest()
935
+ model = models.ChatCompletionRequest()
936
936
  model.from_json_string(json.dumps(args))
937
937
  start_time = time.time()
938
938
  while True:
939
- rsp = client.DeleteNotebookLifecycleScript(model)
939
+ rsp = client.ChatCompletion(model)
940
940
  result = rsp.to_json_string()
941
941
  try:
942
942
  json_obj = json.loads(result)
@@ -955,7 +955,7 @@ def doDeleteNotebookLifecycleScript(args, parsed_globals):
955
955
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
956
956
 
957
957
 
958
- def doDescribeNotebookImageKernels(args, parsed_globals):
958
+ def doDescribeModelAccelerateVersions(args, parsed_globals):
959
959
  g_param = parse_global_arg(parsed_globals)
960
960
 
961
961
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -984,11 +984,11 @@ def doDescribeNotebookImageKernels(args, parsed_globals):
984
984
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
985
985
  client._sdkVersion += ("_CLI_" + __version__)
986
986
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
987
- model = models.DescribeNotebookImageKernelsRequest()
987
+ model = models.DescribeModelAccelerateVersionsRequest()
988
988
  model.from_json_string(json.dumps(args))
989
989
  start_time = time.time()
990
990
  while True:
991
- rsp = client.DescribeNotebookImageKernels(model)
991
+ rsp = client.DescribeModelAccelerateVersions(model)
992
992
  result = rsp.to_json_string()
993
993
  try:
994
994
  json_obj = json.loads(result)
@@ -1007,7 +1007,7 @@ def doDescribeNotebookImageKernels(args, parsed_globals):
1007
1007
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1008
1008
 
1009
1009
 
1010
- def doDescribeNotebook(args, parsed_globals):
1010
+ def doCreateDataset(args, parsed_globals):
1011
1011
  g_param = parse_global_arg(parsed_globals)
1012
1012
 
1013
1013
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1036,11 +1036,11 @@ def doDescribeNotebook(args, parsed_globals):
1036
1036
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1037
1037
  client._sdkVersion += ("_CLI_" + __version__)
1038
1038
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1039
- model = models.DescribeNotebookRequest()
1039
+ model = models.CreateDatasetRequest()
1040
1040
  model.from_json_string(json.dumps(args))
1041
1041
  start_time = time.time()
1042
1042
  while True:
1043
- rsp = client.DescribeNotebook(model)
1043
+ rsp = client.CreateDataset(model)
1044
1044
  result = rsp.to_json_string()
1045
1045
  try:
1046
1046
  json_obj = json.loads(result)
@@ -1059,7 +1059,7 @@ def doDescribeNotebook(args, parsed_globals):
1059
1059
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1060
1060
 
1061
1061
 
1062
- def doUpdateCodeRepository(args, parsed_globals):
1062
+ def doCreateNotebook(args, parsed_globals):
1063
1063
  g_param = parse_global_arg(parsed_globals)
1064
1064
 
1065
1065
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1088,11 +1088,11 @@ def doUpdateCodeRepository(args, parsed_globals):
1088
1088
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1089
1089
  client._sdkVersion += ("_CLI_" + __version__)
1090
1090
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1091
- model = models.UpdateCodeRepositoryRequest()
1091
+ model = models.CreateNotebookRequest()
1092
1092
  model.from_json_string(json.dumps(args))
1093
1093
  start_time = time.time()
1094
1094
  while True:
1095
- rsp = client.UpdateCodeRepository(model)
1095
+ rsp = client.CreateNotebook(model)
1096
1096
  result = rsp.to_json_string()
1097
1097
  try:
1098
1098
  json_obj = json.loads(result)
@@ -1111,7 +1111,7 @@ def doUpdateCodeRepository(args, parsed_globals):
1111
1111
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1112
1112
 
1113
1113
 
1114
- def doDescribeNotebookInstances(args, parsed_globals):
1114
+ def doDescribeModelServiceGroup(args, parsed_globals):
1115
1115
  g_param = parse_global_arg(parsed_globals)
1116
1116
 
1117
1117
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1140,11 +1140,11 @@ def doDescribeNotebookInstances(args, parsed_globals):
1140
1140
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1141
1141
  client._sdkVersion += ("_CLI_" + __version__)
1142
1142
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1143
- model = models.DescribeNotebookInstancesRequest()
1143
+ model = models.DescribeModelServiceGroupRequest()
1144
1144
  model.from_json_string(json.dumps(args))
1145
1145
  start_time = time.time()
1146
1146
  while True:
1147
- rsp = client.DescribeNotebookInstances(model)
1147
+ rsp = client.DescribeModelServiceGroup(model)
1148
1148
  result = rsp.to_json_string()
1149
1149
  try:
1150
1150
  json_obj = json.loads(result)
@@ -1163,7 +1163,7 @@ def doDescribeNotebookInstances(args, parsed_globals):
1163
1163
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1164
1164
 
1165
1165
 
1166
- def doStopTrainingJob(args, parsed_globals):
1166
+ def doCreatePresignedNotebookInstanceUrl(args, parsed_globals):
1167
1167
  g_param = parse_global_arg(parsed_globals)
1168
1168
 
1169
1169
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1192,11 +1192,11 @@ def doStopTrainingJob(args, parsed_globals):
1192
1192
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1193
1193
  client._sdkVersion += ("_CLI_" + __version__)
1194
1194
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1195
- model = models.StopTrainingJobRequest()
1195
+ model = models.CreatePresignedNotebookInstanceUrlRequest()
1196
1196
  model.from_json_string(json.dumps(args))
1197
1197
  start_time = time.time()
1198
1198
  while True:
1199
- rsp = client.StopTrainingJob(model)
1199
+ rsp = client.CreatePresignedNotebookInstanceUrl(model)
1200
1200
  result = rsp.to_json_string()
1201
1201
  try:
1202
1202
  json_obj = json.loads(result)
@@ -1215,7 +1215,7 @@ def doStopTrainingJob(args, parsed_globals):
1215
1215
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1216
1216
 
1217
1217
 
1218
- def doCreateTrainingModel(args, parsed_globals):
1218
+ def doDeleteNotebookInstance(args, parsed_globals):
1219
1219
  g_param = parse_global_arg(parsed_globals)
1220
1220
 
1221
1221
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1244,11 +1244,11 @@ def doCreateTrainingModel(args, parsed_globals):
1244
1244
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1245
1245
  client._sdkVersion += ("_CLI_" + __version__)
1246
1246
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1247
- model = models.CreateTrainingModelRequest()
1247
+ model = models.DeleteNotebookInstanceRequest()
1248
1248
  model.from_json_string(json.dumps(args))
1249
1249
  start_time = time.time()
1250
1250
  while True:
1251
- rsp = client.CreateTrainingModel(model)
1251
+ rsp = client.DeleteNotebookInstance(model)
1252
1252
  result = rsp.to_json_string()
1253
1253
  try:
1254
1254
  json_obj = json.loads(result)
@@ -1267,7 +1267,7 @@ def doCreateTrainingModel(args, parsed_globals):
1267
1267
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1268
1268
 
1269
1269
 
1270
- def doDescribeBillingSpecsPrice(args, parsed_globals):
1270
+ def doDeleteModelServiceGroup(args, parsed_globals):
1271
1271
  g_param = parse_global_arg(parsed_globals)
1272
1272
 
1273
1273
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1296,11 +1296,11 @@ def doDescribeBillingSpecsPrice(args, parsed_globals):
1296
1296
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1297
1297
  client._sdkVersion += ("_CLI_" + __version__)
1298
1298
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1299
- model = models.DescribeBillingSpecsPriceRequest()
1299
+ model = models.DeleteModelServiceGroupRequest()
1300
1300
  model.from_json_string(json.dumps(args))
1301
1301
  start_time = time.time()
1302
1302
  while True:
1303
- rsp = client.DescribeBillingSpecsPrice(model)
1303
+ rsp = client.DeleteModelServiceGroup(model)
1304
1304
  result = rsp.to_json_string()
1305
1305
  try:
1306
1306
  json_obj = json.loads(result)
@@ -1319,7 +1319,7 @@ def doDescribeBillingSpecsPrice(args, parsed_globals):
1319
1319
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1320
1320
 
1321
1321
 
1322
- def doCreateOptimizedModel(args, parsed_globals):
1322
+ def doDescribeNotebookLifecycleScript(args, parsed_globals):
1323
1323
  g_param = parse_global_arg(parsed_globals)
1324
1324
 
1325
1325
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1348,11 +1348,11 @@ def doCreateOptimizedModel(args, parsed_globals):
1348
1348
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1349
1349
  client._sdkVersion += ("_CLI_" + __version__)
1350
1350
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1351
- model = models.CreateOptimizedModelRequest()
1351
+ model = models.DescribeNotebookLifecycleScriptRequest()
1352
1352
  model.from_json_string(json.dumps(args))
1353
1353
  start_time = time.time()
1354
1354
  while True:
1355
- rsp = client.CreateOptimizedModel(model)
1355
+ rsp = client.DescribeNotebookLifecycleScript(model)
1356
1356
  result = rsp.to_json_string()
1357
1357
  try:
1358
1358
  json_obj = json.loads(result)
@@ -1371,7 +1371,7 @@ def doCreateOptimizedModel(args, parsed_globals):
1371
1371
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1372
1372
 
1373
1373
 
1374
- def doDescribeNotebookLifecycleScripts(args, parsed_globals):
1374
+ def doPushTrainingMetrics(args, parsed_globals):
1375
1375
  g_param = parse_global_arg(parsed_globals)
1376
1376
 
1377
1377
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1400,11 +1400,11 @@ def doDescribeNotebookLifecycleScripts(args, parsed_globals):
1400
1400
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1401
1401
  client._sdkVersion += ("_CLI_" + __version__)
1402
1402
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1403
- model = models.DescribeNotebookLifecycleScriptsRequest()
1403
+ model = models.PushTrainingMetricsRequest()
1404
1404
  model.from_json_string(json.dumps(args))
1405
1405
  start_time = time.time()
1406
1406
  while True:
1407
- rsp = client.DescribeNotebookLifecycleScripts(model)
1407
+ rsp = client.PushTrainingMetrics(model)
1408
1408
  result = rsp.to_json_string()
1409
1409
  try:
1410
1410
  json_obj = json.loads(result)
@@ -1423,7 +1423,7 @@ def doDescribeNotebookLifecycleScripts(args, parsed_globals):
1423
1423
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1424
1424
 
1425
1425
 
1426
- def doStopBatchTask(args, parsed_globals):
1426
+ def doDescribeTrainingModelVersions(args, parsed_globals):
1427
1427
  g_param = parse_global_arg(parsed_globals)
1428
1428
 
1429
1429
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1452,11 +1452,11 @@ def doStopBatchTask(args, parsed_globals):
1452
1452
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1453
1453
  client._sdkVersion += ("_CLI_" + __version__)
1454
1454
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1455
- model = models.StopBatchTaskRequest()
1455
+ model = models.DescribeTrainingModelVersionsRequest()
1456
1456
  model.from_json_string(json.dumps(args))
1457
1457
  start_time = time.time()
1458
1458
  while True:
1459
- rsp = client.StopBatchTask(model)
1459
+ rsp = client.DescribeTrainingModelVersions(model)
1460
1460
  result = rsp.to_json_string()
1461
1461
  try:
1462
1462
  json_obj = json.loads(result)
@@ -1475,7 +1475,7 @@ def doStopBatchTask(args, parsed_globals):
1475
1475
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1476
1476
 
1477
1477
 
1478
- def doDescribeModelAccelerateTask(args, parsed_globals):
1478
+ def doCreateNotebookLifecycleScript(args, parsed_globals):
1479
1479
  g_param = parse_global_arg(parsed_globals)
1480
1480
 
1481
1481
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1504,11 +1504,11 @@ def doDescribeModelAccelerateTask(args, parsed_globals):
1504
1504
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1505
1505
  client._sdkVersion += ("_CLI_" + __version__)
1506
1506
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1507
- model = models.DescribeModelAccelerateTaskRequest()
1507
+ model = models.CreateNotebookLifecycleScriptRequest()
1508
1508
  model.from_json_string(json.dumps(args))
1509
1509
  start_time = time.time()
1510
1510
  while True:
1511
- rsp = client.DescribeModelAccelerateTask(model)
1511
+ rsp = client.CreateNotebookLifecycleScript(model)
1512
1512
  result = rsp.to_json_string()
1513
1513
  try:
1514
1514
  json_obj = json.loads(result)
@@ -1527,7 +1527,7 @@ def doDescribeModelAccelerateTask(args, parsed_globals):
1527
1527
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1528
1528
 
1529
1529
 
1530
- def doChatCompletion(args, parsed_globals):
1530
+ def doCreateCodeRepository(args, parsed_globals):
1531
1531
  g_param = parse_global_arg(parsed_globals)
1532
1532
 
1533
1533
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1556,11 +1556,11 @@ def doChatCompletion(args, parsed_globals):
1556
1556
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1557
1557
  client._sdkVersion += ("_CLI_" + __version__)
1558
1558
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1559
- model = models.ChatCompletionRequest()
1559
+ model = models.CreateCodeRepositoryRequest()
1560
1560
  model.from_json_string(json.dumps(args))
1561
1561
  start_time = time.time()
1562
1562
  while True:
1563
- rsp = client.ChatCompletion(model)
1563
+ rsp = client.CreateCodeRepository(model)
1564
1564
  result = rsp.to_json_string()
1565
1565
  try:
1566
1566
  json_obj = json.loads(result)
@@ -1579,7 +1579,7 @@ def doChatCompletion(args, parsed_globals):
1579
1579
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1580
1580
 
1581
1581
 
1582
- def doModifyNotebookTags(args, parsed_globals):
1582
+ def doCreateModelService(args, parsed_globals):
1583
1583
  g_param = parse_global_arg(parsed_globals)
1584
1584
 
1585
1585
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1608,11 +1608,11 @@ def doModifyNotebookTags(args, parsed_globals):
1608
1608
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1609
1609
  client._sdkVersion += ("_CLI_" + __version__)
1610
1610
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1611
- model = models.ModifyNotebookTagsRequest()
1611
+ model = models.CreateModelServiceRequest()
1612
1612
  model.from_json_string(json.dumps(args))
1613
1613
  start_time = time.time()
1614
1614
  while True:
1615
- rsp = client.ModifyNotebookTags(model)
1615
+ rsp = client.CreateModelService(model)
1616
1616
  result = rsp.to_json_string()
1617
1617
  try:
1618
1618
  json_obj = json.loads(result)
@@ -1631,7 +1631,7 @@ def doModifyNotebookTags(args, parsed_globals):
1631
1631
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1632
1632
 
1633
1633
 
1634
- def doDescribeBatchTaskInstances(args, parsed_globals):
1634
+ def doDescribeTrainingJob(args, parsed_globals):
1635
1635
  g_param = parse_global_arg(parsed_globals)
1636
1636
 
1637
1637
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1660,11 +1660,11 @@ def doDescribeBatchTaskInstances(args, parsed_globals):
1660
1660
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1661
1661
  client._sdkVersion += ("_CLI_" + __version__)
1662
1662
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1663
- model = models.DescribeBatchTaskInstancesRequest()
1663
+ model = models.DescribeTrainingJobRequest()
1664
1664
  model.from_json_string(json.dumps(args))
1665
1665
  start_time = time.time()
1666
1666
  while True:
1667
- rsp = client.DescribeBatchTaskInstances(model)
1667
+ rsp = client.DescribeTrainingJob(model)
1668
1668
  result = rsp.to_json_string()
1669
1669
  try:
1670
1670
  json_obj = json.loads(result)
@@ -1683,7 +1683,7 @@ def doDescribeBatchTaskInstances(args, parsed_globals):
1683
1683
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1684
1684
 
1685
1685
 
1686
- def doCreateNotebook(args, parsed_globals):
1686
+ def doStopNotebookInstance(args, parsed_globals):
1687
1687
  g_param = parse_global_arg(parsed_globals)
1688
1688
 
1689
1689
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1712,11 +1712,11 @@ def doCreateNotebook(args, parsed_globals):
1712
1712
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1713
1713
  client._sdkVersion += ("_CLI_" + __version__)
1714
1714
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1715
- model = models.CreateNotebookRequest()
1715
+ model = models.StopNotebookInstanceRequest()
1716
1716
  model.from_json_string(json.dumps(args))
1717
1717
  start_time = time.time()
1718
1718
  while True:
1719
- rsp = client.CreateNotebook(model)
1719
+ rsp = client.StopNotebookInstance(model)
1720
1720
  result = rsp.to_json_string()
1721
1721
  try:
1722
1722
  json_obj = json.loads(result)
@@ -1735,7 +1735,7 @@ def doCreateNotebook(args, parsed_globals):
1735
1735
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1736
1736
 
1737
1737
 
1738
- def doDeleteModelAccelerateTask(args, parsed_globals):
1738
+ def doCreatePresignedNotebookUrl(args, parsed_globals):
1739
1739
  g_param = parse_global_arg(parsed_globals)
1740
1740
 
1741
1741
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1764,11 +1764,11 @@ def doDeleteModelAccelerateTask(args, parsed_globals):
1764
1764
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1765
1765
  client._sdkVersion += ("_CLI_" + __version__)
1766
1766
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1767
- model = models.DeleteModelAccelerateTaskRequest()
1767
+ model = models.CreatePresignedNotebookUrlRequest()
1768
1768
  model.from_json_string(json.dumps(args))
1769
1769
  start_time = time.time()
1770
1770
  while True:
1771
- rsp = client.DeleteModelAccelerateTask(model)
1771
+ rsp = client.CreatePresignedNotebookUrl(model)
1772
1772
  result = rsp.to_json_string()
1773
1773
  try:
1774
1774
  json_obj = json.loads(result)
@@ -1787,7 +1787,7 @@ def doDeleteModelAccelerateTask(args, parsed_globals):
1787
1787
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1788
1788
 
1789
1789
 
1790
- def doDeleteNotebookInstance(args, parsed_globals):
1790
+ def doDeleteModelService(args, parsed_globals):
1791
1791
  g_param = parse_global_arg(parsed_globals)
1792
1792
 
1793
1793
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1816,11 +1816,11 @@ def doDeleteNotebookInstance(args, parsed_globals):
1816
1816
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1817
1817
  client._sdkVersion += ("_CLI_" + __version__)
1818
1818
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1819
- model = models.DeleteNotebookInstanceRequest()
1819
+ model = models.DeleteModelServiceRequest()
1820
1820
  model.from_json_string(json.dumps(args))
1821
1821
  start_time = time.time()
1822
1822
  while True:
1823
- rsp = client.DeleteNotebookInstance(model)
1823
+ rsp = client.DeleteModelService(model)
1824
1824
  result = rsp.to_json_string()
1825
1825
  try:
1826
1826
  json_obj = json.loads(result)
@@ -1839,7 +1839,7 @@ def doDeleteNotebookInstance(args, parsed_globals):
1839
1839
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1840
1840
 
1841
1841
 
1842
- def doDescribeAPIConfigs(args, parsed_globals):
1842
+ def doDescribeDatasets(args, parsed_globals):
1843
1843
  g_param = parse_global_arg(parsed_globals)
1844
1844
 
1845
1845
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1868,11 +1868,11 @@ def doDescribeAPIConfigs(args, parsed_globals):
1868
1868
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1869
1869
  client._sdkVersion += ("_CLI_" + __version__)
1870
1870
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1871
- model = models.DescribeAPIConfigsRequest()
1871
+ model = models.DescribeDatasetsRequest()
1872
1872
  model.from_json_string(json.dumps(args))
1873
1873
  start_time = time.time()
1874
1874
  while True:
1875
- rsp = client.DescribeAPIConfigs(model)
1875
+ rsp = client.DescribeDatasets(model)
1876
1876
  result = rsp.to_json_string()
1877
1877
  try:
1878
1878
  json_obj = json.loads(result)
@@ -1891,7 +1891,7 @@ def doDescribeAPIConfigs(args, parsed_globals):
1891
1891
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1892
1892
 
1893
1893
 
1894
- def doDescribeModelAccelerateTasks(args, parsed_globals):
1894
+ def doDescribeBillingResourceInstanceRunningJobs(args, parsed_globals):
1895
1895
  g_param = parse_global_arg(parsed_globals)
1896
1896
 
1897
1897
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1920,11 +1920,11 @@ def doDescribeModelAccelerateTasks(args, parsed_globals):
1920
1920
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1921
1921
  client._sdkVersion += ("_CLI_" + __version__)
1922
1922
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1923
- model = models.DescribeModelAccelerateTasksRequest()
1923
+ model = models.DescribeBillingResourceInstanceRunningJobsRequest()
1924
1924
  model.from_json_string(json.dumps(args))
1925
1925
  start_time = time.time()
1926
1926
  while True:
1927
- rsp = client.DescribeModelAccelerateTasks(model)
1927
+ rsp = client.DescribeBillingResourceInstanceRunningJobs(model)
1928
1928
  result = rsp.to_json_string()
1929
1929
  try:
1930
1930
  json_obj = json.loads(result)
@@ -1943,7 +1943,7 @@ def doDescribeModelAccelerateTasks(args, parsed_globals):
1943
1943
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1944
1944
 
1945
1945
 
1946
- def doStopTrainingTask(args, parsed_globals):
1946
+ def doSendChatMessage(args, parsed_globals):
1947
1947
  g_param = parse_global_arg(parsed_globals)
1948
1948
 
1949
1949
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1972,11 +1972,11 @@ def doStopTrainingTask(args, parsed_globals):
1972
1972
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
1973
1973
  client._sdkVersion += ("_CLI_" + __version__)
1974
1974
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1975
- model = models.StopTrainingTaskRequest()
1975
+ model = models.SendChatMessageRequest()
1976
1976
  model.from_json_string(json.dumps(args))
1977
1977
  start_time = time.time()
1978
1978
  while True:
1979
- rsp = client.StopTrainingTask(model)
1979
+ rsp = client.SendChatMessage(model)
1980
1980
  result = rsp.to_json_string()
1981
1981
  try:
1982
1982
  json_obj = json.loads(result)
@@ -1995,7 +1995,7 @@ def doStopTrainingTask(args, parsed_globals):
1995
1995
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1996
1996
 
1997
1997
 
1998
- def doDeleteNotebookImageRecord(args, parsed_globals):
1998
+ def doModifyModelService(args, parsed_globals):
1999
1999
  g_param = parse_global_arg(parsed_globals)
2000
2000
 
2001
2001
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2024,11 +2024,11 @@ def doDeleteNotebookImageRecord(args, parsed_globals):
2024
2024
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2025
2025
  client._sdkVersion += ("_CLI_" + __version__)
2026
2026
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2027
- model = models.DeleteNotebookImageRecordRequest()
2027
+ model = models.ModifyModelServiceRequest()
2028
2028
  model.from_json_string(json.dumps(args))
2029
2029
  start_time = time.time()
2030
2030
  while True:
2031
- rsp = client.DeleteNotebookImageRecord(model)
2031
+ rsp = client.ModifyModelService(model)
2032
2032
  result = rsp.to_json_string()
2033
2033
  try:
2034
2034
  json_obj = json.loads(result)
@@ -2047,7 +2047,7 @@ def doDeleteNotebookImageRecord(args, parsed_globals):
2047
2047
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2048
2048
 
2049
2049
 
2050
- def doCreateBatchTask(args, parsed_globals):
2050
+ def doDescribeNotebooks(args, parsed_globals):
2051
2051
  g_param = parse_global_arg(parsed_globals)
2052
2052
 
2053
2053
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2076,11 +2076,11 @@ def doCreateBatchTask(args, parsed_globals):
2076
2076
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2077
2077
  client._sdkVersion += ("_CLI_" + __version__)
2078
2078
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2079
- model = models.CreateBatchTaskRequest()
2079
+ model = models.DescribeNotebooksRequest()
2080
2080
  model.from_json_string(json.dumps(args))
2081
2081
  start_time = time.time()
2082
2082
  while True:
2083
- rsp = client.CreateBatchTask(model)
2083
+ rsp = client.DescribeNotebooks(model)
2084
2084
  result = rsp.to_json_string()
2085
2085
  try:
2086
2086
  json_obj = json.loads(result)
@@ -2099,7 +2099,7 @@ def doCreateBatchTask(args, parsed_globals):
2099
2099
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2100
2100
 
2101
2101
 
2102
- def doDeleteCodeRepository(args, parsed_globals):
2102
+ def doDescribeNotebookInstances(args, parsed_globals):
2103
2103
  g_param = parse_global_arg(parsed_globals)
2104
2104
 
2105
2105
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2128,11 +2128,11 @@ def doDeleteCodeRepository(args, parsed_globals):
2128
2128
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2129
2129
  client._sdkVersion += ("_CLI_" + __version__)
2130
2130
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2131
- model = models.DeleteCodeRepositoryRequest()
2131
+ model = models.DescribeNotebookInstancesRequest()
2132
2132
  model.from_json_string(json.dumps(args))
2133
2133
  start_time = time.time()
2134
2134
  while True:
2135
- rsp = client.DeleteCodeRepository(model)
2135
+ rsp = client.DescribeNotebookInstances(model)
2136
2136
  result = rsp.to_json_string()
2137
2137
  try:
2138
2138
  json_obj = json.loads(result)
@@ -2151,7 +2151,7 @@ def doDeleteCodeRepository(args, parsed_globals):
2151
2151
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2152
2152
 
2153
2153
 
2154
- def doDescribeNotebookSummary(args, parsed_globals):
2154
+ def doDeleteTrainingModel(args, parsed_globals):
2155
2155
  g_param = parse_global_arg(parsed_globals)
2156
2156
 
2157
2157
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2180,11 +2180,11 @@ def doDescribeNotebookSummary(args, parsed_globals):
2180
2180
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2181
2181
  client._sdkVersion += ("_CLI_" + __version__)
2182
2182
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2183
- model = models.DescribeNotebookSummaryRequest()
2183
+ model = models.DeleteTrainingModelRequest()
2184
2184
  model.from_json_string(json.dumps(args))
2185
2185
  start_time = time.time()
2186
2186
  while True:
2187
- rsp = client.DescribeNotebookSummary(model)
2187
+ rsp = client.DeleteTrainingModel(model)
2188
2188
  result = rsp.to_json_string()
2189
2189
  try:
2190
2190
  json_obj = json.loads(result)
@@ -2203,7 +2203,7 @@ def doDescribeNotebookSummary(args, parsed_globals):
2203
2203
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2204
2204
 
2205
2205
 
2206
- def doDescribeNotebookInstance(args, parsed_globals):
2206
+ def doStopModelAccelerateTask(args, parsed_globals):
2207
2207
  g_param = parse_global_arg(parsed_globals)
2208
2208
 
2209
2209
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2232,11 +2232,11 @@ def doDescribeNotebookInstance(args, parsed_globals):
2232
2232
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2233
2233
  client._sdkVersion += ("_CLI_" + __version__)
2234
2234
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2235
- model = models.DescribeNotebookInstanceRequest()
2235
+ model = models.StopModelAccelerateTaskRequest()
2236
2236
  model.from_json_string(json.dumps(args))
2237
2237
  start_time = time.time()
2238
2238
  while True:
2239
- rsp = client.DescribeNotebookInstance(model)
2239
+ rsp = client.StopModelAccelerateTask(model)
2240
2240
  result = rsp.to_json_string()
2241
2241
  try:
2242
2242
  json_obj = json.loads(result)
@@ -2255,7 +2255,7 @@ def doDescribeNotebookInstance(args, parsed_globals):
2255
2255
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2256
2256
 
2257
2257
 
2258
- def doDescribeModelServiceHistory(args, parsed_globals):
2258
+ def doCreateNotebookInstance(args, parsed_globals):
2259
2259
  g_param = parse_global_arg(parsed_globals)
2260
2260
 
2261
2261
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2284,11 +2284,11 @@ def doDescribeModelServiceHistory(args, parsed_globals):
2284
2284
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2285
2285
  client._sdkVersion += ("_CLI_" + __version__)
2286
2286
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2287
- model = models.DescribeModelServiceHistoryRequest()
2287
+ model = models.CreateNotebookInstanceRequest()
2288
2288
  model.from_json_string(json.dumps(args))
2289
2289
  start_time = time.time()
2290
2290
  while True:
2291
- rsp = client.DescribeModelServiceHistory(model)
2291
+ rsp = client.CreateNotebookInstance(model)
2292
2292
  result = rsp.to_json_string()
2293
2293
  try:
2294
2294
  json_obj = json.loads(result)
@@ -2307,7 +2307,7 @@ def doDescribeModelServiceHistory(args, parsed_globals):
2307
2307
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2308
2308
 
2309
2309
 
2310
- def doCreateTrainingJob(args, parsed_globals):
2310
+ def doDeleteCodeRepository(args, parsed_globals):
2311
2311
  g_param = parse_global_arg(parsed_globals)
2312
2312
 
2313
2313
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2336,11 +2336,11 @@ def doCreateTrainingJob(args, parsed_globals):
2336
2336
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2337
2337
  client._sdkVersion += ("_CLI_" + __version__)
2338
2338
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2339
- model = models.CreateTrainingJobRequest()
2339
+ model = models.DeleteCodeRepositoryRequest()
2340
2340
  model.from_json_string(json.dumps(args))
2341
2341
  start_time = time.time()
2342
2342
  while True:
2343
- rsp = client.CreateTrainingJob(model)
2343
+ rsp = client.DeleteCodeRepository(model)
2344
2344
  result = rsp.to_json_string()
2345
2345
  try:
2346
2346
  json_obj = json.loads(result)
@@ -2359,7 +2359,7 @@ def doCreateTrainingJob(args, parsed_globals):
2359
2359
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2360
2360
 
2361
2361
 
2362
- def doDescribeCodeRepositories(args, parsed_globals):
2362
+ def doDescribeNotebookSummary(args, parsed_globals):
2363
2363
  g_param = parse_global_arg(parsed_globals)
2364
2364
 
2365
2365
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2388,11 +2388,11 @@ def doDescribeCodeRepositories(args, parsed_globals):
2388
2388
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2389
2389
  client._sdkVersion += ("_CLI_" + __version__)
2390
2390
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2391
- model = models.DescribeCodeRepositoriesRequest()
2391
+ model = models.DescribeNotebookSummaryRequest()
2392
2392
  model.from_json_string(json.dumps(args))
2393
2393
  start_time = time.time()
2394
2394
  while True:
2395
- rsp = client.DescribeCodeRepositories(model)
2395
+ rsp = client.DescribeNotebookSummary(model)
2396
2396
  result = rsp.to_json_string()
2397
2397
  try:
2398
2398
  json_obj = json.loads(result)
@@ -2411,7 +2411,7 @@ def doDescribeCodeRepositories(args, parsed_globals):
2411
2411
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2412
2412
 
2413
2413
 
2414
- def doStopNotebook(args, parsed_globals):
2414
+ def doDescribeTrainingJobs(args, parsed_globals):
2415
2415
  g_param = parse_global_arg(parsed_globals)
2416
2416
 
2417
2417
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2440,11 +2440,11 @@ def doStopNotebook(args, parsed_globals):
2440
2440
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2441
2441
  client._sdkVersion += ("_CLI_" + __version__)
2442
2442
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2443
- model = models.StopNotebookRequest()
2443
+ model = models.DescribeTrainingJobsRequest()
2444
2444
  model.from_json_string(json.dumps(args))
2445
2445
  start_time = time.time()
2446
2446
  while True:
2447
- rsp = client.StopNotebook(model)
2447
+ rsp = client.DescribeTrainingJobs(model)
2448
2448
  result = rsp.to_json_string()
2449
2449
  try:
2450
2450
  json_obj = json.loads(result)
@@ -2463,7 +2463,7 @@ def doStopNotebook(args, parsed_globals):
2463
2463
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2464
2464
 
2465
2465
 
2466
- def doDeleteBatchTask(args, parsed_globals):
2466
+ def doDeleteNotebookLifecycleScript(args, parsed_globals):
2467
2467
  g_param = parse_global_arg(parsed_globals)
2468
2468
 
2469
2469
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2492,11 +2492,11 @@ def doDeleteBatchTask(args, parsed_globals):
2492
2492
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2493
2493
  client._sdkVersion += ("_CLI_" + __version__)
2494
2494
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2495
- model = models.DeleteBatchTaskRequest()
2495
+ model = models.DeleteNotebookLifecycleScriptRequest()
2496
2496
  model.from_json_string(json.dumps(args))
2497
2497
  start_time = time.time()
2498
2498
  while True:
2499
- rsp = client.DeleteBatchTask(model)
2499
+ rsp = client.DeleteNotebookLifecycleScript(model)
2500
2500
  result = rsp.to_json_string()
2501
2501
  try:
2502
2502
  json_obj = json.loads(result)
@@ -2515,7 +2515,7 @@ def doDeleteBatchTask(args, parsed_globals):
2515
2515
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2516
2516
 
2517
2517
 
2518
- def doDescribeModelServiceCallInfo(args, parsed_globals):
2518
+ def doDescribeBillingResourceGroup(args, parsed_globals):
2519
2519
  g_param = parse_global_arg(parsed_globals)
2520
2520
 
2521
2521
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2544,11 +2544,11 @@ def doDescribeModelServiceCallInfo(args, parsed_globals):
2544
2544
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2545
2545
  client._sdkVersion += ("_CLI_" + __version__)
2546
2546
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2547
- model = models.DescribeModelServiceCallInfoRequest()
2547
+ model = models.DescribeBillingResourceGroupRequest()
2548
2548
  model.from_json_string(json.dumps(args))
2549
2549
  start_time = time.time()
2550
2550
  while True:
2551
- rsp = client.DescribeModelServiceCallInfo(model)
2551
+ rsp = client.DescribeBillingResourceGroup(model)
2552
2552
  result = rsp.to_json_string()
2553
2553
  try:
2554
2554
  json_obj = json.loads(result)
@@ -2567,7 +2567,7 @@ def doDescribeModelServiceCallInfo(args, parsed_globals):
2567
2567
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2568
2568
 
2569
2569
 
2570
- def doDescribeTrainingTasks(args, parsed_globals):
2570
+ def doDescribeNotebook(args, parsed_globals):
2571
2571
  g_param = parse_global_arg(parsed_globals)
2572
2572
 
2573
2573
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2596,11 +2596,11 @@ def doDescribeTrainingTasks(args, parsed_globals):
2596
2596
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2597
2597
  client._sdkVersion += ("_CLI_" + __version__)
2598
2598
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2599
- model = models.DescribeTrainingTasksRequest()
2599
+ model = models.DescribeNotebookRequest()
2600
2600
  model.from_json_string(json.dumps(args))
2601
2601
  start_time = time.time()
2602
2602
  while True:
2603
- rsp = client.DescribeTrainingTasks(model)
2603
+ rsp = client.DescribeNotebook(model)
2604
2604
  result = rsp.to_json_string()
2605
2605
  try:
2606
2606
  json_obj = json.loads(result)
@@ -2619,7 +2619,7 @@ def doDescribeTrainingTasks(args, parsed_globals):
2619
2619
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2620
2620
 
2621
2621
 
2622
- def doDescribeEvents(args, parsed_globals):
2622
+ def doDescribeNotebookInstance(args, parsed_globals):
2623
2623
  g_param = parse_global_arg(parsed_globals)
2624
2624
 
2625
2625
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2648,11 +2648,11 @@ def doDescribeEvents(args, parsed_globals):
2648
2648
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2649
2649
  client._sdkVersion += ("_CLI_" + __version__)
2650
2650
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2651
- model = models.DescribeEventsRequest()
2651
+ model = models.DescribeNotebookInstanceRequest()
2652
2652
  model.from_json_string(json.dumps(args))
2653
2653
  start_time = time.time()
2654
2654
  while True:
2655
- rsp = client.DescribeEvents(model)
2655
+ rsp = client.DescribeNotebookInstance(model)
2656
2656
  result = rsp.to_json_string()
2657
2657
  try:
2658
2658
  json_obj = json.loads(result)
@@ -2671,7 +2671,7 @@ def doDescribeEvents(args, parsed_globals):
2671
2671
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2672
2672
 
2673
2673
 
2674
- def doDescribeBuildInImages(args, parsed_globals):
2674
+ def doDeleteTrainingModelVersion(args, parsed_globals):
2675
2675
  g_param = parse_global_arg(parsed_globals)
2676
2676
 
2677
2677
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2700,11 +2700,11 @@ def doDescribeBuildInImages(args, parsed_globals):
2700
2700
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2701
2701
  client._sdkVersion += ("_CLI_" + __version__)
2702
2702
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2703
- model = models.DescribeBuildInImagesRequest()
2703
+ model = models.DeleteTrainingModelVersionRequest()
2704
2704
  model.from_json_string(json.dumps(args))
2705
2705
  start_time = time.time()
2706
2706
  while True:
2707
- rsp = client.DescribeBuildInImages(model)
2707
+ rsp = client.DeleteTrainingModelVersion(model)
2708
2708
  result = rsp.to_json_string()
2709
2709
  try:
2710
2710
  json_obj = json.loads(result)
@@ -2723,7 +2723,7 @@ def doDescribeBuildInImages(args, parsed_globals):
2723
2723
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2724
2724
 
2725
2725
 
2726
- def doStartNotebook(args, parsed_globals):
2726
+ def doDescribeBillingResourceGroups(args, parsed_globals):
2727
2727
  g_param = parse_global_arg(parsed_globals)
2728
2728
 
2729
2729
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2752,11 +2752,11 @@ def doStartNotebook(args, parsed_globals):
2752
2752
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2753
2753
  client._sdkVersion += ("_CLI_" + __version__)
2754
2754
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2755
- model = models.StartNotebookRequest()
2755
+ model = models.DescribeBillingResourceGroupsRequest()
2756
2756
  model.from_json_string(json.dumps(args))
2757
2757
  start_time = time.time()
2758
2758
  while True:
2759
- rsp = client.StartNotebook(model)
2759
+ rsp = client.DescribeBillingResourceGroups(model)
2760
2760
  result = rsp.to_json_string()
2761
2761
  try:
2762
2762
  json_obj = json.loads(result)
@@ -2775,7 +2775,7 @@ def doStartNotebook(args, parsed_globals):
2775
2775
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2776
2776
 
2777
2777
 
2778
- def doDescribeTrainingModels(args, parsed_globals):
2778
+ def doDescribeInferTemplates(args, parsed_globals):
2779
2779
  g_param = parse_global_arg(parsed_globals)
2780
2780
 
2781
2781
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2804,11 +2804,11 @@ def doDescribeTrainingModels(args, parsed_globals):
2804
2804
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2805
2805
  client._sdkVersion += ("_CLI_" + __version__)
2806
2806
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2807
- model = models.DescribeTrainingModelsRequest()
2807
+ model = models.DescribeInferTemplatesRequest()
2808
2808
  model.from_json_string(json.dumps(args))
2809
2809
  start_time = time.time()
2810
2810
  while True:
2811
- rsp = client.DescribeTrainingModels(model)
2811
+ rsp = client.DescribeInferTemplates(model)
2812
2812
  result = rsp.to_json_string()
2813
2813
  try:
2814
2814
  json_obj = json.loads(result)
@@ -2827,7 +2827,7 @@ def doDescribeTrainingModels(args, parsed_globals):
2827
2827
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2828
2828
 
2829
2829
 
2830
- def doDescribeTrainingMetrics(args, parsed_globals):
2830
+ def doDescribeModelServiceGroups(args, parsed_globals):
2831
2831
  g_param = parse_global_arg(parsed_globals)
2832
2832
 
2833
2833
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2856,11 +2856,11 @@ def doDescribeTrainingMetrics(args, parsed_globals):
2856
2856
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2857
2857
  client._sdkVersion += ("_CLI_" + __version__)
2858
2858
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2859
- model = models.DescribeTrainingMetricsRequest()
2859
+ model = models.DescribeModelServiceGroupsRequest()
2860
2860
  model.from_json_string(json.dumps(args))
2861
2861
  start_time = time.time()
2862
2862
  while True:
2863
- rsp = client.DescribeTrainingMetrics(model)
2863
+ rsp = client.DescribeModelServiceGroups(model)
2864
2864
  result = rsp.to_json_string()
2865
2865
  try:
2866
2866
  json_obj = json.loads(result)
@@ -2879,1983 +2879,7 @@ def doDescribeTrainingMetrics(args, parsed_globals):
2879
2879
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2880
2880
 
2881
2881
 
2882
- def doDeleteTrainingModel(args, parsed_globals):
2883
- g_param = parse_global_arg(parsed_globals)
2884
-
2885
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2886
- cred = credential.CVMRoleCredential()
2887
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2888
- cred = credential.STSAssumeRoleCredential(
2889
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2890
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2891
- )
2892
- 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):
2893
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2894
- else:
2895
- cred = credential.Credential(
2896
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2897
- )
2898
- http_profile = HttpProfile(
2899
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2900
- reqMethod="POST",
2901
- endpoint=g_param[OptionsDefine.Endpoint],
2902
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2903
- )
2904
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2905
- if g_param[OptionsDefine.Language]:
2906
- profile.language = g_param[OptionsDefine.Language]
2907
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2908
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2909
- client._sdkVersion += ("_CLI_" + __version__)
2910
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
2911
- model = models.DeleteTrainingModelRequest()
2912
- model.from_json_string(json.dumps(args))
2913
- start_time = time.time()
2914
- while True:
2915
- rsp = client.DeleteTrainingModel(model)
2916
- result = rsp.to_json_string()
2917
- try:
2918
- json_obj = json.loads(result)
2919
- except TypeError as e:
2920
- json_obj = json.loads(result.decode('utf-8')) # python3.3
2921
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2922
- break
2923
- cur_time = time.time()
2924
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2925
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2926
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2927
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2928
- else:
2929
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2930
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2931
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2932
-
2933
-
2934
- def doStartTrainingTask(args, parsed_globals):
2935
- g_param = parse_global_arg(parsed_globals)
2936
-
2937
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2938
- cred = credential.CVMRoleCredential()
2939
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2940
- cred = credential.STSAssumeRoleCredential(
2941
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2942
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2943
- )
2944
- 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):
2945
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2946
- else:
2947
- cred = credential.Credential(
2948
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2949
- )
2950
- http_profile = HttpProfile(
2951
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2952
- reqMethod="POST",
2953
- endpoint=g_param[OptionsDefine.Endpoint],
2954
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2955
- )
2956
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2957
- if g_param[OptionsDefine.Language]:
2958
- profile.language = g_param[OptionsDefine.Language]
2959
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2960
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
2961
- client._sdkVersion += ("_CLI_" + __version__)
2962
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
2963
- model = models.StartTrainingTaskRequest()
2964
- model.from_json_string(json.dumps(args))
2965
- start_time = time.time()
2966
- while True:
2967
- rsp = client.StartTrainingTask(model)
2968
- result = rsp.to_json_string()
2969
- try:
2970
- json_obj = json.loads(result)
2971
- except TypeError as e:
2972
- json_obj = json.loads(result.decode('utf-8')) # python3.3
2973
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2974
- break
2975
- cur_time = time.time()
2976
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2977
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2978
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2979
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2980
- else:
2981
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2982
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2983
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2984
-
2985
-
2986
- def doCreatePresignedNotebookInstanceUrl(args, parsed_globals):
2987
- g_param = parse_global_arg(parsed_globals)
2988
-
2989
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2990
- cred = credential.CVMRoleCredential()
2991
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2992
- cred = credential.STSAssumeRoleCredential(
2993
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2994
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2995
- )
2996
- 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):
2997
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2998
- else:
2999
- cred = credential.Credential(
3000
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3001
- )
3002
- http_profile = HttpProfile(
3003
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3004
- reqMethod="POST",
3005
- endpoint=g_param[OptionsDefine.Endpoint],
3006
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3007
- )
3008
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3009
- if g_param[OptionsDefine.Language]:
3010
- profile.language = g_param[OptionsDefine.Language]
3011
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3012
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3013
- client._sdkVersion += ("_CLI_" + __version__)
3014
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3015
- model = models.CreatePresignedNotebookInstanceUrlRequest()
3016
- model.from_json_string(json.dumps(args))
3017
- start_time = time.time()
3018
- while True:
3019
- rsp = client.CreatePresignedNotebookInstanceUrl(model)
3020
- result = rsp.to_json_string()
3021
- try:
3022
- json_obj = json.loads(result)
3023
- except TypeError as e:
3024
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3025
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3026
- break
3027
- cur_time = time.time()
3028
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3029
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3030
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3031
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3032
- else:
3033
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3034
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3035
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3036
-
3037
-
3038
- def doCreateDataset(args, parsed_globals):
3039
- g_param = parse_global_arg(parsed_globals)
3040
-
3041
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3042
- cred = credential.CVMRoleCredential()
3043
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3044
- cred = credential.STSAssumeRoleCredential(
3045
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3046
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3047
- )
3048
- 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):
3049
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3050
- else:
3051
- cred = credential.Credential(
3052
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3053
- )
3054
- http_profile = HttpProfile(
3055
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3056
- reqMethod="POST",
3057
- endpoint=g_param[OptionsDefine.Endpoint],
3058
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3059
- )
3060
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3061
- if g_param[OptionsDefine.Language]:
3062
- profile.language = g_param[OptionsDefine.Language]
3063
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3064
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3065
- client._sdkVersion += ("_CLI_" + __version__)
3066
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3067
- model = models.CreateDatasetRequest()
3068
- model.from_json_string(json.dumps(args))
3069
- start_time = time.time()
3070
- while True:
3071
- rsp = client.CreateDataset(model)
3072
- result = rsp.to_json_string()
3073
- try:
3074
- json_obj = json.loads(result)
3075
- except TypeError as e:
3076
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3077
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3078
- break
3079
- cur_time = time.time()
3080
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3081
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3082
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3083
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3084
- else:
3085
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3086
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3087
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3088
-
3089
-
3090
- def doPushTrainingMetrics(args, parsed_globals):
3091
- g_param = parse_global_arg(parsed_globals)
3092
-
3093
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3094
- cred = credential.CVMRoleCredential()
3095
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3096
- cred = credential.STSAssumeRoleCredential(
3097
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3098
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3099
- )
3100
- 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):
3101
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3102
- else:
3103
- cred = credential.Credential(
3104
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3105
- )
3106
- http_profile = HttpProfile(
3107
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3108
- reqMethod="POST",
3109
- endpoint=g_param[OptionsDefine.Endpoint],
3110
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3111
- )
3112
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3113
- if g_param[OptionsDefine.Language]:
3114
- profile.language = g_param[OptionsDefine.Language]
3115
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3116
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3117
- client._sdkVersion += ("_CLI_" + __version__)
3118
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3119
- model = models.PushTrainingMetricsRequest()
3120
- model.from_json_string(json.dumps(args))
3121
- start_time = time.time()
3122
- while True:
3123
- rsp = client.PushTrainingMetrics(model)
3124
- result = rsp.to_json_string()
3125
- try:
3126
- json_obj = json.loads(result)
3127
- except TypeError as e:
3128
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3129
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3130
- break
3131
- cur_time = time.time()
3132
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3133
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3134
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3135
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3136
- else:
3137
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3138
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3139
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3140
-
3141
-
3142
- def doDescribeTrainingModelVersions(args, parsed_globals):
3143
- g_param = parse_global_arg(parsed_globals)
3144
-
3145
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3146
- cred = credential.CVMRoleCredential()
3147
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3148
- cred = credential.STSAssumeRoleCredential(
3149
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3150
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3151
- )
3152
- 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):
3153
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3154
- else:
3155
- cred = credential.Credential(
3156
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3157
- )
3158
- http_profile = HttpProfile(
3159
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3160
- reqMethod="POST",
3161
- endpoint=g_param[OptionsDefine.Endpoint],
3162
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3163
- )
3164
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3165
- if g_param[OptionsDefine.Language]:
3166
- profile.language = g_param[OptionsDefine.Language]
3167
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3168
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3169
- client._sdkVersion += ("_CLI_" + __version__)
3170
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3171
- model = models.DescribeTrainingModelVersionsRequest()
3172
- model.from_json_string(json.dumps(args))
3173
- start_time = time.time()
3174
- while True:
3175
- rsp = client.DescribeTrainingModelVersions(model)
3176
- result = rsp.to_json_string()
3177
- try:
3178
- json_obj = json.loads(result)
3179
- except TypeError as e:
3180
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3181
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3182
- break
3183
- cur_time = time.time()
3184
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3185
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3186
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3187
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3188
- else:
3189
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3190
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3191
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3192
-
3193
-
3194
- def doCreateModelService(args, parsed_globals):
3195
- g_param = parse_global_arg(parsed_globals)
3196
-
3197
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3198
- cred = credential.CVMRoleCredential()
3199
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3200
- cred = credential.STSAssumeRoleCredential(
3201
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3202
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3203
- )
3204
- 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):
3205
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3206
- else:
3207
- cred = credential.Credential(
3208
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3209
- )
3210
- http_profile = HttpProfile(
3211
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3212
- reqMethod="POST",
3213
- endpoint=g_param[OptionsDefine.Endpoint],
3214
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3215
- )
3216
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3217
- if g_param[OptionsDefine.Language]:
3218
- profile.language = g_param[OptionsDefine.Language]
3219
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3220
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3221
- client._sdkVersion += ("_CLI_" + __version__)
3222
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3223
- model = models.CreateModelServiceRequest()
3224
- model.from_json_string(json.dumps(args))
3225
- start_time = time.time()
3226
- while True:
3227
- rsp = client.CreateModelService(model)
3228
- result = rsp.to_json_string()
3229
- try:
3230
- json_obj = json.loads(result)
3231
- except TypeError as e:
3232
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3233
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3234
- break
3235
- cur_time = time.time()
3236
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3237
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3238
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3239
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3240
- else:
3241
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3242
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3243
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3244
-
3245
-
3246
- def doStopNotebookInstance(args, parsed_globals):
3247
- g_param = parse_global_arg(parsed_globals)
3248
-
3249
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3250
- cred = credential.CVMRoleCredential()
3251
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3252
- cred = credential.STSAssumeRoleCredential(
3253
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3254
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3255
- )
3256
- 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):
3257
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3258
- else:
3259
- cred = credential.Credential(
3260
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3261
- )
3262
- http_profile = HttpProfile(
3263
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3264
- reqMethod="POST",
3265
- endpoint=g_param[OptionsDefine.Endpoint],
3266
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3267
- )
3268
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3269
- if g_param[OptionsDefine.Language]:
3270
- profile.language = g_param[OptionsDefine.Language]
3271
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3272
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3273
- client._sdkVersion += ("_CLI_" + __version__)
3274
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3275
- model = models.StopNotebookInstanceRequest()
3276
- model.from_json_string(json.dumps(args))
3277
- start_time = time.time()
3278
- while True:
3279
- rsp = client.StopNotebookInstance(model)
3280
- result = rsp.to_json_string()
3281
- try:
3282
- json_obj = json.loads(result)
3283
- except TypeError as e:
3284
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3285
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3286
- break
3287
- cur_time = time.time()
3288
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3289
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3290
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3291
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3292
- else:
3293
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3294
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3295
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3296
-
3297
-
3298
- def doDescribeLogs(args, parsed_globals):
3299
- g_param = parse_global_arg(parsed_globals)
3300
-
3301
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3302
- cred = credential.CVMRoleCredential()
3303
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3304
- cred = credential.STSAssumeRoleCredential(
3305
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3306
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3307
- )
3308
- 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):
3309
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3310
- else:
3311
- cred = credential.Credential(
3312
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3313
- )
3314
- http_profile = HttpProfile(
3315
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3316
- reqMethod="POST",
3317
- endpoint=g_param[OptionsDefine.Endpoint],
3318
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3319
- )
3320
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3321
- if g_param[OptionsDefine.Language]:
3322
- profile.language = g_param[OptionsDefine.Language]
3323
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3324
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3325
- client._sdkVersion += ("_CLI_" + __version__)
3326
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3327
- model = models.DescribeLogsRequest()
3328
- model.from_json_string(json.dumps(args))
3329
- start_time = time.time()
3330
- while True:
3331
- rsp = client.DescribeLogs(model)
3332
- result = rsp.to_json_string()
3333
- try:
3334
- json_obj = json.loads(result)
3335
- except TypeError as e:
3336
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3337
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3338
- break
3339
- cur_time = time.time()
3340
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3341
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3342
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3343
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3344
- else:
3345
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3346
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3347
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3348
-
3349
-
3350
- def doDescribeDatasets(args, parsed_globals):
3351
- g_param = parse_global_arg(parsed_globals)
3352
-
3353
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3354
- cred = credential.CVMRoleCredential()
3355
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3356
- cred = credential.STSAssumeRoleCredential(
3357
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3358
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3359
- )
3360
- 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):
3361
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3362
- else:
3363
- cred = credential.Credential(
3364
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3365
- )
3366
- http_profile = HttpProfile(
3367
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3368
- reqMethod="POST",
3369
- endpoint=g_param[OptionsDefine.Endpoint],
3370
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3371
- )
3372
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3373
- if g_param[OptionsDefine.Language]:
3374
- profile.language = g_param[OptionsDefine.Language]
3375
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3376
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3377
- client._sdkVersion += ("_CLI_" + __version__)
3378
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3379
- model = models.DescribeDatasetsRequest()
3380
- model.from_json_string(json.dumps(args))
3381
- start_time = time.time()
3382
- while True:
3383
- rsp = client.DescribeDatasets(model)
3384
- result = rsp.to_json_string()
3385
- try:
3386
- json_obj = json.loads(result)
3387
- except TypeError as e:
3388
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3389
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3390
- break
3391
- cur_time = time.time()
3392
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3393
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3394
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3395
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3396
- else:
3397
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3398
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3399
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3400
-
3401
-
3402
- def doRestartModelAccelerateTask(args, parsed_globals):
3403
- g_param = parse_global_arg(parsed_globals)
3404
-
3405
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3406
- cred = credential.CVMRoleCredential()
3407
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3408
- cred = credential.STSAssumeRoleCredential(
3409
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3410
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3411
- )
3412
- 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):
3413
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3414
- else:
3415
- cred = credential.Credential(
3416
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3417
- )
3418
- http_profile = HttpProfile(
3419
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3420
- reqMethod="POST",
3421
- endpoint=g_param[OptionsDefine.Endpoint],
3422
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3423
- )
3424
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3425
- if g_param[OptionsDefine.Language]:
3426
- profile.language = g_param[OptionsDefine.Language]
3427
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3428
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3429
- client._sdkVersion += ("_CLI_" + __version__)
3430
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3431
- model = models.RestartModelAccelerateTaskRequest()
3432
- model.from_json_string(json.dumps(args))
3433
- start_time = time.time()
3434
- while True:
3435
- rsp = client.RestartModelAccelerateTask(model)
3436
- result = rsp.to_json_string()
3437
- try:
3438
- json_obj = json.loads(result)
3439
- except TypeError as e:
3440
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3441
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3442
- break
3443
- cur_time = time.time()
3444
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3445
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3446
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3447
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3448
- else:
3449
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3450
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3451
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3452
-
3453
-
3454
- def doDescribeBillingResourceInstanceRunningJobs(args, parsed_globals):
3455
- g_param = parse_global_arg(parsed_globals)
3456
-
3457
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3458
- cred = credential.CVMRoleCredential()
3459
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3460
- cred = credential.STSAssumeRoleCredential(
3461
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3462
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3463
- )
3464
- 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):
3465
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3466
- else:
3467
- cred = credential.Credential(
3468
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3469
- )
3470
- http_profile = HttpProfile(
3471
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3472
- reqMethod="POST",
3473
- endpoint=g_param[OptionsDefine.Endpoint],
3474
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3475
- )
3476
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3477
- if g_param[OptionsDefine.Language]:
3478
- profile.language = g_param[OptionsDefine.Language]
3479
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3480
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3481
- client._sdkVersion += ("_CLI_" + __version__)
3482
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3483
- model = models.DescribeBillingResourceInstanceRunningJobsRequest()
3484
- model.from_json_string(json.dumps(args))
3485
- start_time = time.time()
3486
- while True:
3487
- rsp = client.DescribeBillingResourceInstanceRunningJobs(model)
3488
- result = rsp.to_json_string()
3489
- try:
3490
- json_obj = json.loads(result)
3491
- except TypeError as e:
3492
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3493
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3494
- break
3495
- cur_time = time.time()
3496
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3497
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3498
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3499
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3500
- else:
3501
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3502
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3503
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3504
-
3505
-
3506
- def doSendChatMessage(args, parsed_globals):
3507
- g_param = parse_global_arg(parsed_globals)
3508
-
3509
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3510
- cred = credential.CVMRoleCredential()
3511
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3512
- cred = credential.STSAssumeRoleCredential(
3513
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3514
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3515
- )
3516
- 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):
3517
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3518
- else:
3519
- cred = credential.Credential(
3520
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3521
- )
3522
- http_profile = HttpProfile(
3523
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3524
- reqMethod="POST",
3525
- endpoint=g_param[OptionsDefine.Endpoint],
3526
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3527
- )
3528
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3529
- if g_param[OptionsDefine.Language]:
3530
- profile.language = g_param[OptionsDefine.Language]
3531
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3532
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3533
- client._sdkVersion += ("_CLI_" + __version__)
3534
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3535
- model = models.SendChatMessageRequest()
3536
- model.from_json_string(json.dumps(args))
3537
- start_time = time.time()
3538
- while True:
3539
- rsp = client.SendChatMessage(model)
3540
- result = rsp.to_json_string()
3541
- try:
3542
- json_obj = json.loads(result)
3543
- except TypeError as e:
3544
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3545
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3546
- break
3547
- cur_time = time.time()
3548
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3549
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3550
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3551
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3552
- else:
3553
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3554
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3555
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3556
-
3557
-
3558
- def doModifyModelService(args, parsed_globals):
3559
- g_param = parse_global_arg(parsed_globals)
3560
-
3561
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3562
- cred = credential.CVMRoleCredential()
3563
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3564
- cred = credential.STSAssumeRoleCredential(
3565
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3566
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3567
- )
3568
- 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):
3569
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3570
- else:
3571
- cred = credential.Credential(
3572
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3573
- )
3574
- http_profile = HttpProfile(
3575
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3576
- reqMethod="POST",
3577
- endpoint=g_param[OptionsDefine.Endpoint],
3578
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3579
- )
3580
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3581
- if g_param[OptionsDefine.Language]:
3582
- profile.language = g_param[OptionsDefine.Language]
3583
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3584
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3585
- client._sdkVersion += ("_CLI_" + __version__)
3586
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3587
- model = models.ModifyModelServiceRequest()
3588
- model.from_json_string(json.dumps(args))
3589
- start_time = time.time()
3590
- while True:
3591
- rsp = client.ModifyModelService(model)
3592
- result = rsp.to_json_string()
3593
- try:
3594
- json_obj = json.loads(result)
3595
- except TypeError as e:
3596
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3597
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3598
- break
3599
- cur_time = time.time()
3600
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3601
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3602
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3603
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3604
- else:
3605
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3606
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3607
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3608
-
3609
-
3610
- def doDescribeTrainingTask(args, parsed_globals):
3611
- g_param = parse_global_arg(parsed_globals)
3612
-
3613
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3614
- cred = credential.CVMRoleCredential()
3615
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3616
- cred = credential.STSAssumeRoleCredential(
3617
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3618
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3619
- )
3620
- 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):
3621
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3622
- else:
3623
- cred = credential.Credential(
3624
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3625
- )
3626
- http_profile = HttpProfile(
3627
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3628
- reqMethod="POST",
3629
- endpoint=g_param[OptionsDefine.Endpoint],
3630
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3631
- )
3632
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3633
- if g_param[OptionsDefine.Language]:
3634
- profile.language = g_param[OptionsDefine.Language]
3635
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3636
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3637
- client._sdkVersion += ("_CLI_" + __version__)
3638
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3639
- model = models.DescribeTrainingTaskRequest()
3640
- model.from_json_string(json.dumps(args))
3641
- start_time = time.time()
3642
- while True:
3643
- rsp = client.DescribeTrainingTask(model)
3644
- result = rsp.to_json_string()
3645
- try:
3646
- json_obj = json.loads(result)
3647
- except TypeError as e:
3648
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3649
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3650
- break
3651
- cur_time = time.time()
3652
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3653
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3654
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3655
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3656
- else:
3657
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3658
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3659
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3660
-
3661
-
3662
- def doStopCreatingImage(args, parsed_globals):
3663
- g_param = parse_global_arg(parsed_globals)
3664
-
3665
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3666
- cred = credential.CVMRoleCredential()
3667
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3668
- cred = credential.STSAssumeRoleCredential(
3669
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3670
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3671
- )
3672
- 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):
3673
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3674
- else:
3675
- cred = credential.Credential(
3676
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3677
- )
3678
- http_profile = HttpProfile(
3679
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3680
- reqMethod="POST",
3681
- endpoint=g_param[OptionsDefine.Endpoint],
3682
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3683
- )
3684
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3685
- if g_param[OptionsDefine.Language]:
3686
- profile.language = g_param[OptionsDefine.Language]
3687
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3688
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3689
- client._sdkVersion += ("_CLI_" + __version__)
3690
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3691
- model = models.StopCreatingImageRequest()
3692
- model.from_json_string(json.dumps(args))
3693
- start_time = time.time()
3694
- while True:
3695
- rsp = client.StopCreatingImage(model)
3696
- result = rsp.to_json_string()
3697
- try:
3698
- json_obj = json.loads(result)
3699
- except TypeError as e:
3700
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3701
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3702
- break
3703
- cur_time = time.time()
3704
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3705
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3706
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3707
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3708
- else:
3709
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3710
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3711
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3712
-
3713
-
3714
- def doDescribeTrainingJobs(args, parsed_globals):
3715
- g_param = parse_global_arg(parsed_globals)
3716
-
3717
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3718
- cred = credential.CVMRoleCredential()
3719
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3720
- cred = credential.STSAssumeRoleCredential(
3721
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3722
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3723
- )
3724
- 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):
3725
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3726
- else:
3727
- cred = credential.Credential(
3728
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3729
- )
3730
- http_profile = HttpProfile(
3731
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3732
- reqMethod="POST",
3733
- endpoint=g_param[OptionsDefine.Endpoint],
3734
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3735
- )
3736
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3737
- if g_param[OptionsDefine.Language]:
3738
- profile.language = g_param[OptionsDefine.Language]
3739
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3740
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3741
- client._sdkVersion += ("_CLI_" + __version__)
3742
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3743
- model = models.DescribeTrainingJobsRequest()
3744
- model.from_json_string(json.dumps(args))
3745
- start_time = time.time()
3746
- while True:
3747
- rsp = client.DescribeTrainingJobs(model)
3748
- result = rsp.to_json_string()
3749
- try:
3750
- json_obj = json.loads(result)
3751
- except TypeError as e:
3752
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3753
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3754
- break
3755
- cur_time = time.time()
3756
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3757
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3758
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3759
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3760
- else:
3761
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3762
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3763
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3764
-
3765
-
3766
- def doDescribeLatestTrainingMetrics(args, parsed_globals):
3767
- g_param = parse_global_arg(parsed_globals)
3768
-
3769
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3770
- cred = credential.CVMRoleCredential()
3771
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3772
- cred = credential.STSAssumeRoleCredential(
3773
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3774
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3775
- )
3776
- 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):
3777
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3778
- else:
3779
- cred = credential.Credential(
3780
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3781
- )
3782
- http_profile = HttpProfile(
3783
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3784
- reqMethod="POST",
3785
- endpoint=g_param[OptionsDefine.Endpoint],
3786
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3787
- )
3788
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3789
- if g_param[OptionsDefine.Language]:
3790
- profile.language = g_param[OptionsDefine.Language]
3791
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3792
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3793
- client._sdkVersion += ("_CLI_" + __version__)
3794
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3795
- model = models.DescribeLatestTrainingMetricsRequest()
3796
- model.from_json_string(json.dumps(args))
3797
- start_time = time.time()
3798
- while True:
3799
- rsp = client.DescribeLatestTrainingMetrics(model)
3800
- result = rsp.to_json_string()
3801
- try:
3802
- json_obj = json.loads(result)
3803
- except TypeError as e:
3804
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3805
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3806
- break
3807
- cur_time = time.time()
3808
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3809
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3810
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3811
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3812
- else:
3813
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3814
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3815
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3816
-
3817
-
3818
- def doModifyNotebook(args, parsed_globals):
3819
- g_param = parse_global_arg(parsed_globals)
3820
-
3821
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3822
- cred = credential.CVMRoleCredential()
3823
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3824
- cred = credential.STSAssumeRoleCredential(
3825
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3826
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3827
- )
3828
- 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):
3829
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3830
- else:
3831
- cred = credential.Credential(
3832
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3833
- )
3834
- http_profile = HttpProfile(
3835
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3836
- reqMethod="POST",
3837
- endpoint=g_param[OptionsDefine.Endpoint],
3838
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3839
- )
3840
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3841
- if g_param[OptionsDefine.Language]:
3842
- profile.language = g_param[OptionsDefine.Language]
3843
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3844
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3845
- client._sdkVersion += ("_CLI_" + __version__)
3846
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3847
- model = models.ModifyNotebookRequest()
3848
- model.from_json_string(json.dumps(args))
3849
- start_time = time.time()
3850
- while True:
3851
- rsp = client.ModifyNotebook(model)
3852
- result = rsp.to_json_string()
3853
- try:
3854
- json_obj = json.loads(result)
3855
- except TypeError as e:
3856
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3857
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3858
- break
3859
- cur_time = time.time()
3860
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3861
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3862
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3863
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3864
- else:
3865
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3866
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3867
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3868
-
3869
-
3870
- def doDescribeBillingResourceGroups(args, parsed_globals):
3871
- g_param = parse_global_arg(parsed_globals)
3872
-
3873
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3874
- cred = credential.CVMRoleCredential()
3875
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3876
- cred = credential.STSAssumeRoleCredential(
3877
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3878
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3879
- )
3880
- 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):
3881
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3882
- else:
3883
- cred = credential.Credential(
3884
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3885
- )
3886
- http_profile = HttpProfile(
3887
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3888
- reqMethod="POST",
3889
- endpoint=g_param[OptionsDefine.Endpoint],
3890
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3891
- )
3892
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3893
- if g_param[OptionsDefine.Language]:
3894
- profile.language = g_param[OptionsDefine.Language]
3895
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3896
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3897
- client._sdkVersion += ("_CLI_" + __version__)
3898
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3899
- model = models.DescribeBillingResourceGroupsRequest()
3900
- model.from_json_string(json.dumps(args))
3901
- start_time = time.time()
3902
- while True:
3903
- rsp = client.DescribeBillingResourceGroups(model)
3904
- result = rsp.to_json_string()
3905
- try:
3906
- json_obj = json.loads(result)
3907
- except TypeError as e:
3908
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3909
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3910
- break
3911
- cur_time = time.time()
3912
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3913
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3914
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3915
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3916
- else:
3917
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3918
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3919
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3920
-
3921
-
3922
- def doDescribeModelServiceGroups(args, parsed_globals):
3923
- g_param = parse_global_arg(parsed_globals)
3924
-
3925
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3926
- cred = credential.CVMRoleCredential()
3927
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3928
- cred = credential.STSAssumeRoleCredential(
3929
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3930
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3931
- )
3932
- 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):
3933
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3934
- else:
3935
- cred = credential.Credential(
3936
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3937
- )
3938
- http_profile = HttpProfile(
3939
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3940
- reqMethod="POST",
3941
- endpoint=g_param[OptionsDefine.Endpoint],
3942
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3943
- )
3944
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3945
- if g_param[OptionsDefine.Language]:
3946
- profile.language = g_param[OptionsDefine.Language]
3947
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3948
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
3949
- client._sdkVersion += ("_CLI_" + __version__)
3950
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
3951
- model = models.DescribeModelServiceGroupsRequest()
3952
- model.from_json_string(json.dumps(args))
3953
- start_time = time.time()
3954
- while True:
3955
- rsp = client.DescribeModelServiceGroups(model)
3956
- result = rsp.to_json_string()
3957
- try:
3958
- json_obj = json.loads(result)
3959
- except TypeError as e:
3960
- json_obj = json.loads(result.decode('utf-8')) # python3.3
3961
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3962
- break
3963
- cur_time = time.time()
3964
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3965
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3966
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3967
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3968
- else:
3969
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3970
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3971
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3972
-
3973
-
3974
- def doModifyModelServicePartialConfig(args, parsed_globals):
3975
- g_param = parse_global_arg(parsed_globals)
3976
-
3977
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3978
- cred = credential.CVMRoleCredential()
3979
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3980
- cred = credential.STSAssumeRoleCredential(
3981
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3982
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3983
- )
3984
- 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):
3985
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3986
- else:
3987
- cred = credential.Credential(
3988
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3989
- )
3990
- http_profile = HttpProfile(
3991
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3992
- reqMethod="POST",
3993
- endpoint=g_param[OptionsDefine.Endpoint],
3994
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3995
- )
3996
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3997
- if g_param[OptionsDefine.Language]:
3998
- profile.language = g_param[OptionsDefine.Language]
3999
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4000
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4001
- client._sdkVersion += ("_CLI_" + __version__)
4002
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4003
- model = models.ModifyModelServicePartialConfigRequest()
4004
- model.from_json_string(json.dumps(args))
4005
- start_time = time.time()
4006
- while True:
4007
- rsp = client.ModifyModelServicePartialConfig(model)
4008
- result = rsp.to_json_string()
4009
- try:
4010
- json_obj = json.loads(result)
4011
- except TypeError as e:
4012
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4013
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4014
- break
4015
- cur_time = time.time()
4016
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4017
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4018
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4019
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4020
- else:
4021
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4022
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4023
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4024
-
4025
-
4026
- def doUpdateNotebookInstance(args, parsed_globals):
4027
- g_param = parse_global_arg(parsed_globals)
4028
-
4029
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4030
- cred = credential.CVMRoleCredential()
4031
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4032
- cred = credential.STSAssumeRoleCredential(
4033
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4034
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4035
- )
4036
- 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):
4037
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4038
- else:
4039
- cred = credential.Credential(
4040
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4041
- )
4042
- http_profile = HttpProfile(
4043
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4044
- reqMethod="POST",
4045
- endpoint=g_param[OptionsDefine.Endpoint],
4046
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4047
- )
4048
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4049
- if g_param[OptionsDefine.Language]:
4050
- profile.language = g_param[OptionsDefine.Language]
4051
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4052
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4053
- client._sdkVersion += ("_CLI_" + __version__)
4054
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4055
- model = models.UpdateNotebookInstanceRequest()
4056
- model.from_json_string(json.dumps(args))
4057
- start_time = time.time()
4058
- while True:
4059
- rsp = client.UpdateNotebookInstance(model)
4060
- result = rsp.to_json_string()
4061
- try:
4062
- json_obj = json.loads(result)
4063
- except TypeError as e:
4064
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4065
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4066
- break
4067
- cur_time = time.time()
4068
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4069
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4070
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4071
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4072
- else:
4073
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4074
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4075
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4076
-
4077
-
4078
- def doDescribeTrainingFrameworks(args, parsed_globals):
4079
- g_param = parse_global_arg(parsed_globals)
4080
-
4081
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4082
- cred = credential.CVMRoleCredential()
4083
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4084
- cred = credential.STSAssumeRoleCredential(
4085
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4086
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4087
- )
4088
- 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):
4089
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4090
- else:
4091
- cred = credential.Credential(
4092
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4093
- )
4094
- http_profile = HttpProfile(
4095
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4096
- reqMethod="POST",
4097
- endpoint=g_param[OptionsDefine.Endpoint],
4098
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4099
- )
4100
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4101
- if g_param[OptionsDefine.Language]:
4102
- profile.language = g_param[OptionsDefine.Language]
4103
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4104
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4105
- client._sdkVersion += ("_CLI_" + __version__)
4106
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4107
- model = models.DescribeTrainingFrameworksRequest()
4108
- model.from_json_string(json.dumps(args))
4109
- start_time = time.time()
4110
- while True:
4111
- rsp = client.DescribeTrainingFrameworks(model)
4112
- result = rsp.to_json_string()
4113
- try:
4114
- json_obj = json.loads(result)
4115
- except TypeError as e:
4116
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4117
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4118
- break
4119
- cur_time = time.time()
4120
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4121
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4122
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4123
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4124
- else:
4125
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4126
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4127
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4128
-
4129
-
4130
- def doDeleteDataset(args, parsed_globals):
4131
- g_param = parse_global_arg(parsed_globals)
4132
-
4133
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4134
- cred = credential.CVMRoleCredential()
4135
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4136
- cred = credential.STSAssumeRoleCredential(
4137
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4138
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4139
- )
4140
- 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):
4141
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4142
- else:
4143
- cred = credential.Credential(
4144
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4145
- )
4146
- http_profile = HttpProfile(
4147
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4148
- reqMethod="POST",
4149
- endpoint=g_param[OptionsDefine.Endpoint],
4150
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4151
- )
4152
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4153
- if g_param[OptionsDefine.Language]:
4154
- profile.language = g_param[OptionsDefine.Language]
4155
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4156
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4157
- client._sdkVersion += ("_CLI_" + __version__)
4158
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4159
- model = models.DeleteDatasetRequest()
4160
- model.from_json_string(json.dumps(args))
4161
- start_time = time.time()
4162
- while True:
4163
- rsp = client.DeleteDataset(model)
4164
- result = rsp.to_json_string()
4165
- try:
4166
- json_obj = json.loads(result)
4167
- except TypeError as e:
4168
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4169
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4170
- break
4171
- cur_time = time.time()
4172
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4173
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4174
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4175
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4176
- else:
4177
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4178
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4179
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4180
-
4181
-
4182
- def doCreateTrainingTask(args, parsed_globals):
4183
- g_param = parse_global_arg(parsed_globals)
4184
-
4185
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4186
- cred = credential.CVMRoleCredential()
4187
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4188
- cred = credential.STSAssumeRoleCredential(
4189
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4190
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4191
- )
4192
- 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):
4193
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4194
- else:
4195
- cred = credential.Credential(
4196
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4197
- )
4198
- http_profile = HttpProfile(
4199
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4200
- reqMethod="POST",
4201
- endpoint=g_param[OptionsDefine.Endpoint],
4202
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4203
- )
4204
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4205
- if g_param[OptionsDefine.Language]:
4206
- profile.language = g_param[OptionsDefine.Language]
4207
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4208
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4209
- client._sdkVersion += ("_CLI_" + __version__)
4210
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4211
- model = models.CreateTrainingTaskRequest()
4212
- model.from_json_string(json.dumps(args))
4213
- start_time = time.time()
4214
- while True:
4215
- rsp = client.CreateTrainingTask(model)
4216
- result = rsp.to_json_string()
4217
- try:
4218
- json_obj = json.loads(result)
4219
- except TypeError as e:
4220
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4221
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4222
- break
4223
- cur_time = time.time()
4224
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4225
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4226
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4227
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4228
- else:
4229
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4230
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4231
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4232
-
4233
-
4234
- def doStartNotebookInstance(args, parsed_globals):
4235
- g_param = parse_global_arg(parsed_globals)
4236
-
4237
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4238
- cred = credential.CVMRoleCredential()
4239
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4240
- cred = credential.STSAssumeRoleCredential(
4241
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4242
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4243
- )
4244
- 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):
4245
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4246
- else:
4247
- cred = credential.Credential(
4248
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4249
- )
4250
- http_profile = HttpProfile(
4251
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4252
- reqMethod="POST",
4253
- endpoint=g_param[OptionsDefine.Endpoint],
4254
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4255
- )
4256
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4257
- if g_param[OptionsDefine.Language]:
4258
- profile.language = g_param[OptionsDefine.Language]
4259
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4260
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4261
- client._sdkVersion += ("_CLI_" + __version__)
4262
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4263
- model = models.StartNotebookInstanceRequest()
4264
- model.from_json_string(json.dumps(args))
4265
- start_time = time.time()
4266
- while True:
4267
- rsp = client.StartNotebookInstance(model)
4268
- result = rsp.to_json_string()
4269
- try:
4270
- json_obj = json.loads(result)
4271
- except TypeError as e:
4272
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4273
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4274
- break
4275
- cur_time = time.time()
4276
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4277
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4278
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4279
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4280
- else:
4281
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4282
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4283
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4284
-
4285
-
4286
- def doDescribeTrainingTaskPods(args, parsed_globals):
4287
- g_param = parse_global_arg(parsed_globals)
4288
-
4289
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4290
- cred = credential.CVMRoleCredential()
4291
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4292
- cred = credential.STSAssumeRoleCredential(
4293
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4294
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4295
- )
4296
- 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):
4297
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4298
- else:
4299
- cred = credential.Credential(
4300
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4301
- )
4302
- http_profile = HttpProfile(
4303
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4304
- reqMethod="POST",
4305
- endpoint=g_param[OptionsDefine.Endpoint],
4306
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4307
- )
4308
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4309
- if g_param[OptionsDefine.Language]:
4310
- profile.language = g_param[OptionsDefine.Language]
4311
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4312
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4313
- client._sdkVersion += ("_CLI_" + __version__)
4314
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4315
- model = models.DescribeTrainingTaskPodsRequest()
4316
- model.from_json_string(json.dumps(args))
4317
- start_time = time.time()
4318
- while True:
4319
- rsp = client.DescribeTrainingTaskPods(model)
4320
- result = rsp.to_json_string()
4321
- try:
4322
- json_obj = json.loads(result)
4323
- except TypeError as e:
4324
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4325
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4326
- break
4327
- cur_time = time.time()
4328
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4329
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4330
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4331
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4332
- else:
4333
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4334
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4335
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4336
-
4337
-
4338
- def doDescribeModelServiceHotUpdated(args, parsed_globals):
4339
- g_param = parse_global_arg(parsed_globals)
4340
-
4341
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4342
- cred = credential.CVMRoleCredential()
4343
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4344
- cred = credential.STSAssumeRoleCredential(
4345
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4346
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4347
- )
4348
- 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):
4349
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4350
- else:
4351
- cred = credential.Credential(
4352
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4353
- )
4354
- http_profile = HttpProfile(
4355
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4356
- reqMethod="POST",
4357
- endpoint=g_param[OptionsDefine.Endpoint],
4358
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4359
- )
4360
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4361
- if g_param[OptionsDefine.Language]:
4362
- profile.language = g_param[OptionsDefine.Language]
4363
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4364
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4365
- client._sdkVersion += ("_CLI_" + __version__)
4366
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4367
- model = models.DescribeModelServiceHotUpdatedRequest()
4368
- model.from_json_string(json.dumps(args))
4369
- start_time = time.time()
4370
- while True:
4371
- rsp = client.DescribeModelServiceHotUpdated(model)
4372
- result = rsp.to_json_string()
4373
- try:
4374
- json_obj = json.loads(result)
4375
- except TypeError as e:
4376
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4377
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4378
- break
4379
- cur_time = time.time()
4380
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4381
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4382
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4383
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4384
- else:
4385
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4386
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4387
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4388
-
4389
-
4390
- def doModifyServiceGroupWeights(args, parsed_globals):
4391
- g_param = parse_global_arg(parsed_globals)
4392
-
4393
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4394
- cred = credential.CVMRoleCredential()
4395
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4396
- cred = credential.STSAssumeRoleCredential(
4397
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4398
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4399
- )
4400
- 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):
4401
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4402
- else:
4403
- cred = credential.Credential(
4404
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4405
- )
4406
- http_profile = HttpProfile(
4407
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4408
- reqMethod="POST",
4409
- endpoint=g_param[OptionsDefine.Endpoint],
4410
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4411
- )
4412
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4413
- if g_param[OptionsDefine.Language]:
4414
- profile.language = g_param[OptionsDefine.Language]
4415
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4416
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4417
- client._sdkVersion += ("_CLI_" + __version__)
4418
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4419
- model = models.ModifyServiceGroupWeightsRequest()
4420
- model.from_json_string(json.dumps(args))
4421
- start_time = time.time()
4422
- while True:
4423
- rsp = client.ModifyServiceGroupWeights(model)
4424
- result = rsp.to_json_string()
4425
- try:
4426
- json_obj = json.loads(result)
4427
- except TypeError as e:
4428
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4429
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4430
- break
4431
- cur_time = time.time()
4432
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4433
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4434
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4435
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4436
- else:
4437
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4438
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4439
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4440
-
4441
-
4442
- def doDescribeModelAccEngineVersions(args, parsed_globals):
4443
- g_param = parse_global_arg(parsed_globals)
4444
-
4445
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4446
- cred = credential.CVMRoleCredential()
4447
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4448
- cred = credential.STSAssumeRoleCredential(
4449
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4450
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4451
- )
4452
- 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):
4453
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4454
- else:
4455
- cred = credential.Credential(
4456
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4457
- )
4458
- http_profile = HttpProfile(
4459
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4460
- reqMethod="POST",
4461
- endpoint=g_param[OptionsDefine.Endpoint],
4462
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4463
- )
4464
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4465
- if g_param[OptionsDefine.Language]:
4466
- profile.language = g_param[OptionsDefine.Language]
4467
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4468
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4469
- client._sdkVersion += ("_CLI_" + __version__)
4470
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4471
- model = models.DescribeModelAccEngineVersionsRequest()
4472
- model.from_json_string(json.dumps(args))
4473
- start_time = time.time()
4474
- while True:
4475
- rsp = client.DescribeModelAccEngineVersions(model)
4476
- result = rsp.to_json_string()
4477
- try:
4478
- json_obj = json.loads(result)
4479
- except TypeError as e:
4480
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4481
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4482
- break
4483
- cur_time = time.time()
4484
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4485
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4486
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4487
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4488
- else:
4489
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4490
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4491
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4492
-
4493
-
4494
- def doDescribeNotebookLifecycleScript(args, parsed_globals):
4495
- g_param = parse_global_arg(parsed_globals)
4496
-
4497
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4498
- cred = credential.CVMRoleCredential()
4499
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4500
- cred = credential.STSAssumeRoleCredential(
4501
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4502
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4503
- )
4504
- 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):
4505
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4506
- else:
4507
- cred = credential.Credential(
4508
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4509
- )
4510
- http_profile = HttpProfile(
4511
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4512
- reqMethod="POST",
4513
- endpoint=g_param[OptionsDefine.Endpoint],
4514
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4515
- )
4516
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4517
- if g_param[OptionsDefine.Language]:
4518
- profile.language = g_param[OptionsDefine.Language]
4519
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4520
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4521
- client._sdkVersion += ("_CLI_" + __version__)
4522
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4523
- model = models.DescribeNotebookLifecycleScriptRequest()
4524
- model.from_json_string(json.dumps(args))
4525
- start_time = time.time()
4526
- while True:
4527
- rsp = client.DescribeNotebookLifecycleScript(model)
4528
- result = rsp.to_json_string()
4529
- try:
4530
- json_obj = json.loads(result)
4531
- except TypeError as e:
4532
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4533
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4534
- break
4535
- cur_time = time.time()
4536
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4537
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4538
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4539
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4540
- else:
4541
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4542
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4543
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4544
-
4545
-
4546
- def doCreateNotebookImage(args, parsed_globals):
4547
- g_param = parse_global_arg(parsed_globals)
4548
-
4549
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4550
- cred = credential.CVMRoleCredential()
4551
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4552
- cred = credential.STSAssumeRoleCredential(
4553
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4554
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4555
- )
4556
- 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):
4557
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4558
- else:
4559
- cred = credential.Credential(
4560
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4561
- )
4562
- http_profile = HttpProfile(
4563
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4564
- reqMethod="POST",
4565
- endpoint=g_param[OptionsDefine.Endpoint],
4566
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4567
- )
4568
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4569
- if g_param[OptionsDefine.Language]:
4570
- profile.language = g_param[OptionsDefine.Language]
4571
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4572
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4573
- client._sdkVersion += ("_CLI_" + __version__)
4574
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4575
- model = models.CreateNotebookImageRequest()
4576
- model.from_json_string(json.dumps(args))
4577
- start_time = time.time()
4578
- while True:
4579
- rsp = client.CreateNotebookImage(model)
4580
- result = rsp.to_json_string()
4581
- try:
4582
- json_obj = json.loads(result)
4583
- except TypeError as e:
4584
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4585
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4586
- break
4587
- cur_time = time.time()
4588
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4589
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4590
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4591
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4592
- else:
4593
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4594
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4595
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4596
-
4597
-
4598
- def doDescribeTrainingJob(args, parsed_globals):
4599
- g_param = parse_global_arg(parsed_globals)
4600
-
4601
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4602
- cred = credential.CVMRoleCredential()
4603
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4604
- cred = credential.STSAssumeRoleCredential(
4605
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4606
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4607
- )
4608
- 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):
4609
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4610
- else:
4611
- cred = credential.Credential(
4612
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4613
- )
4614
- http_profile = HttpProfile(
4615
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4616
- reqMethod="POST",
4617
- endpoint=g_param[OptionsDefine.Endpoint],
4618
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4619
- )
4620
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4621
- if g_param[OptionsDefine.Language]:
4622
- profile.language = g_param[OptionsDefine.Language]
4623
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4624
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4625
- client._sdkVersion += ("_CLI_" + __version__)
4626
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4627
- model = models.DescribeTrainingJobRequest()
4628
- model.from_json_string(json.dumps(args))
4629
- start_time = time.time()
4630
- while True:
4631
- rsp = client.DescribeTrainingJob(model)
4632
- result = rsp.to_json_string()
4633
- try:
4634
- json_obj = json.loads(result)
4635
- except TypeError as e:
4636
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4637
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4638
- break
4639
- cur_time = time.time()
4640
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4641
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4642
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4643
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4644
- else:
4645
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4646
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4647
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4648
-
4649
-
4650
- def doDeleteModelService(args, parsed_globals):
4651
- g_param = parse_global_arg(parsed_globals)
4652
-
4653
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4654
- cred = credential.CVMRoleCredential()
4655
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4656
- cred = credential.STSAssumeRoleCredential(
4657
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4658
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4659
- )
4660
- 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):
4661
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4662
- else:
4663
- cred = credential.Credential(
4664
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4665
- )
4666
- http_profile = HttpProfile(
4667
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4668
- reqMethod="POST",
4669
- endpoint=g_param[OptionsDefine.Endpoint],
4670
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4671
- )
4672
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4673
- if g_param[OptionsDefine.Language]:
4674
- profile.language = g_param[OptionsDefine.Language]
4675
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4676
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4677
- client._sdkVersion += ("_CLI_" + __version__)
4678
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4679
- model = models.DeleteModelServiceRequest()
4680
- model.from_json_string(json.dumps(args))
4681
- start_time = time.time()
4682
- while True:
4683
- rsp = client.DeleteModelService(model)
4684
- result = rsp.to_json_string()
4685
- try:
4686
- json_obj = json.loads(result)
4687
- except TypeError as e:
4688
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4689
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4690
- break
4691
- cur_time = time.time()
4692
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4693
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4694
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4695
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4696
- else:
4697
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4698
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4699
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4700
-
4701
-
4702
- def doDescribeDatasetDetailStructured(args, parsed_globals):
4703
- g_param = parse_global_arg(parsed_globals)
4704
-
4705
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4706
- cred = credential.CVMRoleCredential()
4707
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4708
- cred = credential.STSAssumeRoleCredential(
4709
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4710
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4711
- )
4712
- 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):
4713
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4714
- else:
4715
- cred = credential.Credential(
4716
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4717
- )
4718
- http_profile = HttpProfile(
4719
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4720
- reqMethod="POST",
4721
- endpoint=g_param[OptionsDefine.Endpoint],
4722
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4723
- )
4724
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4725
- if g_param[OptionsDefine.Language]:
4726
- profile.language = g_param[OptionsDefine.Language]
4727
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4728
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4729
- client._sdkVersion += ("_CLI_" + __version__)
4730
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4731
- model = models.DescribeDatasetDetailStructuredRequest()
4732
- model.from_json_string(json.dumps(args))
4733
- start_time = time.time()
4734
- while True:
4735
- rsp = client.DescribeDatasetDetailStructured(model)
4736
- result = rsp.to_json_string()
4737
- try:
4738
- json_obj = json.loads(result)
4739
- except TypeError as e:
4740
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4741
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4742
- break
4743
- cur_time = time.time()
4744
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4745
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4746
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4747
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4748
- else:
4749
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4750
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4751
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4752
-
4753
-
4754
- def doDeleteTrainingTask(args, parsed_globals):
4755
- g_param = parse_global_arg(parsed_globals)
4756
-
4757
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4758
- cred = credential.CVMRoleCredential()
4759
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4760
- cred = credential.STSAssumeRoleCredential(
4761
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4762
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4763
- )
4764
- 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):
4765
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4766
- else:
4767
- cred = credential.Credential(
4768
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4769
- )
4770
- http_profile = HttpProfile(
4771
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4772
- reqMethod="POST",
4773
- endpoint=g_param[OptionsDefine.Endpoint],
4774
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4775
- )
4776
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4777
- if g_param[OptionsDefine.Language]:
4778
- profile.language = g_param[OptionsDefine.Language]
4779
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4780
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4781
- client._sdkVersion += ("_CLI_" + __version__)
4782
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4783
- model = models.DeleteTrainingTaskRequest()
4784
- model.from_json_string(json.dumps(args))
4785
- start_time = time.time()
4786
- while True:
4787
- rsp = client.DeleteTrainingTask(model)
4788
- result = rsp.to_json_string()
4789
- try:
4790
- json_obj = json.loads(result)
4791
- except TypeError as e:
4792
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4793
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4794
- break
4795
- cur_time = time.time()
4796
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4797
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4798
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4799
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4800
- else:
4801
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4802
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4803
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4804
-
4805
-
4806
- def doDescribeNotebookImageRecords(args, parsed_globals):
4807
- g_param = parse_global_arg(parsed_globals)
4808
-
4809
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4810
- cred = credential.CVMRoleCredential()
4811
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4812
- cred = credential.STSAssumeRoleCredential(
4813
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4814
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4815
- )
4816
- 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):
4817
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4818
- else:
4819
- cred = credential.Credential(
4820
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4821
- )
4822
- http_profile = HttpProfile(
4823
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4824
- reqMethod="POST",
4825
- endpoint=g_param[OptionsDefine.Endpoint],
4826
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4827
- )
4828
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4829
- if g_param[OptionsDefine.Language]:
4830
- profile.language = g_param[OptionsDefine.Language]
4831
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4832
- client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4833
- client._sdkVersion += ("_CLI_" + __version__)
4834
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
4835
- model = models.DescribeNotebookImageRecordsRequest()
4836
- model.from_json_string(json.dumps(args))
4837
- start_time = time.time()
4838
- while True:
4839
- rsp = client.DescribeNotebookImageRecords(model)
4840
- result = rsp.to_json_string()
4841
- try:
4842
- json_obj = json.loads(result)
4843
- except TypeError as e:
4844
- json_obj = json.loads(result.decode('utf-8')) # python3.3
4845
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4846
- break
4847
- cur_time = time.time()
4848
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4849
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4850
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4851
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4852
- else:
4853
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4854
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4855
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4856
-
4857
-
4858
- def doCreateBatchModelAccTasks(args, parsed_globals):
2882
+ def doCreateTrainingJob(args, parsed_globals):
4859
2883
  g_param = parse_global_arg(parsed_globals)
4860
2884
 
4861
2885
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -4884,11 +2908,11 @@ def doCreateBatchModelAccTasks(args, parsed_globals):
4884
2908
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4885
2909
  client._sdkVersion += ("_CLI_" + __version__)
4886
2910
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
4887
- model = models.CreateBatchModelAccTasksRequest()
2911
+ model = models.CreateTrainingJobRequest()
4888
2912
  model.from_json_string(json.dumps(args))
4889
2913
  start_time = time.time()
4890
2914
  while True:
4891
- rsp = client.CreateBatchModelAccTasks(model)
2915
+ rsp = client.CreateTrainingJob(model)
4892
2916
  result = rsp.to_json_string()
4893
2917
  try:
4894
2918
  json_obj = json.loads(result)
@@ -4907,7 +2931,7 @@ def doCreateBatchModelAccTasks(args, parsed_globals):
4907
2931
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4908
2932
 
4909
2933
 
4910
- def doDescribeBatchTask(args, parsed_globals):
2934
+ def doDescribeCodeRepositories(args, parsed_globals):
4911
2935
  g_param = parse_global_arg(parsed_globals)
4912
2936
 
4913
2937
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -4936,11 +2960,11 @@ def doDescribeBatchTask(args, parsed_globals):
4936
2960
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4937
2961
  client._sdkVersion += ("_CLI_" + __version__)
4938
2962
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
4939
- model = models.DescribeBatchTaskRequest()
2963
+ model = models.DescribeCodeRepositoriesRequest()
4940
2964
  model.from_json_string(json.dumps(args))
4941
2965
  start_time = time.time()
4942
2966
  while True:
4943
- rsp = client.DescribeBatchTask(model)
2967
+ rsp = client.DescribeCodeRepositories(model)
4944
2968
  result = rsp.to_json_string()
4945
2969
  try:
4946
2970
  json_obj = json.loads(result)
@@ -4959,7 +2983,7 @@ def doDescribeBatchTask(args, parsed_globals):
4959
2983
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4960
2984
 
4961
2985
 
4962
- def doDescribeBillingResourceGroup(args, parsed_globals):
2986
+ def doUpdateCodeRepository(args, parsed_globals):
4963
2987
  g_param = parse_global_arg(parsed_globals)
4964
2988
 
4965
2989
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -4988,11 +3012,11 @@ def doDescribeBillingResourceGroup(args, parsed_globals):
4988
3012
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
4989
3013
  client._sdkVersion += ("_CLI_" + __version__)
4990
3014
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
4991
- model = models.DescribeBillingResourceGroupRequest()
3015
+ model = models.UpdateCodeRepositoryRequest()
4992
3016
  model.from_json_string(json.dumps(args))
4993
3017
  start_time = time.time()
4994
3018
  while True:
4995
- rsp = client.DescribeBillingResourceGroup(model)
3019
+ rsp = client.UpdateCodeRepository(model)
4996
3020
  result = rsp.to_json_string()
4997
3021
  try:
4998
3022
  json_obj = json.loads(result)
@@ -5011,7 +3035,7 @@ def doDescribeBillingResourceGroup(args, parsed_globals):
5011
3035
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
5012
3036
 
5013
3037
 
5014
- def doDeleteTrainingModelVersion(args, parsed_globals):
3038
+ def doDescribeCodeRepository(args, parsed_globals):
5015
3039
  g_param = parse_global_arg(parsed_globals)
5016
3040
 
5017
3041
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -5040,11 +3064,11 @@ def doDeleteTrainingModelVersion(args, parsed_globals):
5040
3064
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
5041
3065
  client._sdkVersion += ("_CLI_" + __version__)
5042
3066
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
5043
- model = models.DeleteTrainingModelVersionRequest()
3067
+ model = models.DescribeCodeRepositoryRequest()
5044
3068
  model.from_json_string(json.dumps(args))
5045
3069
  start_time = time.time()
5046
3070
  while True:
5047
- rsp = client.DeleteTrainingModelVersion(model)
3071
+ rsp = client.DescribeCodeRepository(model)
5048
3072
  result = rsp.to_json_string()
5049
3073
  try:
5050
3074
  json_obj = json.loads(result)
@@ -5063,7 +3087,7 @@ def doDeleteTrainingModelVersion(args, parsed_globals):
5063
3087
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
5064
3088
 
5065
3089
 
5066
- def doDescribeInferTemplates(args, parsed_globals):
3090
+ def doStopNotebook(args, parsed_globals):
5067
3091
  g_param = parse_global_arg(parsed_globals)
5068
3092
 
5069
3093
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -5092,11 +3116,11 @@ def doDescribeInferTemplates(args, parsed_globals):
5092
3116
  client = mod.TioneClient(cred, g_param[OptionsDefine.Region], profile)
5093
3117
  client._sdkVersion += ("_CLI_" + __version__)
5094
3118
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
5095
- model = models.DescribeInferTemplatesRequest()
3119
+ model = models.StopNotebookRequest()
5096
3120
  model.from_json_string(json.dumps(args))
5097
3121
  start_time = time.time()
5098
3122
  while True:
5099
- rsp = client.DescribeInferTemplates(model)
3123
+ rsp = client.StopNotebook(model)
5100
3124
  result = rsp.to_json_string()
5101
3125
  try:
5102
3126
  json_obj = json.loads(result)
@@ -5130,102 +3154,64 @@ MODELS_MAP = {
5130
3154
  ACTION_MAP = {
5131
3155
  "DescribeTrainingModelVersion": doDescribeTrainingModelVersion,
5132
3156
  "DescribeModelService": doDescribeModelService,
5133
- "DescribeBillingSpecs": doDescribeBillingSpecs,
5134
- "DescribeModelServiceGroup": doDescribeModelServiceGroup,
5135
- "DescribeNotebooks": doDescribeNotebooks,
5136
- "DescribeDatasetDetailUnstructured": doDescribeDatasetDetailUnstructured,
5137
- "DeleteNotebook": doDeleteNotebook,
5138
- "DescribeCodeRepository": doDescribeCodeRepository,
5139
- "DescribeModelAccelerateVersions": doDescribeModelAccelerateVersions,
5140
- "DeleteModelServiceGroup": doDeleteModelServiceGroup,
5141
- "DescribeBatchTasks": doDescribeBatchTasks,
5142
- "CreateCodeRepository": doCreateCodeRepository,
5143
- "CreatePresignedNotebookUrl": doCreatePresignedNotebookUrl,
5144
- "CreateNotebookInstance": doCreateNotebookInstance,
5145
- "CreateNotebookLifecycleScript": doCreateNotebookLifecycleScript,
5146
- "StopModelAccelerateTask": doStopModelAccelerateTask,
5147
- "DescribeModelServices": doDescribeModelServices,
5148
- "DeleteNotebookLifecycleScript": doDeleteNotebookLifecycleScript,
5149
- "DescribeNotebookImageKernels": doDescribeNotebookImageKernels,
5150
- "DescribeNotebook": doDescribeNotebook,
5151
- "UpdateCodeRepository": doUpdateCodeRepository,
5152
- "DescribeNotebookInstances": doDescribeNotebookInstances,
3157
+ "DeleteDataset": doDeleteDataset,
3158
+ "DescribeModelServiceCallInfo": doDescribeModelServiceCallInfo,
3159
+ "UpdateNotebookInstance": doUpdateNotebookInstance,
3160
+ "DescribeTrainingTasks": doDescribeTrainingTasks,
3161
+ "DescribeBuildInImages": doDescribeBuildInImages,
3162
+ "DescribeNotebookLifecycleScripts": doDescribeNotebookLifecycleScripts,
5153
3163
  "StopTrainingJob": doStopTrainingJob,
3164
+ "StartNotebook": doStartNotebook,
5154
3165
  "CreateTrainingModel": doCreateTrainingModel,
5155
- "DescribeBillingSpecsPrice": doDescribeBillingSpecsPrice,
5156
- "CreateOptimizedModel": doCreateOptimizedModel,
5157
- "DescribeNotebookLifecycleScripts": doDescribeNotebookLifecycleScripts,
5158
- "StopBatchTask": doStopBatchTask,
3166
+ "StartNotebookInstance": doStartNotebookInstance,
3167
+ "DeleteNotebook": doDeleteNotebook,
3168
+ "DescribeTrainingTask": doDescribeTrainingTask,
3169
+ "DescribeTrainingTaskPods": doDescribeTrainingTaskPods,
3170
+ "DescribeModelServiceHotUpdated": doDescribeModelServiceHotUpdated,
5159
3171
  "DescribeModelAccelerateTask": doDescribeModelAccelerateTask,
5160
3172
  "ChatCompletion": doChatCompletion,
5161
- "ModifyNotebookTags": doModifyNotebookTags,
5162
- "DescribeBatchTaskInstances": doDescribeBatchTaskInstances,
3173
+ "DescribeModelAccelerateVersions": doDescribeModelAccelerateVersions,
3174
+ "CreateDataset": doCreateDataset,
5163
3175
  "CreateNotebook": doCreateNotebook,
5164
- "DeleteModelAccelerateTask": doDeleteModelAccelerateTask,
5165
- "DeleteNotebookInstance": doDeleteNotebookInstance,
5166
- "DescribeAPIConfigs": doDescribeAPIConfigs,
5167
- "DescribeModelAccelerateTasks": doDescribeModelAccelerateTasks,
5168
- "StopTrainingTask": doStopTrainingTask,
5169
- "DeleteNotebookImageRecord": doDeleteNotebookImageRecord,
5170
- "CreateBatchTask": doCreateBatchTask,
5171
- "DeleteCodeRepository": doDeleteCodeRepository,
5172
- "DescribeNotebookSummary": doDescribeNotebookSummary,
5173
- "DescribeNotebookInstance": doDescribeNotebookInstance,
5174
- "DescribeModelServiceHistory": doDescribeModelServiceHistory,
5175
- "CreateTrainingJob": doCreateTrainingJob,
5176
- "DescribeCodeRepositories": doDescribeCodeRepositories,
5177
- "StopNotebook": doStopNotebook,
5178
- "DeleteBatchTask": doDeleteBatchTask,
5179
- "DescribeModelServiceCallInfo": doDescribeModelServiceCallInfo,
5180
- "DescribeTrainingTasks": doDescribeTrainingTasks,
5181
- "DescribeEvents": doDescribeEvents,
5182
- "DescribeBuildInImages": doDescribeBuildInImages,
5183
- "StartNotebook": doStartNotebook,
5184
- "DescribeTrainingModels": doDescribeTrainingModels,
5185
- "DescribeTrainingMetrics": doDescribeTrainingMetrics,
5186
- "DeleteTrainingModel": doDeleteTrainingModel,
5187
- "StartTrainingTask": doStartTrainingTask,
3176
+ "DescribeModelServiceGroup": doDescribeModelServiceGroup,
5188
3177
  "CreatePresignedNotebookInstanceUrl": doCreatePresignedNotebookInstanceUrl,
5189
- "CreateDataset": doCreateDataset,
3178
+ "DeleteNotebookInstance": doDeleteNotebookInstance,
3179
+ "DeleteModelServiceGroup": doDeleteModelServiceGroup,
3180
+ "DescribeNotebookLifecycleScript": doDescribeNotebookLifecycleScript,
5190
3181
  "PushTrainingMetrics": doPushTrainingMetrics,
5191
3182
  "DescribeTrainingModelVersions": doDescribeTrainingModelVersions,
3183
+ "CreateNotebookLifecycleScript": doCreateNotebookLifecycleScript,
3184
+ "CreateCodeRepository": doCreateCodeRepository,
5192
3185
  "CreateModelService": doCreateModelService,
3186
+ "DescribeTrainingJob": doDescribeTrainingJob,
5193
3187
  "StopNotebookInstance": doStopNotebookInstance,
5194
- "DescribeLogs": doDescribeLogs,
3188
+ "CreatePresignedNotebookUrl": doCreatePresignedNotebookUrl,
3189
+ "DeleteModelService": doDeleteModelService,
5195
3190
  "DescribeDatasets": doDescribeDatasets,
5196
- "RestartModelAccelerateTask": doRestartModelAccelerateTask,
5197
3191
  "DescribeBillingResourceInstanceRunningJobs": doDescribeBillingResourceInstanceRunningJobs,
5198
3192
  "SendChatMessage": doSendChatMessage,
5199
3193
  "ModifyModelService": doModifyModelService,
5200
- "DescribeTrainingTask": doDescribeTrainingTask,
5201
- "StopCreatingImage": doStopCreatingImage,
3194
+ "DescribeNotebooks": doDescribeNotebooks,
3195
+ "DescribeNotebookInstances": doDescribeNotebookInstances,
3196
+ "DeleteTrainingModel": doDeleteTrainingModel,
3197
+ "StopModelAccelerateTask": doStopModelAccelerateTask,
3198
+ "CreateNotebookInstance": doCreateNotebookInstance,
3199
+ "DeleteCodeRepository": doDeleteCodeRepository,
3200
+ "DescribeNotebookSummary": doDescribeNotebookSummary,
5202
3201
  "DescribeTrainingJobs": doDescribeTrainingJobs,
5203
- "DescribeLatestTrainingMetrics": doDescribeLatestTrainingMetrics,
5204
- "ModifyNotebook": doModifyNotebook,
5205
- "DescribeBillingResourceGroups": doDescribeBillingResourceGroups,
5206
- "DescribeModelServiceGroups": doDescribeModelServiceGroups,
5207
- "ModifyModelServicePartialConfig": doModifyModelServicePartialConfig,
5208
- "UpdateNotebookInstance": doUpdateNotebookInstance,
5209
- "DescribeTrainingFrameworks": doDescribeTrainingFrameworks,
5210
- "DeleteDataset": doDeleteDataset,
5211
- "CreateTrainingTask": doCreateTrainingTask,
5212
- "StartNotebookInstance": doStartNotebookInstance,
5213
- "DescribeTrainingTaskPods": doDescribeTrainingTaskPods,
5214
- "DescribeModelServiceHotUpdated": doDescribeModelServiceHotUpdated,
5215
- "ModifyServiceGroupWeights": doModifyServiceGroupWeights,
5216
- "DescribeModelAccEngineVersions": doDescribeModelAccEngineVersions,
5217
- "DescribeNotebookLifecycleScript": doDescribeNotebookLifecycleScript,
5218
- "CreateNotebookImage": doCreateNotebookImage,
5219
- "DescribeTrainingJob": doDescribeTrainingJob,
5220
- "DeleteModelService": doDeleteModelService,
5221
- "DescribeDatasetDetailStructured": doDescribeDatasetDetailStructured,
5222
- "DeleteTrainingTask": doDeleteTrainingTask,
5223
- "DescribeNotebookImageRecords": doDescribeNotebookImageRecords,
5224
- "CreateBatchModelAccTasks": doCreateBatchModelAccTasks,
5225
- "DescribeBatchTask": doDescribeBatchTask,
3202
+ "DeleteNotebookLifecycleScript": doDeleteNotebookLifecycleScript,
5226
3203
  "DescribeBillingResourceGroup": doDescribeBillingResourceGroup,
3204
+ "DescribeNotebook": doDescribeNotebook,
3205
+ "DescribeNotebookInstance": doDescribeNotebookInstance,
5227
3206
  "DeleteTrainingModelVersion": doDeleteTrainingModelVersion,
3207
+ "DescribeBillingResourceGroups": doDescribeBillingResourceGroups,
5228
3208
  "DescribeInferTemplates": doDescribeInferTemplates,
3209
+ "DescribeModelServiceGroups": doDescribeModelServiceGroups,
3210
+ "CreateTrainingJob": doCreateTrainingJob,
3211
+ "DescribeCodeRepositories": doDescribeCodeRepositories,
3212
+ "UpdateCodeRepository": doUpdateCodeRepository,
3213
+ "DescribeCodeRepository": doDescribeCodeRepository,
3214
+ "StopNotebook": doStopNotebook,
5229
3215
 
5230
3216
  }
5231
3217