blob: 65db7da6de83956ece49e2ef1bc7adb830bfe3eb [file] [log] [blame]
Samuel A. Falvo II2dd7d2f2014-06-30 16:18:08 -07001// +build acceptance,old
2
Samuel A. Falvo IIbc3f10f2013-07-11 17:13:24 -07003package main
4
5import (
Samuel A. Falvo IIbc3f10f2013-07-11 17:13:24 -07006 "flag"
Jon Perritt2be65d12013-12-13 17:21:09 -06007 "fmt"
Max Lincoln28b49562013-12-13 13:23:44 -03008 "github.com/rackspace/gophercloud"
Samuel A. Falvo IIbc3f10f2013-07-11 17:13:24 -07009)
10
11var quiet = flag.Bool("quiet", false, "Quiet mode for acceptance testing. $? non-zero on error though.")
Samuel A. Falvo IIe4a3e422013-09-13 12:36:37 -070012var rgn = flag.String("r", "", "Datacenter region to interrogate. Leave blank for provider-default region.")
Samuel A. Falvo IIbc3f10f2013-07-11 17:13:24 -070013
14func main() {
Samuel A. Falvo IIbc3f10f2013-07-11 17:13:24 -070015 flag.Parse()
16
Samuel A. Falvo II887d7802013-07-29 17:55:37 -070017 withIdentity(false, func(auth gophercloud.AccessProvider) {
18 withServerApi(auth, func(servers gophercloud.CloudServersProvider) {
19 flavors, err := servers.ListFlavors()
20 if err != nil {
21 panic(err)
22 }
Samuel A. Falvo IIbc3f10f2013-07-11 17:13:24 -070023
Samuel A. Falvo II887d7802013-07-29 17:55:37 -070024 if !*quiet {
25 fmt.Println("ID,Name,MinRam,MinDisk")
26 for _, f := range flavors {
27 fmt.Printf("%s,\"%s\",%d,%d\n", f.Id, f.Name, f.Ram, f.Disk)
28 }
29 }
30 })
Samuel A. Falvo IIbc3f10f2013-07-11 17:13:24 -070031 })
Samuel A. Falvo IIbc3f10f2013-07-11 17:13:24 -070032}