-
Notifications
You must be signed in to change notification settings - Fork 7
/
urls.go
44 lines (35 loc) · 1.72 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
package snapshots
import "github.com/huaweicloud/terraform-provider-hcs/huaweicloudstack/sdk/huaweicloud"
// policyURL used to set or query the snapshot policy
func policyURL(c *golangsdk.ServiceClient, clusterId string) string {
return c.ServiceURL("clusters", clusterId, "index_snapshot/policy")
}
// enableURL used to automatically perform basic configurations for a cluster snapshot
func enableURL(c *golangsdk.ServiceClient, clusterId string) string {
return c.ServiceURL("clusters", clusterId, "index_snapshot/auto_setting")
}
// disableURL used to disable the snapshot function
func disableURL(c *golangsdk.ServiceClient, clusterId string) string {
return c.ServiceURL("clusters", clusterId, "index_snapshots")
}
// settingURL used to modify the basic configurations of a cluster snapshot,
// including the OBS bucket and IAM agency.
func settingURL(c *golangsdk.ServiceClient, clusterId string) string {
return c.ServiceURL("clusters", clusterId, "index_snapshot/setting")
}
// createURL used to manually create a snapshot
func createURL(c *golangsdk.ServiceClient, clusterId string) string {
return c.ServiceURL("clusters", clusterId, "index_snapshot")
}
// listURL used to query all snapshots of a cluster
func listURL(c *golangsdk.ServiceClient, clusterId string) string {
return c.ServiceURL("clusters", clusterId, "index_snapshots")
}
// restoreURL used to manually restore a snapshot
func restoreURL(c *golangsdk.ServiceClient, clusterId, snapId string) string {
return c.ServiceURL("clusters", clusterId, "index_snapshot", snapId, "restore")
}
// deleteURL used to delete a snapshot
func deleteURL(c *golangsdk.ServiceClient, clusterId, snapId string) string {
return c.ServiceURL("clusters", clusterId, "index_snapshot", snapId)
}