4.10.1
This commit is contained in:
@@ -94,6 +94,7 @@ func flattenResgroup(d *schema.ResourceData, details rg.RecordResourceGroup) err
|
||||
d.Set("account_name", details.AccountName)
|
||||
d.Set("acl", flattenRgAcl(details.ACL))
|
||||
d.Set("compute_features", details.ComputeFeatures)
|
||||
d.Set("storage_policy", flattenRgStoragePolicy(details.ResourceLimits.StoragePolicies))
|
||||
d.Set("vms", details.Computes)
|
||||
d.Set("created_by", details.CreatedBy)
|
||||
d.Set("created_time", details.CreatedTime)
|
||||
@@ -116,6 +117,8 @@ func flattenResgroup(d *schema.ResourceData, details rg.RecordResourceGroup) err
|
||||
d.Set("cpu_allocation_parameter", details.CPUAllocationParameter)
|
||||
d.Set("cpu_allocation_ratio", details.CPUAllocationRatio)
|
||||
d.Set("sdn_access_group_id", details.SDNAccessGroupID)
|
||||
d.Set("resource_limits", flattenRgResourceLimits(details.ResourceLimits))
|
||||
d.Set("storage_policy_ids", details.StoragePolicyIDs)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -204,6 +207,7 @@ func flattenRg(d *schema.ResourceData, itemRg rg.RecordResourceGroup) {
|
||||
d.Set("cpu_allocation_parameter", itemRg.CPUAllocationParameter)
|
||||
d.Set("cpu_allocation_ratio", itemRg.CPUAllocationRatio)
|
||||
d.Set("sdn_access_group_id", itemRg.SDNAccessGroupID)
|
||||
d.Set("storage_policy_ids", itemRg.StoragePolicyIDs)
|
||||
}
|
||||
|
||||
func flattenRgAudits(rgAudits rg.ListAudits) []map[string]interface{} {
|
||||
@@ -257,6 +261,7 @@ func flattenRgList(rgl *rg.ListResourceGroups) []map[string]interface{} {
|
||||
"cpu_allocation_parameter": rg.CPUAllocationParameter,
|
||||
"cpu_allocation_ratio": rg.CPUAllocationRatio,
|
||||
"sdn_access_group_id": rg.SDNAccessGroupID,
|
||||
"storage_policy_ids": rg.StoragePolicyIDs,
|
||||
}
|
||||
res = append(res, temp)
|
||||
}
|
||||
@@ -282,19 +287,34 @@ func flattenRgAcl(rgAcls rg.ListACL) []map[string]interface{} {
|
||||
func flattenRgResourceLimits(rl rg.ResourceLimits) []map[string]interface{} {
|
||||
res := make([]map[string]interface{}, 0)
|
||||
temp := map[string]interface{}{
|
||||
"cu_c": rl.CUC,
|
||||
"cu_d": rl.CUD,
|
||||
"cu_i": rl.CUI,
|
||||
"cu_m": rl.CUM,
|
||||
"cu_dm": rl.CUDM,
|
||||
"cu_np": rl.CUNP,
|
||||
"gpu_units": rl.GPUUnits,
|
||||
"cu_c": rl.CUC,
|
||||
"cu_d": rl.CUD,
|
||||
"cu_i": rl.CUI,
|
||||
"cu_m": rl.CUM,
|
||||
"cu_dm": rl.CUDM,
|
||||
"cu_np": rl.CUNP,
|
||||
"gpu_units": rl.GPUUnits,
|
||||
"storage_policy": flattenRgStoragePolicy(rl.StoragePolicies),
|
||||
}
|
||||
res = append(res, temp)
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
func flattenRgStoragePolicy(spList []rg.StoragePolicy) []map[string]interface{} {
|
||||
res := make([]map[string]interface{}, 0, len(spList))
|
||||
for _, sp := range spList {
|
||||
temp := map[string]interface{}{
|
||||
"id": sp.ID,
|
||||
"limit": sp.Limit,
|
||||
}
|
||||
|
||||
res = append(res, temp)
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
func flattenRules(list rg.ListRules) []map[string]interface{} {
|
||||
res := make([]map[string]interface{}, 0, len(list))
|
||||
for _, rule := range list {
|
||||
|
||||
Reference in New Issue
Block a user