-
Notifications
You must be signed in to change notification settings - Fork 7
/
urls.go
32 lines (24 loc) · 975 Bytes
/
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
package nodes
import "github.com/huaweicloud/terraform-provider-hcs/huaweicloudstack/sdk/huaweicloud"
const (
rootPath = "clusters"
resourcePath = "nodes"
)
func rootURL(c *golangsdk.ServiceClient, clusterid string) string {
return c.ServiceURL(rootPath, clusterid, resourcePath)
}
func resourceURL(c *golangsdk.ServiceClient, clusterid, nodeid string) string {
return c.ServiceURL(rootPath, clusterid, resourcePath, nodeid)
}
func getJobURL(c *golangsdk.ServiceClient, jobid string) string {
return c.ServiceURL("jobs", jobid)
}
func removeNodeURL(c *golangsdk.ServiceClient, clusterid string) string {
return c.ServiceURL(rootPath, clusterid, resourcePath, "operation/remove")
}
func addNodeURL(c *golangsdk.ServiceClient, clusterid string) string {
return c.ServiceURL(rootPath, clusterid, resourcePath, "add")
}
func resetNodeURL(c *golangsdk.ServiceClient, clusterid string) string {
return c.ServiceURL(rootPath, clusterid, resourcePath, "reset")
}