gos_tech_4.4.3 3.4.3
KasimBaybikov 2 years ago
parent 9d1c8eeaa7
commit f5e0a53364

@ -1,12 +1,11 @@
### Version 3.4.2
### Version 3.4.3
### Bug fixes
### Features
- Change field type size_used from int to float in:
- resource decort_kvmvm
- resource decort_disk
- data source decort_kvmvm
- data source decort_disk
- data source decort_disk_list
- data source decort_disk_list-unattached
- Change field type disksize from int to float in:
- resource decort_resgroup
- resource decort_account
- data source decort_rg
- data source decort_account
- data source decort_account_rg_list
- Models of the resources

@ -198,7 +198,7 @@ func dataSourceAccountSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"disksize": {
Type: schema.TypeInt,
Type: schema.TypeFloat,
Computed: true,
},
"extips": {
@ -254,7 +254,7 @@ func dataSourceAccountSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"disksize": {
Type: schema.TypeInt,
Type: schema.TypeFloat,
Computed: true,
},
"extips": {

@ -74,12 +74,41 @@ func flattenAccRGComputes(argc AccountRGComputes) []map[string]interface{} {
return res
}
func flattenAccResourceHack(r ResourceHack) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
temp := map[string]interface{}{
"cpu": r.CPU,
"disksize": r.Disksize,
"extips": r.Extips,
"exttraffic": r.Exttraffic,
"gpu": r.GPU,
"ram": r.RAM,
//"seps": flattenAccountSeps(r.SEPs),
}
res = append(res, temp)
return res
}
func flattenAccResourceRg(r Resource) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
temp := map[string]interface{}{
"cpu": r.CPU,
"disksize": r.Disksize,
"extips": r.Extips,
"exttraffic": r.Exttraffic,
"gpu": r.GPU,
"ram": r.RAM,
}
res = append(res, temp)
return res
}
func flattenAccRGResources(argr AccountRGResources) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
temp := map[string]interface{}{
"consumed": flattenAccResource(argr.Consumed),
"limits": flattenAccResource(argr.Limits),
"reserved": flattenAccResource(argr.Reserved),
"consumed": flattenAccResourceRg(argr.Consumed),
"limits": flattenAccResourceHack(argr.Limits),
"reserved": flattenAccResourceRg(argr.Reserved),
}
res = append(res, temp)
return res

@ -96,7 +96,7 @@ type ResourceSep struct {
type Resource struct {
CPU int `json:"cpu"`
Disksize int `json:"disksize"`
Disksize float64 `json:"disksize"`
Extips int `json:"extips"`
Exttraffic int `json:"exttraffic"`
GPU int `json:"gpu"`
@ -201,9 +201,18 @@ type AccountRGComputes struct {
Stopped int `json:"Stopped"`
}
type ResourceHack struct {
CPU int `json:"cpu"`
Disksize float64 `json:"disksize"`
Extips int `json:"extips"`
Exttraffic int `json:"exttraffic"`
GPU int `json:"gpu"`
RAM int `json:"ram"`
}
type AccountRGResources struct {
Consumed Resource `json:"Consumed"`
Limits Resource `json:"Limits"`
Limits ResourceHack `json:"Limits"`
Reserved Resource `json:"Reserved"`
}

@ -574,7 +574,7 @@ func resourceAccountSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"disksize": {
Type: schema.TypeInt,
Type: schema.TypeFloat,
Computed: true,
},
"extips": {
@ -630,7 +630,7 @@ func resourceAccountSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"disksize": {
Type: schema.TypeInt,
Type: schema.TypeFloat,
Computed: true,
},
"extips": {

@ -138,7 +138,7 @@ type QuotaRecord struct { // this is how quota is reported by /api/.../rg/get
type ResourceRecord struct { // this is how actual usage is reported by /api/.../rg/get
Cpu int `json:"cpu"`
Disk int `json:"disksize"`
Disk float64 `json:"disksize"`
ExtIPs int `json:"extips"`
ExtTraffic int `json:"exttraffic"`
Gpu int `json:"gpu"`
@ -157,7 +157,7 @@ type ResourceSep struct {
type Resource struct {
CPU int `json:"cpu"`
Disksize int `json:"disksize"`
Disksize float64 `json:"disksize"`
Extips int `json:"extips"`
Exttraffic int `json:"exttraffic"`
GPU int `json:"gpu"`

Loading…
Cancel
Save