nerdexam
Cisco

300-435 · Question #63

Which action allows for creating a Python script to pull inventory for Cisco SD-WAN Viptela devices using the Viptela library in the code?

The correct answer is B. from viptela.devices import Viptela. To use a Python script for retrieving inventory from Cisco SD-WAN Viptela devices, the Viptela class must be imported from the viptela.devices module.

Controller-Based Network Automation

Question

Which action allows for creating a Python script to pull inventory for Cisco SD-WAN Viptela devices using the Viptela library in the code?

Options

  • Afrom lib.lib_request import Viptela
  • Bfrom viptela.devices import Viptela
  • Cfrom viptela.viptela import Viptela
  • Dfrom viptela.library import Viptela

How the community answered

(35 responses)
  • A
    3% (1)
  • B
    91% (32)
  • C
    6% (2)

Why each option

To use a Python script for retrieving inventory from Cisco SD-WAN Viptela devices, the Viptela class must be imported from the viptela.devices module.

Afrom lib.lib_request import Viptela

from lib.lib_request import Viptela uses generic module names (lib, lib_request) that are not specific to the viptela package structure for SD-WAN device interaction.

Bfrom viptela.devices import ViptelaCorrect

The statement from viptela.devices import Viptela correctly imports the Viptela class or object from the devices submodule within the viptela package. This specific import path aligns with standard Python package structures for organizing code that interacts with specific device types or services, such as pulling inventory for Cisco SD-WAN Viptela devices.

Cfrom viptela.viptela import Viptela

from viptela.viptela import Viptela implies a redundant submodule name, which is less common in well-structured Python libraries compared to a more descriptive submodule like devices.

Dfrom viptela.library import Viptela

from viptela.library import Viptela uses a generic submodule name (library) that is less specific for device-related operations compared to a module explicitly named devices.

Concept tested: Python module import for Viptela API

Topics

#Python Libraries#SD-WAN Automation#Viptela API#Network Inventory

Community Discussion

No community discussion yet for this question.

Full 300-435 Practice