package main

import (
	"fmt"
	"github.com/rackspace/gophercloud"
	"os"
)

func main() {
	provider := os.Getenv("SDK_PROVIDER")
	username := os.Getenv("SDK_USERNAME")
	password := os.Getenv("SDK_PASSWORD")

	if (provider == "") || (username == "") || (password == "") {
		fmt.Fprintf(os.Stderr, "One or more of the following environment variables aren't set:\n")
		fmt.Fprintf(os.Stderr, "	SDK_PROVIDER=\"%s\"\n", provider)
		fmt.Fprintf(os.Stderr, "	SDK_USERNAME=\"%s\"\n", username)
		fmt.Fprintf(os.Stderr, "	SDK_PASSWORD=\"%s\"\n", password)
		os.Exit(1)
	}

	acc, err := gophercloud.Authenticate(
		provider,
		gophercloud.AuthOptions{
			Username: username,
			Password: password,
		},
	)
	if err != nil {
		panic(err)
	}

	api, err := gophercloud.ServersApi(acc, gophercloud.ApiCriteria{
		Name:      "cloudServersOpenStack",
		Region:    "DFW",
		VersionId: "2",
		UrlChoice: gophercloud.PublicURL,
	})
	if err != nil {
		panic(err)
	}

	servers, err := api.ListServers()
	if err != nil {
		panic(err)
	}

	fmt.Println("Server ID")
	fmt.Println("----------------------------------------")
	for _, s := range servers {
		fmt.Printf("	%s\n", s.Id)
	}
}
