Jamie Hannaford | 548d340 | 2014-09-18 15:50:08 +0200 | [diff] [blame] | 1 | package ports |
| 2 | |
| 3 | import "github.com/rackspace/gophercloud" |
| 4 | |
Jamie Hannaford | 965ae70 | 2014-09-22 14:58:19 +0200 | [diff] [blame] | 5 | const version = "v2.0" |
Jamie Hannaford | 548d340 | 2014-09-18 15:50:08 +0200 | [diff] [blame] | 6 | |
Jamie Hannaford | 965ae70 | 2014-09-22 14:58:19 +0200 | [diff] [blame] | 7 | func resourceURL(c *gophercloud.ServiceClient, id string) string { |
| 8 | return c.ServiceURL(version, "ports", id) |
Jamie Hannaford | 548d340 | 2014-09-18 15:50:08 +0200 | [diff] [blame] | 9 | } |
| 10 | |
Jamie Hannaford | 965ae70 | 2014-09-22 14:58:19 +0200 | [diff] [blame] | 11 | func rootURL(c *gophercloud.ServiceClient) string { |
| 12 | return c.ServiceURL(version, "ports") |
Jamie Hannaford | 548d340 | 2014-09-18 15:50:08 +0200 | [diff] [blame] | 13 | } |
| 14 | |
Jamie Hannaford | 965ae70 | 2014-09-22 14:58:19 +0200 | [diff] [blame] | 15 | func listURL(c *gophercloud.ServiceClient) string { |
| 16 | return rootURL(c) |
Jamie Hannaford | 548d340 | 2014-09-18 15:50:08 +0200 | [diff] [blame] | 17 | } |
| 18 | |
Jamie Hannaford | 965ae70 | 2014-09-22 14:58:19 +0200 | [diff] [blame] | 19 | func getURL(c *gophercloud.ServiceClient, id string) string { |
| 20 | return resourceURL(c, id) |
Jamie Hannaford | 548d340 | 2014-09-18 15:50:08 +0200 | [diff] [blame] | 21 | } |
| 22 | |
Jamie Hannaford | 965ae70 | 2014-09-22 14:58:19 +0200 | [diff] [blame] | 23 | func createURL(c *gophercloud.ServiceClient) string { |
| 24 | return rootURL(c) |
Jamie Hannaford | 548d340 | 2014-09-18 15:50:08 +0200 | [diff] [blame] | 25 | } |
| 26 | |
Jamie Hannaford | 965ae70 | 2014-09-22 14:58:19 +0200 | [diff] [blame] | 27 | func updateURL(c *gophercloud.ServiceClient, id string) string { |
| 28 | return resourceURL(c, id) |
Jamie Hannaford | 548d340 | 2014-09-18 15:50:08 +0200 | [diff] [blame] | 29 | } |
| 30 | |
Jamie Hannaford | 965ae70 | 2014-09-22 14:58:19 +0200 | [diff] [blame] | 31 | func deleteURL(c *gophercloud.ServiceClient, id string) string { |
| 32 | return resourceURL(c, id) |
Jamie Hannaford | 548d340 | 2014-09-18 15:50:08 +0200 | [diff] [blame] | 33 | } |