blob: 2cefee26449db3aa33f9fdba4b94728e4049e2fe [file] [log] [blame]
Jamie Hannafordb6927c12014-11-03 10:31:26 +01001package nodes
Jamie Hannaford3cfa00a2014-11-03 11:16:35 +01002
3import (
4 "strconv"
5
6 "github.com/rackspace/gophercloud"
7)
8
9const (
Jamie Hannaford1fac9dd2014-11-03 14:22:40 +010010 lbPath = "loadbalancers"
11 nodePath = "nodes"
12 eventPath = "events"
Jamie Hannaford3cfa00a2014-11-03 11:16:35 +010013)
14
15func resourceURL(c *gophercloud.ServiceClient, lbID, nodeID int) string {
16 return c.ServiceURL(lbPath, strconv.Itoa(lbID), nodePath, strconv.Itoa(nodeID))
17}
18
19func rootURL(c *gophercloud.ServiceClient, lbID int) string {
20 return c.ServiceURL(lbPath, strconv.Itoa(lbID), nodePath)
21}
Jamie Hannaford1fac9dd2014-11-03 14:22:40 +010022
Jamie Hannaford703527e2014-11-05 12:38:15 +010023func eventsURL(c *gophercloud.ServiceClient, lbID int) string {
24 return c.ServiceURL(lbPath, strconv.Itoa(lbID), nodePath, eventPath)
Jamie Hannaford1fac9dd2014-11-03 14:22:40 +010025}