gns3-gui icon indicating copy to clipboard operation
gns3-gui copied to clipboard

A plugin system

Open julien-duponchelle opened this issue 9 years ago • 16 comments

It's related to #707

We need to list potential plugins:

  • something like autonetkit
  • A visio export/import

julien-duponchelle avatar Oct 09 '15 08:10 julien-duponchelle

My very basic proposal:

In ~/GNS3 we create a directory plugins.

In this directory each plugin is a directory with his python source code. Or perhaps a zipapp when Python 3.5 will be available everywhere: https://docs.python.org/3/library/zipapp.html#module-zipapp

For making dev easier instead of importing code from the plugin we start it at a new process when we need them. The python code is interpreted GNS3 is embedded interpreter.

A plugin can provide a collection of scripts as a endpoint.

For example if I want to apply something to a topology with start: python ~/GNS3/plugins/net.awesomeip/topology.py ~/GNS3/projects/blu/blu.gns3

This mean when you develop you don't need to restart GNS3, you can retry your code from the command line. The downside is we don't have advanced communications.

Plugin can access to the modules provided with GNS3 (Jinja, Qt) but nothing more and we will provide an helper library for basic stuff (like access to the config file, making an API call).

julien-duponchelle avatar Oct 09 '15 09:10 julien-duponchelle

In order to make it customizable, the users of GNS3 should be able to parse the .gns3 file themselves and build tools around it. My original proposal on #707 was to allow for this to occur.

plucena24 avatar Oct 09 '15 11:10 plucena24

Yes that why I propose to pass the .gns3 as parameter to the plugin and let the plugin/program handle the parsing. And plugin can be fully standalone python working without GNS3.

If you put it inside the plugins directory it can be start by GNS3 with our own Python, removing the need for people to install Python 3. Also GNS3 can read config file from the plugin in order to add the require GUI stuff like adding property on nodes.

julien-duponchelle avatar Oct 09 '15 12:10 julien-duponchelle

This is looking good :+1:

grossmj avatar Nov 17 '17 09:11 grossmj

When I moved away from GitHub, my comment vanished, here an updated version:

I created a simple (but effective) plugin system, that makes it easy to call external programs. If these programs use the GNS3 API a lot of fancy stuff can be done. I'm using it with great success on my installations since the early 2.1 days.

I wrote a blog post about that: https://www.b-ehlers.de/blog/2018/01/12/gns3-integrate-programs.html, the patches against v2.1 are here: https://git.b-ehlers.de/ehlers/gns3-gui-tools.

Patches updated for GNS3 v2.2

A similar method can be easily (I hope) integrated in the Web-UI. It could call a gns3+tool: URL, which triggers the WebClient pack and that starts the external program.

As it's a relative simple addition, what about a 2.3 milestone?

b-ehlers avatar Sep 10 '19 13:09 b-ehlers

Thanks for sharing this. I like the idea, let's try to implement that in 2.3

grossmj avatar Sep 10 '19 14:09 grossmj

Hi

This plugin will be useful.

On LiveRaizo, i must patch GNS3 to add the plugin system of ehlers. It will best if it was already integrated, or if GNS3 had a similar system.

Raizo62 avatar Jul 18 '21 12:07 Raizo62

I'm closing my website pretty soon. Anyone, who wants to use my plugin system, should save it before it vanishes.

b-ehlers avatar Aug 18 '21 10:08 b-ehlers

I'm closing my website pretty soon. Anyone, who wants to use my plugin system, should save it before it vanishes.

Oh ? Why ? (if you do not mind my asking)

Raizo62 avatar Aug 18 '21 12:08 Raizo62

I got it. Thanks.

josephmhiggins avatar Aug 18 '21 14:08 josephmhiggins

Oh ? Why ? (if you do not mind my asking)

Shift of interests, and no, I don't want to discuss that any further.

b-ehlers avatar Aug 18 '21 14:08 b-ehlers

Thanks for all your time Bernhard I really liked working with you.

Le mer. 18 août 2021 à 16:24, Bernhard Ehlers @.***> a écrit :

Oh ? Why ? (if you do not mind my asking)

Shift of interests, and no, I don't want to discuss that any further.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/GNS3/gns3-gui/issues/708#issuecomment-901159665, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACUKXM5GNMWU3JMT2W3ZR3T5O7DJANCNFSM4BRPXVTQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

julien-duponchelle avatar Aug 18 '21 14:08 julien-duponchelle

@b-ehlers thanks for the heads up, hopefully you will still be around

I duplicated your repository to https://github.com/grossmj/gns3-gui-tools

grossmj avatar Aug 19 '21 04:08 grossmj

Shift of interests,

It is very sad :-(

I duplicated your repository to https://github.com/grossmj/gns3-gui-tools

Thanks

I duplicated these repositories :

  • https://github.com/Raizo62/gns3-tools-python
  • https://github.com/Raizo62/qemu-mount
  • https://github.com/Raizo62/gns3-ios-base-config

Raizo62 avatar Aug 19 '21 10:08 Raizo62

I have copied the blog post, where I presented the plugin implementation, to discussion https://github.com/GNS3/gns3-gui/discussions/3222. The links were updated to refer to their current location.

b-ehlers avatar Sep 01 '21 17:09 b-ehlers

@b-ehlers : why do you not push all yours codes on your github account ?

Raizo62 avatar Sep 01 '21 18:09 Raizo62