clicon / clixon-controller

Clixon network controller
Apache License 2.0
18 stars 5 forks source link

Service Registration through clixon #159

Open NetworkOverload opened 1 week ago

NetworkOverload commented 1 week ago

I think a better approach to installing user scripts/services in the controller would be to allow the users to create their service in a dedicated git repo and instead of copying the scripts/yang into the controller paths instead provide a clixon cli to register a service which would symlink the repo's yang/python into the controller's paths.

This is the approach I have taken with services I have written, I've been including a shell script to 'install it' which creates the symlinks, but it would be more formal to do it in the Cli where the user could be warned they need to restart the controller.

The other thing that factors in is, our Netgate debian packages require placing paths in different places than the official source code does, so a formal mechanism for registering services would present a uniform experience if other people produce packages also.

NetworkOverload commented 1 week ago

One other comment that factors in here.

We probably only want to register the service main file, I am curious though what the right way to handle a service that may have some separate libraries for various functions. It would have to add the path when it makes the python calls?