-
Notifications
You must be signed in to change notification settings - Fork 18
/
urls.go
55 lines (41 loc) · 1.46 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
package clusters
import gcorecloud "github.com/G-Core/gcorelabscloud-go"
func rootURL(c *gcorecloud.ServiceClient) string {
return c.ServiceURL("")
}
func resourceURL(c *gcorecloud.ServiceClient, clusterName string) string {
return c.ServiceURL(clusterName)
}
func resourceActionURL(c *gcorecloud.ServiceClient, clusterName, action string) string {
return c.ServiceURL(clusterName, action)
}
func checkLimitsURL(c *gcorecloud.ServiceClient) string {
return c.ServiceURL("check_limits")
}
func listURL(c *gcorecloud.ServiceClient) string {
return rootURL(c)
}
func createURL(c *gcorecloud.ServiceClient) string {
return rootURL(c)
}
func getURL(c *gcorecloud.ServiceClient, clusterName string) string {
return resourceURL(c, clusterName)
}
func deleteURL(c *gcorecloud.ServiceClient, clusterName string) string {
return resourceURL(c, clusterName)
}
func certificatesURL(c *gcorecloud.ServiceClient, clusterName string) string {
return resourceActionURL(c, clusterName, "certificates")
}
func configURL(c *gcorecloud.ServiceClient, clusterName string) string {
return resourceActionURL(c, clusterName, "config")
}
func instancesURL(c *gcorecloud.ServiceClient, clusterName string) string {
return resourceActionURL(c, clusterName, "instances")
}
func upgradeURL(c *gcorecloud.ServiceClient, clusterName string) string {
return resourceActionURL(c, clusterName, "upgrade")
}
func versionsURL(c *gcorecloud.ServiceClient) string {
return c.BaseServiceURL("k8s", "versions")
}