From 9709376d6ea0c2f43886994fbcbee448245b2f27 Mon Sep 17 00:00:00 2001 From: "N.S." Date: Tue, 3 Sep 2024 21:19:40 +0300 Subject: [PATCH] fix: use pagination for data source metal_devices (#768) The data source `metal_devices` fails to retrieve all hosts within a project. This PR uses `ExecuteWithPagination` to retrieve the full list of resources. --- equinix/data_source_metal_devices.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/equinix/data_source_metal_devices.go b/equinix/data_source_metal_devices.go index acdd0db74..476ef2e17 100644 --- a/equinix/data_source_metal_devices.go +++ b/equinix/data_source_metal_devices.go @@ -72,7 +72,7 @@ func getDevices(ctx context.Context, d *schema.ResourceData, meta interface{}, e if len(search) > 0 { query = query.Search(search) } - devices, _, err = query.Execute() + devices, err = query.ExecuteWithPagination() } if len(orgID) > 0 { @@ -81,7 +81,7 @@ func getDevices(ctx context.Context, d *schema.ResourceData, meta interface{}, e if len(search) > 0 { query = query.Search(search) } - devices, _, err = query.Execute() + devices, err = query.ExecuteWithPagination() } for _, d := range devices.Devices {