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
RFE: Create machine-readable output option for "stratis ... list" commands #292
Comments
We would like to avoid having anybody commit to parsing the output from the CLI as it stands now w/ anything but their human eyes, that's for sure. One, among many, excellent reasons for this is that the sizes displayed in general do not represent exact values, but a range of values containing a finite, but potentially quite large, set of elements. We're in a different position from a lot of other apps, because the CLI talks to the daemon across the D-Bus. In particular, the information about sizes that is transmitted across the D-Bus is exact, unlike that which is displayed in the CLI (which for formatting reasons is generally inexact). We should anticipate specifying a structured output mode, and responding w/ structured output for every command, not just the list commands, in order to maintain consistency. We should also expect that the structured output should be richer and more exact than the human-reader directed output, since it is unconstrained by the formatting issues that plague human readable output. The implementation of this should be relatively easy; the design of the structured output is the more challenging part. I would like it to be able to be formally validatable, if at at all possible. |
How should we request machine readable output? I like the environment variable approach. |
Blocked by #301. |
See stratis-storage/project#77 (comment) for some remarks about |
I think we should close this. The D-Bus API provides a good programmatic way of getting all the information that the daemon makes available. We can therefore straightforwardly write, e.g., an ansible module directly in Python. If a Stratis user has a reason to want to export information about the engine as structured text, it is very easy to write a small module to do so. If they do it in Python, they can choose to make use of our Python libraries for D-Bus, but as our blackbox tests demonstrate, these are not necessary. If they want to write it in another language, there are facilities for that. In fact, dbus-rs provides some automatic codegen from XML introspection data facilities that might help. So, we should leave it to a Stratis user to find the specific need and implement it, and then we should be happy to support them in their work. |
It would be nice for the "stratis ... list" commands to have a "machine-readable" output option (e.g.: YAML, JSON, TOML, etc.), to allow other programs to interpret the results without resorting to "screen-scraping".
Example output from a stratis pool created on a test device:
The text was updated successfully, but these errors were encountered: