Esempio n. 1
0
func List(cmd *cli.Cmd) {
	cmd.Action = func() {
		l := pools.Location{}
		locations, resp, errs := l.List()

		if len(errs) > 0 {
			log.Fatalf("Could not retrieve locations: %s", errs[0])
		}

		if resp.StatusCode != 200 {
			log.Fatalf("Cloud not retrieve locations: %s", resp.Status)
		}

		PrintLocationBrief(*locations)
	}
}
Esempio n. 2
0
func List(cmd *cli.Cmd) {
	all := cmd.BoolOpt("a all", false, "List all locations, including archived")

	cmd.Action = func() {
		l := pools.Location{}
		locations, resp, errs := l.List()

		if len(errs) > 0 {
			log.Fatalf("Could not retrieve locations: %s", errs[0])
		}

		if resp.StatusCode != 200 {
			log.Fatalf("Cloud not retrieve locations: %s", resp.Status)
		}

		PrintLocationBrief(*locations, *all)
	}
}