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.
29 lines
724 B
29 lines
724 B
package snapshot
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/compute"
|
|
)
|
|
|
|
func flattenSnapshotList(gl compute.ListSnapShots) []map[string]interface{} {
|
|
res := make([]map[string]interface{}, 0)
|
|
for _, item := range gl {
|
|
temp := map[string]interface{}{
|
|
"label": item.Label,
|
|
"guid": item.GUID,
|
|
"disks": item.Disks,
|
|
"timestamp": item.Timestamp,
|
|
}
|
|
|
|
res = append(res, temp)
|
|
}
|
|
return res
|
|
}
|
|
|
|
func flattenSnapshot(d *schema.ResourceData, snapshot *compute.ItemSnapshot) {
|
|
d.Set("timestamp", snapshot.Timestamp)
|
|
d.Set("guid", snapshot.GUID)
|
|
d.Set("disks", snapshot.Disks)
|
|
d.Set("label", snapshot.Label)
|
|
}
|