Regarding the pagination not working for v3 hosts endpoint of Prism Central | Nutanix Community
Skip to main content

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?  

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