gridscale-check/storages_list.go

36 lines
592 B
Go
Raw Normal View History

2018-04-24 23:55:15 +02:00
// Copyright 2018 Felix Kronlage <fkr@hazardous.org>
2018-04-22 00:07:06 +02:00
package main
import (
"fmt"
"g.hazardous.org/fkr/libretto/virtualmachine/gridscale"
2018-04-22 00:07:06 +02:00
)
2018-04-24 23:55:15 +02:00
type StorageListCommand struct {
2018-04-22 00:07:06 +02:00
}
2018-04-24 23:55:15 +02:00
var storageListCommand StorageListCommand
2018-04-22 00:07:06 +02:00
2018-04-24 23:55:15 +02:00
func (x *StorageListCommand) Execute(args []string) error {
2018-04-22 00:07:06 +02:00
storages, error := gridscale.GetStorages(Config.UserId, Config.Token)
if error != nil {
Unknown(fmt.Sprintf("Error while retrieving storages: %s", error))
}
for key, storage := range storages {
fmt.Printf("%s: %v\n\n", key, storage)
}
2018-04-24 23:55:15 +02:00
Ok((""))
// never reached
2018-04-22 00:07:06 +02:00
return nil
}
func init() {
}