You want to retrieve only the system hostname from the Junos running configuration using NETCONF. Which filtering technique is most efficient?
Trap 1: XPath expression filtering via the select attribute
While XPath is supported, standard subtree tag filtering is the native Junos XML API approach for simple element extraction.
Trap 2: Regular expression pattern matching within the <filter> attribute
NETCONF subtree and XPath filters do not use generic regex pattern matching inside attributes.
Trap 3: Retrieving the entire configuration and parsing it locally with a…
Retrieving the full configuration is inefficient when only a specific leaf is needed.
- A
Subtree filtering using XML element tags matching the configuration hierarchy
Subtree filtering sends XML element tags mirroring the configuration hierarchy, so the device returns only the matching hostname node rather than the entire configuration. This satisfies the stem's efficiency constraint by minimising payload and server-side processing compared with retrieving everything and filtering locally.
- B
XPath expression filtering via the select attribute
Why it fails: While XPath is supported, standard subtree tag filtering is the native Junos XML API approach for simple element extraction.
- C
Regular expression pattern matching within the <filter> attribute
Why it fails: NETCONF subtree and XPath filters do not use generic regex pattern matching inside attributes.
- D
Retrieving the entire configuration and parsing it locally with a Python script
Why it fails: Retrieving the full configuration is inefficient when only a specific leaf is needed.