blob: 5ead18beb4d53013c3e49c440224f6a77a91ef70 [file] [log] [blame]
Samuel A. Falvo II2dd7d2f2014-06-30 16:18:08 -07001// +build acceptance,old
2
Samuel A. Falvo II0a6e45a2013-07-11 17:00:41 -07003package main
4
5import (
Samuel A. Falvo II0a6e45a2013-07-11 17:00:41 -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 II0a6e45a2013-07-11 17:00:41 -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 II0a6e45a2013-07-11 17:00:41 -070013
14func main() {
Samuel A. Falvo II0a6e45a2013-07-11 17:00:41 -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 images, err := servers.ListImages()
20 if err != nil {
21 panic(err)
22 }
Samuel A. Falvo II0a6e45a2013-07-11 17:00:41 -070023
Samuel A. Falvo II887d7802013-07-29 17:55:37 -070024 if !*quiet {
25 fmt.Println("ID,Name,MinRam,MinDisk")
26 for _, image := range images {
Samuel A. Falvo II9b23b342013-07-30 11:58:16 -070027 fmt.Printf("%s,\"%s\",%d,%d\n", image.Id, image.Name, image.MinRam, image.MinDisk)
Samuel A. Falvo II887d7802013-07-29 17:55:37 -070028 }
29 }
30 })
Samuel A. Falvo II0a6e45a2013-07-11 17:00:41 -070031 })
Samuel A. Falvo II0a6e45a2013-07-11 17:00:41 -070032}