Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5e0a53364 |
17
CHANGELOG.md
17
CHANGELOG.md
@@ -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:
|
- Change field type disksize from int to float in:
|
||||||
- resource decort_kvmvm
|
- resource decort_resgroup
|
||||||
- resource decort_disk
|
- resource decort_account
|
||||||
- data source decort_kvmvm
|
- data source decort_rg
|
||||||
- data source decort_disk
|
- data source decort_account
|
||||||
- data source decort_disk_list
|
- data source decort_account_rg_list
|
||||||
- data source decort_disk_list-unattached
|
|
||||||
- Models of the resources
|
- Models of the resources
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ func dataSourceAccountSchemaMake() map[string]*schema.Schema {
|
|||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"disksize": {
|
"disksize": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeFloat,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"extips": {
|
"extips": {
|
||||||
@@ -254,7 +254,7 @@ func dataSourceAccountSchemaMake() map[string]*schema.Schema {
|
|||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"disksize": {
|
"disksize": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeFloat,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"extips": {
|
"extips": {
|
||||||
|
|||||||
@@ -74,12 +74,41 @@ func flattenAccRGComputes(argc AccountRGComputes) []map[string]interface{} {
|
|||||||
return res
|
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{} {
|
func flattenAccRGResources(argr AccountRGResources) []map[string]interface{} {
|
||||||
res := make([]map[string]interface{}, 0)
|
res := make([]map[string]interface{}, 0)
|
||||||
temp := map[string]interface{}{
|
temp := map[string]interface{}{
|
||||||
"consumed": flattenAccResource(argr.Consumed),
|
"consumed": flattenAccResourceRg(argr.Consumed),
|
||||||
"limits": flattenAccResource(argr.Limits),
|
"limits": flattenAccResourceHack(argr.Limits),
|
||||||
"reserved": flattenAccResource(argr.Reserved),
|
"reserved": flattenAccResourceRg(argr.Reserved),
|
||||||
}
|
}
|
||||||
res = append(res, temp)
|
res = append(res, temp)
|
||||||
return res
|
return res
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ type ResourceSep struct {
|
|||||||
|
|
||||||
type Resource struct {
|
type Resource struct {
|
||||||
CPU int `json:"cpu"`
|
CPU int `json:"cpu"`
|
||||||
Disksize int `json:"disksize"`
|
Disksize float64 `json:"disksize"`
|
||||||
Extips int `json:"extips"`
|
Extips int `json:"extips"`
|
||||||
Exttraffic int `json:"exttraffic"`
|
Exttraffic int `json:"exttraffic"`
|
||||||
GPU int `json:"gpu"`
|
GPU int `json:"gpu"`
|
||||||
@@ -201,9 +201,18 @@ type AccountRGComputes struct {
|
|||||||
Stopped int `json:"Stopped"`
|
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 {
|
type AccountRGResources struct {
|
||||||
Consumed Resource `json:"Consumed"`
|
Consumed Resource `json:"Consumed"`
|
||||||
Limits Resource `json:"Limits"`
|
Limits ResourceHack `json:"Limits"`
|
||||||
Reserved Resource `json:"Reserved"`
|
Reserved Resource `json:"Reserved"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -574,7 +574,7 @@ func resourceAccountSchemaMake() map[string]*schema.Schema {
|
|||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"disksize": {
|
"disksize": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeFloat,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"extips": {
|
"extips": {
|
||||||
@@ -630,7 +630,7 @@ func resourceAccountSchemaMake() map[string]*schema.Schema {
|
|||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"disksize": {
|
"disksize": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeFloat,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"extips": {
|
"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
|
type ResourceRecord struct { // this is how actual usage is reported by /api/.../rg/get
|
||||||
Cpu int `json:"cpu"`
|
Cpu int `json:"cpu"`
|
||||||
Disk int `json:"disksize"`
|
Disk float64 `json:"disksize"`
|
||||||
ExtIPs int `json:"extips"`
|
ExtIPs int `json:"extips"`
|
||||||
ExtTraffic int `json:"exttraffic"`
|
ExtTraffic int `json:"exttraffic"`
|
||||||
Gpu int `json:"gpu"`
|
Gpu int `json:"gpu"`
|
||||||
@@ -157,7 +157,7 @@ type ResourceSep struct {
|
|||||||
|
|
||||||
type Resource struct {
|
type Resource struct {
|
||||||
CPU int `json:"cpu"`
|
CPU int `json:"cpu"`
|
||||||
Disksize int `json:"disksize"`
|
Disksize float64 `json:"disksize"`
|
||||||
Extips int `json:"extips"`
|
Extips int `json:"extips"`
|
||||||
Exttraffic int `json:"exttraffic"`
|
Exttraffic int `json:"exttraffic"`
|
||||||
GPU int `json:"gpu"`
|
GPU int `json:"gpu"`
|
||||||
|
|||||||
Reference in New Issue
Block a user