-
Notifications
You must be signed in to change notification settings - Fork 7
/
results.go
54 lines (46 loc) · 1.29 KB
/
results.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
package drill
import (
"github.com/huaweicloud/terraform-provider-hcs/huaweicloudstack/sdk/huaweicloud"
)
type Drill struct {
// DR-Drill ID
Id string `json:"id"`
// DR-Drill Name
Name string `json:"name"`
// DR-Drill Status
Status string `json:"status"`
// DR-Drill VPC ID
DrillVpcID string `json:"drill_vpc_id"`
// DR-Drill Group ID
GroupID string `json:"server_group_id"`
// DR-Drill Volume IDs
Servers []Servers `json:"drill_servers"`
}
type Servers struct {
// Protected Instance ID
ProtectedInstance string `json:"protected_instance"`
// Drill server ID
ServerID string `json:"drill_server_id"`
}
type commonResult struct {
golangsdk.Result
}
// Extract is a function that accepts a result and extracts a dr-drill.
func (r commonResult) Extract() (*Drill, error) {
var response Drill
err := r.ExtractInto(&response)
return &response, err
}
func (r commonResult) ExtractInto(v interface{}) error {
return r.Result.ExtractIntoStructPtr(v, "disaster_recovery_drill")
}
// UpdateResult represents the result of a update operation. Call its Extract
// method to interpret it as a dr-drill.
type UpdateResult struct {
commonResult
}
// GetResult represents the result of a get operation. Call its Extract
// method to interpret it as a dr-drill.
type GetResult struct {
commonResult
}