Solved

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

  • 23 May 2023
  • 1 reply
  • 54 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?  

icon

Best answer by JoseNutanix 27 May 2023, 12:08

View original

This topic has been closed for comments

1 reply

Userlevel 4
Badge +5

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