forked from gophercloud/gophercloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
urls.go
59 lines (44 loc) · 1.74 KB
/
urls.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package nodes
import "github.com/gophercloud/gophercloud"
func createURL(client *gophercloud.ServiceClient) string {
return client.ServiceURL("nodes")
}
func listURL(client *gophercloud.ServiceClient) string {
return createURL(client)
}
func listDetailURL(client *gophercloud.ServiceClient) string {
return client.ServiceURL("nodes", "detail")
}
func deleteURL(client *gophercloud.ServiceClient, id string) string {
return client.ServiceURL("nodes", id)
}
func getURL(client *gophercloud.ServiceClient, id string) string {
return deleteURL(client, id)
}
func updateURL(client *gophercloud.ServiceClient, id string) string {
return deleteURL(client, id)
}
func validateURL(client *gophercloud.ServiceClient, id string) string {
return client.ServiceURL("nodes", id, "validate")
}
func injectNMIURL(client *gophercloud.ServiceClient, id string) string {
return client.ServiceURL("nodes", id, "management", "inject_nmi")
}
func bootDeviceURL(client *gophercloud.ServiceClient, id string) string {
return client.ServiceURL("nodes", id, "management", "boot_device")
}
func supportedBootDeviceURL(client *gophercloud.ServiceClient, id string) string {
return client.ServiceURL("nodes", id, "management", "boot_device", "supported")
}
func statesResourceURL(client *gophercloud.ServiceClient, id string, state string) string {
return client.ServiceURL("nodes", id, "states", state)
}
func powerStateURL(client *gophercloud.ServiceClient, id string) string {
return statesResourceURL(client, id, "power")
}
func provisionStateURL(client *gophercloud.ServiceClient, id string) string {
return statesResourceURL(client, id, "provision")
}
func raidConfigURL(client *gophercloud.ServiceClient, id string) string {
return statesResourceURL(client, id, "raid")
}