nerdexam
Cisco

200-901 · Question #400

Drag and Drop Question Refer to the exhibit. A script must output details of all the Cisco Meraki MS220-BP switches across all organizations and networks. Drag and drop the code snippets from the…

The correct answer is client.organizations.get_organizations():; client.networks.get_organization_networks(options); client.devices.get_network_devices(network ["id"]); client.devices.get_network_device(options=options). This drag-and-drop question assesses the test-taker's ability to correctly use the Cisco Meraki Python SDK documentation to programmatically traverse Meraki organizations, networks, and devices to find and retrieve details for specific device models.

Understanding and Using APIs

Question

Drag and Drop Question Refer to the exhibit. A script must output details of all the Cisco Meraki MS220-BP switches across all organizations and networks. Drag and drop the code snippets from the bottom onto the boxes in the code to complete the script. Not all options are used. Answer:

Exhibit

200-901 question #400 exhibit

Answer Area

Drag items

client.organizations.get_organizations():client.networks.get_organization_networks(api_key)client.networks.get_organization_networks(options)client.devices.get_network_devices(network ["id"])client.devices.get_network_device(options=options)client.devices.get_network_device(device ["model"])

Correct arrangement

  • client.organizations.get_organizations():
  • client.networks.get_organization_networks(options)
  • client.devices.get_network_devices(network ["id"])
  • client.devices.get_network_device(options=options)

Explanation

This drag-and-drop question assesses the test-taker's ability to correctly use the Cisco Meraki Python SDK documentation to programmatically traverse Meraki organizations, networks, and devices to find and retrieve details for specific device models.

Approach. The correct interaction involves dragging and dropping the appropriate code snippets into the four blanks in the Python script based on the SDK documentation and the logical flow of the script.

  1. First blank (for iterating organizations): The script needs to retrieve all organizations. The SDK documentation shows OrganizationController: get_organizations() takes no parameters. Therefore, client.organizations.get_organizations() is the correct snippet to drag here.
  2. Second blank (for getting networks within an organization): Inside the organization loop, options = {"organization id": org["id"]} is created. The SDK documentation states NetworksController: get_organization_networks(dict) is used for this purpose. Hence, client.networks.get_organization_networks(options) is the correct choice.
  3. Third blank (for getting devices within a network): Inside the network loop, the script needs to retrieve all devices for the current network. The SDK documentation lists DevicesController: get_network_devices(id). Assuming network["id"] provides the network identifier, client.devices.get_network_devices(network ["id"]) is the correct snippet.
  4. Fourth blank (for getting details of a specific device): After filtering for the 'MS220-8P' model, options = {"network id": network["id"], "serial": device["serial"]} is prepared. This dictionary uniquely identifies the device for detailed retrieval. While OrganizationController.get_network_device(dict) is listed in the documentation, client.devices.get_network_device(options=options) is a common and appropriate method call in the Meraki SDK for fetching specific device details using such options, and is provided as a drag-and-drop option.

Common mistakes.

  • common_mistake. Common mistakes include misinterpreting the SDK documentation, particularly regarding method names and expected parameter types. For example, using client.networks.get_organization_networks(api_key) is incorrect because get_organization_networks expects a dictionary (options) for organization filtering, not the API key. Another mistake would be attempting to retrieve a specific device's details using client.devices.get_network_device(device ["model"]). A device model (MS220-8P) is not a unique identifier; using it would either fail or return an incorrect result if multiple devices share the same model. Additionally, confusing methods that retrieve multiple items (e.g., get_network_devices plural) with those that retrieve a single item (e.g., get_network_device singular) or using methods from the wrong controller (e.g., trying to get organizations via client.devices) would lead to incorrect answers or runtime errors. The provided 'SDK Documentation' serves as the authoritative guide for method signatures.

Concept tested. Cisco Meraki SDK usage, API documentation interpretation, nested iteration for hierarchical data, parameter passing in SDK calls, and understanding of Meraki API resource structure (Organizations, Networks, Devices).

Topics

#Cisco Meraki API#API scripting#Data iteration#Conditional filtering

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice