JN0-224 practice question 14 of 15

What are two Junos PyEZ configuration object methods? (Choose two.)

Full set: 66 questions
Answer options
A: commie () Correct answer
B: device ()
C: lockO Correct answer
D: config ()
Correct Answer:
A. commie (); C. lockO
Explanation

The Junos PyEZ library provides a Config utility object, typically accessed via the config property of a Device instance (e.g., dev.config). This utility simplifies managing device configurations. The standard workflow for making configuration changes mirrors the Junos CLI process: lock the candidate configuration, load changes, commit the changes, and unlock. The lock() method is used to gain an exclusive lock on the candidate configuration database, preventing other users from making changes. The commit() method is used to check and activate the changes from the candidate configuration into the active running configuration.

Why Incorrect

B. device () Device is the primary class used to establish a connection to a Junos device, not a method of the configuration object.
D. config () config is the property of a Device object that returns the Config utility instance; it is not a method called on the Config object itself.

References

1. Juniper Networks TechLibrary, Junos PyEZ Developer Guide, "Using the Configuration Utilities": This document outlines the standard procedure for modifying the configuration using Junos PyEZ. It explicitly states, "To modify the configuration, you must first lock the configuration database... After you load and commit the configuration, you must unlock the database." It provides code examples showing the use of cu.lock() and cu.commit(), where cu is an instance of the Config utility. (Source: Junos PyEZ Developer Guide, Chapter: "Managing the Configuration").

2. Juniper Networks, Junos PyEZ API Reference, junos.utils.config.Config: The official API documentation for the Config class lists its available methods. The list includes lock(timeout=30) and commit(comment=None, timeout=300, detail=False, kwargs), confirming these are valid methods of the configuration object. The methods device() and config() are not listed as part of this class. (Source: Junos PyEZ API Reference, Module: junos.utils.config, Class: Config).

Scroll to Top