nerdexam
Cisco

300-435 · Question #149

Drag and Drop Question Drag and drop the code snippets from the bottom onto the boxes in the code to construct a Python script to use the Cisco Catalyst SD-WAN API to collect the state and uptime for

This question tests the ability to construct a Python script that authenticates to Cisco Catalyst SD-WAN's vManage REST API and queries the correct endpoint to retrieve control connection state and uptime data.

Controller-Based Network Automation

Question

Drag and Drop Question Drag and drop the code snippets from the bottom onto the boxes in the code to construct a Python script to use the Cisco Catalyst SD-WAN API to collect the state and uptime for the control connections. Not all options are used.

Explanation

This question tests the ability to construct a Python script that authenticates to Cisco Catalyst SD-WAN's vManage REST API and queries the correct endpoint to retrieve control connection state and uptime data.

Approach. The correct approach uses the requests library with a persistent Session() object to handle cookie-based authentication. The script must first POST credentials to the vManage login endpoint (/j_security_check with j_username and j_password form fields), then issue a GET request to /dataservice/device/control/connections (optionally with a deviceId query parameter). The JSON response contains a data array where each element includes state and uptime fields that are extracted by iterating over response.json()['data']. Using a session object is critical because it automatically persists the auth cookie across subsequent API calls.

Concept tested. Cisco Catalyst SD-WAN (vManage) REST API authentication and control-plane monitoring - specifically: session-based auth via POST to /j_security_check, querying /dataservice/device/control/connections, and parsing the JSON response for 'state' and 'uptime' fields.

Reference. Cisco SD-WAN API documentation - vManage REST API Guide, 'Device Control Connections' resource under /dataservice/device/control/

Topics

#Python Programming#Cisco SD-WAN API#API Interaction#Operational Data Collection

Community Discussion

No community discussion yet for this question.

Full 300-435 Practice