Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A plugin system #708

Open
julien-duponchelle opened this issue Oct 9, 2015 · 16 comments
Open

A plugin system #708

julien-duponchelle opened this issue Oct 9, 2015 · 16 comments
Milestone

Comments

@julien-duponchelle
Copy link
Contributor

It's related to #707

We need to list potential plugins:

  • something like autonetkit
  • A visio export/import
@julien-duponchelle
Copy link
Contributor Author

julien-duponchelle commented Oct 9, 2015

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
Copy link

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
Copy link
Contributor Author

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
Copy link
Member

grossmj commented Nov 17, 2017

This is looking good 👍

@grossmj grossmj modified the milestones: TBD, 2.3 Nov 17, 2017
@grossmj grossmj modified the milestones: 2.3, 2.4 Mar 10, 2019
@grossmj grossmj modified the milestones: 2.4, TBD May 24, 2019
@ghost
Copy link

ghost commented Sep 10, 2019

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 grossmj modified the milestones: TBD, 2.3 Sep 10, 2019
@grossmj
Copy link
Member

grossmj commented Sep 10, 2019

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

@Raizo62
Copy link

Raizo62 commented Jul 18, 2021

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
Copy link

ghost commented Aug 18, 2021

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

@Raizo62
Copy link

Raizo62 commented Aug 18, 2021

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
Copy link

I got it. Thanks.

@ghost
Copy link

ghost commented Aug 18, 2021

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
Copy link
Contributor Author

julien-duponchelle commented Aug 18, 2021 via email

@grossmj
Copy link
Member

grossmj commented Aug 19, 2021

@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
Copy link

Raizo62 commented Aug 19, 2021

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
Copy link

ghost commented Sep 1, 2021

I have copied the blog post, where I presented the plugin implementation, to discussion #3222. The links were updated to refer to their current location.

@Raizo62
Copy link

Raizo62 commented Sep 1, 2021

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

@grossmj grossmj modified the milestones: 3.1, 3.2 Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants