Hi All,
Anyone have an idea how to do this or how a configuration can be exported into another format?
Or perhaps anyone that have an API or Python or PHP example to parse the configuration export to XML or JSON format?
Thanks in advance
Hi All,
Anyone have an idea how to do this or how a configuration can be exported into another format?
Or perhaps anyone that have an API or Python or PHP example to parse the configuration export to XML or JSON format?
Thanks in advance
Why would you want to export the actual configuration in a different format?
You can export it in the same (.rsc) format easily (just call “/export” with a “file” argument), but if you were to export to a different format, you’d also need a way to import that different format, which is where one of the two big real difficulties are with this.
The other difficulty is that you can’t really get the possible menus and commands from API, so there’s no (easy) way to make an application that backs up “everything” - it’s only easy to make an application that backs up specific stuff that you’re aware of, by making a “print” call to that menu, and then converting the output to JSON (which is the easiest part).
hi boen_robot, totally agree with the points you make however the question and intent was for a use case that was not as per your assumption (no import or recovery needed). Just information that is in the configuration export already, but working with XML or JSON is easier than parsing the export for the correct information.
Never the less the easiest option at this stage do seem API with “print” call to specific information and storing it directly into the format required, that way I get the info I need and the correct format - the caveat is that the application need access to all the routerboards.