Exemplo n.º 1
0
func main() {
	Login := os.Getenv("CLOUDATCOST_API_LOGIN")
	Key := os.Getenv("CLOUDATCOST_API_KEY")
	client, _ := cloudatcost.NewClient(&cloudatcost.Option{Login: Login, Key: Key})

	listservers, hr, err := client.ListTemplatesService.ListTemplates()

	if err != nil {
		fmt.Printf("error: %v\n\n", err)
		return
	}

	if hr.StatusCode != 200 {
		fmt.Printf("http response error: %+v %+v \n\n", hr, err)
		return
	}

	fmt.Printf("%v,%v\n", listservers, err)

}
Exemplo n.º 2
0
func main() {
	Login := os.Getenv("CLOUDATCOST_API_LOGIN")
	Key := os.Getenv("CLOUDATCOST_API_KEY")
	client, _ := cloudatcost.NewClient(&cloudatcost.Option{Login: Login, Key: Key})

	pos, hr, err := client.PowerOperationsService.PowerOn("")

	if err != nil {
		fmt.Printf("error: %v\n\n", err)
		return
	}

	if hr.StatusCode != 200 {
		fmt.Printf("http response error: %+v %+v \n\n", hr, err)
		return
	}

	fmt.Printf("%v,%v\n", pos, err)

}