blob: d51fcbe6cfa50e7f9ebb27635fee2e1437880625 [file] [log] [blame]
Ash Wilson01626a32014-09-17 10:38:07 -04001package servers
2
3import "github.com/rackspace/gophercloud"
4
Jon Perritt703bfc02014-10-08 14:35:00 -05005func createURL(client *gophercloud.ServiceClient) string {
Ash Wilsondc7daa82014-09-23 16:34:42 -04006 return client.ServiceURL("servers")
Ash Wilson01626a32014-09-17 10:38:07 -04007}
8
Jon Perritt703bfc02014-10-08 14:35:00 -05009func listURL(client *gophercloud.ServiceClient) string {
10 return createURL(client)
11}
12
13func listDetailURL(client *gophercloud.ServiceClient) string {
Ash Wilsondc7daa82014-09-23 16:34:42 -040014 return client.ServiceURL("servers", "detail")
Ash Wilson01626a32014-09-17 10:38:07 -040015}
16
Jon Perritt703bfc02014-10-08 14:35:00 -050017func deleteURL(client *gophercloud.ServiceClient, id string) string {
Ash Wilson01626a32014-09-17 10:38:07 -040018 return client.ServiceURL("servers", id)
19}
20
Jon Perritt703bfc02014-10-08 14:35:00 -050021func getURL(client *gophercloud.ServiceClient, id string) string {
22 return deleteURL(client, id)
23}
24
25func updateURL(client *gophercloud.ServiceClient, id string) string {
26 return deleteURL(client, id)
27}
28
Ash Wilson31f6bde2014-09-25 14:52:12 -040029func actionURL(client *gophercloud.ServiceClient, id string) string {
Ash Wilson01626a32014-09-17 10:38:07 -040030 return client.ServiceURL("servers", id, "action")
31}
Jon Perrittcc77da62014-11-16 13:14:21 -070032
Jon Perritt78c57ce2014-11-20 11:07:18 -070033func metadatumURL(client *gophercloud.ServiceClient, id, key string) string {
Jon Perrittcc77da62014-11-16 13:14:21 -070034 return client.ServiceURL("servers", id, "metadata", key)
35}
36
Jon Perritt78c57ce2014-11-20 11:07:18 -070037func metadataURL(client *gophercloud.ServiceClient, id string) string {
Jon Perrittcc77da62014-11-16 13:14:21 -070038 return client.ServiceURL("servers", id, "metadata")
39}
Jon Perritt5cb49482015-02-19 12:19:58 -070040
41func listAddressesURL(client *gophercloud.ServiceClient, id string) string {
42 return client.ServiceURL("servers", id, "ips")
43}
Jon Perritt04d073c2015-02-19 21:46:23 -070044
45func listAddressesByNetworkURL(client *gophercloud.ServiceClient, id, network string) string {
46 return client.ServiceURL("servers", id, "ips", network)
47}
Rickard von Essen5b8bbff2016-02-16 07:48:20 +010048
49func passwordURL(client *gophercloud.ServiceClient, id string) string {
50 return client.ServiceURL("servers", id, "os-server-password")
51}