Jamie Hannaford | fba65af | 2014-11-03 10:32:37 +0100 | [diff] [blame] | 1 | package lbs |
Jamie Hannaford | 186d4e2 | 2014-10-31 12:26:11 +0100 | [diff] [blame] | 2 | |
Jamie Hannaford | 5f95e6a | 2014-10-31 16:13:44 +0100 | [diff] [blame] | 3 | import ( |
| 4 | "strconv" |
| 5 | |
| 6 | "github.com/rackspace/gophercloud" |
| 7 | ) |
Jamie Hannaford | 186d4e2 | 2014-10-31 12:26:11 +0100 | [diff] [blame] | 8 | |
Jamie Hannaford | 4ab9aea | 2014-11-04 14:38:06 +0100 | [diff] [blame] | 9 | const ( |
Jamie Hannaford | 4633628 | 2014-11-04 14:48:20 +0100 | [diff] [blame] | 10 | path = "loadbalancers" |
| 11 | protocolsPath = "protocols" |
| 12 | algorithmsPath = "algorithms" |
Jamie Hannaford | d78bb35 | 2014-11-07 16:36:09 +0100 | [diff] [blame] | 13 | logPath = "connectionlogging" |
Jamie Hannaford | da45b42 | 2014-11-10 11:00:38 +0100 | [diff] [blame] | 14 | epPath = "errorpage" |
Jamie Hannaford | 3da6528 | 2014-11-10 11:36:16 +0100 | [diff] [blame] | 15 | stPath = "stats" |
Jamie Hannaford | 20b7588 | 2014-11-10 13:39:51 +0100 | [diff] [blame] | 16 | cachePath = "contentcaching" |
Jamie Hannaford | 4ab9aea | 2014-11-04 14:38:06 +0100 | [diff] [blame] | 17 | ) |
Jamie Hannaford | 186d4e2 | 2014-10-31 12:26:11 +0100 | [diff] [blame] | 18 | |
Jamie Hannaford | 5f95e6a | 2014-10-31 16:13:44 +0100 | [diff] [blame] | 19 | func resourceURL(c *gophercloud.ServiceClient, id int) string { |
| 20 | return c.ServiceURL(path, strconv.Itoa(id)) |
Jamie Hannaford | 186d4e2 | 2014-10-31 12:26:11 +0100 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | func rootURL(c *gophercloud.ServiceClient) string { |
| 24 | return c.ServiceURL(path) |
| 25 | } |
Jamie Hannaford | 4ab9aea | 2014-11-04 14:38:06 +0100 | [diff] [blame] | 26 | |
| 27 | func protocolsURL(c *gophercloud.ServiceClient) string { |
| 28 | return c.ServiceURL(path, protocolsPath) |
| 29 | } |
Jamie Hannaford | 4633628 | 2014-11-04 14:48:20 +0100 | [diff] [blame] | 30 | |
| 31 | func algorithmsURL(c *gophercloud.ServiceClient) string { |
| 32 | return c.ServiceURL(path, algorithmsPath) |
| 33 | } |
Jamie Hannaford | d78bb35 | 2014-11-07 16:36:09 +0100 | [diff] [blame] | 34 | |
| 35 | func loggingURL(c *gophercloud.ServiceClient, id int) string { |
| 36 | return c.ServiceURL(path, strconv.Itoa(id), logPath) |
| 37 | } |
Jamie Hannaford | da45b42 | 2014-11-10 11:00:38 +0100 | [diff] [blame] | 38 | |
| 39 | func errorPageURL(c *gophercloud.ServiceClient, id int) string { |
| 40 | return c.ServiceURL(path, strconv.Itoa(id), epPath) |
| 41 | } |
Jamie Hannaford | 3da6528 | 2014-11-10 11:36:16 +0100 | [diff] [blame] | 42 | |
| 43 | func statsURL(c *gophercloud.ServiceClient, id int) string { |
| 44 | return c.ServiceURL(path, strconv.Itoa(id), stPath) |
| 45 | } |
Jamie Hannaford | 20b7588 | 2014-11-10 13:39:51 +0100 | [diff] [blame] | 46 | |
| 47 | func cacheURL(c *gophercloud.ServiceClient, id int) string { |
| 48 | return c.ServiceURL(path, strconv.Itoa(id), cachePath) |
| 49 | } |