Nova API Calls Limited to 5000 Results
Problem
API calls to the Nova API endpoint return a maximum of 5000 results by default.
Environment
Platform9 Managed OpenStack - All Versions
Nova
Cause
Responses are truncated at 5000 results due to the osapi_max_limit setting of 5000 which is in place to prevent the API server from becoming overwhelmed while attempting to serve a single call.
Resolution
Obtain an authentication token to authorize your API call and assign it to the variable TOKEN.
# TOKEN=$(openstack token issue -f value -c id)Build your API call and determine the number of objects you'd like returned in each call from 1 to 5000.
Apply the limit parameter to the URI as shown in the 'server list' example call below.
# curl -s -H "X-Auth-Token: $TOKEN" "https://[mgmtPlaneURL]/nova/v2.1/[tenantID]/servers?limit=1Determine the ID of the last object returned from the output or, if the endpoint supports next links, the proper URI for the subsequent API call will be provided in the output.
Additional Information
Last updated
