Jon Perritt | 9f8b015 | 2015-03-17 19:28:18 -0600 | [diff] [blame] | 1 | package lbpools |
| 2 | |
| 3 | import "github.com/rackspace/gophercloud" |
| 4 | |
| 5 | var root = "load_balancer_pools" |
| 6 | |
| 7 | func listURL(c *gophercloud.ServiceClient) string { |
| 8 | return c.ServiceURL(root) |
| 9 | } |
| 10 | |
| 11 | func getURL(c *gophercloud.ServiceClient, id string) string { |
| 12 | return c.ServiceURL(root, id) |
| 13 | } |
| 14 | |
| 15 | func listNodesURL(c *gophercloud.ServiceClient, id string) string { |
| 16 | return c.ServiceURL(root, id, "nodes") |
| 17 | } |
| 18 | |
| 19 | func createNodeURL(c *gophercloud.ServiceClient, id string) string { |
| 20 | return listNodesURL(c, id) |
| 21 | } |
| 22 | |
| 23 | func listNodesDetailsURL(c *gophercloud.ServiceClient, id string) string { |
| 24 | return c.ServiceURL(root, id, "nodes", "details") |
| 25 | } |
| 26 | |
| 27 | func nodeURL(c *gophercloud.ServiceClient, poolID, nodeID string) string { |
| 28 | return c.ServiceURL(root, poolID, "nodes", nodeID) |
| 29 | } |
| 30 | |
| 31 | func deleteNodeURL(c *gophercloud.ServiceClient, poolID, nodeID string) string { |
| 32 | return nodeURL(c, poolID, nodeID) |
| 33 | } |
| 34 | |
| 35 | func nodeDetailsURL(c *gophercloud.ServiceClient, poolID, nodeID string) string { |
| 36 | return c.ServiceURL(root, poolID, "nodes", nodeID, "details") |
| 37 | } |
| 38 | |
| 39 | func createNodesURL(c *gophercloud.ServiceClient) string { |
| 40 | return c.ServiceURL(root, "nodes") |
| 41 | } |
| 42 | |
| 43 | func deleteNodesURL(c *gophercloud.ServiceClient) string { |
| 44 | return createNodesURL(c) |
| 45 | } |
| 46 | |
| 47 | func listNodesForServerURL(c *gophercloud.ServiceClient, serverID string) string { |
| 48 | return c.ServiceURL(root, "nodes", "details?cloud_server_id="+serverID) |
| 49 | } |