Share Juju actions output guidelines

Bug #1935004 reported by Alvaro Uria
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Charm Guide
New
Undecided
Unassigned

Bug Description

For environments where the only possible operational access is via the Juju API, Juju actions need to be used to discover the status of services (e.g. their capacity).

It has been informally discussed with several members of the OpenStack Charmers team the benefit of having actions whose output is human-readable by default. A "format" parameter may allow other "results" output format such as yaml or json.

For example:
juju run-action unit/N --format json actionname format=json

Note: please do not confuse the Juju CLI formatting and the action results output format, despite giving the same name to the parameter (--format and format).

It would be beneficial for contributors to find a section in the charm-guide with the guidelines on what Juju actions output should look like (similar to the coding guidelines). Some examples for these guidelines are:
* Human-readable format may generate a table with the fields that have non-empty values (a summarized list of fields could be defined by the Juju action author if some fields don't add any value)
* non-human readable formats (json, yaml) should list all the fields and values (including empty values)
* Human-readable output should not extend more than 80 characters per line.
* A parameter "format" may be optional, always defaulting to the human-readable output

Sample of Juju action without previous agreement of the output format:
* https://review.opendev.org/c/openstack/charm-ceph-mon/+/781714

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.