Courseiva

CCNA Junos REST API Questions

49 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

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

Why this answer

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

Exam trap

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

How to eliminate wrong answers

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

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

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

Why this answer

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

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

3
MCQmedium

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

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

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

Why this answer

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

4
MCQmedium

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

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

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

Why this answer

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

5
MCQhard

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

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

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

Why this answer

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

6
Multi-Selecthard

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

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

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

Why this answer

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

Exam trap

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

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 converts REST requests and JSON or XML payloads into Junos configuration and operational structures, satisfying the stem's requirement for a translation feature. Without this mapping, REST clients could not drive native Junos RPCs or configuration hierarchies.

Why this answer

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

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

Exam trap

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

8
MCQhard

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

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

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

Why this answer

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

9
MCQhard

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

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

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

Why this answer

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

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

Exam trap

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

10
MCQeasy

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

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

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

Why this answer

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

Exam trap

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

How to eliminate wrong answers

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

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

11
Multi-Selectmedium

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

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

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

Why this answer

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

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

Exam trap

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

12
MCQeasy

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

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

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

Why this answer

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

13
MCQeasy

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

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

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

Why this answer

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

14
MCQmedium

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

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

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

Why this answer

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

15
MCQmedium

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

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

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

Why this answer

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

16
Multi-Selecteasy

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

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

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

Why this answer

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

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

17
MCQmedium

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

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

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

Why this answer

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

Exam trap

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

How to eliminate wrong answers

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

18
Multi-Selecthard

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

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

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

Why this answer

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

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

Exam trap

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

19
MCQeasy

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

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

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

Why this answer

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

20
MCQmedium

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

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

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

Why this answer

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

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

Exam trap

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

21
Multi-Selectmedium

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

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

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

Why this answer

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

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

Exam trap

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

22
MCQmedium

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

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

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

Why this answer

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

23
MCQhard

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

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

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

Why this answer

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

24
Multi-Selectmedium

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

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

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

Why this answer

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

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

25
Multi-Selecteasy

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

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

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

Why this answer

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

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

26
MCQeasy

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

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

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

Why this answer

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

Exam trap

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

How to eliminate wrong answers

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

27
Multi-Selectmedium

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

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

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

Why this answer

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

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

28
Multi-Selectmedium

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

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

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

Why this answer

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

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

29
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 returns faults as structured XML rpc-error elements carrying error-type, tag and severity inside the RPC reply. The Junos REST API instead signals failure through HTTP status codes with a JSON error body, so the two differ in both transport and payload.

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.

30
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 responses and request bodies can be encoded as either JSON or XML, selected via the Accept and Content-Type HTTP headers. This dual-format support satisfies the question's requirement, letting clients choose whichever serialisation suits their tooling without protocol changes.

Why this answer

Option B is correct because the Junos REST API accepts and returns both JSON and XML payloads, letting clients choose the representation via the Content-Type and Accept headers (for example application/json or application/xml). Option D is correct because the REST API is served by the jpagent (Junos REST API agent) daemon, which listens on HTTPS (TCP 443) and handles REST requests on the device. Option A is wrong because the REST API is accessed over standard HTTP/HTTPS with no proprietary C++ client libraries to compile.

Option C is wrong because REST is stateless and uses HTTP/HTTPS requests, not a persistent SSH session per transaction. Option E is wrong because TCP 830 is used by NETCONF over SSH, not by the REST API, which uses HTTPS on port 443.

Exam trap

JNCIA-DevOps often tests the difference between REST API and NETCONF. Candidates might confuse port 830 (NETCONF) with REST API ports, or think SSH is required.

31
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

Supplying action=commit alongside the configuration payload makes the REST API validate and commit the candidate in one call, satisfying the stem's requirement to avoid dangling candidate changes. Without it, the change stays uncommitted until a separate commit request is issued.

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.

32
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

REST API uses standard HTTP/HTTPS transport, so requests traverse existing web proxies and integrate natively with modern web frameworks via JSON payloads. This satisfies the stem's web-centric constraint, where NETCONF's SSH-based transport and XML encoding demand additional tooling and proxy configuration.

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.

33
MCQhard

A network automation team is using the Junos REST API to manage configurations on a Junos device. They need to perform a commit operation that includes a commit comment and also synchronizes the commit across all Routing Engines in a dual-RE system. Which HTTP method and URI combination should they use to achieve this with a single request?

A.POST to /rpc/commit with a JSON body containing <commit-comment> and <synchronize>
B.POST to /rpc/commit with an XML body including <commit-comment> and <synchronize>
C.PUT to /config/commit with a JSON body specifying comment and synchronize
D.PATCH to /rpc/commit with a JSON body containing comment and synchronize attributes
AnswerB

The Junos REST API supports executing RPCs via POST to /rpc/<rpc-name>. For commit, the RPC is 'commit'. The request body must be XML that includes the <commit-comment> and <synchronize> elements to add a comment and synchronize across Routing Engines. This single request accomplishes both requirements, making it the correct approach.

Why this answer

To execute a commit with a comment and synchronization, the Junos REST API requires a POST request to /rpc/commit with an XML body containing the <commit-comment> and <synchronize> elements. This leverages the RPC mechanism, allowing multiple commit options in one request. Other methods and endpoints do not support this functionality.

Exam trap

The trap here is confusing the RPC endpoint with configuration endpoints and using incorrect HTTP methods or payload formats.

34
Multi-Selectmedium

An automation engineer is tasked with implementing a REST API client that authenticates to a Junos device. The engineer must choose an authentication method supported by the Junos REST API and ensure that credentials are transmitted securely. Which two statements are correct about authentication for the Junos REST API? (Choose two.)

Select 2 answers
A.API keys generated on the Junos device can be used in place of passwords.
B.Credentials are sent in plain text by default, so HTTPS is optional.
C.Authentication can be performed using a session cookie obtained from a login RPC.
D.HTTP Basic Authentication is supported and sends credentials in base64-encoded format.
E.OAuth 2.0 tokens are natively supported for authentication.
AnswersC, D

The Junos REST API supports session-based authentication. A client can send a POST request to the /rest/rpc/login RPC with credentials, which returns a session cookie. Subsequent requests include this cookie for authentication. This method avoids sending credentials with every request and is useful for maintaining a session. It is a supported authentication mechanism.

Why this answer

The Junos REST API supports HTTP Basic Authentication, where credentials are base64-encoded and sent in the Authorization header. It also supports session-based authentication via a login RPC that returns a cookie. Both methods require HTTPS for secure transmission.

OAuth 2.0 and API keys are not natively supported. Credentials are not sent in plain text by default; base64 encoding is not encryption, so HTTPS is essential.

Exam trap

The trap here is assuming that modern authentication methods like OAuth or API keys are available, when the Junos REST API actually relies on Basic Auth or session cookies.

35
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

201 Created confirms the POST succeeded and a new static route resource now exists. The response typically includes a Location header pointing to the created object, distinguishing it from 200 OK, which signals a successful request without resource creation.

Why this answer

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

36
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 targets a specific configuration hierarchy or statement, removing it from the candidate configuration rather than committing it. This satisfies the stem's constraint that the change executes against the candidate, not the active configuration, so the deletion stays uncommitted until an explicit commit operation is issued.

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.

37
MCQhard

A network automation team is using the Junos REST API to manage configurations on a fleet of Junos devices. They need to ensure that configuration changes are applied atomically and that they can roll back if an error occurs. They decide to use the REST API to load a configuration, commit it, and then verify the commit. Which sequence of REST API calls should they use to load a configuration snippet, commit it, and then confirm the commit was successful?

A.POST to /rest/rpc/load-configuration with the configuration data, then POST to /rest/rpc/commit, then check the HTTP status code and response body of the commit call for success indicators
B.POST to /rest/rpc/load-configuration with the configuration data, then POST to /rest/rpc/commit, then GET /rest/rpc/get-configuration to verify the applied configuration
C.POST to /rest/rpc/load-configuration, then POST to /rest/rpc/commit, then GET /rest/rpc/get-commit-information
D.POST to /rest/rpc/load-configuration, then POST to /rest/rpc/commit-check, then POST to /rest/rpc/commit
AnswerA

The commit RPC returns an HTTP status code and a response body indicating success or failure. A successful commit returns 200 OK and a commit result. Checking this response directly confirms whether the commit succeeded. This is the most reliable way to verify the commit operation. The load-configuration call must include the configuration data and appropriate parameters.

Why this answer

To load, commit, and verify a configuration via the Junos REST API, you perform a POST to the load-configuration RPC with the configuration data, then a POST to the commit RPC. The commit response includes an HTTP status code and a body that indicates success or failure. Checking this response is the most direct way to confirm the commit succeeded.

Additional calls like get-configuration or get-commit-information are not necessary for verifying the commit operation itself.

Exam trap

The trap here is thinking that a separate verification RPC is needed to confirm a commit, when the commit RPC's own response already provides definitive success or failure status.

38
MCQmedium

An automation engineer is writing a Python script that retrieves the operational status of all interfaces from a Junos device using the Junos REST API. The script sends a GET request to https://device/rest/interface. The device returns an HTTP 200 OK response, but the response body is empty. The engineer examines the request and confirms that the URL is correct and the device is reachable. Which action should the engineer take to retrieve the interface status information?

A.Add the Accept: application/json header to the request.
B.Use the correct RPC endpoint, such as /rest/rpc/get-interface-information, to retrieve operational data.
C.Change the HTTP method to POST and include a JSON payload specifying the interface names.
D.Append the query parameter ?type=operational to the URL.
AnswerB

The Junos REST API exposes operational commands through RPC endpoints. To retrieve interface status, you must call the appropriate RPC, such as get-interface-information, via the /rest/rpc/ path. A simple GET to /rest/interface does not map to an operational command and returns an empty response. Using the correct RPC endpoint returns the desired operational data.

Why this answer

The Junos REST API provides access to operational data through RPCs, not through arbitrary REST endpoints. To retrieve interface status, the correct endpoint is /rest/rpc/get-interface-information. A GET request to /rest/interface does not correspond to a valid RPC and returns an empty body.

Using the proper RPC endpoint ensures the desired operational information is returned in the response.

Exam trap

The trap here is assuming that any REST URL path maps directly to a Junos hierarchy level or operational command, when actually operational data requires invoking a specific RPC endpoint.

39
MCQeasy

A network automation developer is writing a Python script that uses the Junos REST API to load a candidate configuration from a file and commit it. The developer wants to ensure the configuration is merged with the existing candidate configuration. Which HTTP method and endpoint should be used to load the configuration?

A.POST to /rest/conf/ with the configuration in the request body
B.GET to /rest/conf/ with the configuration as a query parameter
C.POST to /rest/config/ with the configuration in the request body
D.PUT to /rest/conf/ with the configuration in the request body
AnswerA

The Junos REST API uses POST to /rest/conf/ to load configuration data into the candidate configuration. By default, the load operation merges the provided configuration with the existing candidate. This is the correct method and endpoint for loading configuration via REST.

Why this answer

To load configuration into the candidate configuration via the Junos REST API, an automation script sends an HTTP POST request to the /rest/conf/ endpoint with the configuration data in the request body. This operation defaults to a merge load, combining the new configuration with the existing candidate. Other methods like PUT or GET are not used for configuration loading.

Exam trap

The trap here is assuming that RESTful conventions like PUT for updates or GET with query parameters apply to the Junos REST API, which instead uses POST to /rest/conf/ for configuration loads.

40
MCQhard

An automation engineer is troubleshooting a Junos REST API script that intermittently fails with HTTP 401 Unauthorized errors when retrieving operational data. The script uses HTTP Basic Authentication with a valid username and password. The engineer confirms that the credentials are correct and that the REST API is enabled. What is the most likely cause of the intermittent failures?

A.The script is exceeding the maximum number of concurrent REST API sessions, causing new requests to be rejected with 401.
B.The device is configured to use RADIUS authentication, and the RADIUS server is occasionally unreachable.
C.The device's clock is out of sync with the authentication server, causing token-based authentication to fail.
D.The REST API requires the use of a session cookie instead of Basic Authentication for operational requests.
AnswerB

Intermittent 401 errors with correct local credentials often indicate an external authentication server issue. If the Junos device is configured to use RADIUS or TACACS+ for authentication, a temporary network problem or server unavailability can cause authentication to fail, resulting in 401 responses. The REST API relies on the device's authentication mechanisms.

Why this answer

Intermittent 401 Unauthorized errors with valid credentials often stem from external authentication server issues. When a Junos device is configured to use RADIUS or TACACS+ for user authentication, temporary server unreachability can cause authentication failures. The REST API uses the device's configured authentication methods, so an unreachable RADIUS server would result in 401 responses.

Exam trap

The trap here is assuming that 401 errors always indicate wrong credentials or API misconfiguration, overlooking external authentication server dependencies that can cause intermittent failures.

41
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

Junos REST JSON mirrors the XML hierarchy: repeated configuration nodes such as multiple static routes or next-hops are encoded as JSON arrays, each element an object holding that entry's leaf values, so every instance is represented distinctly.

Why this answer

In the Junos REST API, when a configuration element can have multiple instances (e.g., multiple static routes or next-hops), the JSON payload represents them as a JSON array containing an object for each instance. This allows the API to handle multiple entries in a structured way, aligning with JSON's array syntax.

Exam trap

JNCIA-DevOps often tests the JSON representation of Junos configuration lists. Candidates may assume that list items are represented as indexed keys or nested objects, but the correct representation is a JSON array. The trap is confusing XML's repeated elements with JSON's array syntax.

How to eliminate wrong answers

Option A is wrong because XML CDATA blocks are not used in JSON; JSON does not support CDATA. Option B is wrong because numerical indexed keys like 'route-0' are not the standard representation; Junos uses arrays for lists. Option D is wrong because a single concatenated string with semicolons is not valid JSON and does not represent structured data.

42
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

HTTP Basic Authentication places the Base64-encoded username and password in the Authorization request header, prefixed with "Basic". Without this header the REST API rejects the request as unauthenticated, so it satisfies the credential-passing requirement in the stem.

Why this answer

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

43
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

The `get-software-information` RPC returns the full software package inventory, satisfying the requirement to list all installed packages. Targeting it under `/api/operational/rpc/` invokes the operational command directly via the Junos REST API, rather than a configuration or management endpoint, which would not expose installed package data.

Why this answer

The Junos REST API exposes operational RPCs under the /api/operational/rpc/ path, and software package information is retrieved via the get-software-information RPC. This endpoint returns details about installed packages, versions, and related state. The other options either target configuration hierarchies or use non-existent REST paths.

Exam trap

JNCIA-DevOps often tests whether candidates know that operational RPCs live under /api/operational/rpc/ and that configuration paths are separate, so mixing up configuration and operational endpoints is the common mistake.

How to eliminate wrong answers

Option A is wrong because /api/configuration/system/software targets the configuration hierarchy, not operational software package status. Option B is wrong because /netconf/rpc/software is not a valid Junos REST API endpoint — NETCONF uses a different transport and path structure. Option D is wrong because /api/v1/packages/status is not a standard Junos REST endpoint; Junos uses /api/operational/rpc/ for operational RPCs.

44
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

'application/json' is a valid Accept header value for Junos REST API GET requests, returning responses serialised as JSON. This satisfies the stem's requirement by naming one of the two supported serialisation formats the device can negotiate.

Why this answer

The Junos REST API supports content negotiation through the HTTP Accept header, and the two media types it recognizes for structured data responses are application/json (option C) and application/xml (option D); requesting either of these causes the device to return the RPC reply serialized in JSON or XML respectively. JSON is the default and most commonly used format for automation tooling, while XML mirrors the native Junos XML API output, so both are valid and correct. The remaining options are not supported by the Junos REST API: application/yaml (A) is not a media type Junos negotiates, text/csv (B) is not a serialization format the API emits, and application/octet-stream (E) denotes an opaque binary stream rather than a structured serialization format.

45
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 relies on standard HTTP verbs — GET, POST, PUT, DELETE — sent over HTTP or HTTPS ports, mapping operations onto resources. NETCONF instead uses SSH transport with XML-encoded RPCs, so this HTTP-method characteristic genuinely distinguishes the two interfaces.

Why this answer

Option C is correct because the Junos REST API is an HTTP-based interface that uses standard HTTP verbs (GET to retrieve, POST to create/execute RPCs, PUT to replace, DELETE to remove) and listens on HTTP/HTTPS ports (typically 80/443 or the configured web-management ports), unlike NETCONF which runs over SSH. Option D is correct because the Junos REST API can return responses in JSON (as well as XML), which is a native capability of the REST interface, whereas NETCONF returns XML-encoded data. Option A is incorrect because TCP port 830 is the default NETCONF-over-SSH port, not a REST API port.

Option B is incorrect because NETCONF does not require explicit SSH key pairs (password or key-based SSH both work), and the REST API does support encryption via HTTPS. Option E is incorrect because NETCONF over SSH maintains a persistent session, while REST is inherently stateless per HTTP request.

46
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

Junos enables the REST API over HTTPS by default on TCP port 3443, distinct from the standard 443 used by other web services. Plain HTTP REST listens on port 3000. The stem's secure HTTPS constraint therefore maps directly to 3443.

Why this answer

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

47
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 `system services jpagent` hierarchy enables the Junos REST API agent, satisfying the stem's requirement for REST API service parameters. Unlike NETCONF over SSH or the legacy JUNOScript API, jpagent exposes RESTful HTTP/HTTPS access, so its configuration lives under `system services` alongside other daemons such as `ssh` and `telnet`.

Why this answer

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

48
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's SSH transport carries a long-lived, stateful session where both peers exchange capability sets at startup, then reuse that negotiated context for every subsequent RPC. This satisfies the stem's contrast with the Junos REST API, which is stateless per HTTP request and re-establishes context each call.

Why this answer

Option A is correct because NETCONF operates over a persistent SSH transport (typically TCP port 830) and establishes a stateful session that begins with a hello message exchanging capabilities between client and server. Option D is correct because the Junos REST API authenticates each request individually using standard HTTP headers (such as Authorization with Basic credentials or an X-Auth-Token) rather than relying on an interactive shell session. Option E is correct because the Junos REST API follows the stateless HTTP request/response model, where each transaction is independent and no session context is retained between calls.

Option B is incorrect because NETCONF does not use HTTP or port 80; it runs over SSH, and HTTP is the transport for REST, not NETCONF. Option C is incorrect because NETCONF sessions do not expire every 30 seconds based on keystrokes; they persist until explicitly closed or timed out by configured idle limits.

49
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 carries configuration and RPC payloads to the Junos REST API, creating or loading candidate configuration and invoking operational commands. It satisfies the stem's need for a method that manages resources rather than merely reading them.

Why this answer

The Junos REST API uses standard HTTP verbs to manipulate configuration and operational resources, and the three commonly supported methods are GET, POST, and DELETE. GET (C) is correct because it is used to retrieve operational data or configuration information from Junos, such as via REST endpoints that return XML or JSON representations of state and configuration. POST (B) is correct because it is used to create, modify, or execute configuration and operational requests, including loading configuration changes or invoking RPCs through the REST API.

DELETE (E) is correct because it is used to remove configuration statements or resources at a specified REST endpoint. TRACE (A) is not used by the Junos REST API; it is a diagnostic HTTP method for echoing requests and is generally disabled for security. CONNECT (D) is also not part of Junos REST API resource management; it establishes a tunnel through a proxy and is unrelated to configuration or operational resource handling.

Ready to test yourself?

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