Courseiva

Juniper Networks Automation and DevOps, Associate (JNCIA-DevOps, JN0-224) (JNCIA-DevOps) (JNCIA-DevOps) — Questions 76150

307 questions total · 5pages · All types, answers revealed

Page 1

Page 2 of 5

Page 3
76
MCQeasy

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

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

Correct. NETCONF is the foundational protocol for Junos structured management.

Why this answer

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

77
MCQeasy

When managing configuration changes via PyEZ Config utility, which context manager ensures that changes are automatically rolled back if an exception occurs within the block?

A.with Config(dev, mode='private') as cu:
B.try: cu.lock() except: cu.rollback()
C.with Config(dev) as cu:
D.cu.commit(rollback_on_error=True)
AnswerC

Correct. Using the Config utility as a Python context manager guarantees rollback if an unhandled exception disrupts the block.

Why this answer

The 'with Config(dev) as cu:' context manager automatically handles locking, loading, committing, and rolling back on failure.

78
MCQmedium

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

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

Three hyphens denote the document start marker in multi-document YAML files.

Why this answer

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

79
MCQhard

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

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

Setting default-operation to replace completely overwrites the existing datastore content.

Why this answer

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

80
Multi-Selectmedium

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

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

Correct. Feature branches isolate work in progress.

Why this answer

Best practices include code reviews via pull requests, using feature branches, and keeping secrets out of code.

81
MCQeasy

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

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

DVCS tools like Git manage source code and configuration history across distributed repositories.

Why this answer

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

82
MCQhard

An engineer needs to modify a configuration parameter using the Junos REST API via an HTTP PUT request. They include the Content-Type header as 'application/json'. However, the device rejects the payload. What is the correct Content-Type or Accept header requirement for configuration manipulation payload representation in Junos REST API?

A.application/vnd.juniper.netconf.config+json
B.application/x-www-form-urlencoded
C.text/xml only
D.multipart/form-data
AnswerA

This specific media type is required for handling Junos configuration data structures in JSON format via the REST API.

Why this answer

Junos REST API supports both JSON and XML representations. When sending configuration payloads, the Content-Type must match the format being transmitted, such as application/vnd.juniper.netconf.config+json or application/json depending on the API version, but application/vnd.juniper.netconf.config+json is specifically designed for structural configuration mapping.

83
MCQmedium

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

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

Correct. json.dumps() serializes a Python object to a JSON formatted string using an indentation of 4 spaces.

Why this answer

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

84
MCQeasy

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

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

Junos REST API relies on HTTP Basic Auth against local user credentials or AAA.

Why this answer

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

85
MCQmedium

An automation engineer is writing an application that sends an <edit-config> RPC to a Junos device to load a replacement configuration. The requirement is to completely replace the candidate configuration with the provided configuration content. Which element and attribute combination should be used inside the <edit-config> request?

A.<default-operation>replace</default-operation>
B.<load-options>replace</load-options>
C.<method>replace-all</method>
D.<action>overwrite</action>
AnswerA

Setting the <default-operation> to replace tells the device to replace the target configuration datastore with the configuration provided in the RPC.

Why this answer

To replace the entire configuration or a specific hierarchy level, the <default-operation> element can be set to 'replace', or the element itself can carry the operation='replace' attribute.

86
MCQhard

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

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

Correct. Jinja2 throws an error on undefined variables unless explicitly handled.

Why this answer

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

87
MCQeasy

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

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

NETCONF uses SSH connections and XML RPCs, while REST API uses HTTP/HTTPS resource URIs.

Why this answer

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

88
Multi-Selectmedium

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

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

The snapshot action saves operational data for later comparison.

Why this answer

JSNAPy CLI commands include taking snapshots (jsnapy --snap) and comparing snapshots against defined checks (jsnapy --check). Options A and C are correct.

89
MCQmedium

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

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

Correct. python3 -m json.tool validates and pretty-prints JSON files.

Why this answer

Python provides a command-line JSON tool via the json.tool module, invoked as 'python3 -m json.tool filename.json'.

90
MCQmedium

You want to validate a candidate configuration on a Junos device without committing it using NETCONF. Which RPC accomplishes this?

A.<test-config>
B.<check-config>
C.<validate><source><candidate/></source></validate>
D.<edit-config test-only="true"/>
AnswerC

The <validate> RPC validates the specified configuration datastore (e.g., candidate).

Why this answer

The <validate> RPC checks the consistency and validity of a specified configuration datastore.

91
MCQhard

When configuring the Junos REST API, an administrator restricts access to a specific port and enables SSL. Which configuration statement sets the secure HTTPS port to 8443?

A.set protocols rest-api https port 8443
B.set system services jpagent https port 8443
C.set system services rest port 8443 secure
D.set system services netconf https-port 8443
AnswerB

This command sets the custom HTTPS listening port for the jpagent service.

Why this answer

To customize the HTTPS port for the jpagent service in Junos, the administrator uses the 'set system services jpagent https port 8443' command.

92
MCQmedium

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

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

Correct. This command reads the file using PyYAML's safe_load, exiting with an error if syntax is invalid.

Why this answer

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

93
MCQmedium

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

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

The <commit/> RPC activates the candidate configuration on a Junos device.

Why this answer

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

94
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

Correct. The copy module provides deepcopy() for duplicating complex nested data structures.

Why this answer

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

95
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

Correct. Config manages locking, loading, committing, and rollbacks.

Why this answer

PyEZ uses Device for connections, Config for configuration management, and Fact for system information.

96
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

Correct. Unit tests validate specific components in isolation.

Why this answer

Unit testing validates individual components (like a specific macro, template, or script function) to ensure they produce the expected output.

97
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

Correct. YAML parsers throw a scanner error when tab characters are used for block indentation.

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.

98
Multi-Selectmedium

Which TWO operations are valid targets for the NETCONF <get-config> RPC on a Junos device? (Choose two)

Select 2 answers
A.<factory-default/>
B.<candidate/>
C.<startup/>
D.<active-alarm/>
E.<running/>
AnswersB, E

Querying the candidate configuration datastore is fully supported.

Why this answer

<get-config> allows querying configuration datastores such as candidate and running.

99
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

Correct. DevOps fosters cross-functional collaboration and automation.

Why this answer

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

100
Multi-Selecteasy

Which TWO configuration steps are required to enable the Junos REST API with basic security settings? (Choose two)

Select 2 answers
A.set system netconf secure-mode
B.set system services jpagent https
C.set protocols rest-api state active
D.set system services jpagent
E.set system services rest enable
AnswersB, D

Enabling https ensures secure transport for the REST API.

Why this answer

To enable the REST API, you must enable the jpagent service and optionally enable HTTPS for secure transport.

101
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

Correct. The Device class is imported directly from jnpr.junos.device to create the connection handle.

Why this answer

The Device class from the jnpr.junos module is the foundational class used in PyEZ to manage connections and sessions with Junos devices.

102
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

<discard-changes> resets the candidate datastore to match the running configuration.

Why this answer

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

103
MCQhard

When executing a PyEZ RPC call that returns a large dataset (e.g., massive routing table), how can you handle the output efficiently without exhausting local memory?

A.etree.iterparse() directly on the raw socket stream
B.Using parser generators or iterator arguments supported by specific RPC wrappers
C.dev.rpc.get_route_information(normalize=True)
D.dev.stream_rpc()
AnswerB

Correct. PyEZ allows using iterators or chunked parsing options for large operational datasets.

Why this answer

Using generators or streaming options in RPC handling prevents loading massive XML trees entirely into memory.

104
MCQmedium

An automation script connects to a Junos device using NETCONF over SSH and retrieves the running configuration. The engineer notices that the retrieved XML elements contain attributes like 'operation="inherit"'. What do these attributes represent in the context of Junos XML API?

A.They indicate the automation user permission level required to modify that specific node.
B.They represent transient states of the NETCONF parser buffer indicating stream synchronization status.
C.They represent mapping hints for how Junos hierarchical statements map to hierarchical template inheritances during operational state generation.
D.They describe the configuration hierarchy manipulation state, indicating whether a statement is inherited from apply-groups or explicitly defined.
AnswerD

Junos configuration output uses operations and attributes to display inheritance status, such as values derived from apply-groups.

Why this answer

Junos XML output uses attributes such as 'operation' to indicate how configuration statements relate to inheritance, deletion, or modification within hierarchical structures.

105
MCQeasy

Which Python library does PyEZ depend on under the hood for managing secure SSH connections and NETCONF framing?

A.ncclient
B.paramiko
C.fabric
D.netmiko
AnswerA

Correct. PyEZ is built on top of the ncclient library for NETCONF operations.

Why this answer

PyEZ relies on ncclient for NETCONF over SSH transport.

106
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

Hierarchical container structures map directly to nested JSON objects.

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.

107
MCQeasy

Which statement accurately describes how the Junos REST API handles configuration locking compared to NETCONF workflows?

A.NETCONF does not support configuration locking at all.
B.NETCONF requires explicit lock commands, whereas the Junos REST API handles configuration locking implicitly during API-driven edit sessions.
C.The Junos REST API uses exclusive database locking for every GET request.
D.The Junos REST API requires manual SSH tunnel establishment before locks can be applied.
AnswerB

NETCONF has explicit <lock> and <unlock> RPCs, while REST API simplifies or automates session-based commit locks.

Why this answer

While NETCONF explicitly supports lock and unlock protocol operations, the Junos REST API manages configuration locks implicitly or through explicit session management parameters during commit operations.

108
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

403 Forbidden means authorization failed due to insufficient privileges.

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.

109
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

Correct. Validating candidate configurations without committing them is part of CI testing.

Why this answer

Checking syntax and logic prior to production deployment is a core part of the Continuous Integration (CI) validation and testing stage.

110
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 specifies TCP port 830 as the standard port for NETCONF over SSH.

Why this answer

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

111
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

Correct. Integers are valid scalar values.

Why this answer

Scalars in YAML represent single values like strings and integers.

112
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

Structured formats make data extraction reliable and programmatic.

Why this answer

REST API provides structured data output (like JSON/XML) and eliminates the need to parse human-readable text CLI screens.

113
Multi-Selecthard

When configuring advanced options for the Junos REST API jpagent, which THREE parameters or sub-statements can be configured under the 'set system services jpagent' hierarchy? (Choose three)

Select 3 answers
A.bgp-peer-group
B.traceoptions
C.https
D.ethernet-switching
E.port
AnswersB, C, E

Traceoptions can be configured under jpagent for debugging API requests.

Why this answer

Under 'set system services jpagent', administrators can configure HTTPS, custom HTTP/HTTPS ports, and connection timeouts or limits depending on Junos software version support.

114
MCQeasy

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

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

Correct. JSON booleans are strictly lowercase 'true'.

Why this answer

JSON booleans are lowercase words: true and false.

115
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

Correct. git commit records the staged snapshot with a message.

Why this answer

'git commit' records changes to the local repository.

116
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

Correct. The check command compares snapshots.

Why this answer

The check action compares current operational state against a snapshot baseline.

117
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 is used to replace or update specific configuration elements in the Junos REST API.

Why this answer

To modify or replace configuration data, the PUT method is typically used in the Junos REST API configuration endpoints with JSON or XML payload.

118
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 sequences of values enclosed in square brackets.

Why this answer

In JSON, arrays are ordered lists of values enclosed in square brackets ([...]).

119
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

Correct. Jinja2 is widely used with Python to generate dynamic configuration files.

Why this answer

Jinja2 is the standard Python templating engine used for rendering configuration templates.

120
MCQhard

An automation script reads a multi-document YAML file containing configuration templates for various Junos router models. To process each document individually in Python using PyYAML, which function should the engineer invoke?

A.yaml.read_multi()
B.yaml.load_all()
C.yaml.safe_load_all()
D.yaml.parse_documents()
AnswerC

Correct. yaml.safe_load_all() safely parses a multi-document YAML stream into an iterator of Python objects.

Why this answer

yaml.safe_load_all() is designed to parse a stream containing multiple YAML documents separated by '---', returning a generator that yields each parsed document sequentially.

121
Multi-Selectmedium

Which TWO conditions will cause a NETCONF <edit-config> transaction to fail on a Junos device? (Choose two)

Select 2 answers
A.Executing a successful <commit> immediately after editing.
B.Using a valid namespace prefix declared in the NETCONF hello message.
C.Syntax errors in the XML payload structure.
D.Locking the candidate datastore prior to making edits.
E.Configuration validation failure against Junos semantic rules.
AnswersC, E

Malformed XML triggers an XML parsing error and rpc-error response.

Why this answer

Transactions fail due to syntactic errors, missing required fields, or validation failures.

122
MCQeasy

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

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

Correct. .yaml (or .yml) is the standard extension for YAML files.

Why this answer

YAML files typically use .yaml or .yml extensions.

123
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

Correct. The path parameter specifies the file location and format specifies its syntax.

Why this answer

The load method with path and format parameters is used to load configuration text from a file.

124
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

Correct. yaml.safe_load() resolves anchors and aliases automatically during parsing.

Why this answer

yaml.safe_load() fully supports YAML anchors (&) and aliases (*) by default, dereferencing them into identical Python data structures in memory.

125
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

Correct. The hash sign (#) designates a comment in YAML.

Why this answer

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

126
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

REST API uses predictable URIs for resources rather than CLI prompt navigation.

Why this answer

REST API provides structured data formats (JSON/XML), deterministic API contracts with HTTP status codes, and programmatic resource addressing, whereas screen-scraping relies on fragile text parsing.

127
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

Correct. json.dump() serializes a Python object directly to a file-like stream.

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.

128
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

Junos REST API fully supports both JavaScript Object Notation (JSON) and eXtensible Markup Language (XML).

Why this answer

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

129
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

Correct. The hyphen (-) prefix defines a list/sequence in YAML.

Why this answer

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

130
MCQhard

An administrator needs to execute a NETCONF RPC that triggers a Junos operational command equivalent to 'clear interfaces statistics ge-0/0/0'. How should this request be formatted using the Junos XML API?

A.<rpc><command>clear interfaces statistics ge-0/0/0</command></rpc>
B.<rpc><edit-config><target><running/></target><clear>ge-0/0/0</clear></edit-config></rpc>
C.<rpc><clear-interfaces-statistics><interface-name>ge-0/0/0</interface-name></clear-interfaces-statistics></rpc>
D.<rpc><load-configuration action="clear"><interface>ge-0/0/0</interface></load-configuration></rpc>
AnswerC

Junos operational commands map directly to XML tags where CLI space-separated words become hyphenated XML tag names.

Why this answer

Operational commands (RPCs) are sent as raw XML elements corresponding to CLI commands under the <command> wrapper or directly as named RPC tags (e.g., <command>clear interfaces statistics interface-name ge-0/0/0</command> or its native equivalent).

131
Multi-Selectmedium

Which TWO methods are valid for loading configuration data into the PyEZ Config utility from different sources? (Choose two)

Select 2 answers
A.cu.load(text='set system hostname router1', format='set')
B.cu.load(template_file='config.j2', engine='jinja2')
C.cu.load(database='active')
D.cu.load(action='commit')
E.cu.load(path='/path/to/config.xml', format='xml')
AnswersA, E

Correct. Loading raw text strings with specified format is supported.

Why this answer

Config.load supports string data, file paths, and template rendering results.

132
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

The device releases locks when the owning session disconnects.

Why this answer

Locks prevent concurrent configuration edits and can be released via explicit unlock or session termination.

133
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

Correct. Raised when an RPC execution returns an error from the device.

Why this answer

PyEZ defines specific exceptions in jnpr.junos.exception for connection, configuration, and RPC errors.

134
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.

135
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 the standard syntax for outputting variable values in Jinja2.

Why this answer

Jinja2 natively supports variable interpolation using double curly braces, control structures like for-loops using {% for %}, and template inheritance via {% extends %}. Options A, C, and D are correct.

136
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

Correct. json.loads() parses a JSON string into Python data structures.

Why this answer

json.loads() (load string) is used to parse a JSON string into a Python object.

137
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

<get-alarm-information> is the standard Junos XML API RPC for querying system alarms.

Why this answer

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

138
MCQhard

An engineer is designing an automated failover script that needs to discard candidate configuration changes made via the Junos REST API. How should this discard action be performed?

A.Send an HTTP GET request with ?action=reset.
B.Issue an HTTP DELETE request to the root /api/configuration path.
C.Restart the routing engine process (RE switchover).
D.Send a request to the configuration discard/rollback endpoint or invoke the discard-changes RPC via the REST API.
AnswerD

Discarding changes via REST maps to the discard-changes RPC or configuration discard action.

Why this answer

Discarding candidate changes in the Junos REST API is performed by invoking the discard configuration RPC or action endpoint equivalent to the NETCONF <discard-changes/> RPC.

139
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

Git tags provide immutable reference points for specific production-deployed configuration states.

Why this answer

Standard Git workflows involve storing configurations as plain text templates, using pull/merge requests for peer review before merging, and tagging repository commits corresponding to official maintenance windows or production releases.

140
MCQhard

During troubleshooting of a Python script using the ncclient library to interact with a Junos device, an automation engineer observes a 'rpc-error' response containing an error-tag of 'operation-failed'. Upon examining the Junos system logs, it is discovered that the candidate configuration had syntax errors introduced by an uncommitted previous session. Which NETCONF capability negotiation mechanism ensures that the client is aware of the exact XML schema constraints before sending the RPC?

A.The <get-schema> RPC operation defined in RFC 6020.
B.The automatic download of Junos PyEZ schema definitions during the SSH handshake phase.
C.NETCONF capability URIs exchanged during the initial hello message exchange.
D.The automated execution of a pre-flight XML validation check via the <validate> RPC.
AnswerC

Clients and servers advertise supported models and schema namespaces via capability URIs in the initial hello messages.

Why this answer

NETCONF hello messages exchange capabilities, which include URLs pointing to XML namespaces and data models such as YANG modules or Junos specific DTDs/XSDs.

141
Multi-Selecthard

When configuring JSNAPy, which THREE components or sections are typically required within a YAML check/snapshot file? (Choose three)

Select 3 answers
A.command: or rpc: specifying the operational commands to run
B.dev: or device: specifying target device connection details
C.jinja_template: defining external configuration templates
D.candidate_database: defining NETCONF lock parameters
E.action: defining test parameters or actions like snap or check
AnswersA, B, E

Correct. Commands or RPCs define what data to snapshot.

Why this answer

JSNAPy configuration files require device definitions, action parameters, and command/rpc test definitions.

142
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

Correct. yaml.safe_dump() serializes a Python object into a safe YAML representation.

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().

143
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

Correct. YAML supports anchors (&) and aliases (*) for DRY data structures.

Why this answer

YAML supports comments and anchors/aliases, whereas standard JSON supports neither.

144
MCQeasy

Which Junos configuration command enables the REST API daemon to start automatically upon device boot?

A.set chassis auto-restart jpagent
B.set management daemon jpagent start
C.set system services jpagent
D.set system boot-services rest
AnswerC

Configuring jpagent under system services ensures it initializes on boot.

Why this answer

Enabling any system service like jpagent under 'set system services jpagent' ensures it starts automatically upon device boot and initialization.

145
MCQmedium

You need to retrieve operational data from a Junos device using a PyEZ RPC call that equates to the CLI command 'show system information'. Which Python statement correctly invokes this RPC?

A.dev.execute("show system information")
B.dev.get_config(cli="show system information")
C.dev.rpc.show_system_information()
D.dev.rpc.get_system_information()
AnswerD

This translates the XML RPC tag <get-system-information> into a Python method.

Why this answer

In PyEZ, CLI commands can be translated to RPC methods by converting dashes to underscores. 'show system information' becomes dev.rpc.get_system_information().

146
MCQmedium

You need to commit a candidate configuration change on a Junos device via NETCONF with a confirmed commit timeout of 5 minutes. Which XML payload structure is correct?

A.<rpc><commit-confirm timeout="5"/></rpc>
B.<rpc><commit><confirmed/><confirm-timeout>5</confirm-timeout></commit></rpc>
C.<rpc><edit-config><timeout>300</timeout></edit-config></rpc>
D.<rpc><commit><timeout>5</timeout></commit></rpc>
AnswerB

This structure properly requests a confirmed commit with a 5-minute timeout.

Why this answer

The <commit> RPC accepts a <confirmed/> tag and a <confirm-timeout> element to specify rollback timing.

147
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

Correct. Sets are not JSON serializable by default.

Why this answer

Standard json.dumps() cannot serialize sets, complex numbers, or custom class instances without custom encoder logic.

148
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

Correct. JSON specification requires all object keys to be strings.

Why this answer

Data type coercion differences (like booleans/octals), lack of comment preservation in JSON, and duplicate key behaviors are common conversion hurdles.

149
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

Operational data in JSON format mirrors the hierarchical structure of XML RPC responses.

Why this answer

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

150
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

The Accept header tells the server the desired media type for the response.

Why this answer

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

Page 1

Page 2 of 5

Page 3

All pages