nerdexam
Cisco

300-435 · Question #129

Drag and drop the code from the bottom onto the box where the code is missing to extract a list of devices located in Baltimore by using the Cisco Catalyst Center (formerly DNA Center) intent API…

This question tests your ability to construct a Python script using the Cisco Catalyst Center (DNA Center) Intent API to authenticate, query, and filter network devices by location (Baltimore). It assesses knowledge of the REST API endpoint structure, authentication flow, and…

Controller-Based Network Automation

Question

Drag and drop the code from the bottom onto the box where the code is missing to extract a list of devices located in Baltimore by using the Cisco Catalyst Center (formerly DNA Center) intent API. Not all options are used.

Explanation

This question tests your ability to construct a Python script using the Cisco Catalyst Center (DNA Center) Intent API to authenticate, query, and filter network devices by location (Baltimore). It assesses knowledge of the REST API endpoint structure, authentication flow, and query parameter filtering.

Approach. The correct approach involves two phases: (1) Authenticate by sending a POST request to '/dna/system/api/v1/auth/token' using Basic Auth credentials, then extracting the 'Token' value from the JSON response to use as 'X-Auth-Token' in subsequent calls. (2) Query the device inventory via a GET request to '/dna/intent/api/v1/network-device', passing 'location=Baltimore' (or the mapped site name) as a query parameter and including 'X-Auth-Token' in the headers. The response JSON contains a 'response' key holding the list of matching device objects. Code fragments that would be dragged in include the correct endpoint strings, the header dict with X-Auth-Token, the params dict with the location filter, and the key used to extract the device list from the response.

Concept tested. Cisco Catalyst Center (DNA Center) Intent API - REST authentication via token exchange and filtered device inventory retrieval using query parameters in Python

Reference. Cisco DNA Center Intent API Reference - GET /dna/intent/api/v1/network-device; Cisco DevNet Learning Labs: DNA Center REST API

Topics

#Cisco Catalyst Center API#Intent API#Device Inventory#API Filtering

Community Discussion

No community discussion yet for this question.

Full 300-435 Practice