Courseiva

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

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

Page 1 of 5

Page 2
1
MCQmedium

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

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

Correct. Double curly braces output the evaluated value of a variable.

Why this answer

Jinja2 uses double curly braces to print or evaluate variables.

2
MCQeasy

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

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

Correct. SW is the PyEZ software utility module.

Why this answer

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

3
MCQmedium

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

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

Correct. Linters validate static code and markup syntax prior to runtime execution.

Why this answer

Linters catch syntax errors, formatting inconsistencies, and indentation mistakes before files are processed by automation tools or sent to devices.

4
MCQmedium

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

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

Correct. Parsing YAML into native Python objects allows them to be re-serialized into JSON.

Why this answer

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

5
MCQmedium

You want to retrieve only the system hostname from the Junos running configuration using NETCONF. Which filtering technique is most efficient?

A.Subtree filtering using XML element tags matching the configuration hierarchy
B.XPath expression filtering via the select attribute
C.Regular expression pattern matching within the <filter> attribute
D.Retrieving the entire configuration and parsing it locally with a Python script
AnswerA

Subtree filtering uses specific XML elements to mirror the configuration tree and filter the output.

Why this answer

Tag-based filtering allows requesting specific configuration hierarchies by including empty container tags in the <get-config> request.

6
MCQhard

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

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

415 Unsupported Media Type is explicitly caused by missing or invalid Content-Type headers.

Why this answer

A 415 Unsupported Media Type error indicates that the Content-Type header sent in the HTTP request does not match what the Junos REST API daemon expects for processing configuration payloads (such as application/vnd.juniper.netconf.config+json or application/json).

7
MCQhard

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

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

Correct. json.loads() decodes escaped forward slashes into standard slashes.

Why this answer

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

8
Multi-Selecthard

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

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

Response codes (401, 403) provide immediate clues regarding auth failures.

Why this answer

Administrators can check jpagent traceoptions logs, messages log (/var/log/messages), and HTTP response headers/status codes for debugging.

9
Multi-Selectmedium

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

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

Correct. Views specify field mappings.

Why this answer

Tables map to RPCs and Views map to item fields using YAML.

10
MCQhard

You are building a custom PyEZ application and need to catch exceptions specific to configuration parsing failures returned by Junos. Which exception class should your script import?

A.from jnpr.junos.exception import ConfigError
B.from jnpr.junos.device import ConfigurationFailed
C.from jnpr.junos.utils.config import ConfigError
D.from jnpr.junos.exception import ParseError
AnswerA

Correct. ConfigError handles configuration-related exceptions in PyEZ.

Why this answer

ConfigError is raised by PyEZ when configuration loading or committing fails.

11
Multi-Selecthard

When executing a NETCONF transaction on a Junos device, an automation script encounters an error or needs to discard changes made in the candidate datastore. Which THREE RPC elements or concepts apply to discarding or rolling back changes in Junos NETCONF workflows? (Choose three.)

Select 3 answers
A.The <rollback-config> operation is a standalone top-level NETCONF protocol operation defined in RFC 6241.
B.The <abort> RPC can be used mid-transaction to cancel an active streaming configuration edit.
C.Unlocking the configuration datastore using <unlock> ensures other administrators are not permanently locked out if a script terminates unexpectedly.
D.The <discard-changes> RPC is used to revert the candidate configuration to match the current running configuration.
E.A commit operation can include a rollback parameter (e.g., <rollback>1</rollback>) to revert to a previous configuration checkpoint.
AnswersC, D, E

Using <unlock> releases the datastore lock, which is a best practice in robust script error-handling blocks.

Why this answer

Junos NETCONF supports discarding candidate changes via <discard-changes>, rolling back committed configurations via rollback IDs in commit operations, and unlocking datastores upon error cleanup.

12
MCQmedium

You want to retrieve the software version and hardware inventory of a Junos device in a single NETCONF request. Which RPC tag combines both hardware and software details?

A.<get-inventory-all>
B.<retrieve-device-state>
C.Executing multiple RPCs or using container elements such as <get-system-information> and <get-chassis-inventory>.
D.<get-hardware-and-software>
AnswerC

Junos provides separate RPCs like <get-system-information> and <get-chassis-inventory> which can be batched or called sequentially.

Why this answer

The <get-software-information> and <get-chassis-inventory> RPCs can be combined, or <get-system-information> can be used; however, Junos provides specific RPCs like <get-software-information>.

13
Multi-Selectmedium

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

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

Correct. Junos supports AAA for NETCONF/SSH sessions.

Why this answer

NETCONF on Junos runs over SSH, supporting SSH keys, username/password, and AAA integration.

14
Multi-Selecthard

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

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

Correct. dev.timeout manages command timeouts.

Why this answer

PyEZ Device instances provide methods to check connection status, manage timeout values, and inspect capabilities.

15
MCQeasy

An administrator wishes to secure their Junos REST API connections by configuring HTTPS instead of plain HTTP. Which command under 'system services jpagent' accomplishes this?

A.set system services jpagent https
B.set system services netconf ssl
C.set security ipsec-vpn
D.set system services rest secure
AnswerA

This command enables secure HTTP (HTTPS) access for the jpagent.

Why this answer

To enable HTTPS for the Junos REST API agent, the administrator must configure the 'https' option under 'set system services jpagent'.

16
MCQmedium

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

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

Correct. Idempotent operations can be run repeatedly with safe, predictable outcomes.

Why this answer

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

17
MCQeasy

Which symbol represents the beginning of a single YAML document stream?

A.Three hashes (###)
B.Three slashes (///)
C.Three dashes (---)
D.Three dots (...)
AnswerC

Correct. Three dashes indicate the start of a YAML document.

Why this answer

YAML documents can optionally begin with a document start marker consisting of three dashes (---).

18
MCQhard

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

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

Correct. PyEZ uses the standard logging module; setting 'jnpr.junos' to DEBUG logs all XML traffic.

Why this answer

Python's standard logging module configured for the jnpr.junos logger enables debug output.

19
MCQmedium

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

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

RPCs are invoked via the operational RPC URI endpoint in Junos REST API.

Why this answer

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

20
MCQeasy

What is JSNAPy primarily used for in Junos network automation?

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

Correct. JSNAPy automates capturing and comparing operational states.

Why this answer

JSNAPy (Junos Snapshot Administrator) is used to capture operational state snapshots of Junos devices and compare them to detect changes or anomalies.

21
Multi-Selectmedium

Which TWO Python exceptions might be raised when attempting to parse a malformed JSON string using the standard 'json' module? (Choose two)

Select 2 answers
A.AttributeError
B.JSONDecodeError
C.KeyError
D.ScannerError
E.TypeError
AnswersB, E

Correct. JSONDecodeError is raised for invalid JSON structure.

Why this answer

json.loads() raises JSONDecodeError (which inherits from ValueError) when encountering invalid JSON syntax.

22
Multi-Selecteasy

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

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

Correct. Telemetry provides fine-grained, real-time data.

Why this answer

Streaming telemetry provides real-time push-based data with high granularity, avoiding the polling overhead of SNMP.

23
MCQmedium

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

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

Correct. sort_keys=True ensures that dictionary keys are output in alphabetical order.

Why this answer

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

24
MCQhard

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

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

GitLab CI uses .gitlab-ci.yml and controls branch triggers using keywords such as rules or only.

Why this answer

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

25
MCQeasy

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

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

Correct. The include statement embeds another template.

Why this answer

The {% include %} tag allows inserting another template's content.

26
MCQmedium

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

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

The <lock> operation allows the client to lock the configuration system datastore.

Why this answer

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

27
MCQhard

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

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

Correct. The 'default' parameter accepts a function that is called for objects that can't otherwise be serialized.

Why this answer

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

28
Multi-Selecthard

You are writing a Python script to convert a complex Juniper device inventory from YAML format into JSON format using PyYAML and the built-in json module. Which THREE considerations must you keep in mind regarding differences between YAML and JSON during this conversion? (Choose three)

Select 3 answers
A.YAML allows unquoted strings for most values, whereas JSON strictly requires double quotes for all string literals.
B.Comments present in the YAML file will be automatically discarded during conversion to JSON because JSON does not support comments.
C.YAML anchors and aliases will be automatically preserved as native references in the resulting JSON output.
D.YAML scalar keys that are integers or booleans will be converted to string keys in JSON, as JSON object keys must be strings.
E.JSON supports multi-document streams natively in a single file just like YAML.
AnswersA, B, D

YAML allows plain unquoted strings in many contexts, but JSON requires explicit double-quote wrapping.

Why this answer

JSON does not support comments, requires double quotes for strings/keys, and only permits string keys in objects, whereas YAML allows comments, optional quotes, and non-string keys.

29
MCQmedium

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

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

Installing or trusting the appropriate certificate solves SSL verification errors securely.

Why this answer

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

30
MCQeasy

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

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

Correct. 'undefined' is a JavaScript concept and is not supported in JSON (which uses 'null').

Why this answer

JSON does not support undefined, functions, or undefined date types natively. Among standard choices, undefined or complex numbers are absent.

31
Multi-Selecthard

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

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

Correct. IDE artifacts and temp outputs should be ignored.

Why this answer

.gitignore should exclude temporary build files, secret key files, and IDE-specific settings.

32
MCQhard

An automation engineer is using Git and needs to undo the last local commit while keeping the modified changes in their working directory as unstaged changes. Which command should they execute?

A.git reset --hard HEAD~1
B.git checkout -f master
C.git reset HEAD~1 (or git reset --mixed HEAD~1)
D.git revert --purge
AnswerC

Correct. git reset HEAD~1 keeps the working tree changes intact while undoing the commit.

Why this answer

'git reset --soft HEAD~1' or 'git reset HEAD~1' resets the commit while keeping working tree files modified/staged depending on flags. 'git reset HEAD~1' defaults to mixed (keeps changes unstaged).

33
MCQmedium

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

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

JSNAPy test files and check definitions are written in YAML format.

Why this answer

JSNAPy uses YAML configuration files to define which RPC commands to run and what expected values or expressions should be evaluated against the resulting snapshots.

34
MCQeasy

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

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

Correct. Macros allow creating reusable template functions.

Why this answer

Macros in Jinja2 act like functions for templates.

35
MCQmedium

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

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

<load-configuration> is the Junos proprietary extension RPC for loading granular configurations.

Why this answer

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

36
MCQhard

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

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

REST API supports validate/check actions analogous to NETCONF validation.

Why this answer

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

37
MCQmedium

A DevOps engineer is implementing a CI/CD pipeline for automated testing of Junos configurations. During the build stage, the pipeline executes a syntax check on candidate configurations before staging them for deployment. Which tool natively provides configuration syntax validation against the Junos schema without applying the configuration to the routing engine?

A.Ansible junipernetworks.junos.junos_config module with 'check_mode: true'
B.SaltStack junos.commit execution module
C.Junos PyEZ configuration mode via the 'cu.validate()' method
D.git-lfs configuration validator
AnswerC

The PyEZ cu.validate() method checks the candidate configuration against the device syntax and semantic rules.

Why this answer

The Junos PyEZ library provides a configuration management module that allows validation of candidate configurations locally or on the device using validate() without committing changes.

38
MCQhard

An automation script executes a NETCONF <edit-config> transaction that updates multiple routing protocols. You need to ensure that the changes take effect immediately without requiring a manual commit. Does NETCONF require a separate commit for candidate changes?

A.Yes, but the commit must be initiated via CLI because NETCONF cannot commit.
B.Yes, changes applied to the candidate datastore require an explicit <commit> RPC to become active in running configuration.
C.No, NETCONF automatically commits all <edit-config> changes instantly.
D.Only if the target datastore is explicitly set to running.
AnswerB

Candidate datastore edits require a separate commit operation unless target is running.

Why this answer

When using the candidate datastore in NETCONF, changes must be explicitly committed using the <commit> RPC unless direct datastore is used.

39
MCQmedium

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

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

Correct. yaml.safe_load() restricts the loader to standard data types, mitigating security risks.

Why this answer

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

40
Multi-Selectmedium

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

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

jpagent translates web API payloads into Junos internal data formats.

Why this answer

The jpagent daemon provides HTTP/HTTPS server capabilities, authentication handling against local/AAA databases, and translation between HTTP requests/JSON/XML and Junos internal RPC/configuration structures.

41
Multi-Selecteasy

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

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

Correct. Block sequences use hyphens.

Why this answer

YAML sequences can be represented using block style with hyphens (-) or flow style with square brackets ([]).

42
MCQmedium

When sending an HTTP POST request to create a new configuration resource via the Junos REST API, what happens if the resource already exists in the candidate configuration?

A.The device automatically performs an HTTP DELETE followed by a POST.
B.The request is rejected, typically returning a 409 Conflict status code.
C.The device silently ignores the request and returns 200 OK.
D.The existing resource is converted to an operational state counter.
AnswerB

Creating an already existing resource via POST usually triggers a conflict response.

Why this answer

In standard REST semantics and Junos REST implementation, a POST request to an existing resource may result in a conflict error (such as HTTP 409 Conflict) or duplicate creation error if the identifier already exists, whereas PUT is idempotent and overwrites.

43
Multi-Selecteasy

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

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

Correct. Automated testing ensures consistency.

Why this answer

CI/CD provides faster delivery, automated error checking, reduced manual toil, and consistent deployments.

44
MCQmedium

When retrieving operational data using the Junos XML API, how do you request pretty-printed or indented XML output?

A.Add <pretty-print>true</pretty-print> inside the <rpc> tag.
B.Use the NETCONF command-line flag --format-xml.
C.Set the environment variable JUNOS_XML_INDENT=1 in your shell.
D.Include the indent="true" attribute in the RPC request element.
AnswerD

The indent='true' attribute instructs the Junos device to format output with clean indentation.

Why this answer

Junos XML API supports formatting attributes such as indent="true" in RPC requests.

45
MCQmedium

An automation script connects to a Junos device and attempts to load a candidate configuration using NETCONF. The script needs to ensure that if any part of the configuration fails validation, the entire transaction is discarded and the candidate database is left untouched. Which NETCONF capability or tag should be utilized?

A.The SNMP trap notification daemon running on port 162
B.The <rollback> RPC with an explicit configuration revision number
C.The 'cli -s' force-override flag in an SSH execution session
D.The candidate configuration database lock combined with atomic transaction semantics provided by NETCONF <lock> and <commit> operations.
AnswerD

Correct. NETCONF provides atomic transaction capabilities where the candidate configuration is verified and committed atomically.

Why this answer

NETCONF supports robust transaction handling, ensuring that configuration changes are validated as a block and rolled back on error.

46
Multi-Selecteasy

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

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

Correct. Declarative tools focus on what state to achieve.

Why this answer

Declarative automation defines the desired state, leaving the system to determine how to reach it, whereas imperative scripts specify exact steps.

47
MCQhard

An enterprise uses Git for tracking Junos configurations. An engineer wants to see the exact line-by-line history of changes made to a specific routing policy file over the past month, including who made each change. Which Git command should they use?

A.git blame <filename> or git log -p <filename>
B.git history --routing-policy
C.git diff --author
D.git status --verbose
AnswerA

Correct. 'git blame' shows line authorship, and 'git log -p' shows patch/diff history per file.

Why this answer

'git blame' shows what revision and author last modified each line of a file, while 'git log' shows commit history.

48
Multi-Selecteasy

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

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

This operational command lists active NETCONF sessions on the device.

Why this answer

Session verification can be performed by checking active system sessions on the device or inspecting script connection outputs.

49
MCQhard

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

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

This accurately contrasts the transport and message formatting of REST vs NETCONF.

Why this answer

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

50
MCQmedium

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

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

Correct. JSON syntax rules do not allow trailing commas, while YAML parsers accommodate them.

Why this answer

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

51
MCQhard

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

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

Correct. default_flow_style=True forces PyYAML to serialize collections in flow style (JSON-like syntax).

Why this answer

The default_flow_style parameter in yaml.safe_dump() controls how collections are dumped. Setting default_flow_style=False uses block style, while True or None dictates flow style formatting.

52
MCQhard

You are writing a script that uses PyEZ to load a Junos configuration file, but you want to replace an entire hierarchy level (e.g., protocols bgp) rather than merging the changes. Which parameter should you pass to the load method?

A.overwrite=True
B.merge=False
C.action='replace'
D.mode='override'
AnswerC

Correct. Setting action='replace' loads the configuration with the replace directive.

Why this answer

The action='replace' parameter tells PyEZ to replace the specified hierarchy level in the candidate configuration.

53
Multi-Selecthard

When troubleshooting Junos REST API integration issues, which THREE factors should an engineer examine if API requests return connection timeouts or refused errors? (Choose three)

Select 3 answers
A.Whether firewall filters or security zones permit traffic to TCP port 3000 or 3443.
B.Whether the BGP routing table has valid routes to external BGP peers.
C.Network reachability and IP connectivity between the client and the Junos management interface (fxp0 or RE loopback).
D.Whether the jpagent service is configured and active on the Junos device.
E.Whether the NETCONF subsystem script is properly compiled in Python 2.7.
AnswersA, C, D

Firewall filters protecting the Routing Engine can block REST API ports.

Why this answer

Connection refused or timeouts indicate that jpagent might not be enabled, firewall filters are blocking ports 3000/3443, or management network routing/reachability issues exist.

54
MCQeasy

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

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

REST APIs rely on standard HTTP verbs to perform CRUD operations.

Why this answer

The Junos REST API uses standard HTTP methods (GET, POST, PUT, DELETE) and standard data formats like JSON or XML over HTTP/HTTPS, unlike NETCONF which uses XML over a dedicated TCP port (830).

55
MCQhard

You are rendering a Jinja2 template in Python that includes a loop over a list of VLANs. Which Jinja2 block syntax correctly iterates over a list named 'vlan_list'?

A.{{ for vlan in vlan_list }} ... {{ endfor }}
B.[for vlan in vlan_list] ... [endfor]
C.{% for vlan in vlan_list %} ... {% endfor %}
D.<% for vlan in vlan_list %> ... <% endif %>
AnswerC

Correct. The percent-brace syntax defines control structures like loops.

Why this answer

Jinja2 uses {% for item in list %} ... {% endfor %} syntax for iteration.

56
MCQeasy

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

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

The json module provides methods like dump(), dumps(), load(), and loads() for handling JSON data.

Why this answer

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

57
MCQmedium

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

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

Correct. Version control history is public/shared among teams, so secrets should be encrypted or managed externally.

Why this answer

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

58
Multi-Selecthard

When writing Jinja2 templates for Junos configurations, which THREE control flow or filtering constructs are valid? (Choose three)

Select 3 answers
A.[# foreach item in list #] ... [# endfor #]
B.<< if interface_active >> ... << endif >>
C.{% for vlan in vlans %} ... {% endfor %}
D.{% if ospf_enabled %} ... {% endif %}
E.{{ interface_list | map(attribute='name') | list }}
AnswersC, D, E

Correct. Loops use for/endfor.

Why this answer

Jinja2 supports filters, loops, and conditional statements.

59
MCQhard

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

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

Correct. Unknown tags in safe load mode trigger a ConstructorError.

Why this answer

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

60
MCQeasy

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

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

Correct. CI/CD automates integration, testing, and deployment.

Why this answer

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

61
Multi-Selectmedium

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

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

Returned when authentication credentials are missing or invalid.

Why this answer

401 Unauthorized is returned for bad or missing credentials, and 400 Bad Request is returned for malformed payload syntax.

62
MCQmedium

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

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

Correct. The csv module handles parsing and generating CSV formatted tabular data.

Why this answer

The Python standard library includes the 'csv' module, which provides reader and writer objects for tabular CSV data.

63
MCQhard

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

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

Correct. Standard JSON parsers overwrite earlier keys with later ones when duplicates occur.

Why this answer

RFC 8259 states that while names within an object SHOULD be unique, the specification does not mandate how parsers should handle duplicates, resulting in behavior dependent on the parser (typically keeping the last encountered key-value pair).

64
Multi-Selectmedium

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

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

Correct. The snap command captures snapshots.

Why this answer

JSNAPy execution is invoked via command line tool 'jsnapy'.

65
MCQhard

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

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

Correct. cu.validate() runs a check equivalent to 'commit check' in Junos CLI.

Why this answer

The .validate() method checks the candidate configuration for syntax and semantic errors without committing.

66
Multi-Selecthard

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

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

Correct. <get-config> retrieves configuration data.

Why this answer

NETCONF standard operations include <get-config>, <edit-config>, <commit>, <lock>, etc.

67
MCQeasy

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

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

This command starts the NETCONF SSH subsystem on Junos.

Why this answer

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

68
MCQeasy

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

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

Correct. Network as code emphasizes version control systems (VCS) like Git for tracking history and peer review.

Why this answer

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

69
MCQmedium

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

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

YAML relies on a fixed indentation space count and prohibits tabs to prevent indentation ambiguity.

Why this answer

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

70
MCQhard

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

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

Without a filter, the entire candidate datastore configuration is returned.

Why this answer

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

71
MCQmedium

You are troubleshooting a NETCONF session where the client sent an improperly formatted XML payload. Where would you expect to find detailed error logging related to this malformed XML request on the Junos device?

A./var/log/netconf.log
B./var/db/config/juniper.conf.gz
C./etc/netconf/errors.xml
D.NETCONF traceoptions output file or /var/log/messages
AnswerD

NETCONF operational logs and parsing errors appear in traceoptions files or /var/log/messages.

Why this answer

Junos logs NETCONF and XML API activity, including parsing errors, into the traceoptions log file if configured, or general system logs.

72
MCQmedium

When configuring a JSNAPy test file, which section defines the specific RPCs or CLI commands that should be executed to gather operational data?

A.action:
B.command: or rpc:
C.device_credentials:
D.template:
AnswerB

Correct. JSNAPy configuration files use command or rpc fields to specify what data to retrieve.

Why this answer

The snapcheck or check configuration structure uses test definitions pointing to specific commands.

73
MCQmedium

You need to execute a Junos CLI command (such as 'show version') as an XML RPC request via NETCONF. Which RPC tag encapsulates raw Junos CLI operational commands?

A.<cli><run>show version</run></cli>
B.<execute-cli>show version</execute-cli>
C.<command>show version</command>
D.<rpc-cli-command>show version</rpc-cli-command>
AnswerC

The <command> tag wraps CLI text strings for execution within an RPC.

Why this answer

The <command> tag allows executing arbitrary operational CLI commands formatted as text within the Junos XML API.

74
MCQmedium

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

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

Correct. Because YAML includes JSON as a subset, JSON structures can be seamlessly interpreted by YAML parsers.

Why this answer

YAML is a superset of JSON, meaning any valid JSON document is technically also a valid YAML document, allowing direct mapping of data structures.

75
Multi-Selectmedium

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

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

Standard JSON specification requires all keys in an object to be strings enclosed in double quotation marks.

Why this answer

JSON object keys must always be double-quoted strings, and null is a valid scalar value representing an empty or missing value.

Page 1 of 5

Page 2

All pages