當前位置: 首頁>>代碼示例>>Golang>>正文


Golang cli.Client類代碼示例

本文整理匯總了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
}
開發者ID:joshie,項目名稱:lochness,代碼行數:8,代碼來源:main.go

示例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
}
開發者ID:joshie,項目名稱:lochness,代碼行數:8,代碼來源:main.go

示例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
}
開發者ID:joshie,項目名稱:lochness,代碼行數:8,代碼來源:main.go

示例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
}
開發者ID:joshie,項目名稱:lochness,代碼行數:8,代碼來源:main.go

示例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
}
開發者ID:joshie,項目名稱:lochness,代碼行數:9,代碼來源:main.go

示例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
}
開發者ID:joshie,項目名稱:lochness,代碼行數:9,代碼來源:main.go

示例7: modifyGuest

func modifyGuest(c *cli.Client, id string, spec string) cli.JMap {
	guest, _ := c.Patch("guest", "guests/"+id, spec)
	return guest
}
開發者ID:joshie,項目名稱:lochness,代碼行數:4,代碼來源:main.go

示例8: getGuest

func getGuest(c *cli.Client, id string) cli.JMap {
	guest, _ := c.Get("guest", "guests/"+id)
	return guest
}
開發者ID:joshie,項目名稱:lochness,代碼行數:4,代碼來源:main.go

示例9: modifyConfig

func modifyConfig(c *cli.Client, id string, spec string) cli.JMap {
	conf, _ := c.Patch("config", "hypervisors/"+id+"/config", spec)
	return conf
}
開發者ID:joshie,項目名稱:lochness,代碼行數:4,代碼來源:main.go

示例10: getHV

func getHV(c *cli.Client, id string) cli.JMap {
	hv, _ := c.Get("hypervisor", "hypervisors/"+id)
	return hv
}
開發者ID:joshie,項目名稱:lochness,代碼行數:4,代碼來源:main.go

示例11: deleteSubnet

func deleteSubnet(c *cli.Client, hv, subnet string) cli.JMap {
	sub, _ := c.Delete("subnet", "hypervisors/"+hv+"/subnets/"+subnet)
	return sub
}
開發者ID:joshie,項目名稱:lochness,代碼行數:4,代碼來源:main.go

示例12: deleteHV

func deleteHV(c *cli.Client, id string) cli.JMap {
	hv, _ := c.Delete("hypervisor", "hypervisors/"+id)
	return hv
}
開發者ID:joshie,項目名稱:lochness,代碼行數:4,代碼來源:main.go

示例13: modifySubnets

func modifySubnets(c *cli.Client, id string, spec string) cli.JMap {
	subnets, _ := c.Patch("subnets", "hypervisors/"+id+"/subnets", spec)
	return subnets
}
開發者ID:joshie,項目名稱:lochness,代碼行數:4,代碼來源:main.go

示例14: createHV

func createHV(c *cli.Client, spec string) cli.JMap {
	hv, _ := c.Post("hypervisor", "hypervisors", spec)
	return hv
}
開發者ID:joshie,項目名稱:lochness,代碼行數:4,代碼來源:main.go

示例15: getJob

func getJob(c *cli.Client, id string) cli.JMap {
	job, _ := c.Get("job", "jobs/"+id)
	return job
}
開發者ID:joshie,項目名稱:lochness,代碼行數:4,代碼來源:main.go


注:本文中的github.com/mistifyio/lochness/internal/cli.Client類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。