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 }
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 }
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 }
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 }
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 }
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 }
func modifyGuest(c *cli.Client, id string, spec string) cli.JMap { guest, _ := c.Patch("guest", "guests/"+id, spec) return guest }
func getGuest(c *cli.Client, id string) cli.JMap { guest, _ := c.Get("guest", "guests/"+id) return guest }
func modifyConfig(c *cli.Client, id string, spec string) cli.JMap { conf, _ := c.Patch("config", "hypervisors/"+id+"/config", spec) return conf }
func getHV(c *cli.Client, id string) cli.JMap { hv, _ := c.Get("hypervisor", "hypervisors/"+id) return hv }
func getGuests(c *cli.Client, id string) []string { hvs, _ := c.GetList("guests", "hypervisors/"+id+"/guests") return hvs }
func deleteSubnet(c *cli.Client, hv, subnet string) cli.JMap { sub, _ := c.Delete("subnet", "hypervisors/"+hv+"/subnets/"+subnet) return sub }
func deleteHV(c *cli.Client, id string) cli.JMap { hv, _ := c.Delete("hypervisor", "hypervisors/"+id) return hv }
func modifySubnets(c *cli.Client, id string, spec string) cli.JMap { subnets, _ := c.Patch("subnets", "hypervisors/"+id+"/subnets", spec) return subnets }
func createHV(c *cli.Client, spec string) cli.JMap { hv, _ := c.Post("hypervisor", "hypervisors", spec) return hv }
func getJob(c *cli.Client, id string) cli.JMap { job, _ := c.Get("job", "jobs/"+id) return job }
func modifyHV(c *cli.Client, id string, spec string) cli.JMap { hv, _ := c.Patch("hypervisor", "hypervisors/"+id, spec) return hv }