You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
811 B
33 lines
811 B
package grid
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/grid"
|
|
)
|
|
|
|
func flattenGrid(d *schema.ResourceData, grid *grid.RecordGrid) {
|
|
d.Set("name", grid.Name)
|
|
d.Set("flag", grid.Flag)
|
|
d.Set("gid", grid.GID)
|
|
d.Set("guid", grid.GUID)
|
|
d.Set("location_code", grid.LocationCode)
|
|
d.Set("id", grid.ID)
|
|
}
|
|
|
|
func flattenGridList(gl *grid.ListGrids) []map[string]interface{} {
|
|
res := make([]map[string]interface{}, 0)
|
|
for _, item := range gl.Data {
|
|
temp := map[string]interface{}{
|
|
"name": item.Name,
|
|
"flag": item.Flag,
|
|
"gid": item.GID,
|
|
"guid": item.GUID,
|
|
"location_code": item.LocationCode,
|
|
"id": item.ID,
|
|
}
|
|
|
|
res = append(res, temp)
|
|
}
|
|
return res
|
|
}
|