forked from G-Core/gcorelabscloud-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
urls.go
55 lines (41 loc) · 1.31 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 volumes
import gcorecloud "github.com/alexandrpaliy/gcorelabscloud-go"
func resourceURL(c *gcorecloud.ServiceClient, id string) string {
return c.ServiceURL(id)
}
func rootURL(c *gcorecloud.ServiceClient) string {
return c.ServiceURL()
}
func getURL(c *gcorecloud.ServiceClient, id string) string {
return resourceURL(c, id)
}
func updateURL(c *gcorecloud.ServiceClient, id string) string {
return resourceURL(c, id)
}
func resourceActionURL(c *gcorecloud.ServiceClient, id, action string) string {
return c.ServiceURL(id, action)
}
func attachURL(c *gcorecloud.ServiceClient, id string) string {
return resourceActionURL(c, id, "attach")
}
func detachURL(c *gcorecloud.ServiceClient, id string) string {
return resourceActionURL(c, id, "detach")
}
func retypeURL(c *gcorecloud.ServiceClient, id string) string {
return resourceActionURL(c, id, "retype")
}
func extendURL(c *gcorecloud.ServiceClient, id string) string {
return resourceActionURL(c, id, "extend")
}
func revertURL(c *gcorecloud.ServiceClient, id string) string {
return resourceActionURL(c, id, "revert")
}
func listURL(c *gcorecloud.ServiceClient) string {
return rootURL(c)
}
func createURL(c *gcorecloud.ServiceClient) string {
return rootURL(c)
}
func deleteURL(c *gcorecloud.ServiceClient, id string) string {
return resourceURL(c, id)
}