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


Golang ServiceClient.Get方法代碼示例

本文整理匯總了Golang中github.com/jrperritt/rack/internal/github.com/rackspace/gophercloud.ServiceClient.Get方法的典型用法代碼示例。如果您正苦於以下問題:Golang ServiceClient.Get方法的具體用法?Golang ServiceClient.Get怎麽用?Golang ServiceClient.Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/jrperritt/rack/internal/github.com/rackspace/gophercloud.ServiceClient的用法示例。


在下文中一共展示了ServiceClient.Get方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Get

// Get requests details on a single server, by ID.
func Get(client *gophercloud.ServiceClient, id string) GetResult {
	var result GetResult
	_, result.Err = client.Get(getURL(client, id), &result.Body, &gophercloud.RequestOpts{
		OkCodes: []int{200, 203},
	})
	return result
}
開發者ID:stephamon,項目名稱:rack,代碼行數:8,代碼來源:requests.go

示例2: Get

// Get validates and retrieves information about another token.
func Get(c *gophercloud.ServiceClient, token string) GetResult {
	var result GetResult
	var response *http.Response
	response, result.Err = c.Get(tokenURL(c), &result.Body, &gophercloud.RequestOpts{
		MoreHeaders: subjectTokenHeaders(c, token),
		OkCodes:     []int{200, 203},
	})
	if result.Err != nil {
		return result
	}
	result.Header = response.Header
	return result
}
開發者ID:hdansou,項目名稱:rack,代碼行數:14,代碼來源:requests.go

示例3: Metadata

// Metadata requests all the metadata for the given server ID.
func Metadata(client *gophercloud.ServiceClient, id string) GetMetadataResult {
	var res GetMetadataResult
	_, res.Err = client.Get(metadataURL(client, id), &res.Body, nil)
	return res
}
開發者ID:stephamon,項目名稱:rack,代碼行數:6,代碼來源:requests.go

示例4: Get

// Get instructs OpenStack to provide details on a single flavor, identified by its ID.
// Use ExtractFlavor to convert its result into a Flavor.
func Get(client *gophercloud.ServiceClient, id string) GetResult {
	var res GetResult
	_, res.Err = client.Get(getURL(client, id), &res.Body, nil)
	return res
}
開發者ID:hdansou,項目名稱:rack,代碼行數:7,代碼來源:requests.go

示例5: Get

// Get retrieves a particular security group based on its unique ID.
func Get(c *gophercloud.ServiceClient, id string) GetResult {
	var res GetResult
	_, res.Err = c.Get(resourceURL(c, id), &res.Body, nil)
	return res
}
開發者ID:hdansou,項目名稱:rack,代碼行數:6,代碼來源:requests.go


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