Automation

last person joined: 3 days ago 

Ask questions and share experiences about Apstra, Paragon, and all things network automation.
  • 1.  Conversion from xml to set command

    Posted 12-24-2014 05:08

    How to convert device configuration from xml to set format configuration? Is there any API for it?



  • 2.  RE: Conversion from xml to set command

    Posted 01-07-2015 20:14

    I'm no JUNOS expert, but you might want to include some more details into what you're trying to do exactly.  Are you trying to view the config on your Juniper device in set commands or are you trying to convert an xml config that was stored externally and convert that into set commands?

     

    If you are trying to do the first, I hope you've already found your answer and found that you can do "show | display set" on your Juniper device.  You can also drill down into your stanzas like "show interfaces | display set".

     

    I would imagine you could use SLAX or XSLT for the latter situation.

     

    g'luck,

     

    mrrex4



  • 3.  RE: Conversion from xml to set command

    Posted 01-07-2015 23:27

    Hi,

     

    You can do reverse from Junos commands to xml view as below example

     

    > show configuration interfaces ge-0/0/9 | display xml
    <rpc-reply xmlns:junos="http://xml.juniper.net/junos/11.4R7/junos">
    <configuration junos:commit-seconds="1419945195" junos:commit-localtime="2014-12-30 16:13:15 AST" junos:commit-user="root">
    <interfaces>
    <interface>
    <name>ge-0/0/9</name>
    <gigether-options>
    <redundant-parent>
    <parent>reth3</parent>
    </redundant-parent>
    </gigether-options>
    </interface>
    </interfaces>
    </configuration>
    <cli>
    <banner>{secondary:node1}</banner>
    </cli>
    </rpc-reply>



  • 4.  RE: Conversion from xml to set command

    Posted 10-19-2018 02:51

    Found an external link to convert configuration from xml to set format:

     

    http://www.stewartb.com/cgi-bin/juniper.pl