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 | 686c496 | 2014-09-23 10:46:20 +0200 | [diff] [blame] | 5 | func resourceURL(c *gophercloud.ServiceClient, id string) string { |
Ash Wilson | b4c8c6f | 2014-10-06 17:35:02 -0400 | [diff] [blame] | 6 | return c.ServiceURL("networks", id) |
Jamie Hannaford | d01a3c7 | 2014-09-15 12:51:00 +0200 | [diff] [blame] | 7 | } |
Jamie Hannaford | d2d9f56 | 2014-09-15 15:35:07 +0200 | [diff] [blame] | 8 | |
Jamie Hannaford | 686c496 | 2014-09-23 10:46:20 +0200 | [diff] [blame] | 9 | func rootURL(c *gophercloud.ServiceClient) string { |
Ash Wilson | b4c8c6f | 2014-10-06 17:35:02 -0400 | [diff] [blame] | 10 | return c.ServiceURL("networks") |
Jamie Hannaford | d2d9f56 | 2014-09-15 15:35:07 +0200 | [diff] [blame] | 11 | } |
Jamie Hannaford | 4721abc | 2014-09-16 16:29:04 +0200 | [diff] [blame] | 12 | |
Jamie Hannaford | 686c496 | 2014-09-23 10:46:20 +0200 | [diff] [blame] | 13 | func getURL(c *gophercloud.ServiceClient, id string) string { |
| 14 | return resourceURL(c, id) |
Jamie Hannaford | 4721abc | 2014-09-16 16:29:04 +0200 | [diff] [blame] | 15 | } |
| 16 | |
Jamie Hannaford | 686c496 | 2014-09-23 10:46:20 +0200 | [diff] [blame] | 17 | func listURL(c *gophercloud.ServiceClient) string { |
| 18 | return rootURL(c) |
Jamie Hannaford | 4721abc | 2014-09-16 16:29:04 +0200 | [diff] [blame] | 19 | } |
| 20 | |
Jamie Hannaford | 686c496 | 2014-09-23 10:46:20 +0200 | [diff] [blame] | 21 | func createURL(c *gophercloud.ServiceClient) string { |
| 22 | return rootURL(c) |
Jamie Hannaford | 4721abc | 2014-09-16 16:29:04 +0200 | [diff] [blame] | 23 | } |
| 24 | |
Jon Perritt | d72ac53 | 2014-10-31 13:58:41 -0500 | [diff] [blame] | 25 | func updateURL(c *gophercloud.ServiceClient, id string) string { |
| 26 | return resourceURL(c, id) |
| 27 | } |
| 28 | |
Jamie Hannaford | 686c496 | 2014-09-23 10:46:20 +0200 | [diff] [blame] | 29 | func deleteURL(c *gophercloud.ServiceClient, id string) string { |
| 30 | return resourceURL(c, id) |
Jamie Hannaford | 4721abc | 2014-09-16 16:29:04 +0200 | [diff] [blame] | 31 | } |