Automation

 View Only
last person joined: yesterday 

Ask questions and share experiences about Apstra, Paragon, and all things network automation.
  • 1.  XML to curly (or set)

    Posted 11 days ago

    Hi,

    Is there any (preferably Juniper supported) way of converting junos XML to "curly" config (or set)? Eg. xslt/python? 

    Thanks,

    AA



  • 2.  RE: XML to curly (or set)

     
    Posted 11 days ago

    This is always a bit of a challenge, as MGD makes some changes to how data is presented from XML to text to cli etc.  So any scripting approach is always going to require some adhoc changes to support some corner cases.

    A classic example of this is with interfaces, for example the XML would have the structure of  interfaces/interface/.... where-as text and set both drop the interface part and jump straight to interface-name, e.g. set interfaces ge-0/0/0 .... rather than set interfaces interface ge-0/0/0 ...

    There are other examples of this.  So it really does depend on which configuration text is being translated from one layout to another and then from an automation perspective trying to handle each of those corner cases where something doesn't follow the same approach.

    I have seen some projects where the configuration has instead been loaded onto a device in order to obtain a different output for example, using a virtual device and pushing the configuration to the candidate database and then retrieving the candidate database back in another format, and then just drop the change so that nothing is actually committed, or going one step further and performing a commit check to validate the configuration etc.

    Probably not the answer you were hoping for, but as you can see not always as straightforward as one would like it to be.

    Regards



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