Courseiva

CCNA Junos REST API Questions

57 questions · Junos REST API · All types, answers revealed

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

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

3
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'.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

30
Multi-Selectmedium

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

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

Using HTTPS prevents plaintext credential and configuration transmission.

Why this answer

Robust REST workflows should handle HTTP status codes, use HTTPS for secure transport, and properly structure payloads with appropriate Content-Type headers.

31
Multi-Selecteasy

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

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

200 OK indicates successful GET or update execution.

Why this answer

200 OK and 204 No Content (or 201 Created) indicate successful API execution depending on the method.

32
MCQeasy

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

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

REST API and NETCONF share the same underlying Junos configuration and operational data models.

Why this answer

Both the Junos REST API and NETCONF interface with the same underlying Junos YANG data models and management infrastructure (MGD), providing different transport and encoding wrappers for the same capabilities.

33
Multi-Selectmedium

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

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

HTTP-based REST traffic traverses web infrastructure and proxies easily.

Why this answer

REST API benefits include native JSON parsing support in languages like Python without extra libraries, simple HTTP request/response debugging, and easy traversal through standard web proxies.

34
Multi-Selectmedium

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

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

Interface operational statistics are accessible via operational REST paths.

Why this answer

Operational endpoints in Junos REST API support retrieving system information, fetching interface operational counters, and executing custom RPCs.

35
MCQhard

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

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

NETCONF relies on XML RPC error tags, while REST uses standard HTTP status codes and response bodies.

Why this answer

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

36
Multi-Selecteasy

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

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

Junos REST API natively handles both JSON and XML representation formats.

Why this answer

The Junos REST API runs on jpagent (default port 3000 for HTTP and 3443 for HTTPS) and natively supports both JSON and XML data formats.

37
MCQhard

An automation script makes a REST API request to modify a Junos configuration. To ensure that the changes are validated and committed in a single workflow step without leaving dangling candidate changes, how can the commit parameter be handled?

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

Commit query parameters or action flags instruct the REST API daemon to commit the candidate changes immediately.

Why this answer

The Junos REST API allows query parameters or header flags (such as '?action=commit' or dedicated commit instructions) to automatically commit changes made during a configuration modification request.

38
MCQhard

An automation developer is designing a tool that interacts with multiple network vendors, including Juniper Junos. They evaluate using Junos REST API versus NETCONF. Which workflow advantage does the REST API offer over NETCONF in web-centric application environments?

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

HTTP/HTTPS transport and native JSON make REST ideal for web-centric integration compared to SSH-based NETCONF.

Why this answer

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

39
MCQmedium

When an automation script issues a POST request to create a new static route via the Junos REST API, what HTTP status code indicates that the resource was successfully created?

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

HTTP 201 Created is the standard response code for successfully creating a new resource via POST.

Why this answer

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

40
MCQmedium

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

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

HTTP DELETE maps to deleting configuration elements in the candidate datastore.

Why this answer

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

41
MCQmedium

When comparing NETCONF and the Junos REST API workflows, which statement accurately describes how configuration locks are handled?

A.NETCONF requires explicit lock and unlock commands, whereas REST API transactions typically manage locks implicitly during request execution.
B.Neither protocol utilizes locking mechanisms since Junos uses optimistic concurrency control.
C.The Junos REST API enforces exclusive global locking which prevents any concurrent NETCONF sessions.
D.Both NETCONF and Junos REST API require the client to manually issue an explicit lock RPC before making changes.
AnswerA

NETCONF clients must manage locks explicitly, whereas REST APIs handle database access sessions internally per transaction.

Why this answer

NETCONF explicitly requires lock and unlock operations on configuration datastores (candidate/running). The Junos REST API abstracts state management or handles implicit locking depending on the specific API call, whereas NETCONF leaves lock management entirely to the client's explicit RPC control.

42
MCQmedium

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

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

Multi-instance list entries map to JSON arrays.

Why this answer

In Junos REST API JSON representations, multi-instance configuration lists are typically represented as arrays of JSON objects.

43
MCQhard

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

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

The 'Authorization' header is standard for passing Basic Authentication credentials in HTTP requests.

Why this answer

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

44
MCQmedium

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

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

This operational RPC endpoint executes the get-software-information query.

Why this answer

Software inventory and package information can be retrieved by invoking the 'get-software-information' RPC via the operational RPC URI path.

45
Multi-Selecteasy

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

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

Clients can request JSON responses using application/json.

Why this answer

The Junos REST API supports application/json and application/xml in Accept headers to return responses in the desired format.

46
MCQmedium

An automation engineer is trying to retrieve operational data from a Junos device using the REST API. They send an HTTP GET request to the URI path 'http://192.168.1.1:3000/api/font/operational/system/information', but the request fails with a 404 Not Found error. What is the cause of this failure?

A.Authentication credentials were missing from the HTTP header.
B.The URI path contains an invalid prefix segment 'font' instead of the required API root structure.
C.The port 3000 is reserved for NETCONF and cannot be used for REST API requests.
D.Operational data retrieval requires an HTTP POST method instead of GET.
AnswerB

The correct operational API route uses '/api/operational/system/information', and 'font' is an incorrect path segment.

Why this answer

The correct base path for Junos REST API operational data uses 'rpc' or 'initial' or specific resource endpoints like /api/restful/rit/rpc, but the standard path prefix for RPCs and operational data via the Junos REST API begins with /api/operational/ rather than /api/font/operational/.

47
Multi-Selectmedium

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

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

REST operates over HTTP/HTTPS using standard CRUD verbs.

Why this answer

Junos REST API utilizes standard HTTP/HTTPS transport and commonly returns JSON formatted responses, whereas NETCONF uses port 830 and XML payloads.

48
MCQeasy

An administrator wants to disable the Junos REST API daemon entirely. Which CLI command achieves this?

A.deactivate protocols rest-api
B.set system services jpagent disable
C.delete system services jpagent
D.stop system services rest
AnswerC

Deleting the jpagent service configuration stops the REST API daemon.

Why this answer

To disable the jpagent service, the administrator uses the 'delete system services jpagent' command in configuration mode.

49
MCQeasy

Which service daemon must be explicitly enabled in the Junos CLI configuration to allow REST API requests to be processed by the routing engine?

A.set system services api-daemon
B.set system services netconf
C.set system services rest http
D.set system services jpagent
AnswerD

Enabling jpagent starts the Junos REST API daemon.

Why this answer

The Junos REST API is managed by the 'jpagent' (Junos Plugin Agent) service. It must be enabled under the 'system services' hierarchy for REST API requests to function.

50
Multi-Selectmedium

When comparing the workflow and capabilities of the Junos REST API versus NETCONF, which THREE statements are correct? (Choose three)

Select 3 answers
A.NETCONF requires explicit <lock> and <unlock> RPC workflows, whereas REST API abstracts transaction locking implicitly.
B.Junos REST API only supports JSON format, while NETCONF only supports binary streams.
C.NETCONF operates over TCP port 830 using an SSH subsystem, while Junos REST API operates over HTTP/HTTPS ports.
D.NETCONF does not support commit operations, whereas REST API automatically commits every keystroke.
E.Both protocols allow interaction with Junos configuration and operational databases.
AnswersA, C, E

NETCONF requires manual lock management, while REST API handles resource locking internally.

Why this answer

NETCONF uses SSH port 830 and XML RPCs with explicit candidate locking, whereas Junos REST API uses HTTP/HTTPS (port 3000/3443) and supports JSON and XML resource operations.

51
MCQeasy

An administrator configures the Junos REST API service. By default, which TCP port does the device listen on for secure HTTPS REST requests?

A.443
B.3443
C.8080
D.830
AnswerB

Port 3443 is the default TCP port for secure Junos REST API connections.

Why this answer

The default TCP port for secure HTTPS requests in the Junos REST API daemon (jpagent) is port 3443.

52
MCQmedium

An administrator wants to retrieve the configuration of a specific interface (e.g., ge-0/0/0) using the Junos REST API. Which URI structure is appropriate for fetching this configuration resource in JSON format?

A./rpc/get-config?interface=ge-0/0/0
B./netconf?subsystem=ge-0/0/0
C./api/operational/interfaces/ge-0/0/0
D./api/configuraton/interfaces/interface/name/ge-0/0/0
AnswerD

This follows the hierarchical Junos configuration REST path structure.

Why this answer

The Junos REST API uses structured paths matching the configuration hierarchy, typically prefixed by /api/configuraton/interfaces/interface/ge-0/0/0 or similar resource roots depending on the Junos release.

53
MCQeasy

Which Junos configuration hierarchy is used to configure system services parameters related to the REST API agent?

A.set system rest-api
B.set protocols rest
C.set management-plane api
D.set system services jpagent
AnswerD

The jpagent hierarchy manages REST API configuration settings.

Why this answer

The jpagent service is configured under the 'set system services jpagent' CLI hierarchy.

54
Multi-Selecthard

Which THREE statements correctly contrast the session handling of NETCONF versus the Junos REST API? (Choose three)

Select 3 answers
A.NETCONF maintains a persistent, stateful connection over an SSH session with capability exchanges.
B.NETCONF requires an HTTP web server running on port 80 to maintain session state.
C.NETCONF sessions automatically expire every 30 seconds if an interactive keystroke is not received.
D.Junos REST API relies on standard HTTP headers for authentication per request rather than maintaining an interactive shell session.
E.Junos REST API utilizes stateless HTTP request/response transactions.
AnswersA, D, E

NETCONF establishes a stateful SSH session with hello message capability exchanges.

Why this answer

NETCONF sessions are stateful, persistent SSH sessions requiring explicit greetings and channel management. Junos REST API requests operate over HTTP/HTTPS where each request is handled via stateless HTTP semantics, though underlying device sessions are managed by the jpagent daemon.

55
MCQeasy

What is the default TCP port used by the Junos jpagent for unencrypted HTTP REST API connections?

A.80
B.830
C.8080
D.3000
AnswerD

Port 3000 is the default TCP port for unencrypted Junos REST API connections.

Why this answer

The Junos REST API daemon (jpagent) listens on TCP port 3000 by default for HTTP traffic, and port 3443 for HTTPS traffic.

56
MCQhard

How does the Junos REST API handle configuration commits compared to NETCONF workflow behavior?

A.REST API does not support committing configurations; it is strictly read-only for operational data.
B.NETCONF utilizes explicit lock, candidate modification, and commit RPC workflows, while REST API provides resource-based endpoints where configuration changes can trigger auto-commits or be committed via dedicated commit URIs.
C.NETCONF requires an explicit <commit> RPC, whereas the Junos REST API executes modifications directly against the running configuration with optional commit flags.
D.Both protocols bypass the candidate datastore entirely and write directly to NVRAM.
AnswerB

This correctly highlights the contrast between NETCONF's rigid RPC sequence and REST's resource-oriented transaction handling.

Why this answer

In NETCONF, changes are made to the candidate datastore and must be explicitly committed using the <commit> RPC. In the Junos REST API, configuration changes made via PUT, POST, or DELETE can either auto-commit depending on the API call parameters or require a separate commit action, but unlike NETCONF's explicit candidate/running model, REST abstracts transactions into resource endpoints where commit behaviors are managed via query parameters or dedicated commit endpoints.

57
Multi-Selecthard

Which THREE HTTP methods are commonly used within the Junos REST API for managing configuration and operational resources? (Choose three)

Select 3 answers
A.TRACE
B.POST
C.GET
D.CONNECT
E.DELETE
AnswersB, C, E

POST is used to create new configuration resources or execute RPCs.

Why this answer

The Junos REST API uses HTTP GET for retrieving data, HTTP POST/PUT for creating or modifying resources, and HTTP DELETE for removing configuration elements.

Ready to test yourself?

Try a timed practice session using only Junos REST API questions.