@@ -199,6 +199,7 @@ func InspectIdentifiers(api *ScalewayAPI, ci chan ScalewayResolvedIdentifier, cj
199199 close (cj )
200200}
201201
202+ // CreateServer creates a server using API based on typical server fields
202203func CreateServer (api * ScalewayAPI , imageName string , name string , bootscript string , env string , additionalVolumes string ) (string , error ) {
203204 if name == "" {
204205 name = strings .Replace (namesgenerator .GetRandomName (0 ), "_" , "-" , - 1 )
@@ -295,6 +296,7 @@ func (a ByCreationDate) Len() int { return len(a) }
295296func (a ByCreationDate ) Swap (i , j int ) { a [i ], a [j ] = a [j ], a [i ] }
296297func (a ByCreationDate ) Less (i , j int ) bool { return a [j ].CreationDate .Before (a [i ].CreationDate ) }
297298
299+ // StartServer start a server based on its needle, can optionaly block while server is booting
298300func StartServer (api * ScalewayAPI , needle string , wait bool ) error {
299301 server := api .GetServerID (needle )
300302
@@ -314,6 +316,7 @@ func StartServer(api *ScalewayAPI, needle string, wait bool) error {
314316 return nil
315317}
316318
319+ // StartServerOnce wraps StartServer for golang channel
317320func StartServerOnce (api * ScalewayAPI , needle string , wait bool , successChan chan bool , errChan chan error ) {
318321 err := StartServer (api , needle , wait )
319322
0 commit comments