Example #1
0
func getImages(c *cli.Client) []cli.JMap {
	ret, _ := c.GetMany("images", "images")
	images := make([]cli.JMap, len(ret))
	for i := range ret {
		images[i] = ret[i]
	}
	return images
}
Example #2
0
func deleteGuest(c *cli.Client, id string) cli.JMap {
	guest, resp := c.Delete("guest", "guests/"+id)
	j := cli.JMap{
		"id":    resp.Header.Get("x-guest-job-id"),
		"guest": guest,
	}
	return j
}
Example #3
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
}
Example #4
0
func getGuests(c *cli.Client) []cli.JMap {
	ret, _ := c.GetMany("guests", "guests")
	guests := make([]cli.JMap, len(ret))
	for i := range ret {
		guests[i] = ret[i]
	}
	return guests
}
Example #5
0
func getHVs(c *cli.Client) []cli.JMap {
	ret, _ := c.GetMany("hypervisors", "hypervisors")
	// wasteful you say?
	hvs := make([]cli.JMap, len(ret))
	for i := range ret {
		hvs[i] = ret[i]
	}
	return hvs
}
Example #6
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
}
Example #7
0
func modifyGuest(c *cli.Client, id string, spec string) cli.JMap {
	guest, _ := c.Patch("guest", "guests/"+id, spec)
	return guest
}
Example #8
0
func getGuest(c *cli.Client, id string) cli.JMap {
	guest, _ := c.Get("guest", "guests/"+id)
	return guest
}
Example #9
0
func modifyConfig(c *cli.Client, id string, spec string) cli.JMap {
	conf, _ := c.Patch("config", "hypervisors/"+id+"/config", spec)
	return conf
}
Example #10
0
func getHV(c *cli.Client, id string) cli.JMap {
	hv, _ := c.Get("hypervisor", "hypervisors/"+id)
	return hv
}
Example #11
0
func getGuests(c *cli.Client, id string) []string {
	hvs, _ := c.GetList("guests", "hypervisors/"+id+"/guests")
	return hvs
}
Example #12
0
func deleteSubnet(c *cli.Client, hv, subnet string) cli.JMap {
	sub, _ := c.Delete("subnet", "hypervisors/"+hv+"/subnets/"+subnet)
	return sub
}
Example #13
0
func deleteHV(c *cli.Client, id string) cli.JMap {
	hv, _ := c.Delete("hypervisor", "hypervisors/"+id)
	return hv
}
Example #14
0
func modifySubnets(c *cli.Client, id string, spec string) cli.JMap {
	subnets, _ := c.Patch("subnets", "hypervisors/"+id+"/subnets", spec)
	return subnets
}
Example #15
0
func createHV(c *cli.Client, spec string) cli.JMap {
	hv, _ := c.Post("hypervisor", "hypervisors", spec)
	return hv
}
Example #16
0
func getJob(c *cli.Client, id string) cli.JMap {
	job, _ := c.Get("job", "jobs/"+id)
	return job
}
Example #17
0
func modifyHV(c *cli.Client, id string, spec string) cli.JMap {
	hv, _ := c.Patch("hypervisor", "hypervisors/"+id, spec)
	return hv
}