When designing an automation workflow that uses the Junos REST API for configuration management, which THREE practices ensure robust execution? (Choose three)
Using HTTPS prevents plaintext credential and configuration transmission.
307 questions total · 5pages · All types, answers revealed
When designing an automation workflow that uses the Junos REST API for configuration management, which THREE practices ensure robust execution? (Choose three)
Using HTTPS prevents plaintext credential and configuration transmission.
200 OK indicates successful GET or update execution.
Why this answer
200 OK and 204 No Content (or 201 Created) indicate successful API execution depending on the method.
When you issue a NETCONF <get-config> request for the running configuration, why might the request fail or return empty on certain Junos platforms?
Junos supports running datastore retrieval, but strict adherence to capability negotiation is required.
Why this answer
In standard NETCONF (RFC 6241), the running datastore must be supported, but Junos requires candidate configuration usage for edits; however, running is supported for reading. If it fails, it is often due to datastore capability support.
Which python module is part of the standard library that can be used to parse XML responses returned by NETCONF?
ElementTree is standard in Python for XML parsing.
Why this answer
Python's built-in xml.etree.ElementTree module provides tools for parsing and navigating XML data.
During a NETCONF session with a Junos device, an automation script issues an RPC to load a configuration. The device returns a response containing an <rpc-error> tag. What does this indicate?
Correct. <rpc-error> signals a failure in processing the request.
Why this answer
An <rpc-error> tag in NETCONF indicates that the request could not be processed successfully due to syntax, permission, or validation errors.
A network engineer is establishing a version control workflow for network configurations using Git. Which Git command should the engineer use to stage newly created configuration template files in the local repository working directory so they are included in the next commit?
git add stages new or modified files for the next commit.
Why this answer
The git add command stages changes in the working directory, moving them to the staging area (index) to prepare them for a commit.
When executing raw XML RPCs via PyEZ, which THREE approaches or parameters can be used to handle or inspect the response XML? (Choose two) -> Wait, let's make it THREE since the prompt requires HALF of multi-select to be 'Which THREE'. Let's verify prompt: 'HALF use 'Which TWO', HALF use 'Which THREE'.' Total multi-select = 6. 3 use TWO, 3 use THREE. Let's make this one THREE. Which THREE approaches...
Correct. Converting the XML element to string helps inspect raw output.
Why this answer
RPC responses can be converted, queried with XPath, or printed as strings.
An automation script reads a configuration template where boolean values are represented as 'yes' and 'no' in YAML. When parsed using PyYAML in Python, how are these values interpreted?
Correct. PyYAML automatically converts 'yes' and 'no' into native boolean types.
Why this answer
In YAML 1.1 (which PyYAML predominantly implements), unquoted words like 'yes', 'no', 'true', 'false', 'on', and 'off' are automatically parsed into native boolean values.
When serializing Python data structures to JSON for Junos automation payloads, which THREE parameters can be passed to json.dumps() to control formatting and readability? (Choose three)
Correct. separators allows customizing item and key-value token dividers (e.g., removing whitespace).
Why this answer
Parameters like indent, sort_keys, and separators are standard formatting arguments for json.dumps().
A network engineer is establishing a NETCONF session with a Junos device and needs to lock the candidate configuration to prevent concurrent modifications by other administrators. Which NETCONF operation should be executed?
This is the correct XML RPC structure to lock the candidate configuration datastore.
Why this answer
The <lock> operation allows a client to lock the configuration datastore of a device to prevent unauthorized or conflicting changes during a transaction.
Which TWO characteristics describe JSNAPy snapshot operations? (Choose two)
Correct. JSNAPy stores operational data snapshots.
Why this answer
JSNAPy captures snapshots to XML/YAML files and compares them over time.
Which TWO actions occur during the initial NETCONF session establishment phase between a client and a Junos device? (Choose two)
Capability negotiation via <hello> messages is a mandatory first step in NETCONF.
Why this answer
During session establishment, SSH authentication occurs first, followed by the exchange of <hello> messages containing capabilities.
When working with the PyEZ Config utility, which THREE actions can be performed using the configuration context manager or its methods? (Choose three)
Correct. Validating the candidate configuration checks for syntax errors.
Why this answer
The Config utility supports locking, loading configurations from various sources, validating, and rolling back.
Which THREE attributes are available within the <edit-config> operation element in NETCONF to specify the modification action on a target node? (Choose three)
'delete' removes the specified node and fails if it does not exist.
Why this answer
NETCONF edit-config operation attributes include merge, replace, create, delete, and remove.
An automation engineer needs to include comments explaining complex network parameters inside a Junos automation data file. Which serialization format should the engineer select?
Correct. YAML supports inline and block comments using the hash (#) symbol.
Why this answer
YAML natively supports comments using the hash (#) symbol, whereas standard JSON does not support comments.
Which TWO of the following methods or attributes are valid ways to handle rollback operations or commit errors when using the PyEZ Config utility (cu)?
cu.rollback() rolls back the candidate configuration to the specified rollback index.
Why this answer
cu.rollback() reverts the candidate configuration to a previous rollback index, and cu.commit(comment=...) allows committing changes with specific options. Options B and D are correct.
An operations team is applying DevOps principles to network automation on Junos devices. They want to ensure that all changes to device operational states and configurations are treated as disposable and repeatable. Which DevOps practice best describes rebuilding device configurations completely from centralized version-controlled templates rather than performing manual incremental hot-patches?
Declarative provisioning and immutable approaches replace manual hot-patches with clean, version-controlled configuration generation.
Why this answer
Infrastructure as Code (IaC) and immutable infrastructure treat configurations as reproducible artifacts generated from source control rather than mutable, long-lived states modified ad-hoc.
A DevOps engineer is designing a CI/CD pipeline for validating Junos configuration changes prior to deployment. Which THREE actions are typically performed during the automated CI pipeline 'test' or 'validate' stage? (Choose THREE)
Testing against virtual instances (vSRX) validates behavior against real Junos parsing logic.
Why this answer
CI validation stages typically run linting checks, static syntax validation against Junos schemas, and unit testing of templates or automation code before deployment staging.
Which statement correctly identifies the relationship between Junos REST API and NETCONF data models?
REST API and NETCONF share the same underlying Junos configuration and operational data models.
Why this answer
Both the Junos REST API and NETCONF interface with the same underlying Junos YANG data models and management infrastructure (MGD), providing different transport and encoding wrappers for the same capabilities.
Which THREE advantages are associated with using the Junos REST API over NETCONF in lightweight automation scripts? (Choose three)
HTTP-based REST traffic traverses web infrastructure and proxies easily.
You are writing a Python script to retrieve the operational state of interfaces from a Junos device using NETCONF. Which XML RPC element must be enclosed within the <rpc> tag to request operational data?
The <get> element allows retrieving running operational state and configuration data.
Why this answer
The <get> rpc tag is used to retrieve both configuration and operational data, whereas <get-config> is restricted to configuration data.
In Junos XML API, what is the XML namespace associated with Junos-specific RPCs and operational tags?
Juniper XML API RPCs utilize namespaces starting with http://xml.juniper.net/junos/.
Why this answer
Junos XML API elements use specific namespaces like http://xml.juniper.net/junos/12.1X46/junos-sw for software or general rpc namespaces.
You are writing a Python script using the PyEZ library to retrieve interface facts from a Juniper EX Series switch. The resulting data structure is stored in a Python dictionary. You need to dump this dictionary into a YAML file so it can be read by an Ansible playbook later. Which PyYAML function should you use to convert the Python dictionary into a YAML-formatted string or file stream?
yaml.dump() serializes a Python object structure into a YAML byte or string stream.
Why this answer
yaml.dump() is the standard PyYAML function used to serialize Python objects (such as dictionaries) into a YAML-formatted stream or string.
Correct. Queries configured for JSON return JSON-formatted payloads.
Which THREE actions can be performed using the Junos REST API operational endpoints? (Choose three)
Interface operational statistics are accessible via operational REST paths.
Why this answer
Operational endpoints in Junos REST API support retrieving system information, fetching interface operational counters, and executing custom RPCs.
When using Jinja2 templates in Python to generate configurations, how can you load a template file from disk prior to rendering it with variables?
Correct. Initializing Jinja2 Template with the read string of a file is a standard loading approach.
Why this answer
Environment and FileSystemLoader are used to load templates from a directory path.
When working with PyYAML in Python for Junos automation scripts, which THREE of the following practices enhance script security and robustness? (Choose three)
Correct. yaml.safe_load() mitigates security vulnerabilities by restricting deserialization.
Why this answer
Using safe loading methods, verifying file existence, and handling scanner errors properly are best practices when processing external YAML configurations.
When modifying a Junos device configuration using the PyEZ Config table-driven or Context manager (with Config(dev) as cu:), what is the default behavior regarding locking the candidate configuration?
Automatic locking is a core feature of the PyEZ Config context manager to ensure transactional safety.
Why this answer
When entering the Config context manager in PyEZ, it automatically locks the candidate configuration database to prevent concurrent edits and unlocks it upon exiting the context.
Which THREE principles are foundational to the DevOps movement when applied to network engineering? (Choose three)
Correct. Monitoring provides feedback on changes and health.
Why this answer
Foundational DevOps principles include automation, continuous feedback, culture/collaboration, and transparency.
A network engineer is exploring the core components of the Junos automation architecture. Which TWO components are native Junos daemons or automation frameworks directly involved in script execution or API processing? (Choose TWO)
jsd is responsible for running local automation scripts on Junos devices.
Why this answer
jsd (Junos Script Daemon) executes local SLAX and Python event scripts, and mgd (Management Daemon) processes XML/NETCONF/JSON-RPC automation requests.
An automation engineer is writing a Python script to push configurations to a Junos device. The script loads a YAML data file containing interface descriptions. One description contains a colon without a following space (e.g., 'Interface:Primary'). What error will PyYAML raise when attempting to parse this file?
Correct. Missing whitespace after a colon violates YAML mapping rules, resulting in a ScannerError.
Why this answer
In YAML, a colon must be followed by a whitespace character to be recognized as a mapping key-value separator. If no space follows, PyYAML raises a ScannerError or MappingValuesError.
Which Junos automation architecture component provides standardized, model-driven interfaces using NETCONF and gRPC/gNMI to manage and monitor Junos devices?
Correct. Junos XML API via NETCONF and RPCs provides structured data modeling.
Why this answer
Junos API and data modeling components like NETCONF and gRPC provide structured, programmatic access to the Junos control plane.
You are utilizing PyEZ Table and View abstractions to parse interface statistics. Which base class must your custom Table class inherit from to map to Junos XML output?
Table is the primary base class for structured operational data parsing in PyEZ.
Why this answer
To leverage PyEZ Table/View mapping for operational commands, your custom table class must inherit from 'jnpr.junos.factory.Table'.
An automation script needs to convert a JSON string containing Juniper interface statistics into a YAML format to maintain consistency with existing Ansible variable files. When performing this conversion, which structural capability does YAML support that standard JSON does not?
YAML supports inline comments using the '#' character, whereas JSON does not support comments.
Why this answer
YAML natively supports complex keys (such as using objects or tuples as keys) and comments, whereas standard JSON requires all keys to be strings and does not support comments.
Which THREE tasks are typical responsibilities of a network DevOps engineer managing a Junos infrastructure? (Choose three)
Correct. Scripting and templating are core tasks.
Why this answer
DevOps engineers write automation code, build CI/CD pipelines, and manage version control systems.
You want to run a JSNAPy verification test via Python code. Which Python class should you import and instantiate to execute the snapshot comparison programmatically?
Correct. SnapAdmin is the core Python class for JSNAPy operations.
Why this answer
The JSNAPy class is imported from jnpr.jsnapy to execute snapshot checks programmatically.
When loading configuration changes via PyEZ using cu.load(format='xml', action='update'), what is the precise impact of the 'update' action compared to 'merge' or 'override'?
The update action applies incremental updates matched by identifiers.
Why this answer
The 'update' action merges configuration elements based on matching keys or identifiers, allowing precise modification of existing hierarchical statements without replacing entire blocks.
In JSNAPy, what file format is used to define test cases and expected operational states?
Correct. JSNAPy configuration and test files are written in YAML format.
Why this answer
JSNAPy uses YAML configuration files for defining tests and expected values.
Which TWO of the following are valid primitive data types in JSON? (Choose two)
Correct. Strings are a fundamental primitive type in JSON.
Why this answer
JSON primitive types include strings, numbers, booleans, and null. Arrays and objects are composite types.
When comparing error handling between NETCONF and the Junos REST API, how are protocol-level errors communicated back to the client?
NETCONF relies on XML RPC error tags, while REST uses standard HTTP status codes and response bodies.
Which TWO tools or protocols can be used to interact with the Junos XML API besides NETCONF over SSH? (Choose two)
PyEZ uses NETCONF under the hood to execute XML API calls.
Which THREE error-tag values defined in NETCONF RFC 6241 may be returned by a Junos device when an edit-config operation fails validation? (Choose three)
'invalid-value' is returned when a configuration value is out of range or malformed.
Why this answer
RFC 6241 error-tags include invalid-value, missing-element, data-exists, and in-use.
Which TWO benefits does NETCONF provide over traditional screen-scraping CLI automation? (Choose two)
Structured XML responses avoid fragile regex scraping.
Why this answer
NETCONF provides structured XML/YANG data formats and reliable error handling compared to fragile CLI screen scraping.
Which TWO characteristics are true regarding the Junos REST API? (Choose two)
Junos REST API natively handles both JSON and XML representation formats.
An automation script makes a REST API request to modify a Junos configuration. To ensure that the changes are validated and committed in a single workflow step without leaving dangling candidate changes, how can the commit parameter be handled?
Commit query parameters or action flags instruct the REST API daemon to commit the candidate changes immediately.
Why this answer
The Junos REST API allows query parameters or header flags (such as '?action=commit' or dedicated commit instructions) to automatically commit changes made during a configuration modification request.
Which THREE error-type values are defined in the NETCONF protocol specification (RFC 6241) for categorizing <rpc-error> messages? (Choose three)
'rpc' is a valid NETCONF error-type for RPC envelope issues.
Why this answer
RFC 6241 defines transport, rpc, protocol, and application error types.
What is the primary delimiter used to separate key-value pairs in a JSON object?
Correct. Commas separate elements within JSON objects and arrays.
Why this answer
JSON object key-value pairs are separated by commas (,).
An automation developer is designing a tool that interacts with multiple network vendors, including Juniper Junos. They evaluate using Junos REST API versus NETCONF. Which workflow advantage does the REST API offer over NETCONF in web-centric application environments?
HTTP/HTTPS transport and native JSON make REST ideal for web-centric integration compared to SSH-based NETCONF.
A Python script processes a YAML configuration template for Junos BGP neighbors. The configuration contains a multi-line banner string description. Which YAML block scalar indicator preserves newlines exactly as written in the text block?
Correct. The literal style indicator (|) preserves newlines in multi-line strings.
Why this answer
In YAML, the pipe symbol (|) denotes a literal scalar style, which preserves newlines within multi-line strings.
What is the standard IETF RFC that defines the core NETCONF protocol architecture and operations?
RFC 6241 specifies the Network Configuration Protocol (NETCONF).
Why this answer
RFC 6241 is the definitive IETF standard defining the NETCONF Configuration Protocol.
Which THREE parameters can be included within a Junos NETCONF <commit> RPC request to customize commit behavior? (Choose three)
<confirm-timeout> specifies the rollback timeframe for confirmed commits.
Why this answer
Junos commit RPC options include comment, confirmed, and check (validate).
You are writing a Python automation script that processes configuration data. The script reads a YAML file containing Junos firewall filters, modifies them, and writes them back out. However, you notice that all the original comments in the file are stripped out in the output. What is the fundamental reason for this behavior in standard PyYAML dump operations?
Correct. Parsers drop comments since data structures only contain keys, values, and sequence items.
Why this answer
PyYAML parses YAML files into abstract syntax trees (AST) or Python native data structures, discarding comments during the parsing phase because comments are not part of the data model.
You are writing a script that uses PyEZ to load a partial configuration merge. By default, what configuration database mode does the Config utility lock and load into?
Correct. The standard target for PyEZ configuration loads is the candidate database.
Why this answer
By default, PyEZ loads configuration changes into the candidate configuration database.
When managing Junos configuration changes in a team environment, why is atomic configuration rollback capability crucial during automated deployments?
Correct. Atomicity guarantees all-or-nothing transaction execution.
Why this answer
Atomic rollbacks ensure that if a change set fails validation or causes a network fault, the system can revert cleanly to the previous working state without partial application.
An automation script attempts to load a configuration snippet using NETCONF <edit-config> with operation="delete" on a container statement. What happens if the specified container does not currently exist in the candidate configuration?
The 'delete' operation requires the target node to exist, otherwise it triggers an error.
Why this answer
The delete operation fails if the target node does not exist, whereas remove is silent if absent.
What is the purpose of the <hello> element exchanged immediately after establishing a NETCONF SSH session?
The <hello> element enables capability negotiation between client and server.
Why this answer
The <hello> element is used by both client and server to exchange supported capabilities and session parameters.
What is the primary function of a version control system (VCS) like Git in a Junos automation workflow?
Correct. VCS provides history tracking, collaboration, and a source of truth.
Why this answer
A VCS tracks changes over time, enabling collaboration, rollback, and audit trails.
Which THREE distinct operational states or configuration views can be queried using specific Junos XML API RPCs? (Choose three)
<get-system-information> queries device software, model, and uptime.
Why this answer
Junos XML API provides dedicated RPCs for system information, interface information, and chassis inventory.
In a CI/CD pipeline configured for Junos network changes, which THREE automated testing steps are typically performed before production deployment? (Choose three)
Correct. Linting catches formatting and syntax errors.
Why this answer
Pipelines typically include syntax validation, schema validation, and dry-run commit checks.
What type of brackets enclose an array in a JSON document?
Correct. Square brackets denote arrays in JSON.
Why this answer
Arrays in JSON are enclosed within square brackets ([ and ]).
When an automation script issues a POST request to create a new static route via the Junos REST API, what HTTP status code indicates that the resource was successfully created?
HTTP 201 Created is the standard response code for successfully creating a new resource via POST.
When writing a Python script that connects to multiple Junos devices concurrently using PyEZ, which Python module is commonly used to manage thread pooling and parallel execution?
Correct. concurrent.futures provides high-level APIs for executing tasks asynchronously using threads or processes.
Why this answer
Concurrent futures or threading modules handle parallel execution in Python.
An automation engineer is writing a Python script using Juniper PyEZ to connect to a Junos device. Which context manager approach is best practice to ensure the Device session is properly closed even if an exception occurs?
The context manager automatically opens the connection upon entry and safely closes it upon exit.
Why this answer
Using the 'with Device(host=...) as dev:' context manager guarantees that the open() and close() methods are handled automatically, even if runtime errors occur inside the block.
Which transport protocol is mandated by RFC 6241 as the standard secure connection mechanism for NETCONF when operating in typical Junos enterprise automation environments?
NETCONF over SSH (TCP port 830 by default) is the standard transport protocol.
Why this answer
RFC 6241 specifies NETCONF over Secure Shell (SSH) as the standard secure transport protocol.
HTTP DELETE maps to deleting configuration elements in the candidate datastore.
When writing a Python script using PyEZ, how should you handle connection timeout exceptions when attempting to connect to an unreachable Junos device?
Correct. ConnectError is raised by jnpr.junos.exception when a connection cannot be established.
Why this answer
PyEZ raises ConnectError when it fails to establish a NETCONF session with the target device.
Which Junos XML API output format option allows requesting the output as plain text instead of structured XML?
Adding format='text' to a Junos RPC requests CLI-like text output instead of XML.
Why this answer
Junos XML API allows requesting ASCII/text output format by appending the format='text' attribute to RPC requests.
In a Junos NETCONF automation workflow, what happens during a lock operation on the configuration database? (Choose two)
Correct. Locking prevents race conditions.
Why this answer
Locking a configuration database prevents other users or processes from making conflicting changes until unlocked.
You are writing a script that parses NETCONF responses from Junos. You encounter an element named <ok/> inside an <rpc-reply>. What does this indicate?
An <ok/> tag is returned for operations like commit or edit-config when successful.
Why this answer
The <ok/> tag indicates that the requested NETCONF operation executed successfully with no data to return.
Which TWO tools or platforms are commonly used for version control and hosting of Junos automation code repositories? (Choose two)
Correct. GitHub is a leading Git repository hosting platform.
Why this answer
Git is the standard version control system, hosted on platforms like GitHub or GitLab.
When using Jinja2 inheritance, which tag is placed in a base template to indicate where child templates can insert their custom content?
Correct. The block tag defines override points in Jinja2 template inheritance.
Why this answer
The block tag defines regions that child templates can override.
An automation engineer is writing a Python script to parse a Juniper Junos NETCONF reply received in XML format and needs to convert it into a native Python dictionary for internal processing. Which built-in library should the engineer use to convert the structured XML tree?
Correct. xml.etree.ElementTree provides functions to parse XML strings and files into hierarchical tree structures.
Why this answer
xml.etree.ElementTree is a standard Python library used for parsing and navigating XML data structures. While JSON and YAML are common serialization formats, NETCONF protocol responses natively return XML, which must be parsed before data manipulation.
An automation script attempts to unlock a candidate configuration datastore that was previously locked by a different NETCONF session. Which RPC is required to force-terminate that session and release the lock?
<kill-session> forcefully terminates the specified session ID and releases its locks.
Why this answer
The <kill-session> RPC allows terminating another active NETCONF session, which automatically releases any locks held by that session.
Which of the following describes the fundamental structural difference between JSON and YAML regarding syntax design?
Correct. JSON uses structural syntax tokens, while YAML uses indentation.
Why this answer
JSON relies explicitly on structural characters (curly braces, brackets, quotes, commas) to define hierarchies, whereas YAML primarily relies on indentation and whitespace.
Which TWO tasks are typically automated using Python and PyEZ in a network DevOps pipeline? (Choose two)
Correct. Pushing generated configs via PyEZ Config is standard practice.
Why this answer
PyEZ automates configuration deployments and operational data gathering.
Practice JNCIA-DevOps by domain
Target a specific domain to shore up weak areas.