nerdexam
Cisco

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.

Understanding and Using APIs

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

200-901 question #272 exhibit

Options

  • Atimes out
  • Brate limit
  • Cpagination
  • Dinvalid password

How the community answered

(24 responses)
  • A
    8% (2)
  • B
    17% (4)
  • C
    71% (17)
  • D
    4% (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.

Atimes out

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.

Brate limit

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.

CpaginationCorrect

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.

Dinvalid password

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

#API Pagination#REST API#Cisco DNA Center#Python Scripting

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice