Skip to main content
Solved

Regarding the pagination not working for v3 hosts endpoint of Prism Central

  • May 23, 2023
  • 1 reply
  • 207 views

For our development work, we are using /v3/hosts/list endpoint. As per the specs, we want to use length and offset for pagination to fetch large number of hosts. We tried using it as follows:

curl --location --request POST 'https://<host>:9440/api/nutanix/v3/hosts/list' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic abc' \
--data-raw '{
"kind": "host",
"length": 1,
"offset": 9
}'

However, length and offset params doesn’t seem to be working. It returns all the hosts (2 in our case) irrespective of the params passed.  

Also, we used the same params in /v3/vms/list and they are working as expected. 

So, wanted to know if this is expected or is this an open issue? Is there a way to get all the hosts through Prism Central (v3) APIs?  

Best answer by JoseNutanix

Pagination is not implemented for hosts. You’ll get all the hosts.

This topic has been closed for replies.

1 reply

JoseNutanix
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • Answer
  • May 27, 2023

Pagination is not implemented for hosts. You’ll get all the hosts.