Courseiva

Juniper Networks Automation and DevOps, Associate (JNCIA-DevOps, JN0-224) (JNCIA-DevOps) (JNCIA-DevOps) — Questions 151–225

273 questions total · 4 pages · All types, answers revealed

Page 2

Page 3 of 4

Page 4
151
Multi-Selectmedium

Which THREE tasks are typical responsibilities of a network DevOps engineer managing a Junos infrastructure? (Choose three)

Select 3 answers
A.Manually crimping CAT6 Ethernet cables in the wiring closet
B.Writing and maintaining Python automation scripts and Jinja2 templates
C.Managing Git repositories, branch policies, and pull request workflows
D.Configuring and maintaining CI/CD pipeline tools (e.g., GitLab CI, GitHub Actions)
E.Manually rebooting every switch in the data center daily
AnswersB, C, D

Python scripts and Jinja2 templates directly satisfy the automation requirement in the stem: Jinja2 renders device-specific configuration from structured data, while Python drives Junos PyEZ or REST API calls to push it. This replaces manual CLI configuration across the Junos estate, which is the core network DevOps responsibility described.

Why this answer

Option B is correct because a network DevOps engineer on Junos infrastructure typically writes Python automation scripts using libraries such as PyEZ and ncclient, and generates configuration from Jinja2 templates to push via NETCONF or Junos CLI, which is core to infrastructure-as-code. Option C is correct because managing Git repositories, branch policies, and pull request workflows is essential for version-controlling Junos configurations and enabling peer review and rollback. Option D is correct because configuring and maintaining CI/CD pipeline tools like GitLab CI or GitHub Actions automates validation, testing, and deployment of Junos configuration changes.

Option A is not a DevOps responsibility since crimping CAT6 cables is a physical layer cabling task performed by cabling technicians, not automation engineers. Option E is not a DevOps responsibility because manually rebooting every switch daily is an operational anti-pattern that automation and proper monitoring would replace.

152
MCQhard

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?

A.from jnpr.jsnapy.verify import VerifyEngine
B.from jnpr.junos.utils.jsnapy import JSNAPy
C.from jnpr.jsnapy.runner import JSNAPyRunner
D.from jnpr.jsnapy import SnapAdmin
AnswerD

SnapAdmin is the JSNAPy class that programmatically runs snapshot comparisons, exposing methods to generate snapshots and check them against stored references. Importing it from jnpr.jsnapy satisfies the stem's requirement to execute verification tests via Python code.

Why this answer

The SnapAdmin class from the jnpr.jsnapy module is the main entry point for programmatically running JSNAPy operations, including taking snapshots and comparing them. You import it with 'from jnpr.jsnapy import SnapAdmin' and instantiate it to call methods like snap() and check(). This is the documented Python API for JSNAPy.

Exam trap

JNCIA-DevOps often tests the exact import path and class name for JSNAPy; candidates confuse the CLI runner with the Python API and pick a non-existent class like JSNAPyRunner or VerifyEngine.

How to eliminate wrong answers

Option A is wrong because jnpr.jsnapy.verify does not contain a VerifyEngine class; the verification logic is handled through SnapAdmin. Option B is wrong because jnpr.junos.utils.jsnapy is not the correct module path for the JSNAPy Python API; JSNAPy is a separate package from PyEZ. Option C is wrong because jnpr.jsnapy.runner does not expose a JSNAPyRunner class for programmatic use; the runner is an internal component invoked by the CLI.

153
MCQeasy

In JSNAPy, what file format is used to define test cases and expected operational states?

A.INI
B.YAML
C.XML
D.JSON
AnswerB

JSNAPy test cases and expected operational states are defined in YAML files, which its parser reads to build assertions. This satisfies the stem's constraint by using YAML's structured key-value syntax rather than JSON or XML for test definitions.

Why this answer

JSNAPy uses YAML configuration files for defining tests and expected values.

154
Multi-Selecteasy

Which TWO of the following are valid primitive data types in JSON? (Choose two)

Select 2 answers
A.String
B.Function
C.Boolean
D.Undefined
E.Symbol
AnswersA, C

Correct. Strings are a fundamental primitive type in JSON.

Why this answer

Option A (String) is correct because JSON defines string as one of its six primitive data types, representing a sequence of Unicode characters enclosed in double quotes. Option C (Boolean) is correct because JSON natively supports the boolean primitive values true and false. The other options do not belong: Function, Undefined, and Symbol are JavaScript-specific types that are not part of the JSON specification and cannot be represented in JSON text.

155
MCQhard

An automation engineer is building a Python script that generates Junos configuration snippets from a JSON payload. The payload contains nested objects representing interfaces, units, and addresses. The engineer uses json.loads and then accesses data['interfaces']['ge-0/0/0']['unit'][0]['family']['inet']['address'][0]['name']. Which JSON structural feature makes this nested access pattern possible?

A.JSON objects map to Python dictionaries, and JSON arrays map to Python lists, allowing mixed nesting.
B.JSON supports XPath expressions natively for navigating nested structures.
C.JSON arrays map to Python sets, enabling fast membership tests during traversal.
D.JSON objects map to Python tuples, which preserve order and allow positional access.
AnswerA

JSON objects are unordered collections of key-value pairs that Python's json module maps to dict, while JSON arrays map to list. Because both can contain each other recursively, deeply nested structures like interfaces containing units containing families are naturally represented. This direct mapping is why the chained bracket and index access pattern works without any custom parsing logic.

Why this answer

The json module maps JSON objects to Python dict and JSON arrays to list. Since dicts and lists can contain each other to arbitrary depth, complex Junos configuration hierarchies can be represented and traversed with chained key lookups and integer indices. This direct structural correspondence is what makes the long access expression valid without any additional query language.

Exam trap

The trap here is confusing JSON with XML and assuming a query language like XPath is built in, when actually JSON nesting is handled through native dict and list structures.

156
MCQhard

When comparing error handling between NETCONF and the Junos REST API, how are protocol-level errors communicated back to the client?

A.NETCONF embeds error details inside XML <rpc-error> tags, whereas REST API uses standard HTTP status codes accompanied by structured error response bodies.
B.NETCONF uses HTTP status codes, while REST API uses XML <rpc-error> tags.
C.NETCONF and REST API both use identical JSON error envelopes defined by RFC 7807.
D.Both protocols rely exclusively on system syslog files to report errors to the client API.
AnswerA

NETCONF returns faults as structured XML rpc-error elements carrying error-type, tag and severity inside the RPC reply. The Junos REST API instead signals failure through HTTP status codes with a JSON error body, so the two differ in both transport and payload.

Why this answer

NETCONF communicates errors via XML <rpc-error> elements embedded in the response envelope. The Junos REST API leverages standard HTTP status codes (such as 400 Bad Request, 401, 403, 404, 500) combined with detailed error payloads in the response body.

157
MCQmedium

An automation engineer is using the Junos XML API to retrieve operational data from a device. The engineer wants to ensure that the response is well-formed XML and includes the Junos namespace so that it can be parsed correctly. Which XML namespace should the engineer expect in the response for Junos-specific operational tags?

A.urn:ietf:params:xml:ns:netconf:base:1.0
B.http://www.w3.org/2001/XMLSchema-instance
C.http://xml.juniper.net/xnm/1.1/xnm
D.http://www.w3.org/2001/XMLSchema
AnswerC

Junos-specific operational tags and RPCs are defined in the namespace 'http://xml.juniper.net/xnm/1.1/xnm'. When parsing responses, the engineer must account for this namespace to correctly interpret the XML elements. This is the standard namespace used by Junos for its XML API, ensuring proper identification of Junos-specific data.

Why this answer

Junos-specific operational tags are encapsulated in the namespace 'http://xml.juniper.net/xnm/1.1/xnm'. When parsing XML responses from a Junos device, automation scripts must handle this namespace to correctly extract data. Other namespaces listed are for NETCONF base protocol or XML Schema, which are not used for Junos operational elements.

Exam trap

The trap here is confusing the NETCONF base namespace with the Junos-specific namespace; the base namespace applies to protocol operations, not Junos operational data.

158
MCQeasy

You are writing a PyEZ script to retrieve the configured hostname from a Junos device. You want to use the simplest method that returns the hostname as a string without parsing XML manually. Which PyEZ feature should you use?

A.Instantiate a `Table` and `View` for the system configuration and extract the hostname field.
B.Access `dev.facts['hostname']` after opening the device connection.
C.Use `dev.rpc.get_software_information()` and extract the hostname from the response.
D.Call `dev.rpc.get_config()` and parse the XML response for the hostname element.
AnswerB

PyEZ automatically gathers a set of basic facts when the device connection is opened, including the hostname. Accessing `dev.facts['hostname']` returns the configured hostname as a string without any manual XML parsing. This is the simplest and most efficient method for this specific requirement.

Why this answer

PyEZ automatically populates a dictionary of facts when the device connection is established. The `dev.facts` dictionary includes common values such as `hostname`, `model`, `version`, and `serialnumber`. Accessing `dev.facts['hostname']` is the simplest and most direct way to obtain the configured hostname as a string, avoiding manual XML parsing or additional RPC calls.

Exam trap

The trap here is overlooking the built-in facts and instead opting for manual RPC calls or custom Table/View definitions, which are unnecessary for basic information.

159
MCQmedium

You are writing a Python script that uses PyEZ to connect to a Junos device. After calling `dev.open()`, you need to verify that the NETCONF session is active before performing operational commands. Which statement correctly checks the connection status and returns a Boolean value?

A.`dev.connected`
B.`dev.is_open()`
C.`dev.status()`
D.`dev.session`
AnswerA

The `connected` property returns `True` if the NETCONF session is currently established, and `False` otherwise. It is a read-only Boolean attribute available on the Device object. Checking this property after `open()` ensures the session is active before sending RPCs, preventing errors from operations on a closed or failed connection.

Why this answer

The `connected` property is a read-only Boolean that reflects whether the NETCONF session is currently open. After calling `open()`, checking `dev.connected` confirms the session is active before sending operational commands. Other options are not valid PyEZ attributes or methods for this check.

Exam trap

The trap here is confusing the `connected` property with a method like `is_open()` or `status()`, which do not exist in the PyEZ API.

160
Multi-Selecthard

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)

Select 3 answers
A.syntax-timeout
B.invalid-value
C.data-exists
D.buffer-overflow
E.missing-element
AnswersB, C, E

`invalid-value` is defined in RFC 6241 as an error-tag returned when a configuration element's content fails validation, such as a value outside its permitted range or an unsupported type. Junos raises it during `edit-config` when the candidate configuration fails syntax or semantic validation, directly satisfying the stem's validation-failure constraint.

Why this answer

Option B, invalid-value, is correct because RFC 6241 defines this error-tag for when a configuration value is syntactically or semantically invalid, which is exactly what a Junos device reports when edit-config content fails validation checks such as range or type constraints. Option C, data-exists, is correct because it is the standard NETCONF error-tag returned when a create operation targets data that already exists, a common validation failure during edit-config processing. Option E, missing-element, is correct because RFC 6241 specifies this tag for when a required element is absent from the configuration being edited, another typical validation error.

Option A, syntax-timeout, is not a defined NETCONF error-tag in RFC 6241, and option D, buffer-overflow, is likewise not part of the RFC 6241 error-tag enumeration, so neither belongs.

161
Multi-Selecteasy

Which TWO benefits does NETCONF provide over traditional screen-scraping CLI automation? (Choose two)

Select 2 answers
A.Structured data representation (XML) that eliminates the need for complex regular expression parsing.
B.Automatic generation of physical fiber cabling diagrams.
C.Elimination of any need for authentication credentials.
D.Formal transaction semantics with built-in validation and error reporting (<rpc-error>).
E.Requirement for lower bandwidth links by compressing all payloads into binary audio streams.
AnswersA, D

NETCONF returns XML-encoded replies whose elements map directly to the schema, so scripts extract values by node rather than matching fragile regular expressions against human-readable CLI text. This structured representation is the benefit the stem seeks.

Why this answer

Option A is correct because NETCONF encodes configuration and state data in structured XML (per RFC 6241), so management applications can consume well-defined elements and namespaces instead of brittle screen-scraping with regular expressions against human-oriented CLI output. Option D is correct because NETCONF defines formal RPC transaction semantics, including candidate datastores, commit/rollback operations, and standardized error reporting via <rpc-error> elements, which CLI scraping cannot guarantee. Option B is wrong because NETCONF is a configuration protocol and does not generate physical fiber cabling diagrams.

Option C is wrong because NETCONF still requires authentication (commonly SSH per RFC 6242), so it does not eliminate credentials. Option E is wrong because NETCONF does not compress payloads into binary audio streams or reduce bandwidth requirements in that manner.

162
Multi-Selecteasy

Which TWO characteristics are true regarding the Junos REST API? (Choose two)

Select 2 answers
A.It requires client-side compilation of proprietary C++ libraries.
B.It supports both JSON and XML data formats.
C.It requires a persistent SSH session for every transaction.
D.It is managed by the jpagent service daemon.
E.It runs on TCP port 830 exclusively.
AnswersB, D

Junos REST API responses and request bodies can be encoded as either JSON or XML, selected via the Accept and Content-Type HTTP headers. This dual-format support satisfies the question's requirement, letting clients choose whichever serialisation suits their tooling without protocol changes.

Why this answer

Option B is correct because the Junos REST API accepts and returns both JSON and XML payloads, letting clients choose the representation via the Content-Type and Accept headers (for example application/json or application/xml). Option D is correct because the REST API is served by the jpagent (Junos REST API agent) daemon, which listens on HTTPS (TCP 443) and handles REST requests on the device. Option A is wrong because the REST API is accessed over standard HTTP/HTTPS with no proprietary C++ client libraries to compile.

Option C is wrong because REST is stateless and uses HTTP/HTTPS requests, not a persistent SSH session per transaction. Option E is wrong because TCP 830 is used by NETCONF over SSH, not by the REST API, which uses HTTPS on port 443.

Exam trap

JNCIA-DevOps often tests the difference between REST API and NETCONF. Candidates might confuse port 830 (NETCONF) with REST API ports, or think SSH is required.

163
MCQhard

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?

A.Issue an HTTP GET request to /api/configuration/commit.
B.Set the Transfer-Encoding header to 'commit'.
C.Include the 'action=commit' query parameter or commit body flag with the configuration request.
D.Send a separate SSH command because REST cannot commit configurations.
AnswerC

Supplying action=commit alongside the configuration payload makes the REST API validate and commit the candidate in one call, satisfying the stem's requirement to avoid dangling candidate changes. Without it, the change stays uncommitted until a separate commit request is issued.

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.

164
Multi-Selecthard

Which THREE error-type values are defined in the NETCONF protocol specification (RFC 6241) for categorizing <rpc-error> messages? (Choose three)

Select 3 answers
A.rpc
B.hardware
C.transport
D.protocol
E.kernel
AnswersA, C, D

RFC 6241 defines rpc as an error-type value, indicating the request itself was invalid or malformed at the RPC layer. It is one of the protocol's defined categories for classifying rpc-error messages returned to the client.

Why this answer

RFC 6241 defines the <error-type> element of an <rpc-error> with exactly three enumerated values: rpc (A), transport (C), and protocol (D). The rpc value indicates an error occurred during RPC processing on the server, such as an invalid or malformed RPC element. The transport value indicates an error at the transport-protocol layer, such as a dropped connection or authentication failure.

The protocol value indicates a violation of the NETCONF protocol semantics, such as an unknown operation or missing mandatory parameter. The unmarked options hardware (B) and kernel (E) are not part of the RFC 6241 <error-type> enumeration; they resemble syslog or SNMP-style categories and have no defined role in NETCONF error reporting.

165
MCQhard

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?

A.REST API leverages standard HTTP/HTTPS transport infrastructure, making it easily traversable through web proxies and adaptable to modern web frameworks using native JSON.
B.REST API completely replaces the Junos candidate configuration datastore with a real-time database.
C.REST API natively supports XML parsing, whereas NETCONF only supports binary protocols.
D.REST API guarantees atomic multi-device commits across different vendors without controllers.
AnswerA

REST API uses standard HTTP/HTTPS transport, so requests traverse existing web proxies and integrate natively with modern web frameworks via JSON payloads. This satisfies the stem's web-centric constraint, where NETCONF's SSH-based transport and XML encoding demand additional tooling and proxy configuration.

Why this answer

REST APIs natively integrate with standard HTTP load balancers, web proxies, firewalls inspectable by HTTP/HTTPS, and standard web application frameworks without needing specialized SSH tunnel management or XML parser libraries.

166
MCQmedium

An automation engineer is using the Junos XML API over SSH to load a configuration snippet into the candidate datastore. The engineer wants to ensure that the configuration is merged with the existing candidate configuration. Which RPC and attribute should be used?

A.<load-configuration> with action='replace'
B.<commit-configuration> with action='merge'
C.<edit-config> with operation='merge'
D.<load-configuration> with action='merge'
AnswerD

This is correct because <load-configuration> is the Junos XML API RPC used to load configuration data. The 'action' attribute specifies how to integrate the new configuration. Setting action='merge' merges the provided configuration with the existing candidate configuration, preserving existing statements not included in the snippet. This is the standard way to perform a merge load.

Why this answer

In the Junos XML API, configuration is loaded using the <load-configuration> RPC. The 'action' attribute controls how the configuration is integrated; 'merge' merges the new configuration with the existing candidate configuration. Other actions like 'replace' or 'override' would not achieve a merge.

NETCONF's <edit-config> is not used in the Junos XML API over SSH context.

Exam trap

The trap here is confusing the Junos XML API <load-configuration> RPC with NETCONF's <edit-config>, which have similar but distinct roles.

167
MCQhard

A network automation team is using the Junos REST API to manage configurations on a Junos device. They need to perform a commit operation that includes a commit comment and also synchronizes the commit across all Routing Engines in a dual-RE system. Which HTTP method and URI combination should they use to achieve this with a single request?

A.POST to /rpc/commit with a JSON body containing <commit-comment> and <synchronize>
B.POST to /rpc/commit with an XML body including <commit-comment> and <synchronize>
C.PUT to /config/commit with a JSON body specifying comment and synchronize
D.PATCH to /rpc/commit with a JSON body containing comment and synchronize attributes
AnswerB

The Junos REST API supports executing RPCs via POST to /rpc/<rpc-name>. For commit, the RPC is 'commit'. The request body must be XML that includes the <commit-comment> and <synchronize> elements to add a comment and synchronize across Routing Engines. This single request accomplishes both requirements, making it the correct approach.

Why this answer

To execute a commit with a comment and synchronization, the Junos REST API requires a POST request to /rpc/commit with an XML body containing the <commit-comment> and <synchronize> elements. This leverages the RPC mechanism, allowing multiple commit options in one request. Other methods and endpoints do not support this functionality.

Exam trap

The trap here is confusing the RPC endpoint with configuration endpoints and using incorrect HTTP methods or payload formats.

168
MCQhard

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?

A.The pipe symbol (|)
B.The ampersand symbol (&)
C.The greater-than symbol (>)
D.The asterisk symbol (*)
AnswerA

The pipe symbol (|) uses the literal block scalar style, preserving every newline and trailing space exactly as written. This satisfies the stem's requirement to retain the multi-line banner string's line breaks without folding them into spaces, unlike the greater-than (>) folded style.

Why this answer

The pipe symbol (|) is the YAML literal block scalar indicator, which preserves newlines and all whitespace exactly as written in the source text. This makes it the correct choice for multi-line banner strings where line breaks are semantically meaningful, such as Junos login banners or BGP neighbor descriptions.

Exam trap

JNCIA-DevOps often tests the confusion between the literal block scalar (|) and the folded block scalar (>), since both look similar and candidates may assume either preserves newlines.

How to eliminate wrong answers

Option B is wrong because the ampersand (&) in YAML denotes an anchor, used to define a reusable node that can later be referenced with an alias, not a block scalar. Option C is wrong because the greater-than symbol (>) is the folded block scalar indicator, which replaces single newlines with spaces and only preserves blank-line-separated paragraphs, altering the original formatting. Option D is wrong because the asterisk (*) denotes a YAML alias that references a previously defined anchor, not a scalar style.

169
MCQeasy

What is the standard IETF RFC that defines the core NETCONF protocol architecture and operations?

A.RFC 8040
B.RFC 6241
C.RFC 4253
D.RFC 7950
AnswerB

RFC 6241 defines the NETCONF protocol architecture, including the transport-independent framing, the `<rpc>` and `<rpc-reply>` message pairs, and core operations such as `<get-config>`, `<edit-config>` and `<commit>`. It satisfies the stem's requirement for the standard IETF RFC specifying NETCONF's core architecture and operations.

Why this answer

RFC 6241 is the definitive IETF standard defining the NETCONF Configuration Protocol.

170
MCQhard

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?

A.The yaml.safe_dump() function explicitly deletes comments for security reasons.
B.Comments are stripped during parsing because they are not part of the YAML data model.
C.YAML specification mandates that all comments are ephemeral and cannot be serialized.
D.Comments must be re-injected using the 'preserve_comments=True' parameter.
AnswerB

PyYAML's parser discards comments at load time because the YAML specification's representation graph models only nodes, scalars, mappings and sequences — comments carry no semantic value and are never emitted as events. Since the data model never retains them, dumping cannot restore them, regardless of formatting options.

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.

171
MCQhard

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?

A.The rescue configuration database
B.The candidate configuration database
C.A private configuration database instance
D.The global active configuration database
AnswerB

PyEZ's Config utility defaults to locking and loading into the candidate configuration, which satisfies the partial merge requirement without committing to the active database. Changes remain staged until an explicit commit, allowing validation before affecting running device state.

Why this answer

By default, PyEZ loads configuration changes into the candidate configuration database.

172
MCQmedium

When managing Junos configuration changes in a team environment, why is atomic configuration rollback capability crucial during automated deployments?

A.It compresses the configuration database to save NVRAM storage space.
B.It allows the router to dynamically rewrite Python scripts into C++ for faster execution.
C.It automatically backs up the entire Junos OS image to an external TFTP server.
D.It ensures that either all configuration statements in a transaction are applied successfully or none are, preventing partial/corrupt states.
AnswerD

Junos commits configuration as a single transaction, so rollback reverts the entire candidate to its prior state. This satisfies the stem's team-automation constraint by guaranteeing all statements apply or none do, preventing partial or corrupt configurations.

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.

173
Multi-Selectmedium

An automation engineer is tasked with implementing a REST API client that authenticates to a Junos device. The engineer must choose an authentication method supported by the Junos REST API and ensure that credentials are transmitted securely. Which two statements are correct about authentication for the Junos REST API? (Choose two.)

Select 2 answers
A.API keys generated on the Junos device can be used in place of passwords.
B.Credentials are sent in plain text by default, so HTTPS is optional.
C.Authentication can be performed using a session cookie obtained from a login RPC.
D.HTTP Basic Authentication is supported and sends credentials in base64-encoded format.
E.OAuth 2.0 tokens are natively supported for authentication.
AnswersC, D

The Junos REST API supports session-based authentication. A client can send a POST request to the /rest/rpc/login RPC with credentials, which returns a session cookie. Subsequent requests include this cookie for authentication. This method avoids sending credentials with every request and is useful for maintaining a session. It is a supported authentication mechanism.

Why this answer

The Junos REST API supports HTTP Basic Authentication, where credentials are base64-encoded and sent in the Authorization header. It also supports session-based authentication via a login RPC that returns a cookie. Both methods require HTTPS for secure transmission.

OAuth 2.0 and API keys are not natively supported. Credentials are not sent in plain text by default; base64 encoding is not encryption, so HTTPS is essential.

Exam trap

The trap here is assuming that modern authentication methods like OAuth or API keys are available, when the Junos REST API actually relies on Basic Auth or session cookies.

174
MCQhard

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?

A.The device ignores the request and returns an OK response.
B.The device converts the operation to a merge automatically.
C.The device returns a NETCONF rpc-error indicating the node does not exist.
D.The device automatically creates the container as an empty object.
AnswerC

Junos treats operation="delete" as strict: deleting a non-existent container returns an rpc-error with a data-missing or unknown-element condition rather than silently succeeding. This satisfies the scenario's expectation that the device reports the missing node, unlike merge operations which tolerate absence.

Why this answer

The delete operation fails if the target node does not exist, whereas remove is silent if absent.

175
MCQeasy

What is the purpose of the <hello> element exchanged immediately after establishing a NETCONF SSH session?

A.To exchange supported protocol capabilities and namespace identifiers.
B.To authenticate the SSH username and password.
C.To request an immediate reboot of the Junos routing engine.
D.To lock the candidate configuration database automatically.
AnswerA

The <hello> element, sent by both peers immediately after the SSH session opens, advertises each side's supported NETCONF capabilities and namespace identifiers. This negotiation determines which protocol operations and datastore features are available for the remainder of the session.

Why this answer

The <hello> element is used by both client and server to exchange supported capabilities and session parameters.

176
MCQeasy

What is the primary function of a version control system (VCS) like Git in a Junos automation workflow?

A.To track configuration history, enable collaboration, and provide a single source of truth for network designs.
B.To act as a high-speed packet forwarding engine for BGP routes.
C.To compile Python automation scripts into binary executables.
D.To monitor real-time CPU utilization on Junos routing engines.
AnswerA

Git records every commit, giving a full configuration history, and its branching and merging let engineers collaborate on network designs. The repository becomes the single source of truth, satisfying the stem's requirement for a Junos automation workflow.

Why this answer

A VCS tracks changes over time, enabling collaboration, rollback, and audit trails.

177
Multi-Selecthard

Which THREE distinct operational states or configuration views can be queried using specific Junos XML API RPCs? (Choose three)

Select 3 answers
A.System information via <get-system-information>
B.BGP routing table via <get-bgp-kernel-table>
C.Chassis inventory via <get-chassis-inventory>
D.Firewall filter logs via <get-security-packet-capture>
E.Interface information via <get-interface-information>
AnswersA, C, E

The `<get-system-information>` RPC returns hostname, model, Junos version and uptime, satisfying the requirement to query a distinct operational state through the Junos XML API. It is a genuine, documented RPC, unlike fabricated tags, so it counts as one of the three valid configuration or operational views.

Why this answer

Option A is correct because the Junos XML API provides the <get-system-information> RPC, which returns operational system data such as hostname, uptime, and platform details from the device. Option C is correct because <get-chassis-inventory> is a valid Junos RPC that queries the hardware inventory of the chassis, including components like FPCs, PICs, and power supplies. Option E is correct because <get-interface-information> is a standard Junos RPC used to retrieve operational state and statistics for interfaces, equivalent to the CLI 'show interfaces' command.

Option B is not correct because there is no Junos XML API RPC named <get-bgp-kernel-table>; BGP routing information is retrieved through other RPCs such as <get-route-information> or <get-bgp-neighbor-information>. Option D is not correct because <get-security-packet-capture> is not a valid Junos RPC for retrieving firewall filter logs; packet capture and log retrieval use different mechanisms and commands.

178
Multi-Selectmedium

In a CI/CD pipeline configured for Junos network changes, which THREE automated testing steps are typically performed before production deployment? (Choose three)

Select 3 answers
A.Physical replacement of router power supply units
B.Manual approval of physical fiber patch cables by a security guard
C.Static code linting of YAML data and Jinja2 templates
D.Dry-run candidate configuration validation on a test Junos device or virtual instance
E.Automated schema validation against YANG models
AnswersC, D, E

Linting catches syntax errors and malformed YAML or Jinja2 before rendering, satisfying the pre-deployment validation requirement. It runs early in the pipeline without touching a device, so broken templates fail fast rather than reaching production configuration.

Why this answer

Option C is correct because CI/CD pipelines for Junos automation typically begin with static code linting of YAML data files and Jinja2 templates to catch syntax errors, formatting issues, and template rendering problems before any configuration is pushed. Option D is correct because a dry-run candidate configuration validation on a test Junos device or virtual instance (e.g., using 'commit check' or 'load merge' in a lab/vSRX/vMX environment) verifies that the generated configuration is syntactically and semantically accepted by Junos without affecting production. Option E is correct because automated schema validation against YANG models ensures the intended configuration data conforms to the device's data model, catching invalid leaf values, wrong types, or unsupported nodes early in the pipeline.

Option A is not a testing step but a physical hardware maintenance action, and Option B is a manual human process unrelated to automated CI/CD validation, so neither belongs in an automated pre-deployment test suite.

179
MCQeasy

What type of brackets enclose an array in a JSON document?

A.Curly braces ({ })
B.Square brackets ([ ])
C.Angle brackets (< >)
D.Parentheses (( ))
AnswerB

JSON defines arrays as ordered lists enclosed by square brackets, with elements comma-separated inside. Curly braces instead denote objects (key-value pairs), so square brackets are the only syntax satisfying the array requirement in this question.

Why this answer

Arrays in JSON are enclosed within square brackets ([ and ]).

180
MCQmedium

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?

A.200 OK
B.302 Found
C.204 No Content
D.201 Created
AnswerD

201 Created confirms the POST succeeded and a new static route resource now exists. The response typically includes a Location header pointing to the created object, distinguishing it from 200 OK, which signals a successful request without resource creation.

Why this answer

In standard HTTP REST semantics, a successful creation request resulting in a new resource returns HTTP status code 201 Created.

181
MCQmedium

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?

A.jnpr.junos.parallel
B.multiprocessing.device
C.asyncio.netconf
D.concurrent.futures
AnswerD

`concurrent.futures` provides the `ThreadPoolExecutor` class, which manages a pool of worker threads and dispatches tasks across them, satisfying the stem's requirement for concurrent connections to multiple Junos devices. PyEZ device sessions are I/O-bound, so threading suits this well, and the executor's `map` or `submit` methods collect results cleanly.

Why this answer

The concurrent.futures module is the standard Python library for managing thread pools and parallel execution. It provides ThreadPoolExecutor and ProcessPoolExecutor, which are commonly used with PyEZ to connect to multiple Junos devices concurrently. This is the recommended approach for parallel device operations in Python scripts.

Exam trap

JNCIA-DevOps often tests the standard Python library for concurrency; candidates pick asyncio or multiprocessing because they sound more modern, but concurrent.futures is the correct and commonly used module for thread pooling with PyEZ.

How to eliminate wrong answers

Option A is wrong because jnpr.junos.parallel is not a real module in PyEZ; PyEZ does not provide a built-in parallel execution module. Option B is wrong because multiprocessing.device is not a valid module; multiprocessing is a standard library for process-based parallelism, but it does not have a 'device' submodule. Option C is wrong because asyncio.netconf is not a standard module; asyncio is for asynchronous I/O, but PyEZ does not use asyncio for NETCONF, and there is no asyncio.netconf module.

182
MCQeasy

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?

A.dev = Device(host="192.168.1.1"); dev.start_session()
B.with Device(host="192.168.1.1", user="admin", passwd="secret") as dev:
C.dev = Device(host="192.168.1.1"); dev.open(autoclose=True)
D.dev = Device(host="192.168.1.1").connect()
AnswerB

Using `with Device(...) as dev:` invokes PyEZ's context-manager protocol, guaranteeing `dev.close()` runs during `__exit__` even when an exception propagates. This satisfies the stem's requirement that the Junos session closes reliably on error, unlike manual `open()`/`close()` calls that leak sessions if an exception interrupts the script.

Why this answer

Using the context manager 'with Device(...) as dev:' is best practice because it ensures the NETCONF session is automatically closed when the block exits, even if an exception occurs. The Device class implements the context manager protocol (__enter__ and __exit__), which calls open() on entry and close() on exit. This prevents session leaks and is the recommended pattern in Juniper's PyEZ documentation.

Exam trap

JNCIA-DevOps often tests the difference between valid PyEZ methods (open, close, start_session) and invalid ones (connect, autoclose) — candidates pick plausible-sounding but non-existent methods.

How to eliminate wrong answers

Option A is wrong because manually calling start_session() does not guarantee session closure on exception — the developer must explicitly call close() in a finally block. Option C is wrong because autoclose=True is not a valid parameter for the open() method in PyEZ; the correct approach is the context manager. Option D is wrong because connect() is not a standard PyEZ Device method — the correct method is open(), and without a context manager or explicit close, the session may leak.

183
MCQeasy

Which transport protocol is mandated by RFC 6241 as the standard secure connection mechanism for NETCONF when operating in typical Junos enterprise automation environments?

A.HTTPS
B.SSH
C.gRPC
D.TLS
AnswerB

RFC 6241 mandates SSH as the default secure transport for NETCONF, providing encryption and authentication over port 830. This satisfies the stem's requirement for a standard secure connection mechanism in typical Junos enterprise automation environments.

Why this answer

RFC 6241 specifies NETCONF over Secure Shell (SSH) as the standard secure transport protocol.

184
MCQmedium

When executing a configuration change via the Junos REST API, what is the role of the HTTP DELETE method?

A.To clear operational state counters such as interface packet counters.
B.To terminate an active REST API session and revoke the auth token.
C.To delete a specific configuration hierarchy or statement from the candidate configuration.
D.To discard the entire candidate configuration.
AnswerC

HTTP DELETE targets a specific configuration hierarchy or statement, removing it from the candidate configuration rather than committing it. This satisfies the stem's constraint that the change executes against the candidate, not the active configuration, so the deletion stays uncommitted until an explicit commit operation is issued.

Why this answer

In the context of the Junos REST API, the HTTP DELETE method is used to remove a specific configuration object or subtree, analogous to deleting a statement in the Junos CLI or removing an element in NETCONF.

185
MCQhard

A network automation team is using the Junos REST API to manage configurations on a fleet of Junos devices. They need to ensure that configuration changes are applied atomically and that they can roll back if an error occurs. They decide to use the REST API to load a configuration, commit it, and then verify the commit. Which sequence of REST API calls should they use to load a configuration snippet, commit it, and then confirm the commit was successful?

A.POST to /rest/rpc/load-configuration with the configuration data, then POST to /rest/rpc/commit, then check the HTTP status code and response body of the commit call for success indicators
B.POST to /rest/rpc/load-configuration with the configuration data, then POST to /rest/rpc/commit, then GET /rest/rpc/get-configuration to verify the applied configuration
C.POST to /rest/rpc/load-configuration, then POST to /rest/rpc/commit, then GET /rest/rpc/get-commit-information
D.POST to /rest/rpc/load-configuration, then POST to /rest/rpc/commit-check, then POST to /rest/rpc/commit
AnswerA

The commit RPC returns an HTTP status code and a response body indicating success or failure. A successful commit returns 200 OK and a commit result. Checking this response directly confirms whether the commit succeeded. This is the most reliable way to verify the commit operation. The load-configuration call must include the configuration data and appropriate parameters.

Why this answer

To load, commit, and verify a configuration via the Junos REST API, you perform a POST to the load-configuration RPC with the configuration data, then a POST to the commit RPC. The commit response includes an HTTP status code and a body that indicates success or failure. Checking this response is the most direct way to confirm the commit succeeded.

Additional calls like get-configuration or get-commit-information are not necessary for verifying the commit operation itself.

Exam trap

The trap here is thinking that a separate verification RPC is needed to confirm a commit, when the commit RPC's own response already provides definitive success or failure status.

186
Multi-Selecthard

In a Junos NETCONF automation workflow, what happens during a lock operation on the configuration database? (Choose two)

Select 2 answers
A.Exclusive write access is acquired for the requesting session, preventing concurrent configuration modifications by other users or scripts.
B.The physical routing engine is immediately powered down to prevent hardware wear.
C.An unlock operation must be performed (or session closed) to release the lock for other processes.
D.All operational state monitoring (such as 'show route') is permanently disabled.
E.All firewall filters on all interfaces are automatically deleted.
AnswersA, C

The lock operation claims the configuration datastore exclusively for the requesting NETCONF session, so other users or scripts cannot modify it concurrently. This satisfies the stem's constraint by guaranteeing atomic, conflict-free edits during an automation workflow.

Why this answer

Option A is correct because a Junos <lock> operation on the candidate configuration grants the requesting NETCONF session exclusive write access, so other users, CLI sessions, or automation scripts cannot modify the configuration concurrently until the lock is released. Option C is correct because the lock is held by that session and must be explicitly released with an <unlock> operation, or implicitly released when the NETCONF session closes, before other processes can edit the configuration. The unmarked options are incorrect: B is false because locking the configuration database has nothing to do with powering down a Routing Engine, D is false because operational commands like 'show route' remain available and are not disabled by a configuration lock, and E is false because no firewall filters are deleted by a lock operation.

187
MCQmedium

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?

A.The SSH tunnel has been successfully authenticated.
B.The NETCONF operation completed successfully with no error or data payload to return.
C.The candidate configuration has uncommitted changes.
D.The device CPU utilization is normal.
AnswerB

The `<ok/>` element is the NETCONF protocol's standard acknowledgement that an RPC completed without error, defined in RFC 6241. It appears only when the operation returns no data payload, satisfying the stem's scenario where a Junos device confirms success silently rather than returning configuration or operational output.

Why this answer

The <ok/> tag indicates that the requested NETCONF operation executed successfully with no data to return.

188
Multi-Selecteasy

Which TWO tools or platforms are commonly used for version control and hosting of Junos automation code repositories? (Choose two)

Select 2 answers
A.Adobe Photoshop
B.Microsoft Word
C.GitHub
D.VLC Media Player
E.GitLab
AnswersC, E

GitHub is a Git-based hosting platform providing remote repositories, pull requests and CI integration for automation code. It satisfies the stem's requirement for a version control hosting platform, storing Junos scripts and playbooks with full commit history and collaboration.

Why this answer

GitHub (C) is correct because it is a widely used web-based platform built on Git that provides repository hosting, branching, pull requests, and CI/CD integration for storing and collaborating on Junos automation code such as Python scripts, Jinja2 templates, and YAML playbooks. GitLab (E) is also correct because it is a Git-based DevOps platform offering self-managed or SaaS repository hosting, merge requests, and built-in CI/CD pipelines commonly used to manage and deploy Junos automation content. The remaining options do not belong: Adobe Photoshop (A) is an image-editing application, Microsoft Word (B) is a document word processor, and VLC Media Player (D) is a multimedia player — none of these provide Git-based version control or code repository hosting.

189
MCQmedium

A network team uses a CI/CD pipeline to manage Junos device configurations. After a developer merges a change to the main branch, the pipeline is triggered automatically. Which DevOps principle is primarily demonstrated when the pipeline deploys the tested configuration to production devices without manual intervention?

A.Infrastructure as Code
B.Continuous integration
C.Continuous monitoring
D.Continuous delivery
AnswerD

Continuous delivery ensures that validated changes are automatically deployed to production-like environments, and with approval, to production. In this scenario, the pipeline deploys tested configurations to production devices without manual steps, which aligns with continuous delivery. It emphasizes automation and reliability, reducing human error and speeding up feedback. The key is that deployment is automated after testing, which matches the described workflow.

Why this answer

Continuous delivery is the practice of automatically deploying validated changes to production after passing tests, which matches the scenario where the pipeline deploys configurations without manual intervention. Continuous integration is limited to merging and testing, while Infrastructure as Code is about defining infrastructure in code, and continuous monitoring is about observing systems. The automated production deployment is the defining characteristic here.

Exam trap

The trap here is confusing continuous delivery with continuous integration, as both are automated pipeline stages, but only continuous delivery includes deployment to production.

190
MCQmedium

When using Jinja2 inheritance, which tag is placed in a base template to indicate where child templates can insert their custom content?

A.{% block block_name %} ... {% endblock %}
B.{{ super() }}
C.{% insert block_name %}
D.{% child_content %}
AnswerA

The {% block block_name %} ... {% endblock %} tag defines an overridable region in a base template; child templates using {% extends %} replace its contents. This satisfies the stem's requirement for marking where child templates insert custom content.

Why this answer

In Jinja2 template inheritance, the base (parent) template defines placeholders using the '{% block block_name %} ... {% endblock %}' syntax. Child templates then use '{% extends "base.html" %}' and override those named blocks with their own content. This is the standard mechanism for defining replaceable sections in a parent template.

Exam trap

JNCIA-DevOps often tests the distinction between defining a block in the parent ('{% block %}') versus calling the parent's content from the child ('{{ super() }}'), so candidates confuse the two roles.

How to eliminate wrong answers

Option B is wrong because '{{ super() }}' is used inside a child template's block to render the parent block's content in addition to the child's content — it is not the tag that defines the placeholder in the base template. Option C is wrong because '{% insert block_name %}' is not valid Jinja2 syntax; there is no 'insert' tag in Jinja2. Option D is wrong because '{% child_content %}' is not a Jinja2 tag; child content is provided by overriding blocks, not by a dedicated tag.

191
MCQmedium

An automation engineer is writing a Python script that retrieves the operational status of all interfaces from a Junos device using the Junos REST API. The script sends a GET request to https://device/rest/interface. The device returns an HTTP 200 OK response, but the response body is empty. The engineer examines the request and confirms that the URL is correct and the device is reachable. Which action should the engineer take to retrieve the interface status information?

A.Add the Accept: application/json header to the request.
B.Use the correct RPC endpoint, such as /rest/rpc/get-interface-information, to retrieve operational data.
C.Change the HTTP method to POST and include a JSON payload specifying the interface names.
D.Append the query parameter ?type=operational to the URL.
AnswerB

The Junos REST API exposes operational commands through RPC endpoints. To retrieve interface status, you must call the appropriate RPC, such as get-interface-information, via the /rest/rpc/ path. A simple GET to /rest/interface does not map to an operational command and returns an empty response. Using the correct RPC endpoint returns the desired operational data.

Why this answer

The Junos REST API provides access to operational data through RPCs, not through arbitrary REST endpoints. To retrieve interface status, the correct endpoint is /rest/rpc/get-interface-information. A GET request to /rest/interface does not correspond to a valid RPC and returns an empty body.

Using the proper RPC endpoint ensures the desired operational information is returned in the response.

Exam trap

The trap here is assuming that any REST URL path maps directly to a Junos hierarchy level or operational command, when actually operational data requires invoking a specific RPC endpoint.

192
MCQmedium

An automation engineer uses a Python script with the PyEZ library to retrieve interface statistics from a Junos device and wants to store the results in a file that preserves data types such as integers, booleans, and null values for later processing by another tool. The engineer needs a serialization format that is compact, widely supported by APIs, and preserves these primitive types. Which format should the engineer choose?

A.XML
B.JSON
C.CSV
D.YAML
AnswerB

JSON natively supports strings, numbers, booleans, and null, and it is the de facto format for REST APIs and telemetry streams. Python's `json.dumps()` and `json.loads()` preserve these types exactly, and the output is compact compared to XML or YAML. Because the other tool likely consumes JSON through an API, JSON is the most interoperable and compact choice for preserving primitive types.

Why this answer

JSON is designed around a small set of primitive types and is the standard payload format for REST APIs and streaming telemetry, so it preserves integers, booleans, and null exactly as Python represents them. Its compact syntax and universal parser support make it the best choice for handing structured data to another tool. YAML is readable but less strict, XML loses native types, and CSV is flat and text-only.

Exam trap

The trap here is assuming that any human-readable format preserves data types equally well, when in fact XML and CSV treat all values as text unless additional type metadata is supplied.

193
MCQhard

An engineer is using Junos PyEZ to load a configuration change onto a device. The script uses the Config class to lock the candidate configuration, load a set of changes, and then commit. During testing, the commit fails because another user has an exclusive lock on the configuration. What is the correct behavior of the engineer's script when it attempts to lock the configuration in this situation?

A.The lock operation will fail immediately with an error indicating that the configuration is already locked by another user.
B.The lock operation will automatically override the existing lock and proceed with the configuration load.
C.The lock operation will block indefinitely until the other user releases the lock, then proceed automatically.
D.The lock operation will succeed but the commit will fail later because of the conflicting lock.
AnswerA

When a user or automation script attempts to lock the candidate configuration and it is already locked by another session, Junos returns an error immediately. In this scenario, the PyEZ script would raise an exception, and the engineer must handle it, for example by retrying or alerting. This behavior prevents conflicting configuration changes and ensures that only one session can modify the candidate configuration at a time. The engineer should design the pipeline to account for such lock contention.

Why this answer

When a Junos device configuration is already locked by another session, an attempt to acquire a lock fails immediately with an error. In this scenario, the PyEZ script would receive an exception at the lock step, preventing it from loading changes. The engineer must handle this error, perhaps by retrying later or by using a different coordination mechanism.

This immediate failure is a safety feature that prevents conflicting configuration modifications and preserves configuration integrity across concurrent management sessions.

Exam trap

The trap here is thinking that a lock request waits for the existing lock to clear or that it can override the lock, when in fact it fails immediately.

194
MCQeasy

You are using PyEZ to retrieve the operational status of all interfaces on a Junos device. You want to get the output in a structured Python dictionary rather than raw XML. Which method should you use on the Device object?

A.`dev.facts`
B.`dev.rpc.get_interface_information()`
C.`dev.cli('show interfaces')`
D.`dev.rpc.get_interface_information(normalize=True)`
AnswerD

The `normalize=True` parameter in PyEZ RPC calls converts the XML response into a Python dictionary, making it easier to work with in scripts. Calling `dev.rpc.get_interface_information(normalize=True)` returns the interface operational status as a dictionary, allowing direct access to fields without XML parsing.

Why this answer

To get structured dictionary output from an RPC in PyEZ, use the `normalize=True` parameter. This converts the XML response into a Python dictionary. Other methods either return XML, facts, or raw text, and do not provide the interface status as a dictionary.

Exam trap

The trap here is assuming that any RPC method returns a dictionary by default, when in fact you must explicitly set `normalize=True`.

195
MCQeasy

A network automation developer is writing a Python script that uses the Junos REST API to load a candidate configuration from a file and commit it. The developer wants to ensure the configuration is merged with the existing candidate configuration. Which HTTP method and endpoint should be used to load the configuration?

A.POST to /rest/conf/ with the configuration in the request body
B.GET to /rest/conf/ with the configuration as a query parameter
C.POST to /rest/config/ with the configuration in the request body
D.PUT to /rest/conf/ with the configuration in the request body
AnswerA

The Junos REST API uses POST to /rest/conf/ to load configuration data into the candidate configuration. By default, the load operation merges the provided configuration with the existing candidate. This is the correct method and endpoint for loading configuration via REST.

Why this answer

To load configuration into the candidate configuration via the Junos REST API, an automation script sends an HTTP POST request to the /rest/conf/ endpoint with the configuration data in the request body. This operation defaults to a merge load, combining the new configuration with the existing candidate. Other methods like PUT or GET are not used for configuration loading.

Exam trap

The trap here is assuming that RESTful conventions like PUT for updates or GET with query parameters apply to the Junos REST API, which instead uses POST to /rest/conf/ for configuration loads.

196
MCQhard

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?

A.<kill-session><session-id>...</session-id></kill-session>
B.<unlock target="candidate" force="true"/>
C.<release-lock session-id="..."/>
D.<close-session><session-id>...</session-id></close-session>
AnswerA

A lock held by another session cannot be released with <unlock> from your session; <kill-session> with the owning session-id terminates that session, which automatically drops its lock. This satisfies the requirement to force-terminate the other session and release the candidate datastore.

Why this answer

The <kill-session> RPC allows terminating another active NETCONF session, which automatically releases any locks held by that session.

197
MCQeasy

Which of the following describes the fundamental structural difference between JSON and YAML regarding syntax design?

A.YAML requires all keys to be enclosed in double quotes, whereas JSON does not.
B.YAML does not support lists or arrays.
C.JSON relies on explicit punctuation like braces and brackets, whereas YAML relies heavily on indentation.
D.JSON supports comments natively, whereas YAML does not.
AnswerC

JSON's structure is defined by explicit delimiters — curly braces for objects, square brackets for arrays — so nesting is unambiguous regardless of whitespace. YAML instead encodes hierarchy through indentation, making significant whitespace the structural mechanism. This indentation-based design is the fundamental syntactic divergence the question asks about.

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.

198
Multi-Selectmedium

Which TWO tasks are typically automated using Python and PyEZ in a network DevOps pipeline? (Choose two)

Select 2 answers
A.Direct packet capture inspection at Layer 1 physical media levels
B.Writing device firmware assembly code
C.Automated pushing of validated Jinja2-generated configurations to candidate databases
D.Automated pre-check and post-check operational verification during maintenance windows
E.Compiling Junos kernel device drivers in C++
AnswersC, D

PyEZ's Config class loads Jinja2-rendered configuration snippets and commits them to the candidate database, enabling programmatic, validated pushes. This satisfies the pipeline requirement for automated configuration deployment rather than manual CLI entry, keeping changes version-controlled and repeatable.

Why this answer

Option C is correct because PyEZ (junos-eznc) provides modules such as Config and the load() method with merge/override/replace actions that push Jinja2-rendered configuration text into the candidate database, then commit it — a core use case in network DevOps pipelines for templated, validated config deployment. Option D is correct because PyEZ exposes operational RPCs via the RPC class and facts/table retrieval (e.g., get_interface_information, get_route_information), enabling scripts to run pre-checks before a change and post-checks after a maintenance window to verify state and automatically roll back on failure. Option A is not correct because PyEZ operates at the Junos management/RPC layer over NETCONF or the Junos XML API, not at Layer 1 physical media, where packet capture requires tools like tcpdump or dedicated analyzers.

Option B is not correct because firmware assembly is a low-level hardware/vendor engineering task, not something PyEZ automates. Option E is not correct because compiling Junos kernel device drivers in C++ is part of Juniper's internal OS build process, not a PyEZ automation task.

199
MCQhard

An automation engineer is troubleshooting a Junos REST API script that intermittently fails with HTTP 401 Unauthorized errors when retrieving operational data. The script uses HTTP Basic Authentication with a valid username and password. The engineer confirms that the credentials are correct and that the REST API is enabled. What is the most likely cause of the intermittent failures?

A.The script is exceeding the maximum number of concurrent REST API sessions, causing new requests to be rejected with 401.
B.The device is configured to use RADIUS authentication, and the RADIUS server is occasionally unreachable.
C.The device's clock is out of sync with the authentication server, causing token-based authentication to fail.
D.The REST API requires the use of a session cookie instead of Basic Authentication for operational requests.
AnswerB

Intermittent 401 errors with correct local credentials often indicate an external authentication server issue. If the Junos device is configured to use RADIUS or TACACS+ for authentication, a temporary network problem or server unavailability can cause authentication to fail, resulting in 401 responses. The REST API relies on the device's authentication mechanisms.

Why this answer

Intermittent 401 Unauthorized errors with valid credentials often stem from external authentication server issues. When a Junos device is configured to use RADIUS or TACACS+ for user authentication, temporary server unreachability can cause authentication failures. The REST API uses the device's configured authentication methods, so an unreachable RADIUS server would result in 401 responses.

Exam trap

The trap here is assuming that 401 errors always indicate wrong credentials or API misconfiguration, overlooking external authentication server dependencies that can cause intermittent failures.

200
Multi-Selecteasy

Which TWO file formats are commonly used for structuring network configuration data and automation templates in Junos DevOps pipelines? (Choose two)

Select 2 answers
A.JSON
B.YAML
C.Proprietary binary core dump format
D.Raw bitmap image (.bmp) format
E.Windows executable (.exe) format
AnswersA, B

JSON encodes Junos configuration as hierarchical key–value pairs, which Junos PyEZ and the Junos REST API parse directly into structured data. This satisfies the stem's requirement for a format structuring configuration data and automation templates, since JSON maps cleanly onto Junos's nested configuration hierarchy without custom parsing.

Why this answer

JSON (A) is correct because Junos automation tooling such as PyEZ, Junos REST API, and NETCONF/RESTCONF interactions commonly serialize structured configuration and template data as JSON, which is easily parsed by Python scripts in DevOps pipelines. YAML (B) is correct because it is the native format for Ansible playbooks and Jinja2-based automation templates widely used to structure Junos configuration data declaratively in CI/CD workflows. The proprietary binary core dump format (C) is a diagnostic artifact produced on crashes, not a human-readable data-structuring format for configuration.

The raw bitmap image format (D) and Windows executable format (E) are unrelated to network configuration data or automation templates and cannot represent structured configuration.

Exam trap

JNCIA-DevOps often tests whether candidates confuse data serialization formats (JSON, YAML, XML) with transport protocols (NETCONF, REST) or with binary artifacts, so distractors like 'binary core dump' or '.exe' are planted to catch anyone who doesn't recognize the text-based structured-data family.

201
MCQmedium

An engineer writes a Python script that loads a JSON configuration file using the json.load() method. The file contains configuration parameters for a Junos device. If the JSON file contains a trailing comma at the end of the last element in an array, what will happen when the script executes?

A.The script will successfully parse the file and ignore the trailing comma.
B.The script will raise a JSONDecodeError.
C.The script will throw a TypeError during execution.
D.The script will convert the trailing comma into a null value automatically.
AnswerB

Python's json.load() delegates parsing to the strict JSON decoder, which rejects trailing commas as invalid syntax per RFC 8259. Because the stem specifies a trailing comma inside an array, the decoder raises json.JSONDecodeError at that character position, halting execution before any Junos configuration parameters are returned to the script.

Why this answer

Standard JSON specification is strict and does not allow trailing commas. Attempting to parse it will raise a json.decoder.JSONDecodeError.

202
MCQhard

A Python script using PyEZ loads a configuration from a file and commits it on a Junos device. The commit fails with a `CommitError` exception. You need to retrieve the specific error message returned by the device. Which method or attribute should you use to obtain the detailed error text?

A.`exception.errs`
B.`exception.detail`
C.`exception.message`
D.`exception.response`
AnswerA

The `CommitError` exception in PyEZ includes an `errs` attribute, which is a list of error dictionaries or objects containing the detailed error messages from the Junos device. Accessing `exception.errs` allows you to iterate over each error and extract the specific text, such as syntax errors or commit check failures.

Why this answer

When a commit fails, PyEZ raises `CommitError` with an `errs` attribute containing a list of error details from the device. Iterating over `exception.errs` provides the specific commit error messages. Other attributes like `message`, `detail`, or `response` are not the correct way to retrieve these details.

Exam trap

The trap here is assuming that `exception.message` or `exception.response` contains the commit error text, when in fact PyEZ stores them in `errs`.

203
MCQhard

You are writing a Python script that converts a Junos operational state output from XML (via NETCONF) into JSON. The XML structure contains sibling elements with the same tag name. When converted naively, how do standard XML-to-JSON conversion libraries (like xmltodict) typically represent these repeated sibling elements in the resulting JSON dictionary?

A.By appending numeric indexes to every key name automatically.
B.As a JSON array containing multiple objects.
C.By raising a DuplicateElementException.
D.By overwriting previous elements so only the last element is retained.
AnswerB

Libraries such as xmltodict detect repeated sibling tags and collapse them into a JSON array of objects, preserving each occurrence's child data. This satisfies the stem's requirement for representing duplicate tag names, since a single JSON key cannot hold multiple identically-named children without an array wrapper.

Why this answer

Conversion libraries like xmltodict represent repeated sibling XML elements as a JSON array (list) to preserve all instances under a single key.

204
MCQmedium

An automation engineer needs to parse a JSON payload returned by the Junos REST API that contains a list of interfaces, each with a name and a list of addresses. The engineer wants to iterate over the interfaces and then over each interface's addresses in Python. Which Python data structure mapping does the `json` module produce for this payload?

A.A dictionary whose keys are interface names and whose values are lists of addresses.
B.A set of dictionaries, where each dictionary contains the interface name and addresses.
C.A list of dictionaries, where each dictionary represents an interface and contains a key whose value is a list of address dictionaries.
D.A list of tuples where each tuple contains the interface name and a nested list of addresses.
AnswerC

The `json` module maps JSON arrays to Python lists and JSON objects to Python dictionaries. A payload that is an array of interface objects therefore becomes a list of dicts, and a nested array of address objects becomes a list of dicts inside each interface dict. This structure allows natural iteration with `for iface in data:` and `for addr in iface['addresses']:`.

Why this answer

The `json` module follows a direct mapping: JSON arrays become Python lists, JSON objects become Python dictionaries, strings become str, numbers become int or float, and booleans become bool. A payload with a top-level array of interface objects therefore decodes to a list of dictionaries, each containing a nested list of address dictionaries. This alignment makes iteration straightforward and predictable.

Exam trap

The trap here is assuming that JSON arrays decode to tuples or sets, when Python's `json` module always produces lists for arrays and dicts for objects.

205
Multi-Selectmedium

A network automation team is evaluating Junos PyEZ for managing a fleet of Junos devices. They want to understand which capabilities PyEZ provides natively. (Choose two.)

Select 2 answers
A.Executing operational commands and retrieving structured output via RPCs using the Device class.
B.Replacing the Junos CLI entirely by exposing a RESTCONF-only management interface.
C.Providing a built-in Git server for version-controlling Junos configurations directly on the device.
D.Loading, comparing, and committing candidate configurations using the Config utility class.
E.Automatically converting all Junos YANG models into Python classes at runtime for every device connection.
AnswersA, D

The Device class in PyEZ connects over NETCONF and can execute both CLI commands and RPCs, returning structured XML or JSON when supported. This lets automation consume operational state without screen-scraping. It is a fundamental PyEZ feature, so it correctly describes a native capability relevant to managing a Junos fleet programmatically.

Why this answer

PyEZ natively provides configuration management through the Config utility, including load, compare, commit, and rollback, and it provides operational command and RPC execution through the Device class. These two capabilities are central to automating Junos devices. The other options describe features PyEZ does not include, such as an on-device Git server, a RESTCONF-only interface, or automatic YANG-to-Python class generation.

Exam trap

The trap here is conflating PyEZ's configuration and operational capabilities with unrelated tooling such as Git servers or RESTCONF, which are not part of the library.

206
MCQmedium

In a Junos automation environment, what role does a schema (such as YANG or Junos XSD) play when interacting with NETCONF?

A.It encrypts the communication channel between the client and the Junos device.
B.It defines the structural rules, data types, and valid hierarchy for configuration and operational data models.
C.It acts as a firewall filter blocking unauthorized IP addresses on the management interface.
D.It compiles Python scripts into executable machine code for the Routing Engine CPU.
AnswerB

A schema such as YANG or Junos XSD declares the permitted hierarchy, data types and structural rules for configuration and operational data. NETCONF uses it to validate RPC payloads, so automation scripts know exactly which elements and values the device accepts.

Why this answer

YANG or XSD schemas define the data model structure, types, and constraints for configuration and operational data.

207
MCQeasy

What is the role of the <rpc> element in a NETCONF message exchange?

A.It defines the security credentials for SSH authentication.
B.It acts as a wrapper enclosing the specific NETCONF method request sent by the client to the server.
C.It stores error logs returned by the Junos routing engine.
D.It terminates the NETCONF session upon completion.
AnswerB

The <rpc> element is the mandatory envelope for every NETCONF request, carrying the message-id attribute and wrapping the operation the client invokes. The server replies with <rpc-reply>. Without this wrapper, the server cannot identify which method to execute, so it satisfies the stem's requirement for the request container.

Why this answer

The <rpc> element is the protocol envelope used by the client to send a request to the NETCONF server.

208
MCQeasy

You are writing a script that uses Jinja2 to dynamically render a Junos interface configuration. Which Python module and function are required to load a template from the local filesystem and render it with a dictionary of variables?

A.from jnpr.junos.cfg import ConfigTemplate
B.from jinja2 import Environment, FileSystemLoader
C.from jnpr.junos.template import TemplateRenderer
D.import jnpr.junos.utils.jinja as jinja
AnswerB

FileSystemLoader resolves template paths from local disk, and Environment compiles and renders them with the supplied variable dictionary. This pairing satisfies the filesystem-loading constraint, since a plain Template object cannot locate external files without a configured loader.

Why this answer

The standard Jinja2 API for loading templates from disk is to create an Environment with a FileSystemLoader pointed at the template directory, then call get_template() and render() with a variable dictionary. This is the canonical Python Jinja2 pattern and works directly with Junos config templates. PyEZ does not provide its own Jinja2 wrapper module for this purpose.

Exam trap

The trap is that candidates assume PyEZ provides its own Jinja2 wrapper (like ConfigTemplate or TemplateRenderer) when in fact you import Jinja2 directly from the jinja2 package and use Environment + FileSystemLoader.

How to eliminate wrong answers

Option A is wrong because jnpr.junos.cfg.ConfigTemplate is not a real module/class in PyEZ — PyEZ uses jinja2 directly for templating, not a ConfigTemplate class. Option C is wrong because jnpr.junos.template.TemplateRenderer does not exist in the PyEZ library. Option D is wrong because jnpr.junos.utils.jinja is not a real PyEZ module — while PyEZ has jnpr.junos.utils.* submodules (config, sw, fs, etc.), there is no jinja utility module; Jinja2 is imported directly from the jinja2 package.

209
MCQhard

While executing a NETCONF edit-config operation, you want to ensure that any syntax errors or invalid statements immediately cause the device to roll back the entire transaction without applying partial changes. Which parameter achieves this?

A.<error-option>rollback-on-error</error-option>
B.<test-option>test-then-set</test-option>
C.<default-operation>none</default-operation>
D.<error-option>stop-on-error</error-option>
AnswerA

The `<error-option>rollback-on-error</error-option>` parameter instructs the NETCONF server to discard the entire candidate configuration and revert to the previous committed state if any error occurs during the edit-config transaction. This satisfies the stem's requirement that syntax errors or invalid statements trigger a full rollback, preventing partial changes from being applied.

Why this answer

The error-option element with the value 'rollback-on-error' instructs the device to abort and roll back if any error occurs.

210
MCQmedium

When using the Junos REST API to configure static routes, how does the JSON payload structure represent list items that can have multiple instances (such as multiple next-hops or static routes)?

A.As XML CDATA blocks embedded within JSON keys.
B.As numerical indexed keys (e.g., 'route-0', 'route-1').
C.As JSON arrays containing objects for each list entry.
D.As a single concatenated string separated by semicolons.
AnswerC

Junos REST JSON mirrors the XML hierarchy: repeated configuration nodes such as multiple static routes or next-hops are encoded as JSON arrays, each element an object holding that entry's leaf values, so every instance is represented distinctly.

Why this answer

In the Junos REST API, when a configuration element can have multiple instances (e.g., multiple static routes or next-hops), the JSON payload represents them as a JSON array containing an object for each instance. This allows the API to handle multiple entries in a structured way, aligning with JSON's array syntax.

Exam trap

JNCIA-DevOps often tests the JSON representation of Junos configuration lists. Candidates may assume that list items are represented as indexed keys or nested objects, but the correct representation is a JSON array. The trap is confusing XML's repeated elements with JSON's array syntax.

How to eliminate wrong answers

Option A is wrong because XML CDATA blocks are not used in JSON; JSON does not support CDATA. Option B is wrong because numerical indexed keys like 'route-0' are not the standard representation; Junos uses arrays for lists. Option D is wrong because a single concatenated string with semicolons is not valid JSON and does not represent structured data.

211
MCQmedium

You are using the PyEZ SW utility to install a new Junos image on a device. Which method parameter allows the script to automatically reboot the device after a successful installation?

A.auto_reboot=1
B.reboot=True
C.reload_after_install=True
D.action='reboot'
AnswerB

The reboot=True parameter instructs the PyEZ SW utility to reboot the device automatically once the new Junos image installs successfully. This satisfies the scenario's constraint of unattended installation, removing the need for a separate manual reboot step after the image is written.

Why this answer

The PyEZ SW utility's install() method accepts a reboot=True parameter that instructs the utility to reboot the device automatically after the Junos image is successfully installed. This is the documented keyword argument in the jnpr.junos.utils.sw.SW class, and it triggers the device reboot as part of the install workflow.

Exam trap

JNCIA-DevOps often tests whether candidates can distinguish real PyEZ method parameters from plausible-sounding fabrications like auto_reboot or reload_after_install.

How to eliminate wrong answers

Option A is wrong because auto_reboot=1 is not a recognized parameter of the PyEZ SW.install() method — it is a fabricated name that sounds plausible but does not exist in the API. Option C is wrong because reload_after_install=True is not a PyEZ parameter; the actual method uses reboot, and inventing a longer name is a common distractor pattern. Option D is wrong because action='reboot' is not a valid keyword for SW.install(); the install method does not take an action parameter for rebooting.

212
Multi-Selectmedium

Which TWO methods are provided by the Python standard library 'json' module for deserializing JSON data? (Choose two)

Select 2 answers
A.json.read()
B.json.decode()
C.json.loads()
D.json.load()
E.json.parse()
AnswersC, D

json.loads() deserialises a JSON-formatted string into a Python object such as a dictionary or list. It satisfies the stem's requirement for a deserialisation method, operating on string input rather than a file object, which is the axis distinguishing it from json.load().

Why this answer

Option C, json.loads(), is correct because it deserializes a JSON-formatted string (or bytes) directly into a Python object such as a dict or list. Option D, json.load(), is correct because it reads JSON data from a file-like object (for example, an open file handle) and deserializes it into a Python object. These are the two deserialization functions actually exposed by the standard library json module.

Options A (json.read()), B (json.decode()), and E (json.parse()) are not functions provided by the json module, so they cannot be used for deserialization.

213
MCQmedium

You are developing a Python script using PyEZ to load a configuration onto a Junos device. You need to ensure that the configuration is merged with the existing candidate configuration, and that the load operation does not perform a commit check automatically. Which method should you use to load the configuration from a file?

A.Use `cu.load(path='config.conf', overwrite=True, check=False)`
B.Use `cu.load(path='config.conf', merge=True, check=False)`
C.Use `cu.load(path='config.conf', merge=True, commit_check=True)`
D.Use `cu.load(path='config.conf', action='merge', verify=False)`
AnswerB

The `load` method of the `Config` object accepts parameters `merge` and `check`. Setting `merge=True` merges the configuration with the candidate, and `check=False` disables the automatic commit check. This matches the requirement to merge and avoid an automatic check. This is the correct method and parameter combination.

Why this answer

The `load` method of the PyEZ `Config` object supports `merge` and `check` parameters. To merge without a commit check, use `merge=True` and `check=False`. The other options either use incorrect parameter names, perform an overwrite, or enable the check.

Only the combination of merge and check=False achieves the desired behavior.

Exam trap

The trap here is confusing the `check` parameter with `commit_check` or using `overwrite` when merge is needed.

214
MCQhard

A network engineer is using Git for version control of Junos configurations. During a peer review on a pull request, a merge conflict arises because two engineers modified the same interface description line in different branches. What is the correct procedure to resolve this conflict in Git?

A.Reboot the Junos routing engine to clear the Git repository cache and force a fast-forward merge.
B.Run the 'git force-merge' command to automatically discard the older branch's changes.
C.Use 'git reset --hard' on the remote repository to delete both conflicting branches entirely.
D.Manually edit the conflict markers in the affected configuration file, stage the resolved file, and complete the merge commit.
AnswerD

Git inserts conflict markers around the competing interface description lines; editing them manually, then running git add followed by git commit, records the resolution. This satisfies the stem's constraint of two engineers changing the same line, which Git cannot merge automatically.

Why this answer

Git marks the conflicting lines in the file, requiring manual editing to choose the correct changes or combine them, followed by staging and committing the resolution.

215
MCQmedium

An automation engineer is using the Junos XML API over NETCONF to load a configuration change into the candidate datastore. The engineer wants to ensure that the change is committed automatically only if the candidate configuration passes a validation check. Which NETCONF operation should the engineer use to validate the candidate configuration before committing?

A.<edit-config>
B.<commit>
C.<check>
D.<validate>
AnswerD

The <validate> operation in NETCONF is used to validate the contents of a specified configuration datastore. It checks the candidate configuration for syntax and semantic errors without applying it. This allows the engineer to confirm that the change is valid before committing, satisfying the requirement to validate before commit.

Why this answer

The <validate> operation is the standard NETCONF method to check a configuration datastore for errors without applying changes. In Junos, this corresponds to the 'commit check' functionality. Using <validate> on the candidate datastore ensures the configuration is syntactically and semantically correct before a commit is attempted, reducing the risk of a failed commit in production.

Exam trap

The trap here is confusing the Junos CLI 'commit check' command with a NETCONF operation of the same name; the correct NETCONF operation is <validate>.

216
MCQhard

A network automation engineer is using the Junos XML API over NETCONF to make configuration changes. The engineer wants to ensure that if the commit fails, the candidate configuration is automatically rolled back to its previous state without manual intervention. Which NETCONF operation should the engineer use to achieve this?

A.<rollback> operation with a rollback number.
B.<discard-changes> operation after a failed commit.
C.<commit> with a <confirmed/> element and a <confirm-timeout> value.
D.<commit> with a <synchronize/> element.
AnswerC

The <commit> operation with <confirmed/> and <confirm-timeout> establishes a confirmed commit. If the engineer does not issue a follow-up <commit> within the timeout, the device automatically rolls back to the previous configuration. This provides the desired automatic rollback on failure, meeting the requirement without manual intervention.

Why this answer

A confirmed commit using <commit> with <confirmed/> and a timeout automatically rolls back if a confirming commit is not received within the timeout period. This is ideal for automation scripts that need to ensure configuration changes do not persist if something goes wrong. It provides a safety net without manual intervention, unlike explicit rollback or discard operations.

Exam trap

The trap here is confusing the explicit <rollback> operation with the automatic rollback provided by a confirmed commit; only the latter triggers automatically on timeout.

217
MCQhard

You are writing a Python script to retrieve interface statistics from a Junos device using the REST API. You use HTTP Basic Authentication. Which HTTP header must be included to pass the encoded credentials correctly?

A.Proxy-Authenticate
B.Authorization
C.Junos-Auth-Token
D.X-API-Key
AnswerB

HTTP Basic Authentication places the Base64-encoded username and password in the Authorization request header, prefixed with "Basic". Without this header the REST API rejects the request as unauthenticated, so it satisfies the credential-passing requirement in the stem.

Why this answer

HTTP Basic Authentication requires the 'Authorization' header containing the keyword 'Basic' followed by the Base64-encoded username:password string.

218
MCQmedium

What is the primary benefit of decoupling network configuration data (YAML/JSON) from presentation templates (Jinja2) in network automation?

A.It allows non-engineers to modify device variables without altering the core template logic, promoting the DRY principle.
B.It eliminates the need for any version control system.
C.It converts all configuration files into binary format to save disk space.
D.It forces the Junos device to run all configuration commits in parallel across all line cards.
AnswerA

Separating data from templates means variable files can be edited independently of Jinja2 logic, so non-engineers change values without touching template code. This satisfies the DRY constraint by keeping one template reused across many device datasets rather than duplicating configuration logic.

Why this answer

Separating data from templates allows the same template to be reused across multiple devices with different data sets, adhering to DRY principles.

219
MCQhard

A network engineer writes a Python script using Junos PyEZ to push a configuration change. The script uses the ConfigTable or Config class. What mechanism does PyEZ use under the hood to ensure the configuration lock is released even if the script encounters an unhandled exception?

A.NETCONF keepalive timers that drop the SSH session after 1 second.
B.A UNIX cron job that reboots the router every 5 minutes.
C.Python context managers ('with' statements) that automatically release locks and clean up session state upon exit.
D.Hardware watchdog timers built into the Routing Engine ASIC.
AnswerC

PyEZ's Config and ConfigTable classes implement Python context managers, so the 'with' block's __exit__ releases the configuration lock and cleans up the session even when an exception propagates. This satisfies the stem's requirement for automatic lock release on unhandled exceptions.

Why this answer

Python context managers (using the 'with' statement) automatically handle acquiring and releasing locks and rolling back candidate changes on exception in PyEZ.

220
Multi-Selectmedium

Which TWO of the following are valid ways to instantiate a PyEZ Device object in Python, providing connection parameters? (Choose two)

Select 2 answers
A.dev = Device(host='192.168.1.1', user='admin', password='secret')
B.dev = Device.connect('192.168.1.1')
C.dev = Device.from_cli('192.168.1.1')
D.dev = Device(database='candidate')
E.dev = Device('192.168.1.1', user='admin', ssh_private_key='/path/to/key')
AnswersA, E

Device() accepts connection parameters as keyword arguments, so host, user and password passed directly instantiate the object and populate the connection details. This is a valid PyEZ instantiation method, satisfying the requirement to provide connection parameters at creation.

Why this answer

Option A is correct because the PyEZ Device constructor accepts connection parameters as keyword arguments, so Device(host='192.168.1.1', user='admin', password='secret') is a valid instantiation that supplies the host, username, and password directly. Option E is also correct because the Device constructor accepts the host as the first positional argument along with keyword parameters such as user and ssh_private_key, so Device('192.168.1.1', user='admin', ssh_private_key='/path/to/key') properly creates a Device object using key-based authentication. Option B is not valid because Device.connect() is not a classmethod for instantiation; connection is performed via the open() method on an already-created Device instance.

Option C is not valid because PyEZ does not provide a Device.from_cli() constructor. Option D is not valid because database='candidate' is not a connection parameter for instantiating a Device; the candidate configuration is selected later via the Config or cu.load() mechanisms, not at object creation.

221
MCQeasy

A network engineer is designing a new automation workflow for Junos devices and wants to understand how the Junos automation stack separates its responsibilities. Which statement accurately describes the role of the Junos management daemon (mgd) in this stack?

A.mgd renders Jinja2 configuration templates before committing changes to the candidate configuration.
B.mgd exposes management interfaces such as NETCONF, CLI, and Junos XML API, and manages the configuration database on the device.
C.mgd performs YANG model validation and generates the final device configuration automatically without any external tooling.
D.mgd is responsible for compiling and enforcing firewall filter policies in the packet forwarding path.
AnswerB

The Junos management daemon (mgd) is the core process that provides management access through NETCONF, the CLI, and the Junos XML API, and it owns the configuration database operations on the device. In this automation workflow, mgd is the component that receives configuration load requests, applies lock/unlock semantics, and commits candidate configurations. Understanding that mgd is the management entry point helps engineers choose the correct protocol when building automated pipelines against Junos.

Why this answer

The Junos management daemon, mgd, is the process that exposes management interfaces including NETCONF, CLI, and the Junos XML API, and it manages the configuration database. In this scenario, the engineer needs to know that mgd is the entry point for loading, locking, and committing configurations. Understanding this separation clarifies why automation tools interact with mgd rather than with forwarding-plane processes, and it guides correct protocol selection for building the workflow.

Exam trap

The trap here is assuming that mgd performs template rendering or policy enforcement, when it actually provides management protocol access and configuration database operations.

222
MCQeasy

Which Junos automation toolset relies heavily on XML over NETCONF and provides robust Python libraries tailored specifically for Junos network devices?

A.Junos PyEZ
B.Cisco IOS XE Embedded Event Manager (EEM)
C.Microsoft PowerShell Active Directory module
D.Arista eAPI Python client library
AnswerA

Junos PyEZ satisfies the NETCONF requirement by using ncclient to exchange XML-encoded RPCs with Junos devices, then abstracting them into Python objects. Its Junos-specific libraries expose configuration tables, operational commands and device facts directly, unlike generic Paramiko or NAPALM, which lack Junos-native XML schema handling.

Why this answer

Junos PyEZ is the Python library tailored specifically for Junos devices using NETCONF.

223
MCQmedium

An automation engineer wants to retrieve information about all software packages installed on a Junos device using the REST API. Which operational RPC endpoint category is typically targeted?

A./api/configuration/system/software
B./netconf/rpc/software
C./api/operational/rpc/get-software-information
D./api/v1/packages/status
AnswerC

The `get-software-information` RPC returns the full software package inventory, satisfying the requirement to list all installed packages. Targeting it under `/api/operational/rpc/` invokes the operational command directly via the Junos REST API, rather than a configuration or management endpoint, which would not expose installed package data.

Why this answer

The Junos REST API exposes operational RPCs under the /api/operational/rpc/ path, and software package information is retrieved via the get-software-information RPC. This endpoint returns details about installed packages, versions, and related state. The other options either target configuration hierarchies or use non-existent REST paths.

Exam trap

JNCIA-DevOps often tests whether candidates know that operational RPCs live under /api/operational/rpc/ and that configuration paths are separate, so mixing up configuration and operational endpoints is the common mistake.

How to eliminate wrong answers

Option A is wrong because /api/configuration/system/software targets the configuration hierarchy, not operational software package status. Option B is wrong because /netconf/rpc/software is not a valid Junos REST API endpoint — NETCONF uses a different transport and path structure. Option D is wrong because /api/v1/packages/status is not a standard Junos REST endpoint; Junos uses /api/operational/rpc/ for operational RPCs.

224
Multi-Selecteasy

Which TWO data serialization formats can an automation engineer request using the 'Accept' header in a Junos REST API GET request? (Choose two)

Select 2 answers
A.application/yaml
B.text/csv
C.application/json
D.application/xml
E.application/octet-stream
AnswersC, D

'application/json' is a valid Accept header value for Junos REST API GET requests, returning responses serialised as JSON. This satisfies the stem's requirement by naming one of the two supported serialisation formats the device can negotiate.

Why this answer

The Junos REST API supports content negotiation through the HTTP Accept header, and the two media types it recognizes for structured data responses are application/json (option C) and application/xml (option D); requesting either of these causes the device to return the RPC reply serialized in JSON or XML respectively. JSON is the default and most commonly used format for automation tooling, while XML mirrors the native Junos XML API output, so both are valid and correct. The remaining options are not supported by the Junos REST API: application/yaml (A) is not a media type Junos negotiates, text/csv (B) is not a serialization format the API emits, and application/octet-stream (E) denotes an opaque binary stream rather than a structured serialization format.

225
Multi-Selectmedium

Which TWO characteristics distinguish the Junos REST API from NETCONF when interacting with Junos devices? (Choose two)

Select 2 answers
A.The REST API communicates directly over TCP port 830.
B.NETCONF requires explicit SSH key pairs for transport security, whereas REST API cannot use encryption.
C.The REST API uses standard HTTP methods (GET, POST, PUT, DELETE) over HTTP/HTTPS ports.
D.The REST API natively supports returning responses formatted in JSON.
E.NETCONF is stateless, whereas REST API maintains persistent interactive sessions by default.
AnswersC, D

REST relies on standard HTTP verbs — GET, POST, PUT, DELETE — sent over HTTP or HTTPS ports, mapping operations onto resources. NETCONF instead uses SSH transport with XML-encoded RPCs, so this HTTP-method characteristic genuinely distinguishes the two interfaces.

Why this answer

Option C is correct because the Junos REST API is an HTTP-based interface that uses standard HTTP verbs (GET to retrieve, POST to create/execute RPCs, PUT to replace, DELETE to remove) and listens on HTTP/HTTPS ports (typically 80/443 or the configured web-management ports), unlike NETCONF which runs over SSH. Option D is correct because the Junos REST API can return responses in JSON (as well as XML), which is a native capability of the REST interface, whereas NETCONF returns XML-encoded data. Option A is incorrect because TCP port 830 is the default NETCONF-over-SSH port, not a REST API port.

Option B is incorrect because NETCONF does not require explicit SSH key pairs (password or key-based SSH both work), and the REST API does support encryption via HTTPS. Option E is incorrect because NETCONF over SSH maintains a persistent session, while REST is inherently stateless per HTTP request.

Page 2

Page 3 of 4

Page 4

All pages