Jamie Hannaford | 01e1492 | 2014-09-11 15:23:49 +0200 | [diff] [blame] | 1 | package networks |
| 2 | |
| 3 | import ( |
Jamie Hannaford | f14d456 | 2014-09-11 17:46:18 +0200 | [diff] [blame] | 4 | "strings" |
| 5 | |
Jamie Hannaford | 01e1492 | 2014-09-11 15:23:49 +0200 | [diff] [blame] | 6 | "github.com/rackspace/gophercloud" |
| 7 | ) |
| 8 | |
Jamie Hannaford | 12bc247 | 2014-09-15 12:14:31 +0200 | [diff] [blame] | 9 | const Version = "v2.0" |
| 10 | |
Jamie Hannaford | 01e1492 | 2014-09-11 15:23:49 +0200 | [diff] [blame] | 11 | func APIVersionsURL(c *gophercloud.ServiceClient) string { |
| 12 | return c.ServiceURL("") |
| 13 | } |
Jamie Hannaford | f14d456 | 2014-09-11 17:46:18 +0200 | [diff] [blame] | 14 | |
| 15 | func APIInfoURL(c *gophercloud.ServiceClient, version string) string { |
| 16 | return c.ServiceURL(strings.TrimRight(version, "/") + "/") |
| 17 | } |
Jamie Hannaford | 12bc247 | 2014-09-15 12:14:31 +0200 | [diff] [blame] | 18 | |
| 19 | func ExtensionURL(c *gophercloud.ServiceClient, name string) string { |
| 20 | return c.ServiceURL(Version, "extensions", name) |
| 21 | } |
Jamie Hannaford | d01a3c7 | 2014-09-15 12:51:00 +0200 | [diff] [blame^] | 22 | |
| 23 | func NetworkURL(c *gophercloud.ServiceClient, id string) string { |
| 24 | return c.ServiceURL(Version, "networks", id) |
| 25 | } |