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

  1. Obtain an authentication token to authorize your API call and assign it to the variable TOKEN.
Command
Copy
  1. Build your API call and determine the number of objects you'd like returned in each call from 1 to 5000.
  2. Apply the limit parameter to the URI as shown in the 'server list' example call below.
Command
Copy
  1. Determine 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.
Sample
Copy

Additional Information

OpenStack Development: API Guide - Paginated Collections

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard