Courseiva

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

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

Page 1 of 4

Page 2
1
MCQmedium

In a Jinja2 template designed for Junos configuration, how do you correctly output the value of a variable named 'hostname'?

A.${hostname}
B.{% hostname %}
C.<< hostname >>
D.{{ hostname }}
AnswerD

Double curly braces denote a Jinja2 expression, so `{{ hostname }}` substitutes the variable's value into the rendered Junos configuration. Single braces or bare names would be emitted literally, failing to satisfy the requirement to output the value.

Why this answer

Jinja2 uses double curly braces {{ }} as the expression delimiter to output the value of a variable into the rendered template. Writing {{ hostname }} substitutes the value of the 'hostname' variable at render time. This is the standard Jinja2 syntax for variable interpolation and is used throughout Junos configuration templates.

Exam trap

JNCIA-DevOps often tests the distinction between Jinja2's expression delimiter {{ }} and its statement delimiter {% %}, and candidates frequently swap them or use shell-style ${} syntax out of habit.

How to eliminate wrong answers

Option A is wrong because ${hostname} is shell/Perl-style variable interpolation, not Jinja2 syntax — Jinja2 does not recognize dollar-brace notation. Option B is wrong because {% hostname %} uses Jinja2's statement delimiter, which is reserved for control structures like if, for, and set, not for outputting variable values. Option C is wrong because << hostname >> is not valid Jinja2 syntax at all — it resembles heredoc or custom placeholder notation and would be rendered literally.

2
MCQeasy

Which PyEZ utility module should you import if you need to upgrade the Junos operating system on a remote device via a Python script?

A.from jnpr.junos.utils.upgrade import Upgrade
B.from jnpr.junos.utils.config import Config
C.from jnpr.junos.device import OS_Update
D.from jnpr.junos.utils.sw import SW
AnswerD

The SW class in jnpr.junos.utils.sw exposes install() and related methods that push a Junos image to a remote device, satisfying the OS upgrade requirement. Importing it gives the script direct access to software-management RPCs rather than generic configuration handling.

Why this answer

The SW utility module from jnpr.junos.utils.sw is used for software installation and upgrades.

3
MCQmedium

Your CI/CD pipeline includes a linters step before deployment. Why is running a linter against YAML or Jinja2 template files critical in a Junos automation workflow?

A.To compile YAML files into Junos microcode for the Packet Forwarding Engine.
B.To automatically execute unit tests against live BGP peering sessions.
C.To detect syntax errors, indentation issues, and style violations in template and data files before deployment.
D.To encrypt sensitive passwords stored within plaintext configuration files.
AnswerC

Linters parse YAML and Jinja2 files and flag malformed syntax, inconsistent indentation and style violations before the pipeline deploys anything. Because YAML hierarchy depends on whitespace and Jinja2 errors surface only at render time, catching these defects early prevents failed or misconfigured Junos deployments.

Why this answer

Linters analyze source code or configuration files for syntax errors, indentation issues, and style violations without executing them. In a Junos automation workflow, running a linter against YAML or Jinja2 templates before deployment catches errors early, preventing failed deployments and reducing troubleshooting time. This is critical because YAML is indentation-sensitive and Jinja2 templates can have syntax errors that only surface at render time.

Exam trap

JNCIA-DevOps often tests the purpose of linters, tricking candidates into selecting options that confuse linting with compilation, testing, or encryption.

How to eliminate wrong answers

Option A is wrong because YAML files are not compiled into Junos microcode; they are data files used by automation tools. Option B is wrong because linters do not execute unit tests against live BGP sessions; that would require a test framework and live devices. Option D is wrong because linters do not encrypt passwords; encryption is handled by tools like Ansible Vault or Junos' own encryption mechanisms.

4
MCQmedium

An engineer needs to convert an existing YAML-formatted inventory file into JSON format using a Python script. Which workflow accomplishes this transformation?

A.Directly pass the YAML file object into json.load().
B.Rename the file extension from .yaml to .json.
C.Load YAML with yaml.safe_load() and serialize to JSON with json.dumps().
D.Use yaml.safe_dump() directly on the JSON output stream.
AnswerC

Loading YAML with `yaml.safe_load()` parses the inventory into native Python dictionaries and lists, then `json.dumps()` serialises that structure into a JSON string. This two-step parse-then-serialise workflow satisfies the stem's requirement to convert an existing YAML inventory into JSON, avoiding unsafe object construction.

Why this answer

To convert YAML to JSON, the engineer must read and parse the YAML file into a Python data structure using yaml.safe_load(), and then serialize that structure into a JSON string using json.dumps().

5
MCQhard

You are developing a PyEZ script that loads a configuration snippet onto a Junos device. You want to ensure the configuration is merged with the existing candidate configuration and then committed. Which sequence of PyEZ methods should you use?

A.`dev.load_config()` then `dev.commit_check()` then `dev.commit()`
B.`dev.load()` then `dev.commit()`
C.`dev.load_config(merge=False)` then `dev.commit()`
D.`dev.load_config()` then `dev.commit()`
AnswerD

`dev.load_config()` loads the configuration into the candidate configuration, and by default it performs a merge operation. After loading, `dev.commit()` commits the candidate configuration to make it active. This sequence correctly merges the snippet and commits it, achieving the desired result.

Why this answer

The PyEZ `load_config()` method loads a configuration snippet into the candidate configuration, merging it with existing configuration by default. Calling `commit()` then activates the candidate configuration on the device. This two-step sequence is the standard way to apply configuration changes with PyEZ, ensuring that the snippet is merged and committed as required.

Exam trap

The trap here is confusing the lower-level `load()` method with the higher-level `load_config()`, or mistakenly thinking that `merge=False` is needed for merging when it actually replaces the configuration.

6
MCQhard

An engineer is troubleshooting a script that updates Junos configuration via the REST API. The payload is sent as JSON, but the device returns a 415 Unsupported Media Type error. What is the root cause?

A.The device is running out of memory buffers.
B.The user account does not have permission to execute PUT requests.
C.The Content-Type header provided in the HTTP request is missing or specifies an unsupported media type.
D.The target resource URI path does not exist on the device.
AnswerC

A 415 response is returned by the Junos REST API when the request's Content-Type header does not match the payload format. Since the script sends JSON, the header must be `Content-Type: application/json`; omitting it or specifying another media type causes the device to reject the request before parsing the body.

Why this answer

HTTP 415 Unsupported Media Type means the server refuses to process the request because the payload's media type is not supported. In the Junos REST API, the client must send a Content-Type header (e.g., 'application/json' or 'application/xml') that matches the payload format. If the header is missing or set to something the device does not accept, the device returns 415.

Exam trap

JNCIA-DevOps often tests HTTP status code semantics — candidates confuse 415 (media type) with 401/403 (auth), 404 (not found), or 500 (server error), and pick the wrong root cause.

How to eliminate wrong answers

Option A is wrong because memory exhaustion would typically manifest as a 500 Internal Server Error or a timeout, not a 415 — 415 is specifically about media type negotiation. Option B is wrong because insufficient permissions produce 401 Unauthorized or 403 Forbidden, not 415. Option D is wrong because a non-existent URI path produces 404 Not Found, not 415.

7
MCQhard

You are writing a Python automation tool that reads telemetry data from a Junos device. The data is received as a JSON string containing forward slashes escaped as '\/'. When you load this string using json.loads(), how does Python handle the escaped slashes?

A.The parser raises a ValueError because escaped slashes are invalid in JSON.
B.They remain as literal escaped sequences ('\/').
C.They are converted to backslashes ('\').
D.They are automatically converted to unescaped forward slashes ('/').
AnswerD

JSON treats the backslash as an escape character, so the sequence \/ is decoded to a plain forward slash. json.loads() therefore returns the string with unescaped slashes, satisfying the stem's question about handling of escaped forward slashes.

Why this answer

JSON allows forward slashes to be escaped as '\/' for embedding JSON inside HTML script tags. Python's json.loads() automatically unescapes '\/' into normal '/' characters in the resulting string.

8
Multi-Selecthard

When troubleshooting REST API authentication and authorization on Junos devices, which THREE log files or diagnostic tools can an administrator inspect? (Choose three)

Select 3 answers
A.Kernel core dump files located in /var/crash/kernel.
B.HTTP response headers and status codes returned by the API client.
C.jpagent traceoptions log file (if configured under system services jpagent)
D.BGP peer state packet captures in Wireshark.
E./var/log/messages system log file for daemon startup and authentication events.
AnswersB, C, E

HTTP response headers and status codes expose authentication and authorisation outcomes directly: 401 signals failed credentials, 403 signals insufficient privileges, and WWW-Authenticate reveals the required scheme. Inspecting these on the API client satisfies the stem's need to diagnose REST authentication and authorisation faults without device-side log access.

Why this answer

Option B is correct because the HTTP response headers and status codes returned by the API client directly reveal REST API authentication and authorization outcomes, such as 401 Unauthorized for failed authentication or 403 Forbidden for insufficient privileges, making them a primary diagnostic tool. Option C is correct because the jpagent process handles Junos REST API requests, and enabling traceoptions under system services jpagent writes detailed request, authentication, and authorization handling information to the jpagent trace log for inspection. Option E is correct because /var/log/messages records daemon startup and authentication-related events, including messages from processes involved in REST API access, which helps correlate login and service failures.

Option A is not relevant because kernel core dumps in /var/crash/kernel capture kernel crash data, not REST API authentication or authorization activity. Option D is not relevant because BGP peer state packet captures in Wireshark analyze routing protocol behavior, not REST API authentication or authorization flows.

9
Multi-Selectmedium

Which TWO statements are true regarding PyEZ Table and View definitions? (Choose two)

Select 2 answers
A.Tables can only be used to modify device configurations, not read operational state.
B.Tables require Jinja2 templates to parse raw XML output.
C.A View defines how individual fields within the returned XML elements are mapped to Python dictionary keys.
D.Tables are typically defined using YAML configuration files.
E.Views replace the need to instantiate a Device object.
AnswersC, D

A View maps each XML element returned by the device to a named Python dictionary key, so Table output becomes usable Python data. This field-level mapping is exactly what the stem asks about regarding View definitions.

Why this answer

Option C is correct because a PyEZ View specifies the mapping between fields in the returned XML (via XPath expressions) and the corresponding Python dictionary keys, allowing structured access to the data. Option D is correct because PyEZ Tables are commonly defined in YAML files, where you declare the table's XPath, view, and key/column mappings. Option A is wrong because Tables are primarily used to retrieve and parse operational state, not to modify configuration.

Option B is wrong because Tables parse XML directly using their View definitions; Jinja2 templates are used for configuration templating, not for Table parsing. Option E is wrong because a View is only a schema/mapping definition and still requires a Device object (or an equivalent connection) to fetch data from the device.

Exam trap

JNCIA-DevOps often tests the misconception that Tables require Jinja2 templates or are only for configuration — in reality, Tables are YAML-defined and primarily used for reading operational state.

10
Multi-Selectmedium

Which THREE mechanisms are valid methods for authenticating and establishing a NETCONF session with a Junos device? (Choose three)

Select 3 answers
A.Remote RADIUS or TACACS+ AAA server integration via SSH transport
B.Username and password authentication over SSH
C.SSH public key authentication
D.Anonymous guest access without credentials
E.Unencrypted cleartext Telnet on TCP port 23
AnswersA, B, C

Junos NETCONF sessions run over SSH, and authentication can be delegated to external RADIUS or TACACS+ AAA servers rather than local accounts. This satisfies the stem by combining SSH transport with centralised AAA credential validation for the session.

Why this answer

Option B is correct because NETCONF sessions are established over SSH (default TCP port 830), and the client can authenticate with a username and password just like a standard SSH login. Option C is correct because SSH public key authentication is a supported method for authenticating the NETCONF-over-SSH session, using the client's private key matched against an authorized key on the Junos device. Option A is correct because Junos can delegate authentication of NETCONF-over-SSH users to external RADIUS or TACACS+ AAA servers, so credentials are validated by the remote AAA server rather than only local accounts.

Option D is wrong because NETCONF requires authenticated credentials and does not permit anonymous guest access. Option E is wrong because NETCONF uses SSH transport, not unencrypted cleartext Telnet on TCP port 23.

Exam trap

JNCIA-DevOps often tests whether candidates know NETCONF requires SSH transport — options like Telnet or anonymous access are distractors that violate the protocol's security model.

11
Multi-Selecthard

Which THREE advanced features or methods are available on a PyEZ Device instance for session management and inspection? (Choose three)

Select 3 answers
A.dev.timeout property to get or set NETCONF RPC timeout values
B.dev.connected property to check if the session is active
C.dev.capabilities list showing NETCONF server capability URIs
D.dev.reload_session() for refreshing device facts
E.dev.commit_timeout for software installation timing
AnswersA, B, C

The dev.timeout property reads or sets the NETCONF RPC timeout on a PyEZ Device instance, controlling how long the library waits for a response. This satisfies the session-management requirement by letting scripts tune RPC timeouts for slow or long-running operations.

Why this answer

Option A is correct because a PyEZ Device object exposes a timeout property that lets you get or set the NETCONF RPC timeout value used for requests. Option B is correct because the connected property returns a boolean indicating whether the NETCONF session to the device is currently active. Option C is correct because the capabilities attribute returns the list of NETCONF server capability URIs advertised by the device, useful for feature inspection.

Option D is not a real PyEZ Device method; refreshing facts is done via facts_refresh(), not reload_session(). Option E is not a valid PyEZ Device attribute; commit timeouts are handled through configuration/commit options rather than a commit_timeout property.

Exam trap

JNCIA-DevOps often tests the exact names of PyEZ Device properties and methods — candidates confuse valid attributes like dev.timeout with non-existent ones like dev.commit_timeout.

12
MCQmedium

In the context of network DevOps, what is the purpose of implementing idempotency in automation scripts or playbooks targeting Junos devices?

A.To ensure that running the same configuration task multiple times produces the exact same desired state without making redundant changes if already applied.
B.To encrypt all configuration payloads using AES-256 before transport.
C.To ensure that every script execution generates a completely random new configuration to test device resilience.
D.To force the Junos Routing Engine to reboot every time a script is executed.
AnswerA

Idempotency compares the requested configuration against the device's current state, so repeated runs converge on the same result without reapplying unchanged statements. This satisfies the requirement that rerunning a playbook causes no redundant commits or disruptive changes on Junos devices.

Why this answer

Idempotency ensures that running the same automation task multiple times yields the same result without making unintended changes if the state is already correct.

13
MCQhard

When using PyEZ to push a configuration, you want to log out all NETCONF XML traffic exchanged between the script and the Junos device for debugging purposes. How do you enable this logging in Python?

A.import jnpr.junos.debug; jnpr.junos.debug.enable()
B.dev.rpc.trace(enabled=True)
C.Configuring Python logging for the 'jnpr.junos' logger with DEBUG level
D.dev.debug = True
AnswerC

PyEZ uses Python's standard logging framework, emitting NETCONF XML traffic through the jnpr.junos logger. Setting that logger to DEBUG level captures the full request and reply exchange between script and device, satisfying the stem's debugging requirement.

Why this answer

PyEZ uses Python's standard `logging` module and emits all NETCONF XML traffic under the `jnpr.junos` logger hierarchy. Setting that logger to DEBUG level (via `logging.getLogger('jnpr.junos').setLevel(logging.DEBUG)` plus a handler) causes the full request/response XML to be logged. There is no PyEZ-specific debug flag or `dev.debug` attribute that performs this function.

Exam trap

JNCIA-DevOps often tests whether candidates invent PyEZ-specific debug APIs (`dev.debug`, `jnpr.junos.debug`) instead of recognizing that PyEZ relies on the standard Python `logging` module and the `jnpr.junos` logger namespace.

How to eliminate wrong answers

Option A is wrong because there is no `jnpr.junos.debug` module or `enable()` function in PyEZ — debugging is done through the standard Python logging framework. Option B is wrong because `dev.rpc.trace()` is not a PyEZ API; `dev.rpc` exposes Junos RPC methods, not a tracing toggle. Option D is wrong because `dev.debug = True` is not a recognized PyEZ attribute and would simply set an unused instance variable without enabling any logging.

14
MCQmedium

An engineer needs to execute a custom Junos RPC (such as 'get-route-information') using the REST API. Which HTTP method and general URI structure should be used?

A.HTTP GET/POST targeting /api/operational/rpc/<rpc-name>
B.HTTP PATCH targeting /api/v1/rpc
C.HTTP DELETE targeting /rpc/clear/<rpc-name>
D.HTTP PUT targeting /api/configuration/rpc/<rpc-name>
AnswerA

The Junos REST API exposes operational RPCs beneath /api/operational/rpc/<rpc-name>, invoked with HTTP GET or POST. This URI structure lets the engineer call custom RPCs such as get-route-information directly, with arguments supplied as query parameters or XML/JSON payload.

Why this answer

Custom RPCs in the Junos REST API are typically executed using HTTP GET or POST requests directed to the RPC execution endpoint, such as /api/operational/rpc/get-route-information or via the rpc resource path.

15
MCQeasy

What is JSNAPy primarily used for in Junos network automation?

A.Taking operational state snapshots and verifying device health
B.Compiling Junos CLI operational commands into Python bytecode
C.Performing automated firmware upgrades across clusters
D.Generating static configuration templates
AnswerA

JSNAPy takes snapshots of operational state and compares them against stored or expected values, verifying device health and configuration compliance. It satisfies the stem by providing snapshot-and-check automation rather than configuration pushing or RPC execution.

Why this answer

JSNAPy (Junos Snapshot Administrator in Python) is a Python tool that captures operational state snapshots from Junos devices and compares them against a baseline to verify health and detect drift. It is commonly used for pre/post-change validation and compliance checks. It does not compile CLI commands, perform firmware upgrades, or generate configuration templates.

Exam trap

JNCIA-DevOps often tests whether candidates confuse JSNAPy's operational-state verification role with configuration-generation or upgrade tools, so distractors describing templating or firmware tasks look plausible.

How to eliminate wrong answers

Option B is wrong because JSNAPy does not compile Junos CLI commands into Python bytecode — that description does not match any Junos tool; JSNAPy works with YAML-defined checks and RPC calls. Option C is wrong because automated firmware upgrades are handled by tools like Junos Space, Ansible, or PyEZ scripts, not JSNAPy. Option D is wrong because static configuration template generation is the domain of Jinja2, Ansible templates, or PyEZ config utilities — JSNAPy focuses on operational state, not configuration generation.

16
Multi-Selecteasy

Which TWO advantages does structured telemetry and data streaming offer over traditional SNMP polling in Junos automation? (Choose two)

Select 2 answers
A.Requiring all network devices to run Windows Server OS
B.Mandatory requirement for analog dial-up modems
C.High granularity and real-time visibility into operational state
D.Elimination of all network interfaces
E.Push-based streaming model instead of periodic polling overhead
AnswersC, E

Streaming telemetry pushes continuous, high-frequency data from Junos devices, delivering sub-second granularity that SNMP polling cannot match. Polling is constrained by interval-based collection, so transient events between cycles are missed. This satisfies the stem's requirement for real-time visibility into operational state, giving automation workflows immediate, fine-grained awareness of device conditions.

Why this answer

Option C is correct because structured telemetry and data streaming provide high granularity and real-time visibility into operational state, delivering continuous, fine-grained metrics (e.g., via gRPC or JTI) rather than the coarse, interval-based snapshots typical of SNMP polling. Option E is correct because streaming uses a push-based model where devices proactively send data to collectors, eliminating the periodic polling overhead and associated CPU, bandwidth, and latency costs of SNMP GET/WALK cycles. The unmarked options do not belong: A is wrong because Junos devices run Junos OS, not Windows Server, and telemetry does not require it; B is wrong because analog dial-up modems are obsolete and irrelevant to modern telemetry transport; D is wrong because network interfaces are still required for connectivity and telemetry transport, so they are not eliminated.

17
MCQmedium

An automation engineer wants to log structured data from a Junos device automation run. The Python script formats a dictionary into a JSON string and prints it. However, the engineer wants all keys sorted alphabetically to ensure consistent log diffing. Which parameter accomplishes this in json.dumps()?

A.keys_sort=True
B.alphabetize=True
C.sort_keys=True
D.order='alphabetical'
AnswerC

Passing sort_keys=True to json.dumps() orders every dictionary key alphabetically in the emitted JSON string. Identical data then serialises identically across runs, so line-by-line log diffs stay stable rather than shifting whenever key insertion order changes.

Why this answer

The sort_keys parameter in json.dumps() sorts the output of dictionaries by key alphabetically.

18
MCQhard

An enterprise network is adopting a CI/CD pipeline for Junos network changes using GitLab CI. A developer wants to ensure that a test job automatically runs whenever a merge request is opened against the main branch. In which configuration file must this pipeline behavior be defined, and what is the primary keyword used to control branch execution?

A.Junos 'juniper.conf', using the 'commit-script' keyword
B.ansible.cfg, using the 'hosts' parameter
C.Jenkinsfile, using the 'when' parameter
D..gitlab-ci.yml, using the 'rules' or 'only' keyword
AnswerD

GitLab CI reads pipeline definitions solely from .gitlab-ci.yml at the repository root, so merge-request-triggered test jobs must be declared there. The 'rules' keyword (or legacy 'only') controls which branches or events, such as merge requests against main, cause the job to execute.

Why this answer

GitLab CI pipelines are defined in a .gitlab-ci.yml file located in the root of the repository, and jobs use the 'rules' or 'only/except' keywords to control execution on specific branches.

19
MCQhard

An automation engineer writes a Python script that reads a Junos configuration exported as JSON and uses json.loads to parse it. The script then searches for a key named "interfaces". The JSON document contains two objects at the same nesting level, each with an "interfaces" key, because the configuration was merged from two sources. What will json.loads produce, and how should the script handle it?

A.The parser raises a ValueError because JSON forbids duplicate keys, so the script must catch the exception and merge the two sources manually.
B.The parser stores both occurrences and exposes them through a special duplicate key accessor that the script can iterate over.
C.The parser keeps only the last occurrence of "interfaces" for that object, so the script loses the first source's data unless the original JSON is restructured to use unique keys or an array.
D.The parser combines both values into a Python list under the single "interfaces" key, preserving data from both sources automatically.
AnswerC

JSON objects are collections of name/value pairs, and when duplicate names appear, standard parsers such as Python's json module retain only the last one. The first source's interface data is therefore silently discarded, and the script must be changed to avoid duplicate keys, for example by wrapping each source's interfaces in an array.

Why this answer

When a JSON object contains duplicate names, Python's json.loads keeps the last occurrence and discards earlier ones without warning. The script must avoid duplicate keys by restructuring the data, such as placing each source's interfaces in a separate array element, so no information is lost during parsing.

Exam trap

The trap here is expecting JSON parsers to reject or merge duplicate keys, when in practice they silently keep only the last value.

20
MCQeasy

What Jinja2 feature allows you to include the contents of another template file into your main configuration template?

A.{% insert 'filename.j2' %}
B.{% import 'filename.j2' %}
C.{{ load_template('filename.j2') }}
D.{% include 'filename.j2' %}
AnswerD

The `{% include 'filename.j2' %}` tag performs template composition, pulling the referenced file's rendered contents directly into the parent template at that point. This satisfies the stem's requirement to embed another template file's contents, unlike `{% import %}` or `{% extends %}`, which handle macros and inheritance respectively rather than inline inclusion.

Why this answer

Jinja2's {% include 'filename.j2' %} statement renders the contents of another template file inline at that point in the parent template. This is the standard mechanism for modularizing templates — common config blocks (e.g., standard interface settings, SNMP communities) can be stored in separate files and included where needed. The included template shares the parent's variable context.

Exam trap

JNCIA-DevOps often tests the distinction between {% include %} (renders inline with shared context) and {% import %} (loads macros into a namespace without rendering) — candidates who pick import for inline inclusion get it wrong.

How to eliminate wrong answers

Option A is wrong because {% insert 'filename.j2' %} is not Jinja2 syntax — there is no 'insert' statement in Jinja2. Option B is wrong because {% import 'filename.j2' %} is used to import macros and variables from another template into the current namespace, not to render the file's contents inline; import requires the imported file to define macros. Option C is wrong because {{ load_template('filename.j2') }} is not a Jinja2 function — load_template is not part of Jinja2's global namespace, and using {{ }} would attempt to evaluate it as an expression, not a statement.

21
MCQmedium

You need to lock the candidate configuration datastore in your NETCONF script to prevent concurrent modifications by other administrators. Which XML element accomplishes this?

A.<lock-config>
B.<acquire-lock>
C.<exclusive-edit>
D.<lock>
AnswerD

The <lock> element targets the candidate datastore, granting the requesting session exclusive write access so concurrent administrators cannot commit changes. This satisfies the requirement to prevent concurrent modifications during the script's edit window, and the lock is released by <unlock> or session termination.

Why this answer

The <lock> RPC takes a target element specifying which datastore to lock, such as the candidate datastore.

22
MCQhard

When writing a Python script to interact with a Junos device via PyEZ, you receive an object representing RPC output. You want to serialize a custom Python class instance containing device metadata into JSON, but calling json.dumps() raises a TypeError. What is the standard approach to resolve this?

A.Pass a custom serialization function to the 'default' parameter in json.dumps().
B.Use yaml.safe_dump() instead, which natively serializes all custom Python classes.
C.Convert the object into an XML string before calling json.dumps().
D.Modify the global sys.path variable to include the custom class definition.
AnswerA

json.dumps() cannot natively encode arbitrary class instances, so it raises TypeError. Supplying a function to the default parameter lets you return a serialisable representation, such as a dictionary, for objects the encoder cannot handle, satisfying the custom-serialisation requirement.

Why this answer

The json module does not know how to serialize custom Python object instances by default. You must provide a custom serialization function and pass it to the 'default' parameter of json.dumps().

23
MCQmedium

An automation script attempts to connect to the Junos REST API via HTTPS, but the Python script throws an SSL certificate verification error. What is the most appropriate way to resolve this in a development environment while maintaining security best practices?

A.Switch from REST API to NETCONF, which does not use SSL certificates.
B.Downgrade the REST API connection from HTTPS to plain HTTP 80.
C.Change the Junos system host-name to match the default SSL common name.
D.Configure the client application to trust the Junos device's self-signed CA certificate or install a valid enterprise CA certificate on the Junos device.
AnswerD

Trusting the device's self-signed CA certificate, or installing a proper enterprise CA certificate on the Junos device, fixes the verification failure without disabling TLS checks. This satisfies the stem's constraint of resolving the error while maintaining security best practices.

Why this answer

Self-signed certificates on Junos devices cause SSL verification errors. The best practice is to install the device's CA certificate in the client's trust store, rather than disabling verification globally in production.

24
MCQeasy

Which of the following primitive data types is NOT supported natively in JSON?

A.Undefined
B.Number
C.String
D.Null
AnswerA

JSON defines only string, number, object, array, boolean and null. Undefined, familiar from JavaScript, has no JSON representation, so it cannot be expressed natively; serialisers typically omit such properties or convert them to null instead.

Why this answer

JSON supports a limited set of primitive data types defined in RFC 8259: string, number, boolean, null, object, and array. 'Undefined' is not one of them — it is a JavaScript-specific value that has no representation in the JSON specification. When JavaScript serializes an object with JSON.stringify(), any property whose value is undefined is simply omitted from the output rather than encoded.

Exam trap

JNCIA-DevOps often tests candidates who confuse JavaScript's runtime type system (which includes undefined) with JSON's serialization specification, assuming anything valid in JS objects is valid in JSON.

How to eliminate wrong answers

Option B is wrong because Number is a core JSON primitive used for integers and floating-point values (e.g., 42, 3.14). Option C is wrong because String is a fundamental JSON primitive, always enclosed in double quotes. Option D is wrong because Null is an explicit JSON literal (the keyword null) used to represent an intentional absence of value.

25
Multi-Selecthard

In a Git repository managing Junos configurations, which TWO files or directories are typically added to the '.gitignore' file to prevent sensitive or temporary files from being tracked? (Choose two)

Select 2 answers
A.Core YANG data models provided by Juniper
B.Local IDE configuration folders and temporary build output directories
C.Master branch commit history logs
D.Files containing decrypted production passwords or private SSH keys
E.Standard production Jinja2 templates (.j2)
AnswersB, D

Local IDE configuration folders and temporary build output directories hold machine-specific settings and generated artefacts that must never enter version control. Ignoring them keeps the repository clean and prevents accidental commits of transient data, satisfying the stem's requirement to exclude temporary files from tracking.

Why this answer

Option B is correct because local IDE configuration folders (e.g., .vscode/, .idea/) and temporary build output directories contain machine-specific or generated artifacts that should never be committed to a shared Git repository. Option D is correct because files holding decrypted production passwords or private SSH keys are highly sensitive secrets that must be excluded from version control to prevent credential leakage. Option A is incorrect because Juniper's core YANG data models are vendor-supplied schema files that are typically versioned or referenced deliberately, not ignored.

Option C is incorrect because Git commit history is intrinsic to the repository's object database and cannot be placed in .gitignore. Option E is incorrect because standard production Jinja2 templates are legitimate configuration source files that should be tracked and versioned.

26
MCQmedium

An automation script needs to compare pre- and post-change states on a Junos device using JSNAPy (Junos Snapshot Administrator). Which configuration file format is used by JSNAPy to define snapshot checks and test assertions?

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

JSNAPy defines snapshot checks and test assertions in YAML files, satisfying the requirement to compare pre- and post-change states. Its configuration files (config.yaml, test files) use YAML syntax, letting the script declare which commands to snapshot and which assertions to run against the captured device state.

Why this answer

JSNAPy uses YAML files to define snapshots and test assertions. Snapshot files (for example, `snapshot.yaml`) list the commands or RPCs to capture, and test files (for example, `test.yaml`) define assertions using operators like `is-equal`, `is-greater-than`, and `contains`. YAML's human-readable structure makes it the standard format for JSNAPy configuration.

Exam trap

JNCIA-DevOps often tests the distinction between the data format returned by Junos (XML) and the configuration format used by JSNAPy (YAML), so candidates who conflate the two pick XML incorrectly.

How to eliminate wrong answers

Option B is wrong because XML is the format of the data returned by Junos RPCs, not the format JSNAPy uses to define snapshot or test files. Option C is wrong because JSON is not the configuration format for JSNAPy snapshot or test definitions — JSNAPy parses YAML. Option D is wrong because INI is a legacy key-value format not used by JSNAPy for snapshot or assertion configuration.

27
MCQeasy

Which Jinja2 construct is used to define reusable blocks of template code that can be called with arguments like a function?

A.{% def %} ... {% enddef %}
B.{% block %} ... {% endblock %}
C.{% macro %} ... {% endmacro %}
D.{% function %} ... {% endfunction %}
AnswerC

The `{% macro %}` construct defines reusable template blocks that accept arguments, functioning like a function within Jinja2. It satisfies the stem's requirement for callable, parameterised code reuse, unlike `{% include %}` or `{% import %}`, which pull in external templates without argument passing.

Why this answer

Macros in Jinja2 act like functions for templates.

28
MCQmedium

You need to load a set of configuration changes into the Junos candidate datastore from an inline XML string using NETCONF. Which RPC element is used to load configuration data?

A.<update-candidate>
B.<set-config>
C.<load-configuration>
D.<edit-config>
AnswerC

The <load-configuration> RPC carries configuration data into the Junos candidate datastore over NETCONF. This satisfies the scenario's requirement to load inline XML changes, accepting the XML string as its payload before a subsequent commit activates them.

Why this answer

The <load-configuration> RPC is a Juniper-specific extension used within NETCONF to load configuration data with formats like XML, text, or set.

29
MCQhard

An engineer is comparing how NETCONF and the Junos REST API handle candidate configuration validation. In NETCONF, the client can issue a <validate> RPC. How is configuration validation typically handled in the Junos REST API workflow?

A.NETCONF validates via XML, while REST API automatically converts invalid syntax into comments.
B.Configuration updates via REST API can include validation parameters or commit-check actions to verify syntax before finalizing.
C.Validation requires downloading the entire configuration as a text file and running an external Python syntax checker.
D.Validation is impossible in REST API; changes are always applied directly to the forwarding plane immediately.
AnswerB

Unlike NETCONF's dedicated <validate> RPC, the Junos REST API folds validation into the commit workflow: requests can carry commit-check or validation parameters so the device parses and verifies candidate syntax before the change is finalised.

Why this answer

The Junos REST API supports validation parameters or actions (such as checking candidate syntax during configuration updates or invoking validation actions via commit parameters) to ensure correctness before committing.

30
Multi-Selecthard

An automation engineer is designing a data model for Junos device inventory that will be serialized to JSON and consumed by multiple tools. The engineer wants to include a null value, a boolean, and a string that contains a colon and a space. Which TWO statements correctly describe JSON serialization rules that apply to this model? (Choose two.)

Select 2 answers
A.JSON object keys must be unique and must always be enclosed in single quotation marks to distinguish them from values.
B.JSON permits comments and trailing commas, so the inventory model can include annotations after each field for documentation.
C.A JSON null value is represented by the literal null, and a JSON boolean is represented by the literals true or false, all without quotation marks.
D.A JSON string containing a colon and a space must escape both characters with a backslash to remain valid.
E.A JSON string value must be enclosed in double quotation marks, and any embedded double quote must be escaped with a backslash.
AnswersC, E

The JSON specification defines null, true, and false as unquoted literals. In the inventory model, the null field becomes Python None and the boolean field becomes a Python bool after decoding, which lets downstream automation tools test presence and flags without string comparison.

Why this answer

JSON strings use double quotation marks and escape embedded double quotes with a backslash. The literals null, true, and false are unquoted and map to Python None and bool. Colons and spaces inside strings need no escaping, and comments or trailing commas are not permitted in standard JSON.

Exam trap

The trap here is assuming that characters such as colon and space need escaping inside JSON strings, when only quote, backslash, and control characters do.

31
MCQmedium

A DevOps engineer is building a pipeline that uses Junos PyEZ to retrieve operational data from a fleet of Junos devices. The engineer wants to understand which transport protocol PyEZ uses by default and why this matters for firewall rules. Which statement is correct?

A.PyEZ uses SNMP by default on UDP port 161 to gather operational data from Junos devices.
B.PyEZ uses Telnet by default on TCP port 23, and the firewall must allow Telnet for management access.
C.PyEZ uses SSH by default on TCP port 22, and the firewall must allow SSH between the automation host and the devices.
D.PyEZ uses HTTP by default on TCP port 80 and requires the REST API to be enabled on the device.
AnswerC

Junos PyEZ communicates with Junos devices over NETCONF, which by default runs over SSH on TCP port 22. In this scenario, the automation host must be able to reach the devices on port 22 for the pipeline to retrieve operational data. If firewall rules block SSH, PyEZ connections will fail even if the device is otherwise reachable. This is why the engineer should verify that SSH access is permitted from the automation host to the Junos management interface.

Why this answer

Junos PyEZ uses NETCONF over SSH by default, which means it connects to Junos devices on TCP port 22. In this pipeline scenario, the automation host must have SSH access to the devices for PyEZ to retrieve operational data. Firewall rules that block SSH will cause PyEZ operations to fail.

Recognizing the default transport helps engineers configure network access correctly and avoid unnecessary exposure of other services like Telnet or HTTP.

Exam trap

The trap here is assuming PyEZ uses a web-based or SNMP transport, when it actually relies on NETCONF over SSH on port 22 by default.

32
MCQmedium

An automation scripter needs to load a YAML configuration file in Python. To prevent arbitrary code execution vulnerabilities associated with untrusted files, which function should always be called?

A.yaml.safe_load()
B.yaml.load()
C.yaml.secure_load()
D.yaml.restricted_load()
AnswerA

yaml.safe_load() restricts parsing to standard YAML tags, constructing only basic Python types and refusing arbitrary object instantiation. The default load() can execute embedded Python tags, so safe_load() satisfies the constraint of processing untrusted configuration files without exposing code-execution vulnerabilities.

Why this answer

yaml.safe_load() restricts loading to simple Python types like scalars, lists, and dicts, preventing instantiation of arbitrary Python objects.

33
Multi-Selecthard

An automation team is designing a script that uses the Junos REST API to manage configurations on a fleet of Junos devices. They need to ensure secure communication and proper error handling. Which two practices should they implement? (Choose two.)

Select 2 answers
A.Parse HTTP status codes and response bodies to detect and handle API errors gracefully.
B.Store credentials in plaintext within the script to avoid external dependencies.
C.Disable SSL certificate verification in the script to prevent connection failures due to self-signed certificates.
D.Use HTTPS with certificate validation to encrypt API traffic and verify the device identity.
E.Use HTTP instead of HTTPS to reduce latency and simplify certificate management.
AnswersA, D

The Junos REST API returns standard HTTP status codes (e.g., 200, 400, 401, 500) and may include error details in the response body. Proper error handling involves checking these codes and parsing messages to retry or log failures. This ensures robust automation that can react to issues like authentication failures or invalid requests.

Why this answer

Secure automation with the Junos REST API requires using HTTPS with certificate validation to protect data in transit and verify the device. Additionally, robust error handling by checking HTTP status codes and parsing response bodies ensures the script can detect and respond to failures. These practices together provide security and reliability.

Exam trap

The trap here is prioritizing convenience over security by using HTTP or disabling certificate verification, or neglecting error handling, which can lead to insecure or fragile automation.

34
Multi-Selectmedium

Which THREE features are provided by the Junos REST API daemon (jpagent) when running on a Junos device? (Choose three)

Select 3 answers
A.Kernel-level packet forwarding optimization for ASIC line cards.
B.Translation between REST requests/JSON/XML payloads and Junos configuration/operational structures.
C.HTTP and HTTPS server listener management on configurable ports.
D.Authentication validation against local user databases or AAA.
E.Autonomous BGP route reflection across core routing instances.
AnswersB, C, D

jpagent converts REST requests and JSON or XML payloads into Junos configuration and operational structures, satisfying the stem's requirement for a translation feature. Without this mapping, REST clients could not drive native Junos RPCs or configuration hierarchies.

Why this answer

Option B is correct because jpagent's core function is to translate incoming REST requests and their JSON or XML payloads into Junos configuration and operational data structures, allowing the REST API to manipulate the same candidate/active configuration and operational command infrastructure used by the CLI. Option C is correct because jpagent manages the HTTP and HTTPS listeners, including binding to configurable ports (for example via the 'set system services rest http port' or 'https port' configuration), so clients can reach the REST endpoint. Option D is correct because jpagent performs authentication validation for REST requests against local user accounts or external AAA (RADIUS/TACACS+) before allowing access to Junos resources.

Option A is incorrect because kernel-level packet forwarding and ASIC line-card optimization are handled by the Packet Forwarding Engine and related hardware/software components, not by the REST API daemon. Option E is incorrect because BGP route reflection is a routing protocol function configured under BGP, not a service provided by jpagent.

Exam trap

The trap here is conflating the REST API daemon with routing or forwarding functions — candidates may pick options that describe rpd or PFE behavior because they sound like 'device services'.

35
MCQeasy

An engineer is designing a Junos automation solution that requires programmatic access to retrieve operational data and configuration from devices. The solution must use a standardized, vendor-neutral protocol that supports capabilities exchange and transactions. Which protocol should be used?

A.NETCONF
B.CLI over SSH
C.SNMP
D.RESTCONF
AnswerA

NETCONF is a standardized protocol defined by the IETF for network management. It uses XML-based RPCs over SSH and supports capabilities exchange, configuration transactions, and retrieval of operational data. Junos devices support NETCONF natively, making it ideal for vendor-neutral automation. The scenario requires a standardized protocol with transactional support, which NETCONF provides.

Why this answer

NETCONF is the IETF-standard protocol designed for network configuration and management, offering capabilities exchange, transactional changes, and structured data retrieval. SNMP is for monitoring, RESTCONF is RESTful but less transactional, and CLI over SSH is not standardized. For a vendor-neutral, transactional automation solution on Junos, NETCONF is the correct choice.

Exam trap

The trap here is assuming that any remote management protocol like SNMP or CLI over SSH can provide transactional configuration, but only NETCONF is built for that purpose.

36
Multi-Selecteasy

Which TWO characters or sequences are valid in YAML for representing lists or sequences? (Choose two)

Select 2 answers
A.Hyphen followed by a space (- )
B.Semicolon followed by a space (; )
C.Angle brackets (< >)
D.Curly braces ({ })
E.Square brackets ([ ])
AnswersA, E

In YAML block style, a hyphen followed by a space introduces each sequence entry, marking a list item at the current indentation level. This satisfies the stem's requirement for a valid list representation, distinct from flow-style bracket notation.

Why this answer

Option A is correct because YAML uses a hyphen followed by a space ("- ") as block sequence indicator, where each list item is introduced by that dash at the same indentation level. Option E is correct because YAML supports flow sequences written with square brackets, e.g. [one, two, three], representing a list inline. Option B is incorrect because a semicolon followed by a space is not a YAML list indicator; semicolons are not used for sequences in YAML.

Option C is incorrect because angle brackets are not YAML sequence syntax; they are used in other markup languages or as plain scalar characters. Option D is incorrect because curly braces denote flow mappings (key-value pairs), not sequences.

37
Multi-Selecteasy

Which TWO benefits are provided by implementing automated CI/CD pipelines for Junos network changes? (Choose two)

Select 2 answers
A.Standardized, repeatable validation and testing of every change before production
B.Elimination of network routing protocols like OSPF
C.Immediate physical replacement of broken optical transceivers by robots
D.Accelerated deployment speed and reduced human configuration errors
E.Guaranteed 100% uptime regardless of fiber cuts
AnswersA, D

Pipelines run identical validation, syntax checks and test suites against every proposed Junos change before it reaches production devices. This satisfies the stem's benefit requirement by removing engineer-to-engineer variability, so the same change yields the same verified outcome regardless of who submits it.

Why this answer

Option A is correct because CI/CD pipelines run standardized, repeatable validation and testing (e.g., Junos commit check, configuration linting, and automated test suites) on every proposed change before it reaches production, ensuring consistency and catching errors early. Option D is correct because automation accelerates deployment by pushing validated configurations rapidly and consistently, removing manual CLI typing and thereby reducing human configuration errors. Option B is incorrect because CI/CD automation does not eliminate routing protocols such as OSPF; those protocols remain essential for dynamic routing regardless of how changes are deployed.

Option C is incorrect because automated pipelines handle software and configuration changes, not physical hardware replacement like swapping optical transceivers, which still requires human or robotic intervention outside CI/CD scope. Option E is incorrect because no pipeline can guarantee 100% uptime; fiber cuts are physical-layer failures that CI/CD cannot prevent.

38
Multi-Selecteasy

Which TWO characteristics describe declarative network automation compared to imperative scripting? (Choose two)

Select 2 answers
A.Manually logging into each router to execute sequential shell commands
B.Defining the desired end state rather than scripting exact step-by-step CLI commands
C.Using hardcoded assembly language for packet processing
D.Requiring manual calculation of diff patches for every single line item
E.The automation engine automatically computes and applies the required changes to reach the goal
AnswersB, E

Declarative automation expresses the intended end state, leaving the tool to determine how to reach it. This contrasts with imperative scripting, where the engineer explicitly sequences each CLI command, making the desired outcome the defining axis of difference.

Why this answer

Option B is correct because declarative network automation focuses on specifying the intended end state (for example, a desired VLAN, interface, or routing configuration) rather than writing the exact sequence of CLI commands to reach it. Option E is correct because the automation engine (such as Ansible with declarative modules, Terraform, or NSO) compares the current state to the desired state and automatically computes and applies the necessary changes, including diffs and idempotent updates. Option A is incorrect because manually logging into each router and running sequential shell commands is the opposite of declarative automation and is characteristic of manual or imperative operation.

Option C is incorrect because hardcoded assembly language for packet processing is unrelated to declarative network automation and describes low-level programming, not intent-based configuration. Option D is incorrect because manually calculating diff patches for every line item is a tedious imperative task, whereas declarative systems generate the required diffs automatically.

39
Multi-Selecteasy

Which TWO methods can an administrator use to verify that a Python script successfully established a NETCONF session with a Junos device? (Choose two)

Select 2 answers
A.Review BGP neighbor adjacency tables.
B.Run 'show system netconf sessions' on the Junos CLI.
C.Verify physical interface link LEDs.
D.Inspect script execution logs or success return objects from PyEZ/NETCONF connection handlers.
E.Check the device temperature sensors.
AnswersB, D

Running `show system netconf sessions` on the Junos CLI directly lists active NETCONF sessions, confirming the script's connection reached the device. This satisfies the stem's requirement to verify session establishment from the device side, showing the session ID, username and client address that the Python script created.

Why this answer

Option B is correct because the Junos CLI command 'show system netconf sessions' displays active NETCONF-over-SSH sessions on the device, including the session ID, client, and login time, directly confirming that the script's NETCONF session was established. Option D is correct because a PyEZ or ncclient-based script can programmatically confirm success via return objects (for example, a connected Device instance or a successful <hello> exchange) and by inspecting execution logs that record session establishment or exceptions. Option A is wrong because BGP neighbor adjacency tables reflect routing protocol state, not NETCONF session status.

Option C is wrong because physical interface link LEDs only indicate Layer 1 link state and say nothing about an application-layer NETCONF session. Option E is wrong because temperature sensors report hardware environmental data unrelated to NETCONF connectivity.

40
MCQhard

An engineer compares NETCONF and Junos REST API when fetching operational state via RPCs. How does the REST API transmit an RPC request compared to a NETCONF <rpc> wrapper?

A.REST API uses HTTP POST/GET requests targeting specific RPC URI paths, translating JSON/XML parameters, whereas NETCONF sends raw XML RPC elements over a dedicated SSH subsystem.
B.There is no functional difference; REST API is simply an alias for NETCONF over port 830.
C.NETCONF uses HTTP status codes for error reporting, while REST API uses standard syslog messages.
D.REST API requires a persistent WebSocket connection that tunnels NETCONF XML streams.
AnswerA

REST maps RPCs onto HTTP verbs and URI paths, encoding arguments as JSON or XML in the request body, and returns the response over HTTPS. NETCONF instead wraps raw XML <rpc> elements inside a persistent SSH subsystem session, giving a single XML-based transport rather than per-request HTTP semantics.

Why this answer

NETCONF wraps queries in an XML <rpc> element over a persistent SSH channel. The Junos REST API maps RPCs to HTTP methods (such as GET or POST) targeting specific URI endpoints under /api/operational/ or /api/rpc/, translating the payload to JSON or XML without needing a raw NETCONF XML envelope.

41
MCQmedium

An automation engineer writes a Python script that reads a Junos configuration file serialized in JSON. The file opens successfully, but parsing fails with a JSONDecodeError due to trailing commas at the end of object lists. How does standard JSON handle trailing commas compared to YAML?

A.JSON strictly forbids trailing commas, whereas YAML permits them in collections.
B.Both formats handle trailing commas identically by ignoring them.
C.JSON allows trailing commas, but YAML strictly forbids them.
D.Both JSON and YAML strictly require trailing commas for every key.
AnswerA

Standard JSON grammar forbids trailing commas before a closing brace or bracket, so the parser rejects the file outright. YAML's flow collections tolerate them, which is why the same data parses cleanly there. Removing the trailing commas satisfies JSON's strict syntax and resolves the JSONDecodeError.

Why this answer

Standard JSON strictly prohibits trailing commas in objects and arrays, whereas YAML is much more lenient and allows trailing commas in sequences and mappings.

42
MCQhard

When converting a deeply nested JSON data structure representing Junos device health metrics into YAML using PyYAML, the output uses complex block styles that are difficult for team members to read. Which parameter in yaml.safe_dump() can force scalar values or containers to prefer flow style (JSON-like curly braces and brackets) instead?

A.force_json=True
B.format='compact'
C.style='flow'
D.default_flow_style=True
AnswerD

Setting `default_flow_style=True` in `yaml.safe_dump()` makes PyYAML emit every collection in flow style — curly braces for mappings and square brackets for sequences — rather than nested block indentation. This directly satisfies the stem's readability constraint by producing compact, JSON-like output for the deeply nested Junos health metrics.

Why this answer

The default_flow_style parameter in yaml.safe_dump() controls whether containers (lists and dictionaries) are rendered in flow style (JSON-like with braces and brackets) or block style (indented). Setting default_flow_style=True forces all containers to use flow style, making the output more compact and JSON-like. This directly addresses the readability issue caused by complex block styles.

Exam trap

JNCIA-DevOps often tests the distinction between yaml.safe_dump() parameters and node-level styling, tricking candidates into selecting non-existent parameters like force_json or format.

How to eliminate wrong answers

Option A is wrong because force_json=True is not a valid parameter in PyYAML's safe_dump(); it does not exist. Option B is wrong because format='compact' is not a recognized parameter in PyYAML. Option C is wrong because style='flow' is not a top-level parameter for yaml.safe_dump(); while individual nodes can have a style attribute, the global default is controlled by default_flow_style.

43
MCQhard

A developer is writing a script that uses the Junos REST API to make configuration changes. The script needs to handle errors gracefully. After sending a load-configuration RPC, the developer receives an HTTP 400 Bad Request response with a JSON body containing an error message. What is the most likely cause of this error?

A.The user account used for authentication lacks the necessary permissions.
B.The REST API service is not enabled on the Junos device.
C.The commit RPC was not called after the load-configuration RPC.
D.The configuration payload contains a syntax error or invalid statement.
AnswerD

An HTTP 400 Bad Request from the Junos REST API often indicates that the request was understood but the configuration data was invalid, such as a syntax error or an unrecognized statement. The JSON error message would provide details. This is a common response when loading configuration with incorrect hierarchy or unsupported commands. The developer should parse the error message to identify and correct the invalid configuration.

Why this answer

An HTTP 400 Bad Request in response to a load-configuration RPC indicates that the request was syntactically incorrect or contained invalid configuration data. Common causes include malformed JSON, invalid Junos configuration statements, or incorrect parameter values. The error response body usually contains a detailed message pointing to the specific issue.

Authentication failures yield 401, permission issues yield 403, and a missing commit would not cause an immediate error. Therefore, the most likely cause is a syntax error in the configuration payload.

Exam trap

The trap here is assuming that a 400 error is due to authentication or missing commit, when it actually signals a malformed request or invalid configuration data.

44
Multi-Selecthard

You are developing a Python script using Junos PyEZ to retrieve and process operational data. You need to handle exceptions that may occur during device interaction. Which two exceptions are raised by PyEZ when a connection or authentication issue occurs? (Choose two.)

Select 2 answers
A.ConnectError
B.AuthError
C.RpcError
D.ConfigError
E.TimeoutError
AnswersA, B

ConnectError is raised when PyEZ fails to establish a connection to the Junos device, such as due to network issues, incorrect hostname, or SSH port problems. It indicates a failure before authentication, making it a key exception for connection handling.

Why this answer

PyEZ raises ConnectError for general connection failures and AuthError for authentication failures. AuthError is a subclass of ConnectError, so catching ConnectError will also catch AuthError. These exceptions are essential for robust error handling in automation scripts that interact with Junos devices.

Exam trap

The trap here is assuming that RpcError or ConfigError are related to connection issues, when they actually occur after a session is established.

45
MCQeasy

When comparing the Junos REST API workflow to the NETCONF protocol workflow, which characteristic is unique to the REST API?

A.It exclusively transmits data encoded in protocol buffers.
B.It uses connection-oriented stateful sessions over port 830.
C.It mandates the use of YANG schema files for every single RPC.
D.It requires the use of HTTP verbs such as GET, POST, PUT, and DELETE.
AnswerD

REST maps operations onto HTTP methods: GET retrieves, POST creates, PUT replaces and DELETE removes resources. NETCONF instead uses XML-encoded RPC elements over SSH. This verb-based interaction model is the characteristic unique to REST in the comparison.

Why this answer

The Junos REST API uniquely requires the use of HTTP verbs such as GET, POST, PUT, and DELETE to perform operations. This is a fundamental characteristic of RESTful APIs, distinguishing it from NETCONF, which uses XML-based RPCs over SSH. NETCONF does not use HTTP verbs; it uses <rpc> elements within a NETCONF session.

Exam trap

JNCIA-DevOps often tests the differences between REST API and NETCONF, and candidates may confuse characteristics like stateful sessions (NETCONF) or YANG usage (both) with being unique to REST, leading them to select incorrect options.

How to eliminate wrong answers

Option A is wrong because the Junos REST API does not exclusively use protocol buffers; it supports JSON and XML. Protocol buffers are not used by Junos REST API. Option B is wrong because connection-oriented stateful sessions over port 830 are characteristic of NETCONF, not the REST API; the REST API uses HTTP over port 80/443 and is stateless.

Option C is wrong because while YANG models are used by both NETCONF and RESTCONF (the REST API for Junos), the REST API does not mandate YANG schema files for every RPC; it can use RPCs directly. Moreover, NETCONF also uses YANG, so it's not unique to REST.

46
MCQeasy

An automation engineer is writing a Python script to parse a Juniper Junos NETCONF reply received in XML format and needs to convert it into a JSON structure for easier manipulation in a web application. Which built-in Python module is primarily used to handle JSON data serialization and deserialization?

A.json
B.pickle
C.yaml
D.xml.etree
AnswerA

Python's built-in json module provides loads() and dumps() for deserialising and serialising JSON, directly satisfying the stem's conversion need. It parses JSON text into dictionaries and lists, which the web application can then manipulate natively.

Why this answer

The 'json' module is the standard built-in Python library used for parsing, serializing, and deserializing JSON data.

47
MCQmedium

An automation engineer uses a Python script to pull interface statistics from a Junos device through the Junos PyEZ Table and View framework. The View definition must map the XML element <name> to the Python attribute interface_name. Which PyEZ View syntax correctly performs this mapping?

A.interface_name: { name: name }
B.interface_name: name
C.interface_name = name
D.name: interface_name
AnswerB

In a PyEZ View definition, the mapping is written with the Python attribute name as the key and the XML element name as the value. This line tells the View to extract the <name> element and expose it as interface_name, which the automation script can then read directly from each Table row returned by the Junos device.

Why this answer

A PyEZ View is a YAML mapping where each key is the Python attribute to expose and each value is the corresponding XML element or path. Writing the attribute first and the XML element second correctly maps <name> to interface_name, allowing the Table to populate rows with the expected attribute.

Exam trap

The trap here is reversing the YAML mapping so the XML element becomes the attribute name, which silently produces empty fields instead of an error.

48
MCQmedium

Why is it considered a best practice to store sensitive secrets (such as SNMP community strings or API tokens) outside of plaintext Jinja2 templates in a Git repository?

A.Because Junos devices do not accept authentication strings longer than 8 characters.
B.To prevent Jinja2 rendering engines from running out of memory.
C.To ensure that NETCONF sessions always default to unencrypted plain text.
D.To prevent unauthorized exposure of credentials in shared version control systems, utilizing secure secret management tools instead.
AnswerD

Plaintext secrets committed to Git persist in history and are readable by anyone with repository access, so credentials leak permanently. Storing them in a dedicated secret manager and injecting at render time satisfies the stem's requirement to prevent unauthorised exposure in shared version control.

Why this answer

Storing secrets in plaintext in version control risks exposure of sensitive credentials to anyone with repository access.

49
MCQhard

You are writing a Python script that parses a multi-document YAML stream containing Junos device site configurations. One of the documents contains a custom YAML tag. When parsing with yaml.safe_load_all(), how does the safe loader handle custom tags?

A.It converts the tagged object into a JSON equivalent.
B.It automatically evaluates the custom tag using Python eval().
C.It raises a ConstructorError unless a custom constructor is registered.
D.It ignores the tag and loads the scalar value as a plain string.
AnswerC

The safe loader restricts construction to standard YAML types, so encountering an unrecognised custom tag raises a ConstructorError instead of instantiating arbitrary Python objects. Parsing the Junos site configuration therefore fails unless you explicitly register a constructor for that tag via add_constructor.

Why this answer

The safe loader in PyYAML does not know how to construct objects from custom tags by default and will raise a ConstructorError unless a custom constructor has been explicitly registered.

50
MCQeasy

Which term describes the practice of continuously building, testing, and validating software or network configurations in an automated pipeline?

A.CI/CD (Continuous Integration / Continuous Deployment)
B.Manual Change Advisory Board (CAB) review
C.Cold-boot disaster recovery
D.Static physical cable patching
AnswerA

CI/CD automates building, testing and validating network configurations on every commit, then promotes validated artefacts toward deployment. This satisfies the stem's requirement for continuous automated validation, replacing manual, intermittent checks with a repeatable pipeline triggered by each change.

Why this answer

Continuous Integration / Continuous Deployment (CI/CD) describes automated building and testing.

51
Multi-Selectmedium

Which TWO error response categories or HTTP status codes are commonly returned by the Junos REST API when client requests are malformed or unauthorized? (Choose two)

Select 2 answers
A.401 Unauthorized
B.400 Bad Request
C.202 Accepted
D.504 Gateway Timeout
E.100 Continue
AnswersA, B

HTTP 401 Unauthorized is returned when a Junos REST API request lacks valid authentication credentials, such as a missing or incorrect session token. This satisfies the stem's requirement for a status code covering unauthorised client requests.

Why this answer

Option A (401 Unauthorized) is correct because the Junos REST API returns HTTP 401 when a client request lacks valid authentication credentials, such as a missing or incorrect Authorization header or invalid username/password, which is the standard response for unauthorized access. Option B (400 Bad Request) is correct because the Junos REST API returns HTTP 400 when the client request is malformed, for example due to invalid JSON/XML payload syntax, incorrect URI formatting, or unsupported parameters that the server cannot parse. Option C (202 Accepted) is not correct because it is a success-class status indicating the request was accepted for processing, not an error for malformed or unauthorized requests.

Option D (504 Gateway Timeout) is not correct because it indicates an upstream server failed to respond in time, which is an infrastructure/proxy timeout rather than a client malformation or authorization error. Option E (100 Continue) is not correct because it is an informational interim response used with the Expect: 100-continue mechanism, not an error category returned for malformed or unauthorized requests.

Exam trap

JNCIA-DevOps often tests HTTP status codes in the context of REST API error handling, and candidates may confuse 401 with 403 or overlook that 400 is for malformed requests, leading them to select less relevant codes like 504 or 202.

52
MCQmedium

An automation script reads interface names and VLAN IDs from a CSV file and converts each row into a JSON object before sending it to a Junos device REST API. Which Python module is specifically designed to parse CSV (Comma-Separated Values) files?

A.yaml
B.json
C.xml
D.csv
AnswerD

The csv module ships in Python's standard library and is purpose-built for reading and writing delimited files, handling quoting, delimiters and line endings. It parses each row into fields the script can map to a JSON object for the Junos REST API call, satisfying the CSV-parsing requirement directly.

Why this answer

The csv module in Python is specifically designed to read and write CSV files. It provides functionality to parse rows of comma-separated values into lists or dictionaries, handling quoting and delimiter variations. This makes it the correct choice for reading interface names and VLAN IDs from a CSV file before converting to JSON.

Exam trap

JNCIA-DevOps often tests basic module recognition, expecting candidates to know that csv is the standard library for CSV parsing, not yaml or json.

How to eliminate wrong answers

Option A is wrong because the yaml module parses YAML, not CSV. Option B is wrong because the json module handles JSON, not CSV. Option C is wrong because the xml module processes XML, not CSV.

53
MCQhard

You are writing a Python automation script that reads a Junos configuration file in JSON format. The JSON file contains duplicate keys within the same object scope. According to the JSON specification RFC 8259, how should a conforming JSON parser handle duplicate keys?

A.Behavior is undefined by the specification; typically the last defined key-value pair overwrites previous ones in Python dictionaries.
B.Both values are automatically combined into a JSON array under that key.
C.Duplicate keys are prohibited, and compliance checks will reject the file pre-parsing.
D.The parser must raise a fatal JSONDecodeError immediately.
AnswerA

RFC 8259 leaves duplicate-key behaviour undefined, so conforming parsers may differ; Python's json module keeps the last occurrence, silently overwriting earlier values. This satisfies the stem's specification question precisely: the standard mandates no error, no merge, and no first-wins rule, making parser choice implementation-dependent.

Why this answer

RFC 8259 explicitly states that JSON object names SHOULD be unique, but does not mandate parser behavior when duplicates occur — the behavior is undefined by the specification. In practice, Python's json module (and most parsers) keeps the last occurrence, silently overwriting earlier values in the resulting dictionary.

Exam trap

JNCIA-DevOps often tests whether candidates know that RFC 8259 uses SHOULD (not MUST) for unique keys — many assume duplicates are strictly forbidden and pick the 'fatal error' option.

How to eliminate wrong answers

Option B is wrong because JSON has no mechanism to automatically combine duplicate keys into an array — that would require custom parsing logic not defined in the spec. Option C is wrong because RFC 8259 does not prohibit duplicate keys at the syntax level; parsers are not required to reject them, and no pre-parse compliance check exists in standard JSON tooling. Option D is wrong because the spec does not require a fatal error — parsers may accept duplicates, and Python's json module does not raise JSONDecodeError for them.

54
Multi-Selectmedium

Which TWO commands or tools are associated with running JSNAPy snapshot verifications from a CLI environment? (Choose two)

Select 2 answers
A.pyez-snap --run
B.jsnapy --snap
C.junos-snapshot --verify
D.juniper-snapshot-admin --test
E.jsnapy --check
AnswersB, E

The jsnapy --snap command captures a snapshot of device operational state for later comparison, forming the baseline half of JSNAPy verification. Running it from the CLI generates the snapshot files that subsequent check commands compare against.

Why this answer

Option B, `jsnapy --snap`, is correct because JSNAPy's snapshot mode is invoked with the `--snap` flag, which collects the current device state defined in the test file and stores it as a snapshot for later comparison. Option E, `jsnapy --check`, is correct because the `--check` flag runs the verification step, comparing a previously taken snapshot against the current device state to validate that operational values match expectations. Together these two commands form the standard JSNAPy CLI workflow of taking a baseline snapshot and then checking against it.

The remaining options do not belong: `pyez-snap --run` (A) is not a real JSNAPy command, `junos-snapshot --verify` (C) is not a JSNAPy CLI tool, and `juniper-snapshot-admin --test` (D) is a fabricated command name not associated with JSNAPy.

Exam trap

The trap here is that candidates may invent plausible-sounding command names (pyez-snap, junos-snapshot) instead of recalling the actual jsnapy CLI syntax with --snap and --check.

55
MCQhard

You are writing a script that performs multiple configuration changes inside a single PyEZ Config context. How can you verify that the candidate configuration has syntax errors before committing it?

A.cu.validate()
B.cu.test_syntax()
C.cu.verify()
D.cu.check()
AnswerA

Within a PyEZ `Config` context, `cu.validate()` runs the candidate configuration through Junos's own commit-time syntax and semantic checks without committing, satisfying the requirement to detect errors beforehand. It returns detailed error output, letting your script abort or correct the candidate before `commit()` applies it.

Why this answer

The PyEZ Config utility provides the `cu.validate()` method to check the candidate configuration for syntax errors before committing. It performs a commit check on the device, returning any errors without actually committing the configuration, allowing the script to verify correctness inside a Config context.

Exam trap

JNCIA-DevOps often tests the exact method names on the PyEZ Config object, so candidates who guess plausible-sounding names like `test_syntax()` or `check()` instead of the correct `validate()` pick the wrong answer.

How to eliminate wrong answers

Option B is wrong because `test_syntax()` is not a method on the PyEZ Config object — the correct method is `validate()`. Option C is wrong because `verify()` is not a PyEZ Config method; verification of configuration is done via `validate()` or by comparing rollback diffs. Option D is wrong because `check()` is not a PyEZ Config method — the correct method for syntax validation is `validate()`.

56
Multi-Selecthard

When interacting with Junos devices via NETCONF, which TWO RPC operations are part of standard NETCONF protocol capabilities? (Choose two)

Select 2 answers
A.<reboot-routing-engine-force>
B.<get-config>
C.<format-hard-drive>
D.<traceroute-packet>
E.<edit-config>
AnswersB, E

<get-config> is a base NETCONF capability defined in RFC 6241, retrieving all or part of a specified configuration datastore. It satisfies the stem's requirement for a standard protocol RPC operation, unlike Junos-specific or vendor extension operations.

Why this answer

Option B, <get-config>, is correct because it is a base NETCONF protocol operation defined in RFC 6241 that retrieves configuration data from a specified datastore (such as <running/> or <candidate/>), and it is one of the mandatory capabilities every NETCONF server must support. Option E, <edit-config>, is also correct because it is a standard NETCONF operation from RFC 6241 used to load, merge, replace, create, or delete configuration data in a target datastore, making it a core part of NETCONF's configuration-management capabilities. The remaining options are Junos-specific or vendor-proprietary RPCs rather than standard NETCONF operations: <reboot-routing-engine-force> and <format-hard-drive> are Junos extension RPCs for device maintenance, and <traceroute-packet> is a Junos operational RPC for troubleshooting, none of which are defined in the base NETCONF protocol specification.

57
MCQeasy

Which Junos configuration statement enables the NETCONF service over SSH for remote automation clients?

A.set system services netconf ssh
B.set protocols netconf enable
C.set netconf ssh-server enable
D.set system xml-api netconf enable
AnswerA

`set system services netconf ssh` activates the NETCONF subsystem on the Junos device, tunnelled over SSH on port 830. This satisfies the stem's requirement for remote automation clients to establish NETCONF sessions, since the statement explicitly binds the netconf service to the ssh transport rather than leaving it disabled.

Why this answer

Enabling NETCONF on Junos requires configuring the system services netconf ssh hierarchy.

58
MCQeasy

An engineer needs to explain the primary advantage of treating network configurations as code in a modern DevOps workflow. Which principle best describes this approach?

A.Immutable infrastructure deployment where devices are replaced rather than updated manually.
B.Compiling the network CLI commands into binary machine code before executing them on Junos devices.
C.Storing configurations in a version control system to track history, enable rollbacks, and facilitate collaboration.
D.Automating the complete removal of the command-line interface in favor of graphical topology builders.
AnswerC

Version control stores configurations as text artefacts, giving commit history, rollback to any prior revision, and branch-based collaboration. This satisfies the stem's principle, treating configuration changes with the same review and auditability as application source code.

Why this answer

Treating network configurations as code allows infrastructure to be version-controlled, repeatedly deployed, and tested just like software code.

59
MCQmedium

An engineer receives a YAML configuration snippet for a PyEZ automation script, but the script fails with a parser error. Upon inspection, the error is caused by improper indentation levels. Which rule must be strictly followed regarding indentation in YAML syntax?

A.Indentation is completely optional if curly braces are used.
B.Tabs must be used consistently for every level of indentation.
C.Indentation must always be exactly four spaces per level.
D.Spaces must be used for indentation, and tabs are strictly forbidden.
AnswerD

YAML forbids tab characters entirely; indentation must use spaces, and consistency matters because the parser maps nesting levels from leading whitespace. Since the stem's parser error stems from improper indentation, replacing any tabs with spaces resolves it, satisfying YAML's strict whitespace rule.

Why this answer

YAML requires the use of space characters for indentation. Tab characters are strictly forbidden for indentation purposes.

60
MCQhard

When executing a NETCONF <get-config> request, you specify <source><candidate/></source> but omit any filtering tags. What is returned in the <rpc-reply>?

A.An rpc-error stating that a filter is mandatory.
B.Only the differences between candidate and running configurations.
C.Only the top-level system hierarchy statements.
D.The complete configuration contained within the candidate datastore.
AnswerD

Omitting filter tags means no subtree or XPath restriction is applied, so the server returns the full candidate datastore contents inside <rpc-reply>. The <source><candidate/></source> element selects the candidate datastore as the retrieval target, satisfying the stem's specified source.

Why this answer

Omiting filter tags on a <get-config> request returns the entire contents of the specified configuration datastore.

61
MCQmedium

An automation engineer needs to convert a JSON payload representing Junos interface configurations into equivalent YAML format to reuse in an Ansible playbook. Which fundamental structural relationship between JSON and YAML makes this conversion straightforward?

A.JSON uses indentation for structure just like YAML.
B.JSON and YAML both strictly require curly braces for all data containers.
C.YAML is a strict superset of JSON, allowing valid JSON to be parsed as YAML.
D.YAML forces all numeric values to be encapsulated in strings.
AnswerC

Because YAML is a strict superset of JSON, every valid JSON document is also valid YAML. A JSON parser can therefore read the payload and emit equivalent YAML without restructuring, satisfying the conversion requirement. The two formats share the same underlying mapping, sequence and scalar data model.

Why this answer

YAML 1.2 is a strict superset of JSON, meaning every valid JSON document is also valid YAML. This structural compatibility allows tools like PyYAML to parse JSON directly, and makes conversion between the two formats straightforward — the data model (mappings, sequences, scalars) is identical.

Exam trap

The trap here is assuming JSON and YAML are structurally identical in syntax — candidates may pick 'JSON uses indentation' or 'both require braces' without realizing YAML's superset relationship is the key enabler.

How to eliminate wrong answers

Option A is wrong because JSON does not use indentation for structure — it uses braces and brackets; indentation is cosmetic and ignored by JSON parsers. Option B is wrong because YAML does not require curly braces for all containers; it uses indentation and dashes for mappings and sequences, with braces only in flow style. Option D is wrong because YAML supports native numeric types (integers, floats) without requiring string encapsulation — quoting numbers is optional and only needed to force string interpretation.

62
Multi-Selectmedium

An automation engineer is reviewing data serialization formats used within Junos automation workflows. Which TWO statements are correct regarding JSON syntax and data types? (Choose two)

Select 2 answers
A.Single quotes can be used interchangeably with double quotes for strings.
B.JSON supports inline comments starting with the '#' symbol.
C.JSON object keys must be enclosed in double quotes.
D.The 'null' keyword is a valid data type in JSON.
E.Trailing commas are permitted in both arrays and objects.
AnswersC, D

JSON's grammar requires every object member name to be a string delimited by double quotation marks; single quotes and unquoted keys are invalid. This satisfies the stem's requirement for a correct JSON syntax statement within Junos automation data serialisation.

Why this answer

Option C is correct because JSON (RFC 8259) requires that every object member name, i.e., every key, be a string enclosed in double quotes, so keys like {"host": "router1"} are valid while {host: "router1"} is not. Option D is correct because JSON defines exactly six value types — string, number, object, array, boolean (true/false), and null — and the literal keyword null is the valid representation of the null data type, commonly used in Junos automation payloads to indicate an absent or empty value. Option A is incorrect because JSON strings must use double quotes; single quotes are not valid JSON (they are only tolerated by some lenient parsers such as Python's ast.literal_eval or YAML).

Option B is incorrect because standard JSON has no comment syntax at all, so a '#' character would be invalid — comments are only available in JSON5, JSONC, or YAML. Option E is incorrect because JSON forbids trailing commas after the last element of an array or the last member of an object, and such input will fail strict parsing.

63
MCQeasy

Which protocol is natively used by Junos XML management APIs to provide structured, session-oriented configuration and operational data exchange?

A.FTP
B.NETCONF
C.Syslog
D.Telnet
AnswerB

NETCONF runs over SSH and exchanges XML-encoded RPCs, giving Junos a session-oriented, structured channel for configuration and operational data. Its candidate datastore, commit model and capability handshake satisfy the stem's requirement for native structured exchange, unlike SNMP's flat OIDs or REST's stateless request model.

Why this answer

NETCONF is the session-oriented protocol used for Junos XML management.

64
MCQmedium

During script development, an engineer encounters a YAML file containing comments and multiple configuration documents separated by document markers. Which characters are used to denote the start of a new document within a single YAML file stream?

A.===
B.---
C....
D.###
AnswerB

Three hyphens (---) mark the start of a new document within a single YAML stream, allowing multiple documents to coexist in one file. The three dots (...) instead signal the end of a document, so --- is the correct marker.

Why this answer

In YAML, three dashes (---) indicate the start of a document, while three dots (...) indicate the end of a document.

65
MCQhard

An administrator issues an edit-config RPC with default-operation="replace" targeting the candidate datastore. What is the impact on the existing configuration on the Junos device?

A.The entire target configuration datastore is replaced by the configuration provided in the RPC payload.
B.The configuration is merged, and any conflicting nodes generate a validation error.
C.The candidate datastore is cleared, and only the default factory configuration is loaded.
D.Only the specific leaf nodes provided in the RPC are updated; everything else remains intact.
AnswerA

Setting default-operation="replace" on the candidate datastore discards the entire existing configuration and substitutes only the hierarchy supplied in the RPC payload, satisfying the stem's whole-datastore replacement constraint. Unlike "merge", which overlays changes, or "none", which inherits per-level defaults, replace wipes unspecified configuration.

Why this answer

The replace operation overwrites the entire target configuration datastore with the configuration provided in the RPC message.

66
Multi-Selectmedium

When designing a version control workflow for Junos configurations using Git, which THREE practices are considered industry best standards? (Choose three)

Select 3 answers
A.Completely bypassing automated testing to speed up deployments
B.Using feature branches for developing new configuration changes before merging into main
C.Storing plaintext administrative passwords directly in public Git repositories
D.Requiring peer reviews and pull request approvals prior to merging changes
E.Using semantic or descriptive commit messages to document the intent of configuration updates
AnswersB, D, E

Feature branches isolate in-progress Junos configuration edits from the main branch, so unstable or untested changes never reach production until deliberately merged. This satisfies the workflow's requirement for controlled, reviewable integration of configuration changes rather than committing directly to main.

Why this answer

Option B is correct because feature branches isolate new Junos configuration changes from the main branch, allowing development and validation without destabilizing production-ready configurations before a controlled merge. Option D is correct because peer reviews and pull request approvals enforce a four-eyes principle, catching errors, policy violations, or unintended commit/rollback commands before changes reach the main branch. Option E is correct because semantic or descriptive commit messages document the intent of each configuration update, which is essential for audit trails, troubleshooting, and correlating commits with change tickets in Junos automation workflows.

Option A does not belong because bypassing automated testing removes validation of syntax, commit checks, and rollback safety, increasing outage risk. Option C does not belong because storing plaintext administrative passwords in public Git repositories exposes credentials and violates security best practices; secrets should be managed with tools like Ansible Vault, HashiCorp Vault, or Junos encrypted passwords.

67
MCQeasy

A network architect is designing a version control strategy for multi-vendor network operations. They need a system that tracks changes to text-based configuration files, allows multiple engineers to work on separate feature branches concurrently, and merges changes systematically. Which category of tool is being utilized?

A.Network Management System (NMS) poller
B.Network Configuration Protocol (NETCONF) manager
C.Distributed Version Control System (DVCS)
D.Dynamic Host Configuration Protocol (DHCP) server
AnswerC

A DVCS gives every engineer a full repository clone, enabling independent feature branches and systematic merges without a central server bottleneck. This satisfies the stem's constraints of tracking text configuration changes, supporting concurrent branch work, and merging changes methodically across multi-vendor environments.

Why this answer

Git and similar tools are Distributed Version Control Systems (DVCS) designed to track file revisions and manage collaborative workflows through branching and merging.

68
MCQmedium

A Python script retrieves interface statistics from a Junos device in JSON format, modifies a threshold value, and needs to output it back into a formatted JSON string with an indentation level of 4 spaces for readability. Which Python snippet achieves this?

A.json.format(data, spacing=4)
B.json.dumps(data, indent=4)
C.json.dump(data, indent=4)
D.json.stringify(data, spaces=4)
AnswerB

json.dumps() serialises a Python object into a JSON-formatted string, and its indent parameter inserts the specified number of spaces per nesting level. Passing indent=4 therefore produces the readable, four-space-indented JSON string the script requires, satisfying the formatting constraint in the stem.

Why this answer

The json.dumps() method accepts an 'indent' parameter which specifies the number of spaces to use for pretty-printing the resulting JSON string.

69
MCQeasy

Which user credential validation mechanism does the Junos REST API use by default when authenticating incoming API calls?

A.Junos local user database or AAA via HTTP Basic Authentication
B.OAuth 2.0 bearer tokens generated by an external IdP
C.Pre-shared API secret keys stored in environment variables
D.SSH public key authentication exclusively
AnswerA

The Junos REST API authenticates each request using HTTP Basic Authentication, validating the supplied credentials against the local Junos user database or an external AAA server. This default mechanism satisfies the stem's requirement without requiring token-based or session-based authentication.

Why this answer

The Junos REST API authenticates incoming requests against the Junos local user database or configured AAA servers (RADIUS/TACACS+) using standard HTTP Basic Authentication.

70
MCQhard

You are reviewing a pull request that updates Junos interface configurations using Jinja2 templates. The template contains a conditional statement checking an interface speed variable. What happens if the variable is undefined during template rendering?

A.The Git repository automatically rejects the push citing syntax errors.
B.Jinja2 raises an undefined error and halts template rendering unless default filters or conditional checks are used.
C.Junos automatically ignores the missing variable and applies default factory settings.
D.The target Junos router enters rescue mode due to corrupted NETCONF RPC messages.
AnswerB

Jinja2's default Undefined type raises an error when the interface speed variable is referenced, halting rendering. This satisfies the stem's undefined-variable scenario: without a default filter or an is defined check, the conditional cannot evaluate and the template fails.

Why this answer

Jinja2 raises an UndefinedError by default when an undefined variable is evaluated in a template, unless configured otherwise or handled with defined tests.

71
MCQeasy

Which statement best describes the primary architectural difference between NETCONF and the Junos REST API?

A.NETCONF only supports JSON, while REST API only supports XML.
B.There are no architectural differences; REST API is simply an XML parser for NETCONF.
C.NETCONF is a web-based stateless API, whereas REST API requires a persistent SSH session.
D.NETCONF is a connection-oriented RPC protocol over SSH, while Junos REST API is a resource-oriented web API over HTTP/HTTPS.
AnswerD

NETCONF operates as a connection-oriented RPC protocol carried over SSH, maintaining a session and exchanging XML-encoded operations. The Junos REST API instead follows resource-oriented design, using HTTP methods and URIs over HTTP/HTTPS to manipulate configuration and retrieve state.

Why this answer

NETCONF is a session-oriented, connection-oriented protocol running over SSH (port 830) using XML-encoded RPCs. The Junos REST API is a stateless (at the HTTP layer) resource-oriented web API running over HTTP/HTTPS (port 3000/3443) supporting JSON and XML.

72
Multi-Selectmedium

Which TWO actions can be performed using the JSNAPy command-line interface (CLI) tool during network verification workflows?

Select 2 answers
A.Capturing operational state snapshots of devices defined in configuration files
B.Provisioning zero-touch deployment (ZTP) DHCP server scopes on core switches
C.Comparing pre- and post-change snapshots to verify test assertions
D.Directly compiling Junos Source routing daemon binaries
E.Translating PyEZ Python scripts into native Junos SLAX op scripts
AnswersA, C

JSNAPy's CLI captures operational state snapshots by running its snapshot command against devices listed in the YAML configuration files, satisfying the requirement to record live device state during verification workflows. This snapshot mechanism underpins later comparison and diff operations, letting engineers detect configuration drift across Junos devices.

Why this answer

JSNAPy (Junos Snapshot Administrator in Python) is a CLI tool designed for network verification workflows, and option A is correct because its core function is to capture operational state snapshots from devices listed in the jsnapy.cfg configuration file using commands like 'jsnapy --snapcheck' or 'jsnapy --snap'. Option C is also correct because JSNAPy's primary purpose is to compare pre-change and post-change snapshots against test assertions defined in YAML test files, executed via 'jsnapy --check' or 'jsnapy --diff', to validate that network state matches expected values. The unmarked options do not belong: ZTP DHCP server scope provisioning (B) is a configuration task unrelated to JSNAPy's snapshot/verification role, compiling Junos routing daemon binaries (D) is an internal Juniper build process not exposed through JSNAPy, and translating PyEZ scripts into SLAX op scripts (E) is not a JSNAPy capability since JSNAPy consumes PyEZ but does not perform such translation.

73
MCQmedium

An automation engineer needs to pretty-print a JSON payload in the Linux terminal for debugging Junos telemetry. Which built-in Python command-line utility can be invoked to validate and pretty-print a JSON file?

A.python3 -m yaml.format filename.json
B.python3 -c 'import json; json.format()'
C.python3 -m json.tool filename.json
D.netconf-console --pretty filename.json
AnswerC

Invoking python3 -m json.tool filename.json runs the standard library's JSON module as a script, parsing the file to validate syntax and re-emitting it with indentation. No third-party package is needed, satisfying the built-in utility constraint for terminal debugging.

Why this answer

The command 'python3 -m json.tool filename.json' invokes the built-in json.tool module, which validates and pretty-prints JSON from a file or stdin. It is a standard utility available in any Python 3 installation.

Exam trap

JNCIA-DevOps often tests the assumption that Python has built-in YAML formatting, confusing the standard json.tool with non-existent yaml modules.

How to eliminate wrong answers

Option A is wrong because there is no built-in 'yaml.format' module in Python's standard library; YAML support requires third-party libraries like PyYAML. Option B is wrong because 'json.format()' is not a valid function in the json module; the correct function is json.dumps() with indent parameter. Option D is wrong because 'netconf-console' is a third-party tool for NETCONF, not a built-in Python utility, and '--pretty' is not a standard option for JSON pretty-printing.

74
MCQmedium

An automation engineer wants to verify the syntax of a large YAML playbook before executing it against a production Junos device. Which python one-liner command can be run in the terminal to quickly check if the file is syntactically valid YAML?

A.python3 -c 'import yaml, sys; yaml.safe_load(open(sys.argv[1]))' config.yaml
B.yaml --validate config.yaml
C.netconf-console --check config.yaml
D.python3 -m json.tool config.yaml
AnswerA

Invoking `yaml.safe_load` parses the entire document and raises a `YAMLError` on malformed indentation, tabs or duplicate keys, so the playbook's syntax is validated without touching the Junos device. Passing the filename via `sys.argv[1]` keeps the one-liner reusable, satisfying the pre-execution check requirement.

Why this answer

Running python3 -c 'import yaml, sys; yaml.safe_load(open(sys.argv[1]))' filename.yaml attempts to parse the file and will report any syntax errors.

75
MCQmedium

An engineer writes a Python script using ncclient to push changes to a Junos device. After sending the configuration via <edit-config>, the script needs to make the changes active without dropping the NETCONF session lock prematurely or requiring a separate explicit commit RPC if candidate workflows are bypassed. However, using standard candidate datastore workflow, what is the exact RPC required to activate the candidate configuration?

A.<commit/>
B.<apply-changes/>
C.<save-config/>
D.<push-running/>
AnswerA

The candidate datastore holds changes staged by <edit-config> until a separate RPC activates them. Issuing <commit/> promotes the candidate configuration to the running configuration, satisfying the stem's requirement to make changes active while retaining the NETCONF session lock. This is the standard Junos candidate workflow, distinct from <copy-config> or bypassing the candidate entirely.

Why this answer

The <commit> RPC is used to commit the candidate configuration to the running configuration datastore in Junos.

Page 1 of 4

Page 2

All pages