Automation

last person joined: 3 days ago 

Ask questions and share experiences about Apstra, Paragon, and all things network automation.
  • 1.  Convert Junos XML Configuration to CLI Statement

    Posted 06-15-2014 12:21

    Hello! Is it possible to see how JUNOS convert junos xml to Junos cli ?

     

    For example:

     

    from such:

    <protocols>
      <bgp>
        <group>
          <name>23</name>
          <import>policy1</import>
        </group>
       </bgp>
    </protocols>

     to such:

    protocols {
      bgp {
        group 23 {
          import policy1;
         }
        }
       }

     

    I assume that JUNOS use XSLT .  Where can i see this xsl file which is superimposed on  the current xml file 



  • 2.  RE: Convert Junos XML Configuration to CLI Statement
    Best Answer

    Posted 06-17-2014 10:35

    Junos doesn't use XSLT to convert the XML configuration into the text configuration, and the processing that it does use (which I believe is proprietary) is not exposed outside of the source code.

     

    You can craft a template that makes a best effort conversion like you showed in your post, or you can load it into a Junos box and pull out the text configuration. I'm not aware of any other alternative. I guess there are the config schemas as well, but I don't think that will give you what you're looking for.