/
urls.go
58 lines (43 loc) · 1.63 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
package clusters
import "github.com/gophercloud/gophercloud"
var apiVersion = "v1"
var apiName = "clusters"
func commonURL(client *gophercloud.ServiceClient) string {
return client.ServiceURL(apiVersion, apiName)
}
func idURL(client *gophercloud.ServiceClient, id string) string {
return client.ServiceURL(apiVersion, apiName, id)
}
func actionURL(client *gophercloud.ServiceClient, id string) string {
return client.ServiceURL(apiVersion, apiName, id, "actions")
}
func createURL(client *gophercloud.ServiceClient) string {
return commonURL(client)
}
func getURL(client *gophercloud.ServiceClient, id string) string {
return idURL(client, id)
}
func listURL(client *gophercloud.ServiceClient) string {
return commonURL(client)
}
func updateURL(client *gophercloud.ServiceClient, id string) string {
return idURL(client, id)
}
func deleteURL(client *gophercloud.ServiceClient, id string) string {
return idURL(client, id)
}
func listPoliciesURL(client *gophercloud.ServiceClient, clusterID string) string {
return client.ServiceURL(apiVersion, apiName, clusterID, "policies")
}
func getPolicyURL(client *gophercloud.ServiceClient, clusterID string, policyID string) string {
return client.ServiceURL(apiVersion, apiName, clusterID, "policies", policyID)
}
func nodeURL(client *gophercloud.ServiceClient, id string) string {
return actionURL(client, id)
}
func collectURL(client *gophercloud.ServiceClient, clusterID string, path string) string {
return client.ServiceURL(apiVersion, apiName, clusterID, "attrs", path)
}
func opsURL(client *gophercloud.ServiceClient, id string) string {
return client.ServiceURL(apiVersion, apiName, id, "ops")
}