@@ -40,35 +40,52 @@ func (r commonResult) Extract() (*Flavor, error) {
4040 return s .Flavor , err
4141}
4242
43+ // Link represents the structure of a link in the flavor data
44+ type Link struct { // Added
45+ Href string `json:"href"`
46+ Rel string `json:"rel"`
47+ }
48+
49+ // ExtraSpecs represents the extra specifications of a flavor
50+ type ExtraSpecs struct { // Added
51+ FlavorType string `json:"flavor_type"`
52+ }
53+
4354// Flavor represent (virtual) hardware configurations for server resources
4455// in a region.
45- type Flavor struct {
56+ type Flavor struct { // Modified
4657 // ID is the flavor's unique ID.
47- ID string `json:"id"`
58+ ID string `json:"id"`
4859
49- // Disk is the amount of root disk, measured in GB.
50- Disk int `json:"disk"`
60+ // Name is the name of the flavor.
61+ Name string `json:"name"`
62+
63+ Links []Link `json:"links"`
5164
5265 // RAM is the amount of memory, measured in MB.
53- RAM int `json:"ram"`
66+ RAM int `json:"ram"`
5467
55- // Name is the name of the flavor.
56- Name string `json:"name"`
68+ Disabled bool `json:"OS-FLV-DISABLED:disabled"`
5769
58- // RxTxFactor describes bandwidth alterations of the flavor.
59- RxTxFactor float64 `json:"rxtx_factor "`
70+ // VCPUs indicates how many (virtual) CPUs are available for this flavor.
71+ VCPUs int `json:"vcpus "`
6072
61- // Swap is the amount of swap space, measured in MB.
62- Swap int `json:"-"`
73+ ExtraSpecs ExtraSpecs `json:"extra_specs"`
6374
64- // VCPUs indicates how many (virtual) CPUs are available for this flavor .
65- VCPUs int `json:"vcpus "`
75+ // Swap is the amount of swap space, measured in MB .
76+ Swap int `json:"- "`
6677
6778 // IsPublic indicates whether the flavor is public.
68- IsPublic bool `json:"os-flavor-access:is_public"`
79+ IsPublic bool `json:"os-flavor-access:is_public"`
6980
81+ // RxTxFactor describes bandwidth alterations of the flavor.
82+ RxTxFactor float64 `json:"rxtx_factor"`
83+
7084 // Ephemeral is the amount of ephemeral disk space, measured in GB.
71- Ephemeral int `json:"OS-FLV-EXT-DATA:ephemeral"`
85+ Ephemeral int `json:"OS-FLV-EXT-DATA:ephemeral"`
86+
87+ // Disk is the amount of root disk, measured in GB.
88+ Disk int `json:"disk"`
7289}
7390
7491func (r * Flavor ) UnmarshalJSON (b []byte ) error {
0 commit comments