diff options
| author | JIHOJU <jihoju96@gmail.com> | 2021-10-11 15:43:55 +0900 |
|---|---|---|
| committer | Stephen Finucane <stephenfin@redhat.com> | 2022-04-19 11:17:03 +0000 |
| commit | 10835a1886301d36ee77f0221b7b87476fe312cf (patch) | |
| tree | 3ce6a30a6fe22d0361ac7e3f84e82015cd543703 /openstackclient/compute/v2 | |
| parent | dabaec5a7b1b9786a8f91eebef738bf755faf059 (diff) | |
| download | python-openstackclient-10835a1886301d36ee77f0221b7b87476fe312cf.tar.gz | |
Add more filter option of columns for server list -c COLUMN
In order to improve the convenient of use,
columns corresponding to the "--long" option has been added
so that it can be used in the filter.
Currently filterable columns include the following:
'ID', 'Name', 'Status', 'Networks', 'Image', 'Flavor'.
Story: 2009150
Task: 43113
Change-Id: I6760ca5da0e3707d1d746ae5eeec7d9162020d15
Diffstat (limited to 'openstackclient/compute/v2')
| -rw-r--r-- | openstackclient/compute/v2/server.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index 69aaa3c5..4fe6590d 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -2458,6 +2458,27 @@ class ListServer(command.Lister): if c in ('Security Groups', 'security_groups'): columns += ('security_groups_name',) column_headers += ('Security Groups',) + if c in ("Task State", "task_state"): + columns += ('OS-EXT-STS:task_state',) + column_headers += ('Task State',) + if c in ("Power State", "power_state"): + columns += ('OS-EXT-STS:power_state',) + column_headers += ('Power State',) + if c in ("Image ID", "image_id"): + columns += ('Image ID',) + column_headers += ('Image ID',) + if c in ("Flavor ID", "flavor_id"): + columns += ('Flavor ID',) + column_headers += ('Flavor ID',) + if c in ('Availability Zone', "availability_zone"): + columns += ('OS-EXT-AZ:availability_zone',) + column_headers += ('Availability Zone',) + if c in ('Host', "host"): + columns += ('OS-EXT-SRV-ATTR:host',) + column_headers += ('Host',) + if c in ('Properties', "properties"): + columns += ('Metadata',) + column_headers += ('Properties',) # convert back to tuple column_headers = tuple(column_headers) |
