Jamie Hannaford | 924c09d | 2014-11-19 12:05:38 +0100 | [diff] [blame] | 1 | package secgroups |
| 2 | |
Jamie Hannaford | 2f22617 | 2014-11-25 11:52:25 +0100 | [diff] [blame] | 3 | import "github.com/rackspace/gophercloud" |
Jamie Hannaford | 924c09d | 2014-11-19 12:05:38 +0100 | [diff] [blame] | 4 | |
| 5 | const ( |
| 6 | secgrouppath = "os-security-groups" |
Jamie Hannaford | 8badf1e | 2014-11-19 14:39:26 +0100 | [diff] [blame] | 7 | rulepath = "os-security-group-rules" |
Jamie Hannaford | 924c09d | 2014-11-19 12:05:38 +0100 | [diff] [blame] | 8 | ) |
| 9 | |
Jamie Hannaford | 2f22617 | 2014-11-25 11:52:25 +0100 | [diff] [blame] | 10 | func resourceURL(c *gophercloud.ServiceClient, id string) string { |
| 11 | return c.ServiceURL(secgrouppath, id) |
Jamie Hannaford | 924c09d | 2014-11-19 12:05:38 +0100 | [diff] [blame] | 12 | } |
| 13 | |
| 14 | func rootURL(c *gophercloud.ServiceClient) string { |
| 15 | return c.ServiceURL(secgrouppath) |
| 16 | } |
Jamie Hannaford | 1915179 | 2014-11-19 12:46:47 +0100 | [diff] [blame] | 17 | |
| 18 | func listByServerURL(c *gophercloud.ServiceClient, serverID string) string { |
Jon Perritt | 13dd142 | 2015-02-10 17:35:54 -0700 | [diff] [blame^] | 19 | return c.ServiceURL("servers", serverID, secgrouppath) |
Jamie Hannaford | 1915179 | 2014-11-19 12:46:47 +0100 | [diff] [blame] | 20 | } |
Jamie Hannaford | 8badf1e | 2014-11-19 14:39:26 +0100 | [diff] [blame] | 21 | |
| 22 | func rootRuleURL(c *gophercloud.ServiceClient) string { |
| 23 | return c.ServiceURL(rulepath) |
| 24 | } |
Jamie Hannaford | 61f81ca | 2014-11-19 14:44:33 +0100 | [diff] [blame] | 25 | |
Jamie Hannaford | 2f22617 | 2014-11-25 11:52:25 +0100 | [diff] [blame] | 26 | func resourceRuleURL(c *gophercloud.ServiceClient, id string) string { |
| 27 | return c.ServiceURL(rulepath, id) |
Jamie Hannaford | 61f81ca | 2014-11-19 14:44:33 +0100 | [diff] [blame] | 28 | } |
Jamie Hannaford | 740e4a3 | 2014-11-19 16:13:30 +0100 | [diff] [blame] | 29 | |
| 30 | func serverActionURL(c *gophercloud.ServiceClient, id string) string { |
| 31 | return c.ServiceURL("servers", id, "action") |
| 32 | } |