This commit is contained in:
Nikita Sorokin
2023-10-13 13:28:19 +03:00
parent 28b60de115
commit 0602a4b693
104 changed files with 3804 additions and 301 deletions

View File

@@ -49,7 +49,7 @@ func dataSourceSnapshotListRead(ctx context.Context, d *schema.ResourceData, m i
id := uuid.New()
d.SetId(id.String())
d.Set("items", flattenSnapshotList(snapshotList))
d.Set("entry_count", snapshotList.EntryCount)
return nil
}
@@ -69,6 +69,10 @@ func dataSourceSnapshotListSchemaMake() map[string]*schema.Schema {
Schema: dataSourceSnapshotSchemaMake(),
},
},
"entry_count": {
Type: schema.TypeInt,
Computed: true,
},
}
return rets

View File

@@ -6,7 +6,7 @@ import (
)
func flattenSnapshotList(gl *compute.ListSnapShots) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
res := make([]map[string]interface{}, 0, len(gl.Data))
for _, item := range gl.Data {
temp := map[string]interface{}{
"label": item.Label,