Can I query configuration data using JSON format ? Yes. For NETCONF and Junoscript, the get-configuration RPC is used to emit the configuration. The JSON format can be specified as an XML attribute in the XML tag of get-configuration. For example:
<rpc> <get-configuration format="json"/> </rpc>
For the CLI, the show configuration command is used to emit the configuration. A new option called “json” is added under the | display option for emitting the configuration in JSON format. The show configuration | display json command displays the configuration in JSON.
Can the JSON-formatted configuration be loaded on Junos OS? Yes. The configuration in JSON can be loaded on Junos OS using the following commands for various modes of operations:
load json merge <filename/terminal> <relative>
load json override <filename/terminal>
load json update <filename/terminal>
How are operation commands supported with JSON? Junos OS emits data for operation commands natively in XML. The XML data is then converted to text depending upon the format defined in the Output Definition Language (ODL). In order to emit the operation data in JSON, the XML data must be converted to JSON. The operation data can be viewed in JSON using display json or format= json as already mentioned for configuration commands.