Пример #1
0
func createGuest(c *cli.Client, spec string) cli.JMap {
	guest, resp := c.Post("guest", "guests", spec)
	j := cli.JMap{
		"id":    resp.Header.Get("x-guest-job-id"),
		"guest": guest,
	}
	return j
}
Пример #2
0
func guestAction(c *cli.Client, id, action string) cli.JMap {
	guest, resp := c.Post("guest", fmt.Sprintf("guests/%s/%s", id, action), "")
	j := cli.JMap{
		"id":    resp.Header.Get("x-guest-job-id"),
		"guest": guest,
	}

	return j
}
Пример #3
0
func createHV(c *cli.Client, spec string) cli.JMap {
	hv, _ := c.Post("hypervisor", "hypervisors", spec)
	return hv
}