Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5e0a53364 | ||
|
|
9d1c8eeaa7 |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,8 +1,11 @@
|
|||||||
### Version 3.4.1
|
### Version 3.4.3
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
- Add the affinity_label field into the kvmvm resource
|
- Change field type disksize from int to float in:
|
||||||
- Add affinity_rules blocks into the kvmvm resource
|
- resource decort_resgroup
|
||||||
- Add anti-affinity_rules blocks into the kvmvm resource
|
- resource decort_account
|
||||||
- Update samples for the kvmvm resource
|
- 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,
|
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,10 +201,19 @@ 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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AccountRG struct {
|
type AccountRG struct {
|
||||||
|
|||||||
@@ -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": {
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ func dataSourceDiskSchemaMake() map[string]*schema.Schema {
|
|||||||
Description: "Size in GB",
|
Description: "Size in GB",
|
||||||
},
|
},
|
||||||
"size_used": {
|
"size_used": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeFloat,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Description: "Number of used space, in GB",
|
Description: "Number of used space, in GB",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ func dataSourceDiskListSchemaMake() map[string]*schema.Schema {
|
|||||||
Description: "Size in GB",
|
Description: "Size in GB",
|
||||||
},
|
},
|
||||||
"size_used": {
|
"size_used": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeFloat,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Description: "Number of used space, in GB",
|
Description: "Number of used space, in GB",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ func dataSourceDiskListUnattachedSchemaMake() map[string]*schema.Schema {
|
|||||||
Description: "Size in GB",
|
Description: "Size in GB",
|
||||||
},
|
},
|
||||||
"size_used": {
|
"size_used": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeFloat,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Description: "Number of used space, in GB",
|
Description: "Number of used space, in GB",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ type Disk struct {
|
|||||||
Shareable bool `json:"shareable"`
|
Shareable bool `json:"shareable"`
|
||||||
SepID int `json:"sepId"` // NOTE: absent from compute/get output
|
SepID int `json:"sepId"` // NOTE: absent from compute/get output
|
||||||
SizeMax int `json:"sizeMax"`
|
SizeMax int `json:"sizeMax"`
|
||||||
SizeUsed int `json:"sizeUsed"` // sum over all snapshots of this disk to report total consumed space
|
SizeUsed float64 `json:"sizeUsed"` // sum over all snapshots of this disk to report total consumed space
|
||||||
Snapshots []Snapshot `json:"snapshots"`
|
Snapshots []Snapshot `json:"snapshots"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
TechStatus string `json:"techStatus"`
|
TechStatus string `json:"techStatus"`
|
||||||
@@ -165,7 +165,7 @@ type Unattached struct {
|
|||||||
Role string `json:"role"`
|
Role string `json:"role"`
|
||||||
SepID int `json:"sepId"`
|
SepID int `json:"sepId"`
|
||||||
SizeMax int `json:"sizeMax"`
|
SizeMax int `json:"sizeMax"`
|
||||||
SizeUsed int `json:"sizeUsed"`
|
SizeUsed float64 `json:"sizeUsed"`
|
||||||
Snapshots []Snapshot `json:"snapshots"`
|
Snapshots []Snapshot `json:"snapshots"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
TechStatus string `json:"techStatus"`
|
TechStatus string `json:"techStatus"`
|
||||||
|
|||||||
@@ -661,7 +661,7 @@ func resourceDiskSchemaMake() map[string]*schema.Schema {
|
|||||||
Description: "Type SEP. Defines the type of storage system and contains one of the values set in the cloud platform",
|
Description: "Type SEP. Defines the type of storage system and contains one of the values set in the cloud platform",
|
||||||
},
|
},
|
||||||
"size_used": {
|
"size_used": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeFloat,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Description: "Number of used space, in GB",
|
Description: "Number of used space, in GB",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ func DataSourceCompute() *schema.Resource {
|
|||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"size_used": {
|
"size_used": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeFloat,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"pool": {
|
"pool": {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ type DiskRecord struct {
|
|||||||
SepID int `json:"sepId"` // NOTE: absent from compute/get output
|
SepID int `json:"sepId"` // NOTE: absent from compute/get output
|
||||||
Shareable bool `json:"shareable"`
|
Shareable bool `json:"shareable"`
|
||||||
SizeMax int `json:"sizeMax"`
|
SizeMax int `json:"sizeMax"`
|
||||||
SizeUsed int `json:"sizeUsed"` // sum over all snapshots of this disk to report total consumed space
|
SizeUsed float64 `json:"sizeUsed"` // sum over all snapshots of this disk to report total consumed space
|
||||||
Snapshots []SnapshotRecord `json:"snapshots"`
|
Snapshots []SnapshotRecord `json:"snapshots"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
TechStatus string `json:"techStatus"`
|
TechStatus string `json:"techStatus"`
|
||||||
|
|||||||
@@ -1005,7 +1005,7 @@ func ResourceComputeSchemaMake() map[string]*schema.Schema {
|
|||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"size_used": {
|
"size_used": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeFloat,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"pool": {
|
"pool": {
|
||||||
|
|||||||
@@ -137,12 +137,12 @@ 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"`
|
||||||
Ram int `json:"ram"`
|
Ram int `json:"ram"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UsageRecord struct {
|
type UsageRecord struct {
|
||||||
@@ -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"`
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ func dataSourceDiskSchemaMake() map[string]*schema.Schema {
|
|||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"size_used": {
|
"size_used": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeFloat,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"snapshots": {
|
"snapshots": {
|
||||||
|
|||||||
@@ -399,7 +399,7 @@ func dataSourceDiskListSchemaMake() map[string]*schema.Schema {
|
|||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"size_used": {
|
"size_used": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeFloat,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"snapshots": {
|
"snapshots": {
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ type Disk struct {
|
|||||||
SepType string `json:"sepType"`
|
SepType string `json:"sepType"`
|
||||||
SepID int `json:"sepId"` // NOTE: absent from compute/get output
|
SepID int `json:"sepId"` // NOTE: absent from compute/get output
|
||||||
SizeMax int `json:"sizeMax"`
|
SizeMax int `json:"sizeMax"`
|
||||||
SizeUsed int `json:"sizeUsed"` // sum over all snapshots of this disk to report total consumed space
|
SizeUsed float64 `json:"sizeUsed"` // sum over all snapshots of this disk to report total consumed space
|
||||||
Snapshots []Snapshot `json:"snapshots"`
|
Snapshots []Snapshot `json:"snapshots"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
TechStatus string `json:"techStatus"`
|
TechStatus string `json:"techStatus"`
|
||||||
|
|||||||
@@ -548,7 +548,7 @@ func resourceDiskSchemaMake() map[string]*schema.Schema {
|
|||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"size_used": {
|
"size_used": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeFloat,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"snapshots": {
|
"snapshots": {
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ type DiskRecord struct {
|
|||||||
SepType string `json:"sepType"`
|
SepType string `json:"sepType"`
|
||||||
SepID int `json:"sepId"` // NOTE: absent from compute/get output
|
SepID int `json:"sepId"` // NOTE: absent from compute/get output
|
||||||
SizeMax int `json:"sizeMax"`
|
SizeMax int `json:"sizeMax"`
|
||||||
SizeUsed int `json:"sizeUsed"` // sum over all snapshots of this disk to report total consumed space
|
SizeUsed float64 `json:"sizeUsed"` // sum over all snapshots of this disk to report total consumed space
|
||||||
Snapshots []SnapshotRecord `json:"snapshots"`
|
Snapshots []SnapshotRecord `json:"snapshots"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
TechStatus string `json:"techStatus"`
|
TechStatus string `json:"techStatus"`
|
||||||
|
|||||||
Reference in New Issue
Block a user