Jamie Hannaford | 01e1492 | 2014-09-11 15:23:49 +0200 | [diff] [blame] | 1 | package networks |
| 2 | |
Jamie Hannaford | 1ce30f2 | 2014-09-16 11:23:34 +0200 | [diff] [blame] | 3 | import "github.com/rackspace/gophercloud" |
Jamie Hannaford | 01e1492 | 2014-09-11 15:23:49 +0200 | [diff] [blame] | 4 | |
Jamie Hannaford | 12bc247 | 2014-09-15 12:14:31 +0200 | [diff] [blame] | 5 | const Version = "v2.0" |
| 6 | |
Jamie Hannaford | 4721abc | 2014-09-16 16:29:04 +0200 | [diff] [blame^] | 7 | func ResourceURL(c *gophercloud.ServiceClient, id string) string { |
Jamie Hannaford | d01a3c7 | 2014-09-15 12:51:00 +0200 | [diff] [blame] | 8 | return c.ServiceURL(Version, "networks", id) |
| 9 | } |
Jamie Hannaford | d2d9f56 | 2014-09-15 15:35:07 +0200 | [diff] [blame] | 10 | |
Jamie Hannaford | 4721abc | 2014-09-16 16:29:04 +0200 | [diff] [blame^] | 11 | func RootURL(c *gophercloud.ServiceClient) string { |
Jamie Hannaford | d2d9f56 | 2014-09-15 15:35:07 +0200 | [diff] [blame] | 12 | return c.ServiceURL(Version, "networks") |
| 13 | } |
Jamie Hannaford | 4721abc | 2014-09-16 16:29:04 +0200 | [diff] [blame^] | 14 | |
| 15 | func GetURL(c *gophercloud.ServiceClient, id string) string { |
| 16 | return ResourceURL(c, id) |
| 17 | } |
| 18 | |
| 19 | func ListURL(c *gophercloud.ServiceClient) string { |
| 20 | return RootURL(c) |
| 21 | } |
| 22 | |
| 23 | func CreateURL(c *gophercloud.ServiceClient) string { |
| 24 | return RootURL(c) |
| 25 | } |
| 26 | |
| 27 | func DeleteURL(c *gophercloud.ServiceClient, id string) string { |
| 28 | return ResourceURL(c, id) |
| 29 | } |