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.
Question
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)- A3% (1)
- B91% (32)
- C6% (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.
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.
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.
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.
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
Community Discussion
No community discussion yet for this question.