nerdexam
Cisco

300-435 · Question #154

Refer to the exhibit. An engineer must complete a Python script that creates a Cisco Meraki network containing cameras and switches. The script must apply appropriate tags and print out a response if

This question tests knowledge of the Cisco Meraki Dashboard API for programmatically creating a network with specific product types and tags using Python. It requires understanding the correct API endpoint, payload structure, HTTP method, and response handling.

Controller-Based Network Automation

Question

Refer to the exhibit. An engineer must complete a Python script that creates a Cisco Meraki network containing cameras and switches. The script must apply appropriate tags and print out a response if the creation of the network is allowed. Drag and drop the code snippets from the bottom onto the boxes in the Python script to create the Meraki network. Not all options are used.

Explanation

This question tests knowledge of the Cisco Meraki Dashboard API for programmatically creating a network with specific product types and tags using Python. It requires understanding the correct API endpoint, payload structure, HTTP method, and response handling.

Approach. The correct approach uses a POST request to the Meraki Dashboard API endpoint /organizations/{organizationId}/networks with the X-Cisco-Meraki-API-Key header for authentication. The JSON payload must include productTypes: ["camera", "switch"] (exact lowercase strings) and a tags list - mixing up these strings or using plurals like 'cameras'/'switches' will cause the call to fail. The script should then check for HTTP status code 201 (Created) to confirm the network was successfully provisioned before printing the response - using 200 would be incorrect, as Meraki returns 201 on resource creation. Any snippet that checks response.status_code == 201 and calls print(response.json()) inside that block correctly satisfies the 'print if allowed' requirement.

Concept tested. Cisco Meraki Dashboard API - creating a network via POST /organizations/{orgId}/networks, with correct productTypes payload values ('camera', 'switch'), API key header authentication (X-Cisco-Meraki-API-Key), and proper HTTP 201 status code handling for resource creation responses.

Reference. Cisco Meraki Dashboard API Reference - Create Network: https://developer.cisco.com/meraki/api-v1/create-organization-network/

Topics

#Meraki API#Python Scripting#Network Automation#API Integration

Community Discussion

No community discussion yet for this question.

Full 300-435 Practice