Ash Wilson | 01626a3 | 2014-09-17 10:38:07 -0400 | [diff] [blame] | 1 | package servers |
| 2 | |
Jon Perritt | 27249f4 | 2016-02-18 10:35:59 -0600 | [diff] [blame] | 3 | import "github.com/gophercloud/gophercloud" |
Ash Wilson | 01626a3 | 2014-09-17 10:38:07 -0400 | [diff] [blame] | 4 | |
Jon Perritt | 703bfc0 | 2014-10-08 14:35:00 -0500 | [diff] [blame] | 5 | func createURL(client *gophercloud.ServiceClient) string { |
Ash Wilson | dc7daa8 | 2014-09-23 16:34:42 -0400 | [diff] [blame] | 6 | return client.ServiceURL("servers") |
Ash Wilson | 01626a3 | 2014-09-17 10:38:07 -0400 | [diff] [blame] | 7 | } |
| 8 | |
Jon Perritt | 703bfc0 | 2014-10-08 14:35:00 -0500 | [diff] [blame] | 9 | func listURL(client *gophercloud.ServiceClient) string { |
| 10 | return createURL(client) |
| 11 | } |
| 12 | |
| 13 | func listDetailURL(client *gophercloud.ServiceClient) string { |
Ash Wilson | dc7daa8 | 2014-09-23 16:34:42 -0400 | [diff] [blame] | 14 | return client.ServiceURL("servers", "detail") |
Ash Wilson | 01626a3 | 2014-09-17 10:38:07 -0400 | [diff] [blame] | 15 | } |
| 16 | |
Jon Perritt | 703bfc0 | 2014-10-08 14:35:00 -0500 | [diff] [blame] | 17 | func deleteURL(client *gophercloud.ServiceClient, id string) string { |
Ash Wilson | 01626a3 | 2014-09-17 10:38:07 -0400 | [diff] [blame] | 18 | return client.ServiceURL("servers", id) |
| 19 | } |
| 20 | |
Jon Perritt | 703bfc0 | 2014-10-08 14:35:00 -0500 | [diff] [blame] | 21 | func getURL(client *gophercloud.ServiceClient, id string) string { |
| 22 | return deleteURL(client, id) |
| 23 | } |
| 24 | |
| 25 | func updateURL(client *gophercloud.ServiceClient, id string) string { |
| 26 | return deleteURL(client, id) |
| 27 | } |
| 28 | |
Ash Wilson | 31f6bde | 2014-09-25 14:52:12 -0400 | [diff] [blame] | 29 | func actionURL(client *gophercloud.ServiceClient, id string) string { |
Ash Wilson | 01626a3 | 2014-09-17 10:38:07 -0400 | [diff] [blame] | 30 | return client.ServiceURL("servers", id, "action") |
| 31 | } |
Jon Perritt | cc77da6 | 2014-11-16 13:14:21 -0700 | [diff] [blame] | 32 | |
Jon Perritt | 78c57ce | 2014-11-20 11:07:18 -0700 | [diff] [blame] | 33 | func metadatumURL(client *gophercloud.ServiceClient, id, key string) string { |
Jon Perritt | cc77da6 | 2014-11-16 13:14:21 -0700 | [diff] [blame] | 34 | return client.ServiceURL("servers", id, "metadata", key) |
| 35 | } |
| 36 | |
Jon Perritt | 78c57ce | 2014-11-20 11:07:18 -0700 | [diff] [blame] | 37 | func metadataURL(client *gophercloud.ServiceClient, id string) string { |
Jon Perritt | cc77da6 | 2014-11-16 13:14:21 -0700 | [diff] [blame] | 38 | return client.ServiceURL("servers", id, "metadata") |
| 39 | } |
Jon Perritt | 5cb4948 | 2015-02-19 12:19:58 -0700 | [diff] [blame] | 40 | |
| 41 | func listAddressesURL(client *gophercloud.ServiceClient, id string) string { |
| 42 | return client.ServiceURL("servers", id, "ips") |
| 43 | } |
Jon Perritt | 04d073c | 2015-02-19 21:46:23 -0700 | [diff] [blame] | 44 | |
| 45 | func listAddressesByNetworkURL(client *gophercloud.ServiceClient, id, network string) string { |
| 46 | return client.ServiceURL("servers", id, "ips", network) |
| 47 | } |
Rickard von Essen | 5b8bbff | 2016-02-16 07:48:20 +0100 | [diff] [blame] | 48 | |
| 49 | func passwordURL(client *gophercloud.ServiceClient, id string) string { |
| 50 | return client.ServiceURL("servers", id, "os-server-password") |
| 51 | } |