本文整理匯總了Golang中github.com/mistifyio/lochness/internal/cli.Client類的典型用法代碼示例。如果您正苦於以下問題:Golang Client類的具體用法?Golang Client怎麽用?Golang Client使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Client類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: getImages
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
}
示例2: deleteGuest
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
}
示例3: createGuest
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
}
示例4: getGuests
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
}
示例5: getHVs
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
}
示例6: guestAction
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
}
示例7: modifyGuest
func modifyGuest(c *cli.Client, id string, spec string) cli.JMap {
guest, _ := c.Patch("guest", "guests/"+id, spec)
return guest
}
示例8: getGuest
func getGuest(c *cli.Client, id string) cli.JMap {
guest, _ := c.Get("guest", "guests/"+id)
return guest
}
示例9: modifyConfig
func modifyConfig(c *cli.Client, id string, spec string) cli.JMap {
conf, _ := c.Patch("config", "hypervisors/"+id+"/config", spec)
return conf
}
示例10: getHV
func getHV(c *cli.Client, id string) cli.JMap {
hv, _ := c.Get("hypervisor", "hypervisors/"+id)
return hv
}
示例11: deleteSubnet
func deleteSubnet(c *cli.Client, hv, subnet string) cli.JMap {
sub, _ := c.Delete("subnet", "hypervisors/"+hv+"/subnets/"+subnet)
return sub
}
示例12: deleteHV
func deleteHV(c *cli.Client, id string) cli.JMap {
hv, _ := c.Delete("hypervisor", "hypervisors/"+id)
return hv
}
示例13: modifySubnets
func modifySubnets(c *cli.Client, id string, spec string) cli.JMap {
subnets, _ := c.Patch("subnets", "hypervisors/"+id+"/subnets", spec)
return subnets
}
示例14: createHV
func createHV(c *cli.Client, spec string) cli.JMap {
hv, _ := c.Post("hypervisor", "hypervisors", spec)
return hv
}
示例15: getJob
func getJob(c *cli.Client, id string) cli.JMap {
job, _ := c.Get("job", "jobs/"+id)
return job
}