nerdexam
Cisco

350-901 · Question #20

Drag and Drop Question Refer to the exhibit. The Python script is supposed to make an API call to Cisco DNA Center querying a wireless profile for the "Chicagocampus" and then parsing out its enable…

This question tests the ability to construct a Python script that authenticates with Cisco DNA Center's REST API using token-based auth and then parses a nested JSON response to extract the 'enableFlexConnect' value for a specific wireless profile named 'Chicagocampus'.

Network Automation

Question

Drag and Drop Question Refer to the exhibit. The Python script is supposed to make an API call to Cisco DNA Center querying a wireless profile for the "Chicagocampus" and then parsing out its enable FlexConnect value. Drag and drop the parts of the Python code from the left onto the item numbers in the right that match the missing sections in the exhibit.

Explanation

This question tests the ability to construct a Python script that authenticates with Cisco DNA Center's REST API using token-based auth and then parses a nested JSON response to extract the 'enableFlexConnect' value for a specific wireless profile named 'Chicagocampus'.

Approach. The correct approach follows a two-phase API interaction pattern specific to Cisco DNA Center. Phase 1: Authenticate by sending an HTTP POST to '/dna/system/api/v1/auth/token' using Basic Auth (username/password), then extract the 'Token' key from the JSON response. Phase 2: Use that token as the value of the 'X-Auth-Token' request header when calling the wireless profile endpoint (GET '/dna/intent/api/v1/wireless/profile'). The response is a list of profile objects, so you must iterate through them, match on profileDetails.name == 'Chicagocampus', then drill into profileDetails.ssidDetails[] to read each entry's 'enableFlexConnect' boolean. The missing code blocks in the exhibit almost certainly correspond to these pieces: the auth POST call, token extraction (response.json()['Token']), the X-Auth-Token header assignment, the GET call to the wireless profile endpoint, the profile name filter, and the enableFlexConnect key reference.

Concept tested. Cisco DNA Center REST API authentication flow (token acquisition via POST + X-Auth-Token header), correct API endpoint selection for wireless profiles (/dna/intent/api/v1/wireless/profile), and nested JSON response traversal to filter by profile name and extract a specific field (enableFlexConnect).

Reference. Cisco DNA Center Platform API documentation - Wireless Profile APIs; Cisco DevNet Learning Lab: 'DNA Center REST API Introduction'; ENAUTO exam topic: Construct a Python script using the Cisco DNA Center API.

Topics

#Python Scripting#REST API#Cisco DNA Center#JSON Parsing

Community Discussion

No community discussion yet for this question.

Full 350-901 Practice