GNS3 / gns3-gui

GNS3 Graphical Network Simulator
http://www.gns3.com
GNU General Public License v3.0
2.12k stars 433 forks source link

A plugin system #708

Open julien-duponchelle opened 8 years ago

julien-duponchelle commented 8 years ago

It's related to #707

We need to list potential plugins:

julien-duponchelle commented 8 years ago

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).

plucena24 commented 8 years ago

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.

julien-duponchelle commented 8 years ago

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.

grossmj commented 6 years ago

This is looking good :+1:

ghost commented 5 years ago

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?

grossmj commented 5 years ago

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

Raizo62 commented 3 years ago

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.

ghost commented 3 years ago

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

Raizo62 commented 3 years ago

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)

josephmhiggins commented 3 years ago

I got it. Thanks.

ghost commented 3 years ago

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

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

julien-duponchelle commented 3 years ago

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 .

grossmj commented 3 years ago

@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

Raizo62 commented 3 years ago

Shift of interests,

It is very sad :-(

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

Thanks

I duplicated these repositories :

ghost commented 3 years ago

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.

Raizo62 commented 3 years ago

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