200-901 · Question #272
Refer to the exhibit. An engineer writes a Python script that uses two different API calls to query Cisco DNA Center for the number of interfaces on a device. The engineer notices that the two API…
The correct answer is C. pagination. The get_all_interfaces API call returns fewer results because the API uses pagination, limiting the number of records returned in a single response.
Question
Refer to the exhibit. An engineer writes a Python script that uses two different API calls to query Cisco DNA Center for the number of interfaces on a device. The engineer notices that the two API calls produce different results. Why are fewer interfaces returned for the same device when the 'get_all_interfaces' API call is used?
Exhibit
Options
- Atimes out
- Brate limit
- Cpagination
- Dinvalid password
How the community answered
(24 responses)- A8% (2)
- B17% (4)
- C71% (17)
- D4% (1)
Why each option
The get_all_interfaces API call returns fewer results because the API uses pagination, limiting the number of records returned in a single response.
A timeout would cause the API call to fail with an exception or connection error, not silently return a smaller set of valid interface records.
Rate limiting throttles the frequency of API calls and returns an HTTP 429 error, but does not reduce the number of records within a single successful response.
Cisco DNA Center REST APIs implement pagination by returning a limited subset of results per call, controlled by parameters such as offset and limit. When a caller does not iterate through all pages or does not set the limit high enough, only the first page of results is returned, producing fewer interfaces than the total available on the device.
An invalid password would result in an HTTP 401 Unauthorized error, preventing any data from being returned at all.
Concept tested: Cisco DNA Center API pagination behavior
Source: https://developer.cisco.com/docs/dna-center/api/2-3-7/
Topics
Community Discussion
No community discussion yet for this question.
