From e719b30c02c45cb6a31f39bd454523e4f5c41501 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Mon, 4 Mar 2024 15:52:38 +0100 Subject: [PATCH] Support filtering amphora list by image ID This adds a --image-id parameter to the amphora list command so that one can filter based on image. This can be useful when doing rotations and only listing those running the old image. Change-Id: I30fb59ecbe4411b4d4eec3085ba393b2e48c3c6a --- octaviaclient/osc/v2/amphora.py | 6 ++++++ octaviaclient/osc/v2/utils.py | 1 + 2 files changed, 7 insertions(+) diff --git a/octaviaclient/osc/v2/amphora.py b/octaviaclient/osc/v2/amphora.py index 7deb3d0..acf81b0 100644 --- a/octaviaclient/osc/v2/amphora.py +++ b/octaviaclient/osc/v2/amphora.py @@ -62,6 +62,12 @@ class ListAmphora(lister.Lister): help="Filter by amphora provisioning status." ) + parser.add_argument( + '--image-id', + metavar='', + help="Filter by image ID.", + ) + parser.add_argument( '--long', action='store_true', diff --git a/octaviaclient/osc/v2/utils.py b/octaviaclient/osc/v2/utils.py index 3d93a7c..8015ecd 100644 --- a/octaviaclient/osc/v2/utils.py +++ b/octaviaclient/osc/v2/utils.py @@ -578,6 +578,7 @@ def get_amphora_attrs(client_manager, parsed_args): 'compute_id': ('compute_id', str), 'role': ('role', str), 'status': ('status', str), + 'image_id': ('image_id', str), } return _map_attrs(vars(parsed_args), attr_map)