go-netbox
go-netbox copied to clipboard
Question about pagination
Hello,
I'm trying to use go-netbox v3.4.5-1 DCIM function DcimDevicesList (https://github.com/netbox-community/go-netbox/blob/v3.4.5-1/netbox/client/dcim/dcim_client.go#L4542). I obtain an object with the first 50 devices and would like to access the next page. What is the correct way to "navigate" through all pages ?
Thank you. Pierre-yves
Self answering me...
The solution is to use a DcimDevicesListParams object with an Offset parameter and loop on DcimDevicesList method.
This offset will start at 0 and will change based on the value of the Next attribute in the response payload returned by DcimDevicesList.
The ListParams functions and Offset parameters no longer exist in the recent codebase, what is the new solution?