Juniper Netconf icon

Juniper Netconf

Interact with Juniper devices via NETCONF

Read Config (Path)

AI-generated

Summary

Read a specific subtree or XPath-filtered configuration path from the running configuration of a Juniper device via NETCONF over SSH.

Inputs

  • Host (required) — The hostname or IP address of the Juniper device to connect to.
  • Port (required) — The NETCONF over SSH port to use for the connection (default is 830).
  • Filter Type (required) — The type of filter to apply when retrieving the configuration path, either 'Subtree' or 'XPath'.
  • Path (required) — The configuration path to read, specified either as a subtree path starting with 'configuration' or as an XPath expression.
  • Include Raw XML — Whether to include the raw XML response in the operation output for debugging purposes.

Output shape

a list of JSON objects representing the parsed device configuration response corresponding to the requested path

The output will parse the NETCONF RPC XML response into JSON. If 'Include Raw XML' is enabled, the raw XML response will be included alongside the parsed data. Input validation requires subtree paths to start with 'configuration'. Errors will be thrown for invalid filter types or paths.

Examples

Example 1: Read interface configuration subtree from a Juniper device

Reads the running configuration under 'configuration/interfaces' subtree by connecting to the specified device host and port, returning the configuration in JSON format.

Example 2: Read BGP configuration using XPath filter

Extracts the BGP-related configuration using an XPath filter such as '/configuration/protocols/bgp', parsing the returned configuration data into JSON.

Discussion