Make column content can be read by both human and machine

Registered by Rui Chen

Currently, we use utils.format_dict(), utils.format_list(), utils.format_list_of_dicts to make column value can be easy to read by human, but osc support to format the CLI output into several format, like: json, shell, csv, yaml, most of these should be understand by program and code, so keeping the column content as the original value make sense, like {u'name': u'RuiChen'} than name='RuiChen'

And formattable columns had been added into cliff 2.3.0 [1], so now is a good time to implement it in osc side.

[1]: https://review.openstack.org/#/c/330223/
[2]: https://bugs.launchpad.net/python-openstackclient/+bug/1538015
[3]: https://bugs.launchpad.net/python-openstackclient/+bug/1538006
[4]: https://bugs.launchpad.net/python-openstackclient/+bug/1673821

Blueprint information

Status:
Started
Approver:
Dean Troyer
Priority:
Undefined
Drafter:
Rui Chen
Direction:
Needs approval
Assignee:
Rui Chen
Definition:
Approved
Series goal:
None
Implementation:
Good progress
Milestone target:
None
Started by
Rui Chen

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/osc-formattable-columns,n,z

Addressed by: https://review.openstack.org/444760
    Add formattable column base classes

Gerrit topic: https://review.openstack.org/#q,topic:bug/1538015,n,z

Addressed by: https://review.openstack.org/445794
    [Compute]Make column content readable for both human and machine

Gerrit topic: https://review.openstack.org/#q,topic:bug/1687955,n,z

Addressed by: https://review.openstack.org/462150
    Emit warnings to encourage cliff FormattableColumn

Addressed by: https://review.openstack.org/462170
    Use cliff formattable columns in network commands

Addressed by: https://review.openstack.org/464637
    Use cliff formattable columns in identity commands

Addressed by: https://review.openstack.org/464638
    Use cliff formattable columns in image commands

Addressed by: https://review.openstack.org/464639
    Use cliff formattable columns in object storage commands

Addressed by: https://review.openstack.org/464640
    Use cliff formattable columns in volume v1 commands

Addressed by: https://review.openstack.org/464641
    Use cliff formattable columns in volume v2 commands

Gerrit topic: https://review.openstack.org/#q,topic:feature-4.0,n,z

Addressed by: https://review.openstack.org/479463
    Add test methods to compare formattable column values

Addressed by: https://review.openstack.org/493814
    [Compute]Make column content readable for both human and machine

Addressed by: https://review.openstack.org/494181
    Use cliff formattable columns in network commands

Addressed by: https://review.openstack.org/494182
    Use cliff formattable columns in image commands

Addressed by: https://review.openstack.org/494183
    Use cliff formattable columns in volume v1 commands

Addressed by: https://review.openstack.org/494184
    Use cliff formattable columns in volume v2 commands

Addressed by: https://review.openstack.org/494185
    Use cliff formattable columns in object storage commands

Addressed by: https://review.openstack.org/494186
    Use cliff formattable columns in identity commands

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.