-
Notifications
You must be signed in to change notification settings - Fork 7
/
results.go
53 lines (47 loc) · 1.72 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
package flavors
import (
"github.com/huaweicloud/terraform-provider-hcs/huaweicloudstack/sdk/huaweicloud"
)
// Flavor for dcs
type Flavor struct {
SpecCode string `json:"spec_code"`
CacheMode string `json:"cache_mode"`
Engine string `json:"engine"`
EngineVersion string `json:"engine_version"`
TenantIPCount int `json:"tenant_ip_count"`
ReplicaCount int `json:"replica_count"`
IsDes bool `json:"is_dec"`
Capacity []string `json:"capacity"`
BillingMode []string `json:"billing_mode"`
ProductType string `json:"product_type"`
CPUType string `json:"cpu_type"`
StorageType string `json:"storage_type"`
PricingType string `json:"pricing_type"`
ServiceTypeCode string `json:"cloud_service_type_code"`
ResourceTypeCode string `json:"cloud_resource_type_code"`
Attributes []AttrsObject `json:"attrs"`
AvailableZones []FlavorAzObject `json:"flavors_available_zones"`
}
// AttrsObject contains attributes of the flavor
type AttrsObject struct {
Capacity string `json:"capacity"`
Name string `json:"name"`
Value string `json:"value"`
}
// FlavorAzObject contains information of the available zones
type FlavorAzObject struct {
Capacity string `json:"capacity"`
AzCodes []string `json:"az_codes"`
}
// ListResult contains the body of getting detailed
type ListResult struct {
golangsdk.Result
}
// Extract from ListResult
func (r ListResult) Extract() ([]Flavor, error) {
var s struct {
Flavors []Flavor `json:"flavors"`
}
err := r.Result.ExtractInto(&s)
return s.Flavors, err
}