blob: 4768e5a89769a419b9e4ed1d06e1e874c9364c72 [file] [log] [blame]
Jon Perritt12395212016-02-24 10:41:17 -06001package floatingips
Joe Topjiandee32222015-02-09 23:56:26 +00002
Jon Perritt27249f42016-02-18 10:35:59 -06003import "github.com/gophercloud/gophercloud"
Joe Topjiandee32222015-02-09 23:56:26 +00004
5const resourcePath = "os-floating-ips"
6
7func resourceURL(c *gophercloud.ServiceClient) string {
8 return c.ServiceURL(resourcePath)
9}
10
11func listURL(c *gophercloud.ServiceClient) string {
12 return resourceURL(c)
13}
14
15func createURL(c *gophercloud.ServiceClient) string {
16 return resourceURL(c)
17}
18
19func getURL(c *gophercloud.ServiceClient, id string) string {
20 return c.ServiceURL(resourcePath, id)
21}
22
23func deleteURL(c *gophercloud.ServiceClient, id string) string {
24 return getURL(c, id)
25}
26
Jon Perritt3860b512016-03-29 12:01:48 -050027func serverURL(c *gophercloud.ServiceClient, serverID string) string {
28 return c.ServiceURL("servers/" + serverID + "/action")
Joe Topjiandee32222015-02-09 23:56:26 +000029}
30
Jon Perritt3860b512016-03-29 12:01:48 -050031func associateURL(c *gophercloud.ServiceClient, serverID string) string {
32 return serverURL(c, serverID)
Joe Topjiandee32222015-02-09 23:56:26 +000033}
34
Jon Perritt3860b512016-03-29 12:01:48 -050035func disassociateURL(c *gophercloud.ServiceClient, serverID string) string {
36 return serverURL(c, serverID)
Joe Topjiandee32222015-02-09 23:56:26 +000037}