QuestionQ282

Using APIs

Question Image

Question Image

Refer to the exhibits. An application has been developed to perform multiple API calls. The calls are performed on the infrastructure devices. Information-transfer delays occur when the application runs. What are two reasons for this issue?

Choose two
  • A The list devices API call is failing and does not return a result.
  • B The requests are being rate limited to prevent multiple calls causing the excessive load.
  • C One of the API calls takes roughly three times as long to complete.
  • D Listing devices takes longer than usual due to high network latency.
  • E The list devices API call is inefficient and should be refactored.
Explanation

The authentication call completes in 5 seconds, whereas the device-list operation takes 13.25 seconds, or roughly three times longer. The device-list API is called within a list comprehension, which repeats a full device-list retrieval for every iterated device rather than retrieving the list once; this is inefficient and should be refactored. Cisco’s API defines the device-list operation as returning the list of network devices, so repeated calls are unnecessary for obtaining that same list.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!