4.5.0-alpha

This commit is contained in:
Nikita Sorokin
2023-11-07 18:26:09 +03:00
parent 2453a32d01
commit 2bc0fbae9a
198 changed files with 18877 additions and 4003 deletions

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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