Build something generic to expose python code to the cli
Problem description
All cli calls have to manually added to a bash file and it is becoming a bit dirty. There should be something more generic to use to make our life a bit easier.
(potential inspiration: https://github.com/openvstorage/openvstorage-health-check/blob/master/ovs/extensions/healthcheck/expose_to_cli.py#L57 + https://github.com/openvstorage/openvstorage-health-check/blob/master/ovs/extensions/healthcheck/expose_to_cli.py#L44)
Can't we leverage Swagger (and its toolset) for this? Also see https://github.com/openvstorage/home/issues/28.
Exposing python code should always be done through the API.
Swagger is a just a description for our API. None of the CLI calls do something that the current API is capable of. All current CLI calls execute some python code in the background (ovs config get returns Configuration.get etc) The idea is just decorating these methods and allow the cli to provide the functions arguments.
Eventually we will want to turn our API into a CLI also. So for the long run it might be an option to turn the current CLI options into an action that can be executed by the API.
Yes, that would be nice to have, but there should still be something to expose additional, non-api stuff through the cli
What do you see as use case for calls which should be doable through CLI but not through the API?
Most of these: https://github.com/openvstorage/framework/blob/develop/scripts/system/ovs#L24
The integration of the CLI in the Healthcheck might be a solution here. Related PR: https://github.com/openvstorage/openvstorage-health-check/pull/447