415 Unsupported Media Type is explicitly caused by missing or invalid Content-Type headers.
57 questions · Junos Rest Api topic · All types, answers revealed
415 Unsupported Media Type is explicitly caused by missing or invalid Content-Type headers.
When troubleshooting REST API authentication and authorization on Junos devices, which THREE log files or diagnostic tools can an administrator inspect? (Choose three)
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.
This command enables secure HTTP (HTTPS) access for the jpagent.
RPCs are invoked via the operational RPC URI endpoint in Junos REST API.
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.
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?
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.
Which THREE features are provided by the Junos REST API daemon (jpagent) when running on a Junos device? (Choose three)
jpagent translates web API payloads into Junos internal data formats.
Creating an already existing resource via POST usually triggers a conflict response.
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?
This accurately contrasts the transport and message formatting of REST vs NETCONF.
Why this answer
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)
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.
When comparing the Junos REST API workflow to the NETCONF protocol workflow, which characteristic is unique to the REST API?
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.
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?
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.
Which user credential validation mechanism does the Junos REST API use by default when authenticating incoming API calls?
Which statement best describes the primary architectural difference between NETCONF and the Junos REST API?
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.
Which TWO configuration steps are required to enable the Junos REST API with basic security settings? (Choose two)
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.
Which statement accurately describes how the Junos REST API handles configuration locking compared to NETCONF workflows?
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.
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.
Which TWO benefits are gained by using the Junos REST API instead of traditional CLI screen-scraping in automation workflows? (Choose two)
Structured formats make data extraction reliable and programmatic.
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)
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.
PUT is used to replace or update specific configuration elements in the Junos REST API.
Which THREE architectural features distinguish the Junos REST API from traditional CLI screen-scraping (CLI automation via expect scripts)? (Choose three)
REST API uses predictable URIs for resources rather than CLI prompt navigation.
Which data serialization formats are natively supported by the Junos REST API for both input and output payloads?
Junos REST API fully supports both JavaScript Object Notation (JSON) and eXtensible Markup Language (XML).
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?
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.
Which Junos configuration command enables the REST API daemon to start automatically upon device boot?
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.
Operational data in JSON format mirrors the hierarchical structure of XML RPC responses.
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.
When designing an automation workflow that uses the Junos REST API for configuration management, which THREE practices ensure robust execution? (Choose three)
Using HTTPS prevents plaintext credential and configuration transmission.
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.
Which statement correctly identifies the relationship between Junos REST API and NETCONF data models?
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.
Which THREE advantages are associated with using the Junos REST API over NETCONF in lightweight automation scripts? (Choose three)
Which THREE actions can be performed using the Junos REST API operational endpoints? (Choose three)
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.
When comparing error handling between NETCONF and the Junos REST API, how are protocol-level errors communicated back to the client?
NETCONF relies on XML RPC error tags, while REST uses standard HTTP status codes and response bodies.
Which TWO characteristics are true regarding the Junos REST API? (Choose two)
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?
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.
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?
HTTP/HTTPS transport and native JSON make REST ideal for web-centric integration compared to SSH-based NETCONF.
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?
HTTP 201 Created is the standard response code for successfully creating a new resource via POST.
HTTP DELETE maps to deleting configuration elements in the candidate datastore.
When comparing NETCONF and the Junos REST API workflows, which statement accurately describes how configuration locks are handled?
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.
Multi-instance list entries map to JSON arrays.
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.
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?
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.
Which TWO data serialization formats can an automation engineer request using the 'Accept' header in a Junos REST API GET request? (Choose two)
Clients can request JSON responses using application/json.
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?
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/.
Which TWO characteristics distinguish the Junos REST API from NETCONF when interacting with Junos devices? (Choose two)
An administrator wants to disable the Junos REST API daemon entirely. Which CLI command achieves this?
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.
Which service daemon must be explicitly enabled in the Junos CLI configuration to allow REST API requests to be processed by the routing engine?
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.
When comparing the workflow and capabilities of the Junos REST API versus NETCONF, which THREE statements are correct? (Choose three)
NETCONF requires manual lock management, while REST API handles resource locking internally.
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.
Which Junos configuration hierarchy is used to configure system services parameters related to the REST API agent?
The jpagent hierarchy manages REST API configuration settings.
Why this answer
The jpagent service is configured under the 'set system services jpagent' CLI hierarchy.
Which THREE statements correctly contrast the session handling of NETCONF versus the Junos REST API? (Choose three)
NETCONF establishes a stateful SSH session with hello message capability exchanges.
How does the Junos REST API handle configuration commits compared to NETCONF workflow behavior?
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.
POST is used to create new configuration resources or execute RPCs.
Ready to test yourself?
Try a timed practice session using only Junos Rest Api questions.