当前位置: 首页>>代码示例>>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;未经允许,请勿转载。