You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gridscale-check/servers_list.go

36 lines
611 B
Go

// Copyright 2018 Felix Kronlage <fkr@hazardous.org>
package main
import (
"fmt"
"g.hazardous.org/fkr/libretto/virtualmachine/gridscale"
)
type ListServersCommand struct {
}
var listServersCommand ListServersCommand
func (x *ListServersCommand) Execute(args []string) error {
serversResponse, error := gridscale.GetServers(Config.UserId, Config.Token)
if error != nil {
Unknown(fmt.Sprintf("Error while retrieving storages: %s", error))
}
for key, server := range serversResponse.Servers {
fmt.Printf("%s: %v\n\n", key, server)
}
Ok((""))
// never reached
return nil
}
func init() {
}