本文整理匯總了Golang中github.com/gophercloud/gophercloud.ServiceClient.ServiceURL方法的典型用法代碼示例。如果您正苦於以下問題:Golang ServiceClient.ServiceURL方法的具體用法?Golang ServiceClient.ServiceURL怎麽用?Golang ServiceClient.ServiceURL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/gophercloud/gophercloud.ServiceClient
的用法示例。
在下文中一共展示了ServiceClient.ServiceURL方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Get
// Get performs request to given service and deserializes json response to struct.
// out should be pointer to resulting structure. Returns error if request or
// deserialization failed.
func Get(client *gophercloud.ServiceClient, request string, out interface{}) error {
url := client.ServiceURL(request)
var resp interface{}
_, err := client.Get(url, &resp, nil)
if err != nil {
return fmt.Errorf("request failed: (%v)", err)
}
err = mapstructure.Decode(resp, out)
if err != nil {
return fmt.Errorf("decoding failed: (%v)", err)
}
return nil
}
示例2: getURL
func getURL(c *gophercloud.ServiceClient, stackName, stackID, resourceName, eventID string) string {
return c.ServiceURL("stacks", stackName, stackID, "resources", resourceName, "events", eventID)
}
示例3: insertURL
func insertURL(c *gophercloud.ServiceClient, id string) string {
return c.ServiceURL(rootPath, resourcePath, id, insertPath)
}
示例4: resourceURL
func resourceURL(c *gophercloud.ServiceClient, id string) string {
return c.ServiceURL(secgrouppath, id)
}
示例5: resourceRuleURL
func resourceRuleURL(c *gophercloud.ServiceClient, id string) string {
return c.ServiceURL(rulepath, id)
}
示例6: listByServerURL
func listByServerURL(c *gophercloud.ServiceClient, serverID string) string {
return c.ServiceURL("servers", serverID, secgrouppath)
}
示例7: validateURL
func validateURL(c *gophercloud.ServiceClient) string {
return c.ServiceURL("validate")
}
示例8: deleteURL
func deleteURL(c *gophercloud.ServiceClient, id string) string {
return c.ServiceURL("share-networks", id)
}
示例9: createURL
func createURL(c *gophercloud.ServiceClient) string {
return c.ServiceURL("types")
}
示例10: getExtraSpecsURL
func getExtraSpecsURL(c *gophercloud.ServiceClient, id string) string {
return c.ServiceURL("types", id, "extra_specs")
}
示例11: getDefaultURL
func getDefaultURL(c *gophercloud.ServiceClient) string {
return c.ServiceURL("types", "default")
}
示例12: listAssignmentsURL
func listAssignmentsURL(client *gophercloud.ServiceClient) string {
return client.ServiceURL("role_assignments")
}
示例13: createURL
func createURL(c *gophercloud.ServiceClient, container string) string {
return c.ServiceURL(container)
}
示例14: listURL
func listURL(c *gophercloud.ServiceClient, stackName, stackID string) string {
return c.ServiceURL("stacks", stackName, stackID, "events")
}
示例15: findURL
func findURL(c *gophercloud.ServiceClient, stackName string) string {
return c.ServiceURL("stacks", stackName, "events")
}