blob: 80c307c33ae66ae2e7474b70b6e72b8c5f8c32cf [file] [log] [blame]
Jamie Hannaford01e14922014-09-11 15:23:49 +02001package networks
2
Jamie Hannaford1ce30f22014-09-16 11:23:34 +02003import "github.com/rackspace/gophercloud"
Jamie Hannaford01e14922014-09-11 15:23:49 +02004
Jamie Hannaford12bc2472014-09-15 12:14:31 +02005const Version = "v2.0"
6
Jamie Hannaford686c4962014-09-23 10:46:20 +02007func resourceURL(c *gophercloud.ServiceClient, id string) string {
Jamie Hannafordd01a3c72014-09-15 12:51:00 +02008 return c.ServiceURL(Version, "networks", id)
9}
Jamie Hannafordd2d9f562014-09-15 15:35:07 +020010
Jamie Hannaford686c4962014-09-23 10:46:20 +020011func rootURL(c *gophercloud.ServiceClient) string {
Jamie Hannafordd2d9f562014-09-15 15:35:07 +020012 return c.ServiceURL(Version, "networks")
13}
Jamie Hannaford4721abc2014-09-16 16:29:04 +020014
Jamie Hannaford686c4962014-09-23 10:46:20 +020015func getURL(c *gophercloud.ServiceClient, id string) string {
16 return resourceURL(c, id)
Jamie Hannaford4721abc2014-09-16 16:29:04 +020017}
18
Jamie Hannaford686c4962014-09-23 10:46:20 +020019func listURL(c *gophercloud.ServiceClient) string {
20 return rootURL(c)
Jamie Hannaford4721abc2014-09-16 16:29:04 +020021}
22
Jamie Hannaford686c4962014-09-23 10:46:20 +020023func createURL(c *gophercloud.ServiceClient) string {
24 return rootURL(c)
Jamie Hannaford4721abc2014-09-16 16:29:04 +020025}
26
Jamie Hannaford686c4962014-09-23 10:46:20 +020027func deleteURL(c *gophercloud.ServiceClient, id string) string {
28 return resourceURL(c, id)
Jamie Hannaford4721abc2014-09-16 16:29:04 +020029}