OpenStack Swift List Columns

405 Views Asked by At

How can I have the OpenStack Swift cli list the columns in the output for the swift list like swift list --lh?

I currently see the following

user@server1:~$ swift list --lh      
164006  30G 2020-03-28 02:32:33 backups1
54637 8.1G 2019-10-09 03:00:02 backups2
46549 1.8G 2020-02-26 21:30:03 backups3
 258K  40G

I'd be interested in any official documentation that would state the columns as well.

1

There are 1 best solutions below

3
larsks On

The openstack container list command produces different output that potentially has what you want:

$ openstack container list --long
+------------+-------+-------+
| Name       | Bytes | Count |
+------------+-------+-------+
| container0 |     0 |     0 |
+------------+-------+-------+

You can ask for output in CSV, JSON, YAML, or raw values (using the -f option), and you can request specific columns using -c:

$ openstack container list --long -f yaml -c Name -c Count
- Count: 0
  Name: container0