tdviet / fedcloudclient

EGI FedCloud Client
https://fedcloudclient.fedcloud.eu
MIT License
8 stars 10 forks source link

Pluggable output formatters #140

Open tdviet opened 2 years ago

tdviet commented 2 years ago

fedcloud client already provides output in different formats: text, JSON, YAML. However, there are requests to provide different output formats, e.g. bash shell, CSV, Terraform. Developing and maintaining all formatters in the main code of fedcloud client is not feasible, therefore, it would be better to make the formatter pluggable.

The design is as follows:

EGI-ILM commented 2 years ago

Thanks for splitting the original issue. The formatters as "pluggable" components is a good idea.

Some ideas for the discussion, in case you can take them into consideration:

/fedcloudclient/formatters/
     | table
     | json
     | yaml
     | terraform

An idea is: when using -f terraform the unformatted output is sent to the formatter with name "formatters/terraform" for formatting.