blob: dc53fbfac63ad56a4be240f2fbe195aac9e6a159 [file] [log] [blame]
Jamie Hannaford924c09d2014-11-19 12:05:38 +01001package secgroups
2
Jamie Hannaford2f226172014-11-25 11:52:25 +01003import "github.com/rackspace/gophercloud"
Jamie Hannaford924c09d2014-11-19 12:05:38 +01004
5const (
6 secgrouppath = "os-security-groups"
Jamie Hannaford8badf1e2014-11-19 14:39:26 +01007 rulepath = "os-security-group-rules"
Jamie Hannaford924c09d2014-11-19 12:05:38 +01008)
9
Jamie Hannaford2f226172014-11-25 11:52:25 +010010func resourceURL(c *gophercloud.ServiceClient, id string) string {
11 return c.ServiceURL(secgrouppath, id)
Jamie Hannaford924c09d2014-11-19 12:05:38 +010012}
13
14func rootURL(c *gophercloud.ServiceClient) string {
15 return c.ServiceURL(secgrouppath)
16}
Jamie Hannaford19151792014-11-19 12:46:47 +010017
18func listByServerURL(c *gophercloud.ServiceClient, serverID string) string {
Jon Perritt13dd1422015-02-10 17:35:54 -070019 return c.ServiceURL("servers", serverID, secgrouppath)
Jamie Hannaford19151792014-11-19 12:46:47 +010020}
Jamie Hannaford8badf1e2014-11-19 14:39:26 +010021
22func rootRuleURL(c *gophercloud.ServiceClient) string {
23 return c.ServiceURL(rulepath)
24}
Jamie Hannaford61f81ca2014-11-19 14:44:33 +010025
Jamie Hannaford2f226172014-11-25 11:52:25 +010026func resourceRuleURL(c *gophercloud.ServiceClient, id string) string {
27 return c.ServiceURL(rulepath, id)
Jamie Hannaford61f81ca2014-11-19 14:44:33 +010028}
Jamie Hannaford740e4a32014-11-19 16:13:30 +010029
30func serverActionURL(c *gophercloud.ServiceClient, id string) string {
31 return c.ServiceURL("servers", id, "action")
32}