-
Notifications
You must be signed in to change notification settings - Fork 7
/
results.go
62 lines (53 loc) · 1.46 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
55
56
57
58
59
60
61
62
package products
import (
"github.com/opentelekomcloud/gophertelekomcloud"
)
// GetResponse response
type GetResponse struct {
Hourly []Parameter `json:"Hourly"`
Monthly []Parameter `json:"Monthly"`
}
// Parameter for dms
type Parameter struct {
Name string `json:"name"`
Version string `json:"version"`
Values []Value `json:"values"`
}
// Value for dms
type Value struct {
Details []Detail `json:"detail"`
Name string `json:"name"`
}
// Detail for dms
type Detail struct {
Storage string `json:"storage"`
ProductID string `json:"product_id"`
SpecCode string `json:"spec_code"`
VMSpecification string `json:"vm_specification"`
ProductInfos []ProductInfo `json:"product_info"`
PartitionNum string `json:"partition_num"`
Bandwidth string `json:"bandwidth"`
IOs []IO `json:"io"`
}
// ProductInfo for dms
type ProductInfo struct {
Storage string `json:"storage"`
NodeNum string `json:"node_num"`
ProductID string `json:"product_id"`
SpecCode string `json:"spec_code"`
IOs []IO `json:"io"`
}
type IO struct {
IOType string `json:"io_type"`
StorageSpecCode string `json:"storage_spec_code"`
}
// GetResult contains the body of getting detailed
type GetResult struct {
golangsdk.Result
}
// Extract from GetResult
func (r GetResult) Extract() (*GetResponse, error) {
var s GetResponse
err := r.Result.ExtractInto(&s)
return &s, err
}