Automation

 View Only
last person joined: 8 days ago 

Ask questions and share experiences about Apstra, Paragon, and all things network automation.
  • 1.  Question on JSON and the Junos CLI

     
    Posted 25 days ago

    Hi.

     

    Below I have logged into the Junos CLI and request some information in JSON format.

     

    lab@vmx1> show system information | display json

    {

        "system-information" : [

        {

            "hardware-model" : [

            {

                "data" : "vmx"

            }

            ],

            "os-name" : [

            {

                "data" : "junos"

            }

            ],

            "os-version" : [

            {

                "data" : "18.3R1.9"

            }

            ],

            "serial-number" : [

            {

                "data" : "VM5C8C145200"

            }

            ],

            "host-name" : [

            {

                "data" : "vmx1"

            }

            ]

        }

        ]

    }

     

     

    My understanding is that Junos responds to the operational command in XML, which is then converted by the CLI into JSON.

     

    Now I'm retrieving the same JSON information, but this time from my management station using RESTful messages:

     

    [lab@desktop ~]$ curl http://10.10.1.1:3000/rpc/get-system-information -u "lab:lab123" -H "Accept: application/json"

    {

        "system-information" : [

        {

            "hardware-model" : [

            {

                "data" : "vmx"

            }

            ],

            "os-name" : [

            {

                "data" : "junos"

            }

            ],

            "os-version" : [

            {

                "data" : "18.3R1.9"

            }

            ],

            "serial-number" : [

            {

                "data" : "VM5C8C145200"

            }

            ],

            "host-name" : [

            {

                "data" : "vmx1"

            }

            ]

        }

        ]

    }

     

    My question is: Who is doing the XML->JSON conversion here? Is it still the Junos CLI?

     

    Thanks,

    Deepak


    Juniper Business Use Only



  • 2.  RE: Question on JSON and the Junos CLI
    Best Answer

     
    Posted 24 days ago

    Correct, it is still mgd that is performing the conversion of the RPC request via either NETCONF or REST as JSON.

    Regards.



    ------------------------------
    Andy Sharp
    ------------------------------



  • 3.  RE: Question on JSON and the Junos CLI

     
    Posted 23 days ago

    Thanks Andy!