4.10.1
This commit is contained in:
@@ -41,6 +41,7 @@ func flattenResgroup(d *schema.ResourceData, rgData *rg.RecordRG) {
|
||||
d.Set("vins", rgData.VINS)
|
||||
d.Set("computes", rgData.VMs)
|
||||
d.Set("sdn_access_group_id", rgData.SDNAccessGroupID)
|
||||
d.Set("storage_policy_ids", rgData.StoragePolicyIDs)
|
||||
}
|
||||
|
||||
func flattenRgAcl(rgACLs rg.ListACL) []map[string]interface{} {
|
||||
@@ -64,13 +65,14 @@ 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_dm": rl.CUDM,
|
||||
"cu_i": rl.CUI,
|
||||
"cu_m": rl.CUM,
|
||||
"cu_np": rl.CUNP,
|
||||
"gpu_units": rl.GPUUnits,
|
||||
"cu_c": rl.CUC,
|
||||
"cu_d": rl.CuD,
|
||||
"cu_dm": rl.CUDM,
|
||||
"cu_i": rl.CUI,
|
||||
"cu_m": rl.CUM,
|
||||
"cu_np": rl.CUNP,
|
||||
"gpu_units": rl.GPUUnits,
|
||||
"storage_policy": flattenRgStoragePolicy(rl.StoragePolicies),
|
||||
}
|
||||
res = append(res, temp)
|
||||
|
||||
@@ -413,6 +415,7 @@ func flattenRgList(rgl *rg.ListRG) []map[string]interface{} {
|
||||
"vins": rg.VINS,
|
||||
"vms": rg.VMs,
|
||||
"sdn_access_group_id": rg.SDNAccessGroupID,
|
||||
"storage_policy_ids": rg.StoragePolicyIDs,
|
||||
}
|
||||
res = append(res, temp)
|
||||
}
|
||||
@@ -475,6 +478,7 @@ func flattenResourceRG(d *schema.ResourceData, rgData *rg.RecordRG) {
|
||||
d.Set("gid", rgData.GID)
|
||||
d.Set("rg_name", rgData.Name)
|
||||
d.Set("resource_limits", flattenRgResourceLimits(rgData.ResourceLimits))
|
||||
d.Set("storage_policy", flattenRgStoragePolicy(rgData.ResourceLimits.StoragePolicies))
|
||||
d.Set("description", rgData.Description)
|
||||
d.Set("uniq_pools", rgData.UniqPools)
|
||||
d.Set("cpu_allocation_parameter", rgData.CPUAllocationParameter)
|
||||
@@ -498,4 +502,19 @@ func flattenResourceRG(d *schema.ResourceData, rgData *rg.RecordRG) {
|
||||
d.Set("vins", rgData.VINS)
|
||||
d.Set("vms", rgData.VMs)
|
||||
d.Set("sdn_access_group_id", rgData.SDNAccessGroupID)
|
||||
d.Set("storage_policy_ids", rgData.StoragePolicyIDs)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user