Courseiva

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

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

Page 1

Page 2 of 4

Page 3
76
MCQhard

A Python automation script extracts routing table entries from a Junos device. The data structure contains deeply nested dictionaries and lists. The engineer needs to perform a deep copy of this deserialized JSON structure before modifying it. Which Python module provides the deepcopy function needed to duplicate nested containers safely?

A.os
B.copy
C.sys
D.json
AnswerB

The `copy` module supplies `deepcopy()`, which recursively duplicates every nested dictionary and list rather than merely copying top-level references. This satisfies the stem's requirement to duplicate a deeply nested deserialised JSON structure safely, ensuring modifications to the copy leave the original routing table data unaltered.

Why this answer

The 'copy' module in the Python standard library provides the deepcopy() function, which recursively clones nested dictionaries and lists.

77
Multi-Selectmedium

When writing Python automation scripts for Junos using PyEZ, which THREE objects or methods are commonly used for device interaction and configuration management? (Choose three)

Select 3 answers
A.Microsoft_Excel_Workbook for direct spreadsheet parsing
B.Kernel_Panic_Trigger to deliberately crash the router
C.Config (from jnpr.junos.utils.config) to handle configuration transactions
D.Fact (from jnpr.junos.factory.factory_Loader) to gather device hardware and software inventory
E.Device (from jnpr.junos) to manage the NETCONF connection session
AnswersC, D, E

The Config utility wraps Junos configuration transactions, exposing methods such as load(), commit(), rollback() and diff() over NETCONF. This satisfies the stem's configuration management requirement, letting scripts stage candidate changes, verify them, and commit atomically rather than pushing raw CLI commands.

Why this answer

Option E is correct because the Device class from jnpr.junos is the core PyEZ object that opens and manages the NETCONF session to a Junos device, providing the transport used by all other operations. Option C is correct because Config from jnpr.junos.utils.config wraps configuration transactions, allowing methods like load(), commit(), rollback(), and diff() to apply candidate configurations safely. Option D is correct because Fact, loaded via the factory Loader from jnpr.junos.factory.factory_Loader, retrieves structured device facts such as hardware model, Junos version, and serial number for inventory and automation logic.

Option A is not part of PyEZ and is unrelated to Junos device interaction, and Option B is not a real PyEZ object or method and would be a destructive, nonsensical operation.

78
MCQmedium

You are writing a PyEZ script that must retrieve interface statistics from a Junos device. You want to use a predefined PyEZ Table to avoid writing custom parsing logic. Which predefined Table should you use to get operational status and statistics for all interfaces?

A.`ConfigTable`
B.`InterfaceTable`
C.`PhyPortTable`
D.`EthPortTable`
AnswerB

`InterfaceTable` is a predefined PyEZ Table that retrieves operational information about interfaces, including status, statistics, and configuration details. It is specifically designed for this purpose and returns a dictionary-like structure keyed by interface name. Using it avoids the need to write custom XML parsing code.

Why this answer

PyEZ includes predefined Tables that simplify retrieving operational data. `InterfaceTable` is the standard Table for interface information, providing operational status, statistics, and configuration attributes for all interfaces. It abstracts the underlying XML RPCs and returns a structured dictionary, making it ideal for scripts that need interface statistics without custom parsing.

Exam trap

The trap here is choosing a platform-specific Table like `EthPortTable` or `PhyPortTable` instead of the general-purpose `InterfaceTable` that works across all Junos devices.

79
MCQmedium

In a CI/CD pipeline for network changes, what is the role of automated unit testing?

A.To measure the exact fiber cable distance between two data centers.
B.To automatically upgrade the Junos OS kernel on all cluster nodes simultaneously.
C.To physically test the optical transceiver power levels using laser beams.
D.To verify that individual configuration modules, templates, or script functions produce expected outputs before integration.
AnswerD

Unit testing exercises each configuration module, template, or script function in isolation, asserting its rendered output matches expectations. This catches defects at the smallest testable unit before integration, satisfying the pipeline's need to validate components prior to combining them into full network changes.

Why this answer

Automated unit testing in a CI/CD pipeline verifies that individual components, such as configuration modules, templates, or script functions, produce the expected outputs. This ensures that each part works correctly before integration, catching errors early in the development cycle.

Exam trap

JNCIA-DevOps often tests the scope of unit testing, and candidates may confuse it with integration or system testing, or with unrelated physical tasks.

How to eliminate wrong answers

Option A is wrong because measuring fiber cable distance is a physical task unrelated to unit testing. Option B is wrong because upgrading Junos OS is a deployment task, not unit testing. Option C is wrong because testing optical transceiver power levels is a hardware validation, not software unit testing.

80
MCQmedium

A network automation script is reading a YAML configuration file containing Junos device credentials. The script encounters an unhandled exception when attempting to load the file using PyYAML. Upon inspection, the error is caused by a tab character used for indentation instead of spaces. Which YAML specification rule does this violate?

A.Tab characters are strictly forbidden for indentation in YAML.
B.Comments must start with a double forward slash (//).
C.YAML files require all keys to be wrapped in double quotes.
D.Top-level keys must start with a hyphen (-) character.
AnswerA

YAML's block structure relies on spaces for indentation; tab characters are explicitly prohibited as indentation whitespace, so PyYAML raises a scanner error when it encounters one. This directly satisfies the stem's constraint: the unhandled exception stems from a tab used instead of spaces, violating that specification rule.

Why this answer

YAML 1.2 specifications explicitly prohibit the use of the tab character for indentation. All indentation whitespace must consist exclusively of space characters to maintain hierarchy definition.

81
MCQeasy

What is a primary characteristic of a DevOps culture when applied to network operations (NetOps)?

A.Siloing network operations strictly away from software development teams.
B.Eliminating all documentation in favor of verbal communication.
C.Emphasizing collaboration, automation, continuous testing, and shared responsibility between network and development teams.
D.Relying entirely on manual change approval boards for every minor configuration change.
AnswerC

DevOps culture breaks down silos between network and development teams, replacing ticket-driven handoffs with shared ownership. Collaboration, automation, continuous testing and joint accountability for outcomes are the defining traits, directly matching the collaborative, automated and shared-responsibility emphasis the question describes for NetOps.

Why this answer

NetOps applies DevOps principles like collaboration, automation, and CI/CD to network engineering.

82
MCQeasy

An automation engineer is writing a Python script using Junos PyEZ to connect to a device. Which module and class must be imported to instantiate a device object representing the Junos target?

A.from jnpr.junos.rpcs import RPC
B.from jnpr.junos.facts import Facts
C.from jnpr.junos.device import Device
D.from jnpr.junos.utils.sw import SW
AnswerC

Importing `Device` from `jnpr.junos.device` provides the class that models a Junos target, holding connection parameters and transport settings. Instantiating it satisfies the stem's requirement to create a device object for the PyEZ script, since this class exposes the `open()`, `close()` and RPC methods the automation relies on.

Why this answer

Junos PyEZ provides the Device class in the jnpr.junos.device module, which is used to instantiate a device object representing a Junos target. Importing 'from jnpr.junos.device import Device' is the correct way to create a Device instance and connect to a Junos device. This is the foundational import for any PyEZ automation script.

Exam trap

JNCIA-DevOps often tests the confusion between the Device class (for connection/instantiation) and utility classes like RPC, Facts, or SW, so candidates who pick A, B, or D miss the core object needed to represent the target device.

How to eliminate wrong answers

Option A is wrong because jnpr.junos.rpcs.RPC is used for executing RPCs, not for instantiating a device object. Option B is wrong because jnpr.junos.facts.Facts is used to retrieve facts from a device, not to create the device object. Option D is wrong because jnpr.junos.utils.sw.SW is a utility class for software management (upgrades, installs), not for device instantiation.

83
MCQhard

An engineer executes a NETCONF <discard-changes> RPC. What is the precise effect of this operation on the Junos device?

A.It clears all active alarms and operational logs from the routing engine.
B.It terminates all active NETCONF sessions currently connected to the device.
C.It discards all uncommitted changes currently sitting in the candidate datastore, reverting it to match the running datastore.
D.It reverts the active running configuration to the factory default state.
AnswerC

The <discard-changes> RPC clears every uncommitted edit held in the candidate datastore, restoring it to mirror the running configuration exactly. Nothing is committed, so the running datastore and device forwarding state remain untouched throughout the operation.

Why this answer

The <discard-changes> RPC discards any uncommitted changes present in the candidate configuration datastore.

84
MCQhard

An automation engineer writes a Python script that loads a YAML file containing Junos device connection parameters. The file includes a line `timeout: 30` and another line `description: 30 seconds`. The script then uses the values in a template. Which statement correctly describes how a standard YAML parser will interpret these two scalar values?

A.The value `30` is parsed as a string, and `30 seconds` is parsed as an integer.
B.Both values cause a parser error because unquoted scalars with spaces are not allowed in YAML.
C.The value `30` is parsed as an integer, and `30 seconds` is parsed as a string.
D.Both values are parsed as strings because YAML treats all scalars as strings unless quoted.
AnswerC

YAML's implicit resolver checks plain scalars against patterns for int, float, bool, and null. The scalar `30` matches the integer pattern and becomes an int, while `30 seconds` does not match any numeric or boolean pattern and therefore resolves to a string. This behavior is defined in the YAML specification and implemented by PyYAML's SafeLoader, which is the default for many automation scripts.

Why this answer

YAML resolves plain scalars by matching them against implicit type patterns. A bare `30` matches the integer pattern and is loaded as an int, while `30 seconds` contains a space and letters, fails the numeric patterns, and is loaded as a string. Understanding this distinction prevents type errors when the script later performs arithmetic or string concatenation with these values.

Exam trap

The trap here is assuming that YAML quotes are required to create strings, when in fact unquoted scalars are implicitly typed and only become strings when they fail to match numeric or boolean patterns.

85
MCQmedium

When retrieving configuration data in JSON format from the Junos REST API, how are Junos hierarchical container statements represented in the JSON payload structure?

A.As comma-separated string lists inside a single root array.
B.As flat key-value pairs separated by dots (e.g., 'system.host-name').
C.As nested JSON objects reflecting the hierarchical tree structure of the CLI configuration.
D.As binary encoded ASN.1 objects.
AnswerC

Junos configuration is inherently hierarchical, so the REST API maps each container statement to a nested JSON object, mirroring the CLI tree. This preserves parent-child relationships, letting clients traverse the payload exactly as they would the configuration hierarchy.

Why this answer

Junos configuration hierarchies are translated into nested JSON objects where each container level corresponds to a JSON key whose value is an object or an array of objects.

86
MCQmedium

An engineer executes an HTTP GET request to retrieve interface operational details using the Junos REST API, but receives a 403 Forbidden status code. What is the most likely reason?

A.The HTTP request method should have been POST.
B.The Accept header was missing from the GET request.
C.The jpagent service is disabled on the device.
D.The authenticated user account lacks sufficient RBAC permissions to access the requested resource.
AnswerD

HTTP 403 Forbidden signals the request reached the Junos device and was authenticated, but the account's RBAC class or permission bits deny access to that specific RPC or configuration hierarchy. Insufficient privileges, not malformed syntax or transport failure, produce this authorisation rejection.

Why this answer

A 403 Forbidden status code indicates that the authentication credentials provided were valid (otherwise it would be 401), but the user account lacks the necessary RBAC permissions or class privileges to access the requested resource.

87
MCQmedium

You are configuring a CI/CD pipeline for Junos network deployments. The pipeline must validate the syntax of generated candidate configurations against a physical or virtual Junos device before committing them to production. Which stage of the CI/CD pipeline does this validation step represent?

A.Continuous Deployment stage
B.Continuous Integration validation stage
C.Continuous Monitoring stage
D.Infrastructure Provisioning stage
AnswerB

Continuous Integration validation suits this scenario because the pipeline must check generated candidate configuration syntax against a Junos device before production commits. CI validation runs automated checks on each code change, catching syntax errors early via `commit check` against the device, satisfying the stem's pre-commit validation constraint.

Why this answer

The validation of candidate configuration syntax against a Junos device before committing to production is a pre-merge quality gate, which is the essence of the Continuous Integration (CI) validation stage. In CI, every code change triggers automated builds and tests to catch errors early. Here, the 'code' is the generated Junos configuration, and the test is a syntax check using the device's configuration parser (e.g., via `commit check` or loading the config with `load merge` and `commit check`).

This ensures that only syntactically valid configurations proceed to deployment, preventing broken commits from reaching production.

Exam trap

JNCIA-DevOps often tests the distinction between CI validation and continuous deployment, so candidates may confuse the pre-commit syntax check with the act of deploying the configuration to production.

How to eliminate wrong answers

Option A is wrong because Continuous Deployment is the stage that automatically releases validated changes to production, not the validation itself. Option C is wrong because Continuous Monitoring involves observing the running system for performance, errors, or drift after deployment, not pre-commit syntax checking. Option D is wrong because Infrastructure Provisioning is about allocating and configuring the underlying compute, network, and storage resources (e.g., spinning up VMs or containers), not validating configuration syntax.

88
MCQeasy

An engineer needs to establish a NETCONF session with a Junos device securely. Which underlying transport protocol does NETCONF use by default according to RFC 6242?

A.TCP port 22
B.TCP port 443
C.UDP port 830
D.TCP port 830
AnswerD

RFC 6242 mandates SSH as the default NETCONF transport, and SSH listens on TCP port 830 for NETCONF specifically, satisfying the stem's secure-session requirement. Plain TCP port 830 without SSH would expose credentials and configuration data unencrypted, so the security constraint rules out bare TCP.

Why this answer

NETCONF over SSH is defined in RFC 6242 and uses TCP port 830 by default for secure transport.

89
Multi-Selecteasy

Which TWO of the following are valid scalar values in a YAML document? (Choose two)

Select 2 answers
A.Mapping
B.Integer
C.Sequence
D.String
E.Block
AnswersB, D

An integer is a valid YAML scalar, representing a numeric value such as a count or port number. Scalars are the leaf values in YAML, distinct from mappings and sequences, so integers qualify alongside strings, booleans and nulls.

Why this answer

In YAML, a scalar is a single, indivisible value rather than a collection, so option B (Integer) is correct because values such as 42 or -7 are scalar types. Option D (String) is also correct because text values like "hello" or 'world' are scalars, whether quoted or plain. By contrast, option A (Mapping) is a collection of key-value pairs, option C (Sequence) is an ordered list of items, and option E (Block) refers to a block-style presentation of collections or scalars, not a scalar value itself, so none of those are valid scalar values.

90
Multi-Selecteasy

Which TWO benefits are gained by using the Junos REST API instead of traditional CLI screen-scraping in automation workflows? (Choose two)

Select 2 answers
A.CLI screen-scraping uses less CPU on the Junos routing engine than REST API.
B.Structured data formats (JSON or XML) eliminate the need for complex regular expression parsing of CLI text.
C.Screen-scraping is faster than REST API for bulk configuration pushes.
D.REST API requires no authentication configuration on the device.
E.The REST API provides programmatic status codes and error handling.
AnswersB, E

REST responses arrive as JSON or XML with defined schemas, so scripts index named fields directly instead of matching brittle regular expressions against screen-formatted CLI output. This satisfies the benefit of eliminating fragile text parsing, which breaks whenever Junos changes column widths or spacing.

Why this answer

Option B is correct because the Junos REST API returns responses in structured formats such as JSON or XML, so automation code can parse fields directly instead of relying on fragile regular expressions to extract values from human-oriented CLI text. Option E is correct because REST API calls return standard HTTP status codes (for example 200 for success, 400 for a bad request, 401 for authentication failure) plus structured error payloads, giving automation workflows explicit, programmatic error handling that screen-scraping cannot provide. Option A is incorrect because screen-scraping typically consumes more routing-engine CPU and is less efficient than the REST API, not less.

Option C is incorrect because screen-scraping is generally slower and more brittle for bulk configuration pushes than the REST API. Option D is incorrect because the Junos REST API still requires authentication configuration, such as user credentials or an access token, on the device.

91
MCQeasy

Which of the following valid JSON values represents a boolean true state?

A.True
B."true"
C.TRUE
D.true
AnswerD

JSON defines the lowercase literal true as its boolean true value, alongside false. It is unquoted and case-sensitive, so "true" as a string or True with capitals is invalid; only the bare token represents the boolean state.

Why this answer

JSON (RFC 8259) defines boolean literals as lowercase 'true' and 'false' only. Any other casing or quoting is invalid JSON or represents a different type, so 'true' is the only valid boolean true value among the options.

Exam trap

JNCIA-DevOps often tests JSON's case sensitivity, and the trap is that candidates familiar with Python or other languages assume 'True' is valid — but JSON only accepts lowercase 'true', and quoted '"true"' is a string, not a boolean.

How to eliminate wrong answers

Option A is wrong because 'True' (capital T) is Python's boolean literal, not JSON's — JSON is case-sensitive and does not accept it. Option B is wrong because '"true"' is a JSON string containing the characters t-r-u-e, not a boolean; it would fail a type check expecting a boolean. Option C is wrong because 'TRUE' (all caps) is not a JSON literal and would cause a parse error in strict JSON parsers.

92
MCQeasy

Which command is used in Git to save staged changes to the local repository with a descriptive commit message?

A.git add
B.git push
C.git commit -m "message"
D.git save
AnswerC

git commit -m "message" records the currently staged snapshot into the local repository's history, attaching the supplied message as the commit description. The -m flag supplies the message inline, avoiding an editor prompt during the commit.

Why this answer

The `git commit -m "message"` command records the staged changes to the local repository with the provided commit message. It is the standard Git command for creating a commit from the staging area. The `-m` flag allows the message to be specified inline.

Exam trap

JNCIA-DevOps often tests the confusion between local repository operations (commit) and remote operations (push), so candidates may pick `git push` thinking it saves changes, when it actually only syncs to a remote.

How to eliminate wrong answers

Option A is wrong because `git add` stages changes but does not commit them; it only updates the index. Option B is wrong because `git push` uploads local commits to a remote repository, not saves them locally. Option D is wrong because `git save` is not a valid Git command; it does not exist in Git's command set.

93
MCQmedium

You have captured a baseline snapshot using JSNAPy and want to compare a newly taken snapshot against that baseline. Which JSNAPy command-line action executes this comparison?

A.jsnapy --test
B.jsnapy --check
C.jsnapy --verify
D.jsnapy --compare
AnswerB

The jsnapy --check action compares a freshly captured snapshot against the stored baseline and reports differences, which is exactly the comparison the scenario requires. Other actions such as --snap take snapshots rather than performing the check.

Why this answer

JSNAPy's --check action compares a freshly captured snapshot against the stored baseline snapshot and reports any differences. It is the standard command for post-change verification, typically run after a configuration commit to detect drift from the known-good baseline. The --snap action captures the snapshot, while --check performs the comparison.

Exam trap

The trap here is confusing JSNAPy's --check with generic verbs like --verify or --compare — candidates who haven't run JSNAPy may pick the most 'intuitive' word rather than the actual CLI flag.

How to eliminate wrong answers

Option A is wrong because jsnapy --test is not a valid JSNAPy CLI action — the tool uses --snap, --check, and --diff, not --test. Option C is wrong because jsnapy --verify does not exist as a JSNAPy action; verification is performed via --check. Option D is wrong because jsnapy --compare is not a JSNAPy action — the comparison is invoked with --check, not --compare.

94
MCQeasy

A network automation engineer is establishing a NETCONF session with a Junos device. After the SSH connection is established, the device and the client exchange <hello> messages. What is the primary purpose of this exchange?

A.To synchronize the device's clock with the client's clock.
B.To authenticate the client and establish a secure channel.
C.To transfer the initial configuration from the device to the client.
D.To negotiate NETCONF capabilities and session parameters.
AnswerD

The <hello> messages exchanged between the NETCONF server and client advertise supported capabilities, such as base protocol version, candidate datastore support, and other features. This negotiation ensures both parties understand what operations and datastores are available. It is a mandatory part of session establishment and precedes any RPC operations.

Why this answer

The <hello> messages are exchanged immediately after the SSH connection to advertise and negotiate NETCONF capabilities. This includes the base protocol version, supported datastores, and other features. It ensures that both the client and server understand what operations are available before any RPCs are sent.

It does not authenticate, synchronize clocks, or transfer configuration.

Exam trap

The trap here is assuming that the <hello> exchange handles authentication or configuration transfer, when it actually only negotiates capabilities.

95
MCQmedium

An automation developer is writing a script to modify candidate configuration data on a Junos device using the REST API. Which HTTP method and request body format should be used to replace an existing configuration hierarchy?

A.POST method with form-urlencoded data
B.PUT method with a JSON or XML payload representing the configuration node
C.DELETE method with an empty body
D.GET method with URL parameters
AnswerB

PUT replaces the addressed configuration hierarchy with the supplied JSON or XML payload, overwriting the existing node rather than merging into it. This satisfies the requirement to replace an existing hierarchy on the candidate configuration through the Junos REST API.

Why this answer

The Junos REST API uses standard HTTP methods mapped to NETCONF-like operations: PUT replaces an existing configuration hierarchy at the specified URL with the payload provided (JSON or XML). To replace a configuration node, you send a PUT to the configuration endpoint with the new hierarchy in the body. POST is used to create/merge, DELETE to remove, and GET to retrieve.

Exam trap

JNCIA-DevOps often tests the HTTP-method mapping: candidates confuse POST (merge/create) with PUT (replace), or assume GET can modify configuration.

How to eliminate wrong answers

Option A is wrong because POST with form-urlencoded data is used for RPC execution or creating new resources, not for replacing an existing configuration hierarchy, and form-urlencoded is not the Junos config payload format. Option C is wrong because DELETE removes the target configuration node — it does not replace it with new content. Option D is wrong because GET is read-only and cannot modify configuration; URL parameters only filter or select data.

96
MCQeasy

An automation developer is examining a JSON response payload returned by a Juniper device via a REST API call. Which valid JSON data type is used to represent an ordered list of values enclosed within square brackets?

A.String
B.Array
C.Object
D.Boolean
AnswerB

JSON arrays represent ordered collections enclosed in square brackets, exactly matching the stem's requirement for an ordered list of values. Unlike objects, which use unordered key-value pairs in curly braces, arrays preserve element sequence and permit mixed data types, making them the correct structure for the described payload.

Why this answer

In JSON, an array is an ordered list of values enclosed in square brackets. It can contain multiple values of any data type, including strings, numbers, objects, and other arrays.

Exam trap

JNCIA-DevOps often tests basic JSON syntax, and candidates may confuse arrays with objects due to similar bracket usage in other contexts.

How to eliminate wrong answers

Option A is wrong because a string is a sequence of characters enclosed in double quotes, not square brackets. Option C is wrong because an object is an unordered collection of key-value pairs enclosed in curly braces. Option D is wrong because a boolean represents a true or false value, not a list.

97
MCQeasy

What is the primary templating engine used alongside Python for generating structured Junos configuration text in network automation workflows?

A.Ansible Engine
B.Mako
C.ERB
D.Jinja2
AnswerD

Jinja2 is the templating engine used alongside Python to generate structured Junos configuration text, supporting variables, loops and conditionals. This satisfies the scenario's requirement for producing device-ready configuration snippets within network automation workflows, rather than ad-hoc string concatenation.

Why this answer

Jinja2 is the de facto templating engine used with Python for generating Junos configuration text in network automation. It is bundled or easily installed alongside Python, integrates natively with Ansible, and supports loops, conditionals, and variable substitution that map cleanly to Junos configuration hierarchies. Its syntax ({{ }} for variables, {% %} for logic) is widely used in Junos automation examples and Juniper's own tooling.

Exam trap

JNCIA-DevOps often tests whether candidates confuse the orchestration tool (Ansible) with the templating engine (Jinja2), or mistake a templating engine from another language ecosystem (ERB/Ruby, Mako) for the Python-standard choice.

How to eliminate wrong answers

Option A is wrong because Ansible Engine is a configuration management and orchestration platform, not a templating engine — it uses Jinja2 internally for templating. Option B is wrong because Mako is a Python templating library, but it is not the primary engine used in Junos automation workflows and lacks the ecosystem integration Jinja2 has with Ansible and Junos tooling. Option C is wrong because ERB (Embedded Ruby) is a Ruby templating system, not a Python one, and is irrelevant to Python-based Junos automation.

98
MCQeasy

Which file extension is conventionally used for YAML data serialization files?

A..json
B..yaml
C..ini
D..xml
AnswerB

The `.yaml` extension is the conventional, officially recommended suffix for YAML data serialisation files, satisfying the stem's requirement for the standard extension. It aligns with the YAML specification's preference over the older `.yml` shorthand, ensuring tooling and parsers recognise the file type correctly.

Why this answer

YAML files conventionally use the .yaml or .yml extension. YAML (YAML Ain't Markup Language) is a human-readable data serialization standard often used for configuration files and in DevOps tools like Ansible, Kubernetes, and CI/CD pipelines. The .yaml extension is the most standard and widely recognized.

Exam trap

JNCIA-DevOps often tests file extension recognition, and candidates might confuse .yaml with .yml or other extensions, but both are acceptable; the question asks for the conventional one.

How to eliminate wrong answers

Option A is wrong because .json is used for JSON files, a different serialization format. Option C is wrong because .ini is used for INI configuration files, which have a different syntax. Option D is wrong because .xml is used for XML files, another markup language.

99
MCQmedium

An engineer is applying a candidate configuration using PyEZ and needs to load it from an external text file named 'interfaces.conf'. Which Config method should be used?

A.cu.load(path='interfaces.conf', format='text')
B.dev.load_configuration(file='interfaces.conf')
C.cu.load_file('interfaces.conf')
D.cu.read_config('interfaces.conf')
AnswerA

The PyEZ Config utility's load() method accepts a path argument pointing to an external file plus a format argument, so text format parses 'interfaces.conf' as Junos configuration text. This satisfies the stem's requirement to load from an external text file.

Why this answer

The Config object's load() method is the standard PyEZ API for loading configuration data into a candidate configuration, and it accepts a path argument pointing to an external file plus a format argument specifying the data format. Since the file is a plain text Junos configuration file, format='text' is the correct specification. This combination loads the file contents into the candidate config so it can later be committed.

Exam trap

JNCIA-DevOps often tests whether candidates confuse the PyEZ Config class methods (load, commit, rollback) with non-existent or Device-level methods, so candidates who have not actually written PyEZ code often pick plausible-sounding but invalid method names.

How to eliminate wrong answers

Option B is wrong because load_configuration() is not a valid PyEZ Device method — configuration loading is performed via the Config utility class, not directly on the Device object. Option C is wrong because load_file() is not a PyEZ Config method; the correct method name is load() with a path parameter. Option D is wrong because read_config() does not exist in the PyEZ Config API — reading and loading are distinct operations, and there is no such method for importing a config file.

100
MCQhard

A Python script reads a Junos configuration snippet stored in YAML. The configuration uses YAML anchors and aliases to duplicate common routing policy definitions across multiple VRFs. When the script parses the file using yaml.safe_load(), what happens to the anchors and aliases?

A.The parser raises a ScannerError because anchors are prohibited in safe mode.
B.The parser resolves the anchors and populates the resulting Python dictionary with the referenced data.
C.The aliases are ignored, resulting in empty values for those configuration blocks.
D.The parser treats the anchor syntax as literal string data.
AnswerB

yaml.safe_load() resolves anchors and aliases during parsing, substituting the referenced node's data wherever an alias appears. The resulting Python dictionary therefore contains fully expanded values, satisfying the stem's constraint that duplicated routing policy definitions populate each VRF entry.

Why this answer

When yaml.safe_load() parses a YAML file containing anchors and aliases, it resolves the aliases by inserting the referenced data into the resulting Python dictionary. The anchors and aliases are a YAML feature for reusing nodes, and safe_load() fully supports them, producing a dictionary with the duplicated data expanded.

Exam trap

JNCIA-DevOps often tests YAML anchor behavior, tricking candidates into thinking safe_load() disables anchors or that aliases are ignored, when in fact they are resolved.

How to eliminate wrong answers

Option A is wrong because anchors are not prohibited in safe mode; safe_load() supports anchors and aliases. Option C is wrong because aliases are not ignored; they are resolved to the referenced data. Option D is wrong because the parser does not treat anchor syntax as literal string data; it interprets it as YAML syntax.

101
Multi-Selecthard

An engineer is building a CI/CD pipeline for Junos device configuration. The pipeline must validate configuration changes before deployment and ensure that only tested configurations are merged into the main branch. Which two practices are essential for achieving this goal? (Choose two.)

Select 2 answers
A.Deploying configurations directly to production without testing to save time
B.Running unit tests on Jinja2 templates to verify generated configuration syntax
C.Enforcing branch protection rules that require successful pipeline runs before merging
D.Manually reviewing every configuration change before deployment
E.Using a version control system to track configuration changes
AnswersB, C

Unit tests on Jinja2 templates validate that the templates render correctly and produce syntactically valid Junos configuration. This catches errors early, before deployment. In a CI/CD pipeline, such tests are typically run automatically on each commit or pull request. This practice ensures that only configurations that pass syntax checks are considered for merging, aligning with the requirement to validate changes before deployment.

Why this answer

To validate configuration changes before deployment and ensure only tested configurations are merged, the pipeline must include automated tests that verify template rendering and syntax, and branch protection rules that enforce successful pipeline runs before merging. These two practices together create a gate that prevents untested changes from reaching the main branch. The other options either bypass testing or are insufficient alone.

Exam trap

The trap here is assuming that version control or manual review is sufficient to ensure only tested configurations are merged, but automated validation and merge gating are the essential practices.

102
MCQeasy

Which of the following characters is used to start a comment line in a YAML document?

A.Exclamation mark (!)
B.Percent sign (%)
C.Double forward slash (//)
D.Hash sign (#)
AnswerD

A hash sign (#) begins a comment in YAML, causing the parser to ignore the remainder of that line. This satisfies the stem's requirement for the comment-initiating character, distinguishing YAML from formats using slashes or semicolons.

Why this answer

Comments in YAML begin with the hash or pound sign (#) and continue to the end of the line.

103
Multi-Selecthard

Which THREE architectural features distinguish the Junos REST API from traditional CLI screen-scraping (CLI automation via expect scripts)? (Choose three)

Select 3 answers
A.Resource-based URI routing that maps directly to configuration and operational models.
B.Strict enforcement of synchronous modal CLI configuration blocks.
C.Native support for structured data representations like JSON and XML.
D.Requirement for VT100 terminal emulation buffers.
E.Use of standardized HTTP status codes for programmatic error handling.
AnswersA, C, E

Unlike expect scripts that parse unstable CLI text, the REST API exposes each configuration and operational model as an addressable URI resource, so automation targets a defined endpoint rather than matching screen output. This resource-based routing is the architectural feature that removes dependence on fragile terminal formatting.

Why this answer

Option A is correct because the Junos REST API exposes resources through hierarchical URIs (for example /rest/conf or /rest/rpc) that map directly to Junos configuration hierarchies and operational RPC models, rather than requiring the client to parse human-readable CLI output. Option C is correct because the REST API natively returns and accepts structured payloads such as JSON and XML, allowing programmatic parsing without fragile text matching. Option E is correct because the REST API uses standard HTTP status codes (200 OK, 400 Bad Request, 401 Unauthorized, 500 Internal Server Error, etc.) so automation can handle errors deterministically instead of scanning CLI error strings.

Option B is not correct because strict synchronous modal CLI configuration blocks are a characteristic of the CLI (edit/commit model), not of the REST API, which is stateless and request/response oriented. Option D is not correct because VT100 terminal emulation buffers are required by screen-scraping tools such as expect, whereas the REST API communicates over HTTP and needs no terminal emulation.

Exam trap

JNCIA-DevOps often tests the differences between REST API and CLI screen-scraping, and candidates may incorrectly associate CLI characteristics like modal configuration blocks or terminal emulation with the REST API, leading them to select wrong options.

104
MCQmedium

An automation engineer is writing a script that saves operational telemetry data gathered from a Junos router. The data needs to be written directly to an open file stream in JSON format. Which method from the Python 'json' module should be used?

A.json.dumps()
B.json.to_file()
C.json.dump()
D.json.write()
AnswerC

json.dump() serialises a Python object and writes it straight to a supplied file object, matching the requirement to write telemetry directly to an open file stream. json.dumps() instead returns a string, which would need separate writing.

Why this answer

json.dump() takes a Python object and writes it directly to a file-like stream object, whereas json.dumps() returns a string.

105
MCQeasy

Which data serialization formats are natively supported by the Junos REST API for both input and output payloads?

A.JSON and XML
B.CSV and HTML
C.JSON and YAML
D.YAML and Protocol Buffers
AnswerA

The Junos REST API accepts and returns both JSON and XML payloads, selected via the Accept and Content-Type headers. JSON suits lightweight scripting; XML mirrors Junos native hierarchy. Both satisfy the stem's requirement for natively supported input and output serialisation formats.

Why this answer

The Junos REST API natively supports both JSON and XML data formats for interacting with operational and configuration data.

106
MCQhard

An automation script uses the Junos XML API to retrieve interface statistics every 5 minutes. The script uses the <get-interface-information> RPC with the <interface-name> filter for a specific interface. After several successful runs, the script suddenly receives an empty <interface-information> element. What is the most likely cause?

A.The <get-interface-information> RPC does not support filtering by interface name.
B.The interface has been renamed or deleted from the configuration.
C.The interface is administratively down, so no statistics are returned.
D.The NETCONF session has timed out and needs to be re-established.
AnswerB

This is correct because if the specified interface no longer exists in the configuration, the <get-interface-information> RPC with a filter for that interface name will return an empty response. The RPC returns data only for existing interfaces. Renaming or deleting the interface would cause the filter to match nothing, resulting in an empty element.

Why this answer

The <get-interface-information> RPC returns data only for interfaces that exist in the configuration. If the specified interface is renamed or deleted, the filter matches no interface, and the response contains an empty <interface-information> element. Other causes like session timeout or unsupported filtering would produce errors or different responses.

Administrative state does not cause an empty response.

Exam trap

The trap here is assuming that an empty response indicates a communication problem, when it often means the requested object no longer exists.

107
MCQeasy

An engineer needs to represent an ordered list of IP addresses in a YAML configuration file for a Junos automation playbook. Which valid YAML syntax correctly defines a sequence of items?

A.ip_addresses = {192.168.1.1, 192.168.1.2}
B.ip_addresses: [192.168.1.1: 192.168.1.2]
C.ip_addresses: - 192.168.1.1 - 192.168.1.2
D.ip_addresses: * 192.168.1.1 * 192.168.1.2
AnswerC

YAML sequences are denoted by a hyphen before each item, indented beneath the parent key. Listing each IP address on its own hyphenated line under 'ip_addresses:' correctly defines an ordered sequence, which is the structure the playbook requires.

Why this answer

In YAML, lists or sequences are represented using a hyphen followed by a space (-) at the beginning of each line.

108
Multi-Selectmedium

Which TWO statements are true regarding NETCONF locking mechanisms on Junos devices? (Choose two)

Select 2 answers
A.If a NETCONF session terminates unexpectedly, any locks held by that session are automatically released by the device.
B.Multiple concurrent NETCONF sessions can obtain exclusive write locks on the candidate datastore at the same time.
C.Locking the candidate datastore prevents other users or automation scripts from making conflicting changes.
D.Locks can only be released by rebooting the Routing Engine.
E.Locking is strictly mandatory for every single <get-config> request.
AnswersA, C

Junos ties each lock to its NETCONF session; when that session drops, the management daemon releases the held locks automatically. This prevents stale locks from blocking later commits after a crashed or disconnected automation script, satisfying the unexpected-termination condition in the stem.

Why this answer

Option A is correct because Junos ties NETCONF locks to the session that acquired them; if the session drops or terminates abnormally, the device automatically releases those locks so the configuration is not left permanently locked. Option C is correct because locking the candidate datastore grants exclusive write access, blocking other users or automation scripts from committing conflicting changes until the lock is released. Option B is incorrect because the candidate datastore lock is exclusive, so only one session can hold it at a time.

Option D is incorrect because locks are released through normal NETCONF operations such as <unlock> or session termination, not by rebooting the Routing Engine. Option E is incorrect because locking is not required for read-only <get-config> requests; it is used to protect configuration changes.

109
Multi-Selecthard

Which THREE exceptions can be raised by PyEZ during script execution when interacting with a Junos device? (Choose three)

Select 3 answers
A.RpcError
B.DatabaseLockedError
C.ConfigError
D.ConnectError
E.TemplateRenderError
AnswersA, C, D

RpcError is raised by PyEZ when the Junos device returns an RPC error reply, such as an invalid command or permission failure. It surfaces device-side execution faults encountered while a script interacts with the Junos device, making it one of the valid PyEZ exceptions.

Why this answer

PyEZ raises RpcError (option A) when an RPC sent to the Junos device returns an error response, such as a failed <rpc-error> element from the NETCONF/RPC layer. ConfigError (option C) is raised when a configuration load, commit, or related config operation fails on the device. ConnectError (option D) is raised when PyEZ cannot establish or maintain the connection to the Junos device, for example due to authentication or transport failures.

DatabaseLockedError (option B) and TemplateRenderError (option E) are not PyEZ exceptions: DatabaseLockedError is not a standard PyEZ exception class, and TemplateRenderError belongs to Jinja2 templating, not PyEZ's exception hierarchy.

Exam trap

JNCIA-DevOps often tests whether candidates can distinguish genuine PyEZ exception classes from plausible-sounding but fabricated names like DatabaseLockedError or TemplateRenderError.

110
MCQhard

You are writing a Python automation script that processes JSON output from a Junos device's 'show interfaces' operational command via PyEZ. One of the interface descriptions contains raw control characters. When the script attempts to dump this data to a JSON string using json.dumps(), it raises a ValueError. Which parameter should you pass to json.dumps() to handle non-printable or out-of-range character encoding gracefully?

A.skipkeys=True
B.check_circular=False
C.ensure_ascii=False
D.allow_nan=True
AnswerC

Correct. ensure_ascii=False ensures that non-ASCII or special characters are serialized without crashing the encoder.

Why this answer

The json.dumps() function in Python includes an 'ensure_ascii' parameter. When set to False, it allows non-ASCII characters to be emitted directly without raising serialization errors or escaping them into Unicode escape sequences.

111
MCQmedium

You are writing a PyEZ script that must connect to a Junos device and run several RPCs, but you need the connection to automatically recover if the NETCONF session drops during a long-running task. Which PyEZ connection parameter should you configure to enable this behavior?

A.Set `auto_probe=30` in the `Device` constructor to periodically verify the session and reconnect if needed.
B.Pass `auto_probe=0` to the `Device` constructor to disable session probing.
C.Set `port=22` in the `Device` constructor to use SSH instead of NETCONF.
D.Use the `Device` context manager (`with Device(...) as dev:`) to ensure the session is closed properly.
AnswerA

`auto_probe` specifies the interval in seconds at which PyEZ probes the connection to verify it is still alive. If the session has dropped, PyEZ will attempt to reconnect automatically. Setting `auto_probe=30` means the library checks every 30 seconds, providing resilience during long-running tasks without manual intervention.

Why this answer

The `auto_probe` parameter in the PyEZ `Device` constructor enables automatic session health checks at a specified interval. When set to a non-zero value, PyEZ periodically probes the NETCONF session and reconnects if it has dropped, which is essential for long-running automation tasks that must survive transient network issues. Other parameters like `port` or context managers do not provide this recovery capability.

Exam trap

The trap here is confusing the context manager's cleanup behavior with automatic session recovery, or thinking that specifying a port enables reconnection.

112
Multi-Selecthard

When implementing Jinja2 templates for Junos configuration generation, which THREE features or syntax constructs are natively supported by the Jinja2 engine?

Select 3 answers
A.Automatic translation of Jinja2 syntax into NETCONF XML filters without evaluation
B.Direct execution of arbitrary host-level Bash shell scripts inside template bodies
C.Variable substitution using double curly braces (e.g., {{ interface_name }})
D.Control structures such as loops and conditional blocks (e.g., {% for item in list %})
E.Template inheritance and block overriding (e.g., {% block content %})
AnswersC, D, E

Double curly braces are Jinja2's native expression delimiters, rendering the referenced variable into the generated Junos configuration text at render time. This satisfies the stem's requirement for a natively supported syntax construct, since {{ }} is core engine behaviour requiring no extension.

Why this answer

Jinja2 natively supports variable substitution through double curly braces, so option C ({{ interface_name }}) is correct because the engine evaluates the expression and renders its value into the output. Option D is correct because Jinja2 provides control structures such as {% for item in list %} loops and {% if %} conditional blocks that are evaluated during rendering. Option E is correct because Jinja2 supports template inheritance via {% extends %} and overridable {% block content %} sections, allowing a base template to be reused and customized.

Option A is not a Jinja2 feature; Jinja2 renders text and does not automatically translate its syntax into NETCONF XML filters, which is handled by Junos-specific tooling such as PyEZ or Jinja2 filters written for that purpose. Option B is also not native Jinja2 behavior; arbitrary host-level Bash execution is not part of the template engine and would require custom extensions or filters, not standard Jinja2 syntax.

113
MCQeasy

Which Python function deserializes a JSON-formatted string into a native Python dictionary?

A.json.load()
B.json.read()
C.json.loads()
D.json.parse()
AnswerC

`json.loads()` parses a JSON-formatted string and returns native Python objects, converting a JSON object into a `dict`. This satisfies the stem's requirement to deserialise a string, unlike `json.load()`, which reads from a file object, or `json.dumps()`, which serialises in the opposite direction.

Why this answer

The json.loads() function in Python's json module deserializes a JSON-formatted string into a native Python dictionary (or list, depending on the JSON structure). It is the standard method for parsing JSON strings. The 's' in loads stands for 'string', distinguishing it from json.load(), which reads from a file-like object.

Exam trap

JNCIA-DevOps often tests the confusion between json.load() and json.loads(), catching candidates who forget that the 's' denotes string input.

How to eliminate wrong answers

Option A is wrong because json.load() reads JSON data from a file object, not a string. Option B is wrong because json.read() does not exist in the json module. Option D is wrong because json.parse() is not a function in Python's json module; it is a method in JavaScript's JSON object.

114
MCQhard

An automation script performs a NETCONF transaction that triggers an alarm. You want to retrieve current system alarms using the Junos XML API. Which RPC tag represents this request?

A.<retrieve-alarms>
B.<get-system-alarms>
C.<get-alarm-information>
D.<get-chassis-alarms>
AnswerC

The `<get-alarm-information>` RPC is the dedicated Junos XML API tag that returns current system alarm conditions, satisfying the stem's requirement to retrieve alarms via NETCONF. Other RPCs, such as `<get-system-information>`, expose chassis or resource data rather than alarm state, so they cannot fulfil this request.

Why this answer

The <get-alarm-information> RPC retrieves active system alarms from the Junos device.

115
Multi-Selectmedium

An organization is implementing a Git-based version control strategy for Junos network configurations. Which THREE practices are considered standard DevOps workflows when managing network configurations in Git? (Choose THREE)

Select 3 answers
A.Tagging specific repository commits to mark official production releases or maintenance versions
B.Directly committing experimental production changes to the master branch without review
C.Storing network device configuration templates as plain text files in a repository
D.Submitting configuration changes through pull requests or merge requests for peer review
E.Encrypting all configuration text files using binary compressed archives inside Git
AnswersA, C, D

Tagging commits creates immutable references to specific points in repository history, marking approved production releases or maintenance versions. This satisfies the stem's requirement for a standard DevOps workflow by enabling precise rollback and auditability, since a tag identifies exactly which configuration revision was deployed, independent of later branch commits.

Why this answer

Option A is correct because tagging specific commits (e.g., git tag v1.0) creates immutable, human-readable references that mark official production releases or maintenance versions, enabling rollback and auditability in a Git-based DevOps workflow. Option C is correct because storing network device configuration templates as plain text files in a repository allows Git's native diff, blame, branching, and merging capabilities to track configuration changes line by line. Option D is correct because submitting configuration changes through pull requests or merge requests enforces peer review, automated CI validation, and controlled merging before changes reach production branches.

Option B is incorrect because directly committing experimental changes to master bypasses review and CI gates, violating standard Git branching and change-control practices. Option E is incorrect because encrypting configuration files as binary compressed archives defeats Git's line-based diffing, merging, and review capabilities, which are core to DevOps configuration management.

116
MCQmedium

An engineer is building a Python application to manage Junos devices. They need to open a NETCONF session, retrieve the device's hostname and model, and handle exceptions if the device is unreachable. Which Junos PyEZ component is designed specifically for establishing the NETCONF session and executing RPCs?

A.The Config class, which locks the candidate configuration and commits changes.
B.The Table class, which maps Junos XML output to Python dictionaries for operational commands.
C.The Meta class, which dynamically generates Python methods for YANG models on the device.
D.The Device class, which handles connection, authentication, and RPC execution over NETCONF.
AnswerD

The Device class in PyEZ is responsible for opening the NETCONF session, authenticating, and providing methods like rpc and cli to execute operations. It also supports context management and exception handling for unreachable devices. This directly matches the engineer's need to connect and retrieve operational data such as hostname and model.

Why this answer

The Device class is the PyEZ component that establishes and manages the NETCONF session, handles authentication, and executes RPCs or CLI commands. It is the correct choice for connecting to a device, retrieving operational facts like hostname and model, and handling connection exceptions. The Config, Table, and Meta classes serve configuration management, data transformation, and internal class generation, respectively, not session establishment.

Exam trap

The trap here is mixing up PyEZ's configuration and data-mapping classes with the class that actually owns the NETCONF connection lifecycle.

117
MCQmedium

An automation engineer needs to retrieve the operational status of all interfaces from a Junos device using the Junos REST API over HTTPS. The device is configured with the REST API enabled and the engineer has valid credentials. Which HTTP request accomplishes this task?

A.POST https://<device>/rest/interface-information
B.GET https://<device>/rest/conf/show-interfaces
C.GET https://<device>/rest/interface-information
D.POST https://<device>/rpc/get-interface-information
AnswerC

This request uses the correct REST API endpoint for retrieving interface operational information. The Junos REST API exposes operational RPCs under the /rest/ path, and 'interface-information' corresponds to the 'show interfaces' RPC. A GET request retrieves data without modifying configuration, which is appropriate for this scenario.

Why this answer

The Junos REST API exposes operational RPCs under the /rest/ URI path. To retrieve interface operational status, an automation tool sends a GET request to /rest/interface-information. GET is the correct HTTP method for read-only retrieval, and no additional parameters are needed for a full interface listing.

Other paths like /rpc/ belong to the XML API, and using POST for retrieval is incorrect.

Exam trap

The trap here is confusing the Junos REST API endpoint structure with the JUNOS XML API /rpc/ path, or using POST for read-only operations.

118
MCQmedium

An automation engineer is writing a Python script that takes a complex nested Python dictionary containing Junos telemetry parameters and converts it into a YAML string. Which PyYAML function should be used?

A.yaml.export()
B.yaml.serialize_string()
C.yaml.to_yaml()
D.yaml.safe_dump()
AnswerD

yaml.safe_dump() serialises Python objects to YAML while restricting output to standard safe types, preventing arbitrary object instantiation. This satisfies the constraint of converting a nested dictionary of telemetry parameters into a YAML string without exposing the script to unsafe deserialisation risks.

Why this answer

yaml.safe_dump() converts a Python object into a YAML-formatted string safely, avoiding the security risks associated with the base yaml.dump().

119
Multi-Selectmedium

Which TWO features are supported by YAML but are notably absent in standard JSON? (Choose two)

Select 2 answers
A.Native browser execution support without parsing libraries.
B.Strict enforcement of double quotes on all string keys.
C.Strict indentation-based block scoping.
D.Anchors and aliases for data reuse within the document.
E.Native support for comments using the hash (#) symbol.
AnswersD, E

YAML anchors (&) and aliases (*) let a node be defined once and referenced elsewhere, eliminating duplication within a document. Standard JSON has no equivalent referencing construct, so repeated structures must be written out in full, which is the specific gap this option identifies.

Why this answer

Option D is correct because YAML provides anchors (&) and aliases (*) that let you define a node once and reference it elsewhere in the same document, a reuse mechanism JSON lacks entirely. Option E is correct because YAML natively supports comments introduced by the hash (#) symbol, whereas standard JSON (per RFC 8259) defines no comment syntax at all. Option A is wrong because neither YAML nor JSON executes natively in browsers; JSON is parsed via JSON.parse() and YAML requires a library such as js-yaml.

Option B is wrong because JSON requires double quotes on keys, while YAML permits unquoted keys, so this is a JSON trait, not a YAML-only feature. Option C is wrong because YAML uses indentation for structure but does not enforce strict block scoping the way the option implies, and JSON uses braces and brackets rather than indentation.

Exam trap

JNCIA-DevOps often tests candidates who assume JSON and YAML are interchangeable — the trap is forgetting that comments and anchors/aliases are YAML-only features that JSON explicitly forbids.

120
Multi-Selectmedium

An automation engineer is using the Junos REST API to manage configuration. The engineer needs to perform a commit that includes a descriptive comment and also synchronizes the commit across both Routing Engines in a dual-RE chassis. Which TWO parameters must be included in the commit RPC request? (Choose two.)

Select 2 answers
A.comment
B.detail
C.confirmed
D.synchronize
E.check
AnswersA, D

The 'comment' parameter allows you to attach a descriptive comment to the commit, which is logged in the commit history. This is essential for audit trails and understanding the purpose of configuration changes. In the Junos REST API, you include it as a parameter in the commit RPC, for example: /rpc/commit?comment=my_change. It satisfies the requirement to include a descriptive comment.

Why this answer

To include a comment and synchronize the commit across Routing Engines, the commit RPC must include both the 'comment' and 'synchronize' parameters. The 'comment' parameter attaches a message to the commit, while 'synchronize' ensures both REs are updated. The 'check' parameter only validates, 'confirmed' adds a rollback timer, and 'detail' is not applicable.

These two parameters are explicitly supported by the Junos REST API for the commit operation.

Exam trap

The trap here is confusing validation parameters like 'check' with actual commit parameters, or assuming that synchronization is automatic in a dual-RE system when it requires explicit 'synchronize'.

121
Multi-Selecthard

When serializing complex nested Python dictionaries to JSON, which THREE data types will cause a TypeError unless handled by a custom default encoder function? (Choose three)

Select 3 answers
A.Standard string objects
B.Python set objects
C.Custom class instances
D.Boolean values
E.Complex numbers
AnswersB, C, E

Python sets are unordered collections of unique, hashable elements, and JSON defines no set type, so `json.dumps()` raises TypeError. A custom default encoder must convert them, typically to a list. This satisfies the stem's requirement for types needing explicit handling during serialisation of nested dictionaries.

Why this answer

Option B (Python set objects) is correct because the json module has no native representation for sets, so json.dumps() raises TypeError: Object of type set is not JSON serializable unless a custom default function converts it (e.g., to a list). Option C (Custom class instances) is correct because arbitrary user-defined objects are not JSON-serializable by default; json.dumps() only knows how to encode dict, list, tuple, str, int, float, bool, and None, so a custom default handler must return a serializable representation such as obj.__dict__. Option E (Complex numbers) is correct because Python's complex type is not among the supported JSON types and json.dumps(1+2j) raises TypeError, requiring a custom encoder to convert it (e.g., to a string or a [real, imag] list).

Option A (Standard string objects) is not correct because str is natively supported and serializes directly to a JSON string. Option D (Boolean values) is not correct because bool is natively supported and serializes to JSON true/false.

122
Multi-Selecthard

When writing an automation script that converts data formats between YAML and JSON for Junos configuration pipelines, which THREE potential pitfalls should an engineer account for? (Choose three)

Select 3 answers
A.YAML automatically guarantees lossless round-trip conversion for all Python objects.
B.JSON files natively support YAML anchors and aliases.
C.JSON integer keys are automatically converted to strings in Python dictionaries.
D.YAML comments are entirely lost when converting a YAML document to JSON.
E.Certain unquoted YAML scalars (like 'yes' or leading-zero numbers) may change type during parsing.
AnswersC, D, E

Python dictionaries require hashable keys, and JSON permits only string keys. When json.loads parses an object, integer-looking keys become strings, so round-tripping YAML to JSON silently alters key types, breaking lookups that expect integers in Junos configuration pipelines.

Why this answer

Option C is correct because JSON object keys are always strings, so when Python's json module loads a JSON document, any key that appears numeric (e.g., 1) becomes the string '1', which can break lookups or round-trips if the script expects an integer key. Option D is correct because JSON has no comment syntax, so any YAML comments (# ...) are discarded by the YAML parser and cannot be represented in the resulting JSON output. Option E is correct because YAML 1.1 parsers interpret unquoted scalars such as 'yes'/'no' as booleans and leading-zero values like 012 as octal integers, silently changing the data type unless the scalars are explicitly quoted.

Option A is wrong because YAML does not guarantee lossless round-trip conversion for arbitrary Python objects (custom types, tuples, sets, etc. require tags or custom representers). Option B is wrong because JSON has no native support for YAML anchors and aliases; those are YAML-specific features that must be resolved before JSON serialization.

123
MCQmedium

When an automation engineer queries operational data using the Junos REST API, how does the API format the returned structure if the 'Accept: application/json' header is supplied?

A.As a JSON object representation mirroring the hierarchical XML output of Junos operational RPCs.
B.As a single long string containing raw CLI output text.
C.As a comma-separated values (CSV) text stream.
D.As a binary packet capture file.
AnswerA

Supplying `Accept: application/json` makes the Junos REST API convert the RPC's native hierarchical XML into an equivalent JSON object, preserving the same nested container and leaf structure. This satisfies the stem's constraint of requesting JSON-formatted operational data, returning the hierarchy rather than a flat or tabular representation.

Why this answer

When application/json is requested, the Junos REST API translates the native XML operational data structures into structured JSON objects.

124
MCQhard

An engineer needs to retrieve the entire candidate configuration in JSON format from a Junos device using the Junos REST API. Which HTTP header must be included in the GET request to ensure the response is returned in JSON format?

A.Transfer-Encoding: chunked
B.Accept: application/json
C.Content-Type: text/xml
D.X-Junos-Data-Format: json
AnswerB

Content negotiation in the Junos REST API is driven by the HTTP Accept header. Setting Accept: application/json instructs the device to serialise the candidate configuration response as JSON rather than the default XML, satisfying the JSON output requirement.

Why this answer

The Accept header with 'application/json' specifies that the client expects the response to be formatted in JSON.

125
Multi-Selectmedium

When designing an automation workflow that uses the Junos REST API for configuration management, which THREE practices ensure robust execution? (Choose three)

Select 3 answers
A.Configure HTTPS (jpagent https) to encrypt credentials and configuration payloads in transit.
B.Specify correct Content-Type headers matching the payload format (e.g., JSON).
C.Always reboot the Routing Engine after every GET request.
D.Validate response status codes (e.g., checking for 200, 201, 204) before assuming success.
E.Send raw VT100 terminal escape sequences inside the HTTP body.
AnswersA, B, D

Enabling HTTPS on jpagent encrypts credentials and configuration payloads in transit, preventing interception or tampering over the management network. This satisfies the robust-execution requirement for secure transport when automating configuration through the Junos REST API.

Why this answer

Option A is correct because the Junos REST API is exposed over HTTPS via the jpagent (Juniper Web Agent) service, so enabling HTTPS (jpagent https) ensures that credentials and configuration payloads are encrypted in transit rather than sent in cleartext. Option B is correct because the REST API requires the client to declare the payload format with the proper Content-Type header (for example, application/json for JSON or application/xml for XML); an incorrect or missing header causes the request to be rejected or misparsed. Option D is correct because robust automation must inspect HTTP response status codes — 200 for successful GETs, 201 for created resources, and 204 for successful operations with no content — to confirm the request succeeded before proceeding.

Option C is not appropriate because GET requests are read-only and rebooting the Routing Engine after each one would be disruptive and unnecessary. Option E is not appropriate because the REST API exchanges structured JSON or XML over HTTP, not raw VT100 terminal escape sequences, which belong to interactive CLI sessions.

126
Multi-Selecteasy

Which TWO HTTP response status codes indicate a successful Junos REST API request where data was successfully retrieved or modified? (Choose two)

Select 2 answers
A.404 Not Found
B.200 OK
C.401 Unauthorized
D.204 No Content
E.500 Internal Server Error
AnswersB, D

200 OK confirms the Junos REST API processed the request and returns the requested representation in the response body, satisfying the stem's requirement for data successfully retrieved or modified. It is the standard success code for GET and POST operations that return content.

Why this answer

Option B (200 OK) is correct because the Junos REST API returns HTTP 200 when a request such as a GET successfully retrieves data or a POST/PUT successfully modifies configuration, with the response body carrying the requested representation or result. Option D (204 No Content) is correct because Junos returns HTTP 204 when an operation succeeds but there is no data to return in the body, such as a successful DELETE or a configuration change with no payload. Option A (404 Not Found) is wrong because it signals the requested resource or URI does not exist, not success.

Option C (401 Unauthorized) is wrong because it indicates missing or invalid authentication credentials. Option E (500 Internal Server Error) is wrong because it indicates a server-side failure while processing the request.

127
MCQeasy

Which python module is part of the standard library that can be used to parse XML responses returned by NETCONF?

A.netconf.parser
B.xml.etree.ElementTree
C.xml2dict
D.json
AnswerB

xml.etree.ElementTree ships with every Python installation, so no pip install is needed to parse NETCONF's XML replies. It satisfies the standard-library constraint directly, unlike third-party parsers such as lxml or xmltodict, which must be installed separately before use.

Why this answer

Python's built-in xml.etree.ElementTree module provides tools for parsing and navigating XML data.

128
MCQhard

During a NETCONF session with a Junos device, an automation script issues an RPC to load a configuration. The device returns a response containing an <rpc-error> tag. What does this indicate?

A.The Junos routing engine is operating at 100% CPU capacity.
B.The NETCONF session has successfully terminated with a normal exit code.
C.The physical optical link on the management port has failed.
D.The configuration or RPC request failed validation, syntax checking, or execution constraints on the device.
AnswerD

An rpc-error element signals the device rejected the request, reporting failure of validation, syntax checking or execution constraints. The configuration was not applied; the script must inspect the error details and correct the RPC before retrying.

Why this answer

In NETCONF (RFC 6241), the <rpc-error> element is returned inside the <rpc-reply> when the server cannot successfully process the RPC. It signals that the request failed validation, hit a syntax error, violated a data-model constraint, or was rejected by the device's configuration engine — not that the session or hardware failed. The error contains sub-elements like <error-type>, <error-tag>, <error-severity>, and <error-message> that describe the exact failure.

Exam trap

JNCIA-DevOps often tests whether candidates confuse protocol-level RPC failures (<rpc-error>) with transport, hardware, or session-state problems — the trap is picking an infrastructure cause when the tag is purely about request validation.

How to eliminate wrong answers

Option A is wrong because high CPU on the routing engine would not produce an <rpc-error>; it might cause timeouts or slow responses, but the RPC error tag is a protocol-level rejection of the request. Option B is wrong because a normal session termination is signalled by closing the NETCONF session or an <ok/> reply, not by <rpc-error>; the tag explicitly indicates a failure, not success. Option C is wrong because a physical optical link failure on the management port would break the transport (SSH/TCP) entirely, so no RPC reply — error or otherwise — would be received.

129
MCQeasy

A network engineer is establishing a version control workflow for network configurations using Git. Which Git command should the engineer use to stage newly created configuration template files in the local repository working directory so they are included in the next commit?

A.git clone
B.git commit
C.git push
D.git add
AnswerD

git add moves new or modified files from the working directory into the staging area, marking them for inclusion in the next commit. Without staging, the template files would remain untracked and absent from the commit, so git add is the required command here.

Why this answer

The git add command stages changes in the working directory, moving them to the staging area (index) to prepare them for a commit.

130
MCQmedium

An automation script reads a configuration template where boolean values are represented as 'yes' and 'no' in YAML. When parsed using PyYAML in Python, how are these values interpreted?

A.They are converted to integer 1 and 0 values.
B.They are interpreted as Python boolean True and False values.
C.They remain as literal string objects ('yes' and 'no').
D.The parser raises a ConstructorError because only 'true' and 'false' are valid.
AnswerB

YAML 1.1 resolves the unquoted scalars yes and no as booleans, so PyYAML converts them to Python True and False rather than leaving them as strings. Quoting them, or using true and false explicitly, would preserve string interpretation where that is intended.

Why this answer

In YAML 1.1 (which PyYAML predominantly implements), unquoted words like 'yes', 'no', 'true', 'false', 'on', and 'off' are automatically parsed into native boolean values.

131
Multi-Selecthard

When serializing Python data structures to JSON for Junos automation payloads, which THREE parameters can be passed to json.dumps() to control formatting and readability? (Choose three)

Select 3 answers
A.max_depth
B.separators
C.sort_keys
D.strict_mode
E.indent
AnswersB, C, E

Passing `separators` to `json.dumps()` overrides the default `(', ', ': ')` delimiters, letting you emit compact JSON such as `(',', ':')` for smaller Junos payloads or looser spacing for readability. This directly satisfies the stem's requirement to control formatting of serialised Python structures.

Why this answer

Option B, separators, is correct because json.dumps() accepts a (item_separator, key_separator) tuple that controls the characters placed between JSON elements, letting you produce compact output such as (',', ':') for smaller Junos payloads. Option C, sort_keys, is correct because setting sort_keys=True makes json.dumps() emit object keys in sorted order, which yields deterministic, diff-friendly JSON for configuration and automation scripts. Option E, indent, is correct because passing indent (for example indent=2 or indent=4) pretty-prints the JSON with newlines and that many spaces per level, improving readability of Junos payloads.

Option A, max_depth, is not a valid json.dumps() parameter; Python's json module has no depth-limiting argument. Option D, strict_mode, is also not a json.dumps() parameter; the closest real argument is strict, which controls whether control characters inside strings are allowed, but 'strict_mode' itself does not exist.

132
MCQeasy

A network engineer is establishing a NETCONF session with a Junos device and needs to lock the candidate configuration to prevent concurrent modifications by other administrators. Which NETCONF operation should be executed?

A.<lock><target><candidate/></target></lock>
B.<lock-config><database>candidate</database></lock-config>
C.<get-config><source><candidate/></source><lock/></get-config>
D.<edit-config><target><candidate/></target><operation>lock</operation></edit-config>
AnswerA

The lock operation targeting the candidate datastore prevents other administrators from modifying the candidate configuration until it is unlocked or the session ends. This satisfies the stem's requirement to block concurrent modifications during the engineer's NETCONF session.

Why this answer

The <lock> operation allows a client to lock the configuration datastore of a device to prevent unauthorized or conflicting changes during a transaction.

133
Multi-Selectmedium

Which TWO characteristics describe JSNAPy snapshot operations? (Choose two)

Select 2 answers
A.It compiles Jinja2 configuration templates directly into Junos CLI commands.
B.It replaces PyEZ as the primary library for executing NETCONF RPC calls.
C.It saves captured operational data into snapshot files for later comparison.
D.It modifies the active configuration database automatically upon finding errors.
E.It can compare a post-change snapshot against a baseline pre-change snapshot.
AnswersC, E

JSNAPy captures operational state—such as configuration and interface data—and writes it to snapshot files, enabling later comparison against fresh captures to detect drift. This directly satisfies the stem's requirement for snapshot operations, since persistent storage of captured data is what makes subsequent diff-based validation possible.

Why this answer

Option C is correct because JSNAPy's core function is to capture operational state (for example, via 'show' commands defined in a YAML file) and store that output into snapshot files, which serve as the reference data for later checks. Option E is correct because JSNAPy's primary use case is comparing snapshots — typically a post-change snapshot against a baseline pre-change snapshot — to detect configuration or operational drift, using commands like 'jsnapy --check' or 'jsnapy --snapcheck'. Options A, B, and D are incorrect: JSNAPy does not compile Jinja2 templates into CLI commands (that is the role of tools like Jinja2 templating with PyEZ or Junos PyEZ config utilities), it does not replace PyEZ as the NETCONF RPC library (JSNAPy actually relies on PyEZ under the hood), and it does not modify the active configuration database automatically — it only reports differences and never commits changes.

134
Multi-Selecteasy

Which TWO actions occur during the initial NETCONF session establishment phase between a client and a Junos device? (Choose two)

Select 2 answers
A.The client and server exchange <hello> messages to negotiate supported capabilities.
B.The client sends an immediate <commit> RPC to initialize the session.
C.The routing engine reloads its control plane daemons.
D.The client authenticates via SSH credentials before the NETCONF subsystem initializes.
E.The Junos device automatically locks the running configuration datastore.
AnswersA, D

Session establishment begins with capability exchange: both peers send <hello> messages containing their supported NETCONF base version, capabilities and session-id. This negotiation determines which operations, such as candidate datastore access, are available for subsequent RPCs during the session.

Why this answer

Option A is correct because NETCONF session establishment begins with both peers exchanging <hello> messages that advertise their capabilities and, in the server's case, the session-id, allowing the client and Junos device to negotiate supported features such as candidate configuration or confirmed commit. Option D is correct because NETCONF runs over SSH on Junos (typically TCP port 830), so the client must complete SSH authentication before the NETCONF subsystem is started and the <hello> exchange can occur. Option B is wrong because a <commit> RPC is a configuration operation performed after the session is established, not part of session initialization.

Option C is wrong because NETCONF session setup does not reload or restart routing engine control-plane daemons. Option E is wrong because the running configuration datastore is not automatically locked during session establishment; locking is an explicit client action via the <lock> RPC.

135
Multi-Selecthard

Which THREE attributes are available within the <edit-config> operation element in NETCONF to specify the modification action on a target node? (Choose three)

Select 3 answers
A.delete
B.replace
C.append
D.modify
E.merge
AnswersA, B, E

The delete attribute removes the specified configuration node from the target datastore during <edit-config>. It is one of the standard NETCONF modification operations, satisfying the stem's requirement for attributes that specify the action on a target node.

Why this answer

The NETCONF <edit-config> operation supports the operation attribute, whose valid values are merge, replace, create, delete, and remove. Option A (delete) is correct because the delete operation attribute removes a node that exists in the target datastore, and it is one of the standard values defined in RFC 6241. Option B (replace) is correct because replace overwrites the target node's value or configuration with the supplied content, creating it if it does not exist.

Option E (merge) is correct because merge is the default operation attribute value, combining the supplied configuration with the existing target datastore content. Option C (append) is not a valid NETCONF operation attribute value; list/leaf-list additions are handled via merge or the insert/key attributes. Option D (modify) is not a defined operation attribute value in NETCONF; modification is achieved through merge, replace, create, delete, or remove.

136
MCQmedium

An automation engineer needs to include comments explaining complex network parameters inside a Junos automation data file. Which serialization format should the engineer select?

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

YAML supports inline and block comments natively, so engineers can annotate complex network parameters directly within the automation data file. JSON and XML lack comment syntax, making YAML the only serialisation format satisfying the stem's documentation requirement.

Why this answer

YAML natively supports comments using the hash (#) symbol, whereas standard JSON does not support comments.

137
MCQmedium

An operations team is applying DevOps principles to network automation on Junos devices. They want to ensure that all changes to device operational states and configurations are treated as disposable and repeatable. Which DevOps practice best describes rebuilding device configurations completely from centralized version-controlled templates rather than performing manual incremental hot-patches?

A.Stateful configuration drift management
B.Blue-green circuit provisioning
C.Immutable infrastructure and declarative provisioning
D.Event-driven telemetry ingestion
AnswerC

Immutable infrastructure treats devices as replaceable: configurations are rebuilt declaratively from version-controlled templates rather than patched in place. This eliminates configuration drift and makes every rebuild repeatable, precisely matching the disposable, repeatable state the team demands.

Why this answer

Infrastructure as Code (IaC) and immutable infrastructure treat configurations as reproducible artifacts generated from source control rather than mutable, long-lived states modified ad-hoc.

138
Multi-Selecthard

A DevOps engineer is designing a CI/CD pipeline for validating Junos configuration changes prior to deployment. Which THREE actions are typically performed during the automated CI pipeline 'test' or 'validate' stage? (Choose THREE)

Select 3 answers
A.Performing dry-run validation checks against staging or virtual Junos instances (vSRX)
B.Immediately rebooting the production core routing engine to apply all updates
C.Running automated linters and style checks on Python automation scripts and Jinja2 templates
D.Executing static syntax and semantic validation of candidate configurations against device schemas
E.Manually logging into physical CLI consoles to troubleshoot cabling
AnswersA, C, D

Dry-run validation against staging or vSRX instances exercises the candidate Junos configuration on a non-production device, catching syntax and commit errors before production deployment. This satisfies the pipeline's validate-stage constraint by confirming the configuration commits cleanly without touching live infrastructure.

Why this answer

Option A is correct because the validate/test stage of a CI pipeline should exercise candidate configurations against non-production targets such as staging devices or virtual Junos instances (vSRX/vMX), often using 'commit check' or 'commit dry-run' to confirm the config loads and behaves as expected without impacting live traffic. Option C is correct because automated linters and style checks (for example flake8, pylint, yamllint, or ansible-lint) catch syntax errors, formatting issues, and common bugs in Python automation scripts and Jinja2 templates before they are rendered and pushed to devices. Option D is correct because static syntax and semantic validation against Junos schemas (for example 'commit check' or Junos PyEZ/YANG-based validation) verifies that the candidate configuration is syntactically valid and semantically consistent with the device's data model before deployment.

Option B is not part of a test/validate stage because rebooting a production core routing engine is a disruptive deployment/remediation action, not a validation step, and would cause an outage. Option E is not part of an automated CI test stage because manually logging into physical CLI consoles is a manual troubleshooting activity that contradicts the goal of automated, repeatable validation.

139
MCQeasy

Which statement correctly identifies the relationship between Junos REST API and NETCONF data models?

A.Both protocols leverage the same underlying Junos data models and management infrastructure.
B.REST API bypasses all Junos data models and writes directly to kernel memory.
C.NETCONF uses YANG models, whereas REST API uses proprietary relational databases.
D.NETCONF is deprecated in favor of REST API for all Junos configuration tasks.
AnswerA

Junos REST API and NETCONF both expose the same underlying Junos data models and management daemon infrastructure, differing only in transport and encoding. This satisfies the question by confirming the shared model relationship rather than treating them as separate schemas.

Why this answer

Both Junos REST API and NETCONF leverage the same underlying Junos data models and management infrastructure. The Junos REST API is essentially a RESTful interface to the Junos configuration and operational data, which is modeled using YANG and accessed via NETCONF. Therefore, they share the same data models and management framework.

Exam trap

JNCIA-DevOps often tests the misconception that REST API and NETCONF use different data models or that one is deprecated, when in fact they share the same Junos data models and management infrastructure.

How to eliminate wrong answers

Option B is wrong because REST API does not bypass Junos data models; it uses the same data models and management infrastructure. Option C is wrong because NETCONF uses YANG models, but REST API also uses YANG models, not proprietary relational databases. Option D is wrong because NETCONF is not deprecated; both NETCONF and REST API are supported and used for different purposes.

140
Multi-Selectmedium

Which THREE advantages are associated with using the Junos REST API over NETCONF in lightweight automation scripts? (Choose three)

Select 3 answers
A.Ability to traverse standard HTTP/HTTPS proxies and load balancers easily.
B.Native JSON support without needing specialized XML parsing libraries like lxml.
C.Familiar HTTP verbs (GET, POST, PUT, DELETE) that align with standard web development principles.
D.Elimination of the Junos candidate configuration datastore.
E.Guaranteed multi-vendor transaction rollbacks across non-Juniper hardware.
AnswersA, B, C

REST uses standard HTTP verbs and URIs, so existing HTTP/HTTPS proxies, load balancers and firewalls handle it without protocol-specific configuration. NETCONF requires SSH transport on port 830, which many proxies cannot traverse. This satisfies the stem's lightweight automation constraint, where minimal infrastructure changes matter.

Why this answer

Option A is correct because the Junos REST API communicates over standard HTTP/HTTPS, so it traverses corporate proxies, firewalls, and load balancers using well-understood ports (80/443) without the SSH-based NETCONF transport complications. Option B is correct because REST responses can be returned in native JSON, letting lightweight scripts use built-in JSON parsers instead of requiring XML libraries such as lxml that NETCONF's XML payloads demand. Option C is correct because the REST API maps operations to familiar HTTP verbs (GET for retrieval, POST for creation/RPCs, PUT for replacement, DELETE for removal), aligning with common web development patterns and tooling.

Option D is not correct because the Junos REST API still operates against the Junos configuration datastores, including the candidate configuration, so it does not eliminate them. Option E is not correct because transaction rollback is a Junos commit feature tied to Junos devices, and the REST API provides no guaranteed multi-vendor rollback across non-Juniper hardware.

141
MCQmedium

You are writing a Python script to retrieve the operational state of interfaces from a Junos device using NETCONF. Which XML RPC element must be enclosed within the <rpc> tag to request operational data?

A.<pull-operational>
B.<get-rpc-reply>
C.<get-config>
D.<get>
AnswerD

The <get> RPC retrieves operational state data from the Junos device via NETCONF. Enclosed within <rpc>, it returns configuration and state information, whereas <get-config> returns only configuration. This makes <get> the correct element for requesting interface operational state.

Why this answer

The <get> rpc tag is used to retrieve both configuration and operational data, whereas <get-config> is restricted to configuration data.

142
MCQhard

You are writing a Python script using the PyEZ library to retrieve interface facts from a Juniper EX Series switch. The resulting data structure is stored in a Python dictionary. You need to dump this dictionary into a YAML file so it can be read by an Ansible playbook later. Which PyYAML function should you use to convert the Python dictionary into a YAML-formatted string or file stream?

A.yaml.load()
B.yaml.serialize()
C.yaml.safe_load()
D.yaml.dump()
AnswerD

yaml.dump() serialises a Python object into a YAML stream, writing to a file or returning a string. It handles nested dictionaries and lists, which matches the interface facts structure. yaml.safe_load() does the reverse, so dump() satisfies the stem's requirement to convert the dictionary into YAML for Ansible.

Why this answer

yaml.dump() is the standard PyYAML function used to serialize Python objects (such as dictionaries) into a YAML-formatted stream or string.

143
MCQmedium

A network automation team stores Junos device inventory in JSON. A developer notices that the JSON file contains a field "last_updated": "2024-05-01T12:00:00Z" and wants to compare it against the current time in a Python script. Which statement correctly describes how a standard JSON parser handles this value?

A.It is parsed as a Python datetime object automatically.
B.It is parsed as a Unix epoch integer representing seconds.
C.It is parsed as a Python float because of the colons.
D.It is parsed as a Python string, and the developer must convert it manually.
AnswerD

JSON has no native date or time type, so any timestamp is encoded as a string. The standard json module maps JSON strings to Python str objects. To compare with the current time, the developer must parse the string using datetime.fromisoformat or dateutil. This is a common step in Junos automation scripts that process telemetry timestamps.

Why this answer

JSON defines only a small set of data types: object, array, string, number, boolean, and null. There is no date or time type, so timestamps are always encoded as strings. A standard parser such as Python's json module returns them as str objects.

Developers must explicitly convert these strings to datetime objects before performing time-based comparisons or arithmetic in Junos automation workflows.

Exam trap

The trap here is assuming a JSON parser recognizes ISO 8601 timestamps and returns a datetime object, when in reality JSON has no date type and the value remains a string.

144
MCQeasy

What is the native data format returned by Junos devices when queried via REST API or NETCONF operations configured with JSON output formatting?

A.INI
B.YAML
C.CSV
D.JSON
AnswerD

JSON is the native encoding Junos emits when REST API or NETCONF sessions request JSON output, satisfying the stem's JSON formatting constraint. Junos converts its internal XML representation into JSON structures, so responses arrive as valid JSON objects without client-side transformation.

Why this answer

Junos devices natively return JSON when REST API or NETCONF operations are configured with JSON output formatting, because JSON is the structured data format the device emits for programmatic consumption. The 'accept: application/json' header or equivalent RPC attribute triggers this output.

Exam trap

JNCIA-DevOps often tests the assumption that YAML is the native output format because it is used for input templates, confusing input and output serialization.

How to eliminate wrong answers

Option A is wrong because INI is a simple key-value format used by some legacy tools, not a native Junos API output format. Option B is wrong because YAML is a human-friendly serialization format commonly used for input templates, but Junos does not natively return YAML from REST or NETCONF. Option C is wrong because CSV is a flat tabular format unsuitable for hierarchical Junos configuration data and is not produced by the device.

145
Multi-Selectmedium

Which THREE actions can be performed using the Junos REST API operational endpoints? (Choose three)

Select 3 answers
A.Directly modify the startup configuration file on the hard disk.
B.Fetch interface packet counters and operational states.
C.Retrieve system hardware and software inventory details.
D.Format and partition local storage solid-state drives.
E.Execute custom operational RPCs like 'get-route-information'.
AnswersB, C, E

Operational endpoints expose live device state, so retrieving interface packet counters and operational states falls squarely within their scope. This satisfies the stem's requirement for read-only operational data, unlike configuration endpoints that modify candidate configuration. The REST API returns this telemetry as structured JSON or XML.

Why this answer

Option B is correct because Junos REST API operational endpoints expose RPCs such as get-interface-information, which return live interface packet counters and operational states (up/down, errors, etc.) in JSON or XML. Option C is correct because operational endpoints include RPCs like get-system-information and get-chassis-inventory, which retrieve hardware and software inventory details from the device. Option E is correct because the REST API operational endpoint accepts arbitrary operational RPCs, including get-route-information, invoked via HTTP GET/POST to /rpc/get-route-information.

Option A is not correct because modifying the startup configuration file on disk is a configuration-management task handled through configuration endpoints or CLI, not operational RPC endpoints. Option D is not correct because formatting and partitioning local SSDs is a low-level maintenance action not exposed through Junos REST operational RPCs.

146
MCQmedium

When using Jinja2 templates in Python to generate configurations, how can you load a template file from disk prior to rendering it with variables?

A.Template(open('template.j2').read())
B.template.open('template.j2')
C.import_template('template.j2')
D.jinja2.load_file('template.j2')
AnswerA

Passing the file contents to `Template()` constructs the template object directly from the string read off disk, satisfying the requirement to load before rendering. Jinja2's `Template` class accepts a source string, so `open('template.j2').read()` supplies it; rendering with variables then follows via `.render()`. For repeated use, `Environment` with a `FileSystemLoader` is preferred.

Why this answer

The Jinja2 `Template` class accepts a template source string, so reading the file contents with `open('template.j2').read()` and passing that string to `Template()` is a valid way to load a template from disk. This is the standard minimal pattern when you don't need Jinja2's file-system loader features. The other options reference methods or modules that do not exist in the Jinja2 API.

Exam trap

The trap here is that candidates assume Jinja2 has a dedicated file-loading helper like `load_file()` or a method on the template object, when in fact the simplest correct pattern is just reading the file and passing the string to `Template()`.

How to eliminate wrong answers

Option B is wrong because `template.open()` is not a Jinja2 method — the `Template` object has no `open` attribute; file loading is done via `Environment`/`FileSystemLoader`, not a method on the template instance. Option C is wrong because `import_template()` is not a Jinja2 function; templates are loaded via `Template()`, `Environment.from_string()`, or `Environment.get_template()`. Option D is wrong because `jinja2.load_file()` does not exist — the correct file-based API is `jinja2.Environment(loader=jinja2.FileSystemLoader('path'))` followed by `env.get_template('template.j2')`.

147
Multi-Selecthard

An automation engineer is comparing YAML and JSON for storing Junos device configuration data. Which TWO statements accurately describe differences between the two formats? (Choose two.)

Select 2 answers
A.JSON is a superset of YAML, meaning all YAML documents are valid JSON.
B.JSON supports anchors and aliases for reusing content, while YAML does not.
C.YAML uses indentation to represent structure, while JSON uses braces and brackets.
D.YAML requires all keys to be enclosed in double quotes, while JSON does not.
E.YAML supports comments, while standard JSON does not.
AnswersC, E

YAML relies on indentation to define hierarchy, making it more readable for humans. JSON uses curly braces for objects and square brackets for arrays to denote structure explicitly. This is a fundamental syntactic difference between the two formats and is accurate in the context of choosing a format for Junos configuration data.

Why this answer

YAML and JSON differ in syntax and features. YAML uses indentation for structure and supports comments, while JSON uses braces and brackets and does not allow comments. These differences make YAML more human-friendly for configuration files, whereas JSON is more compact and widely supported by APIs.

The other statements misstate the capabilities or the superset relationship between the formats.

Exam trap

The trap here is mixing up which format supports comments and which is a superset, leading to incorrect assumptions about compatibility between YAML and JSON in automation pipelines.

148
MCQhard

When modifying a Junos device configuration using the PyEZ Config table-driven or Context manager (with Config(dev) as cu:), what is the default behavior regarding locking the candidate configuration?

A.It locks the global database and forces all other users into maintenance mode.
B.It requires an explicit cu.lock() call before any load operation can take place.
C.It automatically locks the candidate configuration upon entry and unlocks it upon exit.
D.It locks the running configuration and restarts the mgd daemon.
AnswerC

Using the context manager form `with Config(dev) as cu:` acquires an exclusive lock on the candidate configuration automatically, then releases it on exit. This satisfies the stem's requirement for default locking behaviour, preventing concurrent commits during the edit session without any explicit `cu.lock()` call.

Why this answer

When entering the Config context manager in PyEZ, it automatically locks the candidate configuration database to prevent concurrent edits and unlocks it upon exiting the context.

149
Multi-Selectmedium

Which THREE principles are foundational to the DevOps movement when applied to network engineering? (Choose three)

Select 3 answers
A.Continuous monitoring and feedback loops for network telemetry
B.Strict siloing of operational teams from software developers
C.Relying solely on annual manual network audits
D.Culture of shared responsibility and rapid learning from failures
E.Automation of repetitive provisioning and configuration tasks
AnswersA, D, E

Continuous monitoring and feedback loops supply the telemetry that drives iterative improvement, letting network teams detect drift and respond quickly. This principle underpins DevOps by closing the loop between deployment, observation and correction across infrastructure.

Why this answer

Option A is correct because DevOps network engineering depends on continuous monitoring and feedback loops—streaming telemetry via SNMP, gNMI, syslog, or NetFlow into observability platforms—so that changes are validated and issues detected immediately rather than discovered later. Option D is correct because the DevOps culture emphasizes shared responsibility between network, development, and operations teams, plus blameless post-mortems and rapid learning from failures, which is essential for safely iterating on network changes. Option E is correct because automating repetitive provisioning and configuration tasks—using tools such as Ansible, Terraform, or Python scripts against APIs—is a core DevOps practice that removes manual drift and enables consistent, repeatable network deployments.

Option B does not belong because strict siloing directly contradicts DevOps's cross-functional collaboration and shared ownership model. Option C does not belong because relying solely on annual manual audits is a slow, reactive practice that DevOps replaces with continuous automated validation and monitoring.

150
MCQmedium

You are utilizing PyEZ Table and View abstractions to parse interface statistics. Which base class must your custom Table class inherit from to map to Junos XML output?

A.jnpr.junos.rpchandler.RPC
B.jnpr.junos.device.Device
C.jnpr.junos.factory.Table
D.jnpr.junos.utils.config.Config
AnswerC

Custom Table classes must inherit from jnpr.junos.factory.Table, which provides the parsing machinery that maps Junos XML output into structured rows via the associated View. Inheriting from this base class satisfies the requirement to map to Junos XML output.

Why this answer

To leverage PyEZ Table/View mapping for operational commands, your custom table class must inherit from 'jnpr.junos.factory.Table'.

Page 1

Page 2 of 4

Page 3

All pages