Jamie Hannaford | b6927c1 | 2014-11-03 10:31:26 +0100 | [diff] [blame] | 1 | package nodes |
Jamie Hannaford | 3cfa00a | 2014-11-03 11:16:35 +0100 | [diff] [blame] | 2 | |
| 3 | import ( |
| 4 | "strconv" |
| 5 | |
| 6 | "github.com/rackspace/gophercloud" |
| 7 | ) |
| 8 | |
| 9 | const ( |
Jamie Hannaford | 1fac9dd | 2014-11-03 14:22:40 +0100 | [diff] [blame] | 10 | lbPath = "loadbalancers" |
| 11 | nodePath = "nodes" |
| 12 | eventPath = "events" |
Jamie Hannaford | 3cfa00a | 2014-11-03 11:16:35 +0100 | [diff] [blame] | 13 | ) |
| 14 | |
| 15 | func resourceURL(c *gophercloud.ServiceClient, lbID, nodeID int) string { |
| 16 | return c.ServiceURL(lbPath, strconv.Itoa(lbID), nodePath, strconv.Itoa(nodeID)) |
| 17 | } |
| 18 | |
| 19 | func rootURL(c *gophercloud.ServiceClient, lbID int) string { |
| 20 | return c.ServiceURL(lbPath, strconv.Itoa(lbID), nodePath) |
| 21 | } |
Jamie Hannaford | 1fac9dd | 2014-11-03 14:22:40 +0100 | [diff] [blame] | 22 | |
Jamie Hannaford | 703527e | 2014-11-05 12:38:15 +0100 | [diff] [blame] | 23 | func eventsURL(c *gophercloud.ServiceClient, lbID int) string { |
| 24 | return c.ServiceURL(lbPath, strconv.Itoa(lbID), nodePath, eventPath) |
Jamie Hannaford | 1fac9dd | 2014-11-03 14:22:40 +0100 | [diff] [blame] | 25 | } |