@@ -97,11 +97,11 @@ func getScripts(pageSize int, search string, name string) []types.Script {
9797 return scripts .Results
9898}
9999
100- func createRun (versionID uuid.UUID , watch bool , machines * types.Bees , outputNodes []string , outputsDir string ) {
100+ func createRun (versionID uuid.UUID , watch bool , machines * types.Machines , outputNodes []string , outputsDir string ) {
101101 run := types.CreateRun {
102102 VersionID : versionID ,
103- HiveInfo : hive . ID ,
104- Bees : executionMachines ,
103+ Vault : fleet . Vault ,
104+ Machines : executionMachines ,
105105 }
106106
107107 data , err := json .Marshal (run )
@@ -110,7 +110,7 @@ func createRun(versionID uuid.UUID, watch bool, machines *types.Bees, outputNode
110110 os .Exit (0 )
111111 }
112112
113- resp := request .Trickest .Post ().Body (data ).DoF ("run /" )
113+ resp := request .Trickest .Post ().Body (data ).DoF ("execution /" )
114114 if resp == nil {
115115 fmt .Println ("Error: Couldn't create run!" )
116116 os .Exit (0 )
@@ -136,10 +136,10 @@ func createRun(versionID uuid.UUID, watch bool, machines *types.Bees, outputNode
136136 if watch {
137137 WatchRun (createRunResp .ID , outputsDir , nodesToDownload , nil , false , & executionMachines , showParams )
138138 } else {
139- availableBees := GetAvailableMachines ()
139+ availableMachines := GetAvailableMachines ()
140140 fmt .Println ("Run successfully created! ID: " + createRunResp .ID .String ())
141141 fmt .Print ("Machines:\n " + FormatMachines (* machines , false ))
142- fmt .Print ("\n Available:\n " + FormatMachines (availableBees , false ))
142+ fmt .Print ("\n Available:\n " + FormatMachines (availableMachines , false ))
143143 }
144144}
145145
@@ -355,7 +355,7 @@ func processInvalidInputStructure() {
355355 os .Exit (0 )
356356}
357357
358- func processMaxMachinesOverflow (maximumMachines types.Bees ) {
358+ func processMaxMachinesOverflow (maximumMachines types.Machines ) {
359359 fmt .Println ("Invalid number or machines!" )
360360 fmt .Println ("The maximum number of machines you can allocate for this workflow: " )
361361 fmt .Println (FormatMachines (maximumMachines , false ))
@@ -381,28 +381,28 @@ func processInvalidInputType(newPNode, existingPNode types.PrimitiveNode) {
381381 os .Exit (0 )
382382}
383383
384- func GetAvailableMachines () types.Bees {
385- hiveInfo := util .GetHiveInfo ()
386- availableBees := types.Bees {}
387- for _ , bee := range hiveInfo .Bees {
388- if bee .Name == "small" {
389- available := bee .Total - bee .Running
390- availableBees .Small = & available
384+ func GetAvailableMachines () types.Machines {
385+ hiveInfo := util .GetFleetInfo ()
386+ availableMachines := types.Machines {}
387+ for _ , machine := range hiveInfo .Machines {
388+ if machine .Name == "small" {
389+ available := machine .Total - machine .Running
390+ availableMachines .Small = & available
391391 }
392- if bee .Name == "medium" {
393- available := bee .Total - bee .Running
394- availableBees .Medium = & available
392+ if machine .Name == "medium" {
393+ available := machine .Total - machine .Running
394+ availableMachines .Medium = & available
395395 }
396- if bee .Name == "large" {
397- available := bee .Total - bee .Running
398- availableBees .Large = & available
396+ if machine .Name == "large" {
397+ available := machine .Total - machine .Running
398+ availableMachines .Large = & available
399399 }
400400 }
401- return availableBees
401+ return availableMachines
402402}
403403
404404func GetRunByID (id uuid.UUID ) * types.Run {
405- resp := request .Trickest .Get ().DoF ("run /%s/" , id )
405+ resp := request .Trickest .Get ().DoF ("execution /%s/" , id )
406406 if resp == nil {
407407 fmt .Println ("Error: Couldn't get run!" )
408408 os .Exit (0 )
@@ -427,7 +427,7 @@ func GetSubJobs(runID uuid.UUID) []types.SubJob {
427427 fmt .Println ("Couldn't list sub-jobs, no run ID parameter specified!" )
428428 os .Exit (0 )
429429 }
430- urlReq := "subjob/?run =" + runID .String ()
430+ urlReq := "subjob/?execution =" + runID .String ()
431431 urlReq = urlReq + "&page_size=" + strconv .Itoa (math .MaxInt )
432432
433433 resp := request .Trickest .Get ().DoF (urlReq )
@@ -451,7 +451,7 @@ func GetSubJobs(runID uuid.UUID) []types.SubJob {
451451}
452452
453453func stopRun (runID uuid.UUID ) {
454- resp := request .Trickest .Post ().DoF ("run /%s/stop/" , runID )
454+ resp := request .Trickest .Post ().DoF ("execution /%s/stop/" , runID )
455455 if resp == nil {
456456 fmt .Println ("Error: Couldn't stop run!" )
457457 os .Exit (0 )
@@ -462,7 +462,7 @@ func stopRun(runID uuid.UUID) {
462462 }
463463}
464464
465- func setMachinesToMinimum (machines * types.Bees ) {
465+ func setMachinesToMinimum (machines * types.Machines ) {
466466 if machines .Small != nil {
467467 * machines .Small = 1
468468 }
@@ -474,7 +474,7 @@ func setMachinesToMinimum(machines *types.Bees) {
474474 }
475475}
476476
477- func FormatMachines (machines types.Bees , inline bool ) string {
477+ func FormatMachines (machines types.Machines , inline bool ) string {
478478 var small , medium , large string
479479 if machines .Small != nil {
480480 small = "small: " + strconv .Itoa (* machines .Small )
@@ -580,7 +580,7 @@ func uploadFilesIfNeeded(primitiveNodes map[string]*types.PrimitiveNode) {
580580 }
581581}
582582
583- func maxMachinesTypeCompatible (machines , maxMachines types.Bees ) bool {
583+ func maxMachinesTypeCompatible (machines , maxMachines types.Machines ) bool {
584584 if (machines .Small != nil && maxMachines .Small == nil ) ||
585585 (machines .Medium != nil && maxMachines .Medium == nil ) ||
586586 (machines .Large != nil && maxMachines .Large == nil ) {
0 commit comments