-
Notifications
You must be signed in to change notification settings - Fork 7
/
urls.go
41 lines (31 loc) · 1.32 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
package instances
import "github.com/huaweicloud/terraform-provider-hcs/huaweicloudstack/sdk/huaweicloud"
// endpoint/instances
const resourcePath = "instances"
const rabbitMqEngine = "rabbitmq"
// createURL will build the rest query url of creation
func createURL(client *golangsdk.ServiceClient) string {
return client.ServiceURL(client.ProjectID, resourcePath)
}
// createWithEngineURL will build the rest query url of creation
func createWithEngineURL(client *golangsdk.ServiceClient) string {
return client.ServiceURL(rabbitMqEngine, client.ProjectID, resourcePath)
}
// deleteURL will build the url of deletion
func deleteURL(client *golangsdk.ServiceClient, id string) string {
return client.ServiceURL(client.ProjectID, resourcePath, id)
}
// updateURL will build the url of update
func updateURL(c *golangsdk.ServiceClient, id string) string {
return c.ServiceURL(c.ProjectID, resourcePath, id)
}
// getURL will build the get url of get function
func getURL(client *golangsdk.ServiceClient, id string) string {
return client.ServiceURL(client.ProjectID, resourcePath, id)
}
func listURL(client *golangsdk.ServiceClient) string {
return client.ServiceURL(client.ProjectID, resourcePath)
}
func extend(client *golangsdk.ServiceClient, id string) string {
return client.ServiceURL(client.ProjectID, resourcePath, id, "extend")
}