Thanks Teodor.
That rpc calls returns a Python dictionary, not a JSON object.
Which is fine.. I just have to add an extra step converting the Python dictionary to a JSON object.
Original Message:
Sent: 09-27-2023 10:50
From: Teodor Adrian Soroceanu
Subject: Question on PyEZ
Hi Deepak,
You mean like this:
from jnpr.junos import Device
from pprint import pprint
with Device(host='router1.example.com') as dev:
sw_info_json = dev.rpc.get_software_information({'format':'json'})
pprint(sw_info_json)
Thanks,
Adrian.
------------------------------
Teodor Adrian Soroceanu
Original Message:
Sent: 09-27-2023 10:21
From: djadhav
Subject: Question on PyEZ
Hi.
By default, a PyEZ RPC call, eg r0.rpc.get_system_information()
returns information in XML format.
How do I get the response to be in text or JSON format?
Thanks,
Deepak