GNS3
http://forum.gns3.net/

[GNS3 1.x] Future file format
http://forum.gns3.net/topic7333.html
Page 1 of 2

Author:  grossmj [ Mon Oct 14, 2013 6:34 pm ]
Post subject:  [GNS3 1.x] Future file format

Hello guys,

As you may know, I have started working on the new GNS3 architecture and I would like to know your opinion about the current .NET topology file format (based on INI files). I'm thinking to ditch it because it is not easily extendible for our needs, not to talk about the portability... However, I still want a text-based file so users would still be able to "hack" topology files if needed.

I am thinking about using the JSON format which is a standard, easy to parse, extend and there are plenty of programming libraries which allows easy integration within GNS3. Maybe someone know a better format more suitable to represent a network topology?

The big downside of a new topology file is that all post 1.0 topologies would not be compatible with the new software which I agree wouldn't be great. This is why I am planning to maybe add the possibility to convert these files to the new format.

Let me know your thoughts.

Thanks,

Author:  xsimio [ Mon Oct 14, 2013 7:18 pm ]
Post subject:  Re: [GNS3 1.x] Future file format

Json would be a great option in my opinion too.

I think you should start from the beginning with the idea of an API which will allow us to write external tools to make use of a GNS3 daemon.

Author:  grossmj [ Tue Oct 15, 2013 2:17 am ]
Post subject:  Re: [GNS3 1.x] Future file format

Quote:
I think you should start from the beginning with the idea of an API which will allow us to write external tools to make use of a GNS3 daemon.


I am working on a REST API too :)

Author:  robeen [ Sun Oct 27, 2013 2:03 am ]
Post subject:  Re: [GNS3 1.x] Future file format

I'm generating .net files from templates, just replacing parts of it with variables. So as long as it's in readable text format it's totally ok :)

However, I'm also importing stuff with scripts editing gns3.ini. This would be great to be able to replace with the new REST API.

As for the choice of format I guess an alternative is XML. Me personally would prefer XML, but that's probably because it's what I'm used to and most familiar with :)

Author:  robeen [ Sun Oct 27, 2013 2:23 am ]
Post subject:  Re: [GNS3 1.x] Future file format

Might be some interesting info here:

http://stackoverflow.com/questions/3536 ... l-and-json

I must add though, I like the current format, very easy to read and modify :) What I'm missing the most is the API, but mostly for gns3.ini.

Author:  flaviojs [ Tue Nov 05, 2013 3:56 pm ]
Post subject:  Re: [GNS3 1.x] Future file format

Normally I would recommend JSON, but in this case I think XML is more appropriate.

I'm considering the amount of work needed:
  • to extend the file format (future features/devices/links/...)
  • to validate the file (schema)
  • to convert the file format (transformation)
  • to convert part of the file as config data for another software GNS3 works with (transformation)
  • to support plugins that need to keep metadata in the file
Everything can be done with JSON, of course, but I think it would need much more code.

------

For communication between software I would definitely go with JSON. ^^


Note: It's unrelated, but I love JSON and dislike XML

Author:  grossmj [ Thu Nov 07, 2013 6:38 pm ]
Post subject:  Re: [GNS3 1.x] Future file format

Quote:
Normally I would recommend JSON, but in this case I think XML is more appropriate.

I'm considering the amount of work needed:

to extend the file format (future features/devices/links/...)
to validate the file (schema)
to convert the file format (transformation)
to convert part of the file as config data for another software GNS3 works with (transformation)
to support plugins that need to keep metadata in the file


If done properly, extending the file format shouldn't be a problem. Also, there are libs to validate JSON schemas. I don't know about transformation...

but the major problem is I hate XML... ;) One of the thing is that XML is not nice to your eyes and to edit.

Quote:
For communication between software I would definitely go with JSON. ^^


Yep, this is gonna be JSON for sure.

Thanks for the input.

Author:  grossmj [ Thu Nov 07, 2013 6:46 pm ]
Post subject:  Re: [GNS3 1.x] Future file format

What about YAML?

Author:  adecisco [ Thu Nov 14, 2013 8:50 am ]
Post subject:  Re: [GNS3 1.x] Future file format

Well Jeremy good job I must say you are a legend. Really I am not a geek when it comes to programming but my advice that whatever you want to do ensure that users like us who came from non gui interface still have access to modify topology when things go wrong from gui interface. Whichever file format you are going to use accessibility to the content of the file will be important to lots of users.

Thanks.

Author:  flaviojs [ Sat Nov 30, 2013 7:25 pm ]
Post subject:  Re: [GNS3 1.x] Future file format

grossmj wrote:
What about YAML?
I'm not a fan of YAML, but it does present advantages when being manually edited by humans.

Advantages:
  • No need to worry about quotes or escaping characters when writing the lab instructions.
  • Comments are an obvious plus for any sample file/lab.
  • References (+anchors) are also good, but use with caution.
  • Other unimportant stuff...

Inconveniences:
  • Needs an editor with mono-spaced font.
  • User has to make sure tabs aren't used as indentation.
  • Using GNS3, comments would be lost in the cycle open->edit->save (we can customize the Scanner of PyYAML?).

If human editability is a major factor then YAML is more appropriate than JSON/XML.

Page 1 of 2 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/