4.5.0-alpha
This commit is contained in:
@@ -49,8 +49,8 @@ func dataSourceBasicServiceSnapshotListRead(ctx context.Context, d *schema.Resou
|
||||
|
||||
id := uuid.New()
|
||||
d.SetId(id.String())
|
||||
d.Set("items", flattenBasicServiceSnapshots(basicServiceSnapshotList))
|
||||
|
||||
d.Set("items", flattenBasicServiceSnapshotsList(basicServiceSnapshotList))
|
||||
d.Set("entry_count", basicServiceSnapshotList.EntryCount)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ func flattenBasicServiceComputes(bscs bservice.ListComputes) []map[string]interf
|
||||
}
|
||||
|
||||
func flattenBasicServiceSnapshots(bsrvss bservice.ListSnapshots) []map[string]interface{} {
|
||||
res := make([]map[string]interface{}, 0)
|
||||
res := make([]map[string]interface{}, 0, len(bsrvss))
|
||||
for _, bsrvs := range bsrvss {
|
||||
temp := map[string]interface{}{
|
||||
"guid": bsrvs.GUID,
|
||||
@@ -123,3 +123,17 @@ func flattenBasicServiceSnapshots(bsrvss bservice.ListSnapshots) []map[string]in
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func flattenBasicServiceSnapshotsList(bsrvss *bservice.ListInfoSnapshots) []map[string]interface{} {
|
||||
res := make([]map[string]interface{}, 0, len(bsrvss.Data))
|
||||
for _, bsrvs := range bsrvss.Data {
|
||||
temp := map[string]interface{}{
|
||||
"guid": bsrvs.GUID,
|
||||
"label": bsrvs.Label,
|
||||
"timestamp": bsrvs.Timestamp,
|
||||
"valid": bsrvs.Valid,
|
||||
}
|
||||
res = append(res, temp)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ import (
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
)
|
||||
|
||||
func utilityBasicServiceSnapshotListCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (bservice.ListSnapshots, error) {
|
||||
func utilityBasicServiceSnapshotListCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*bservice.ListInfoSnapshots, error) {
|
||||
c := m.(*controller.ControllerCfg)
|
||||
var id uint64
|
||||
|
||||
|
||||
Reference in New Issue
Block a user