diff --git a/manilaclient/api_versions.py b/manilaclient/api_versions.py index 73601af29..de0014b26 100644 --- a/manilaclient/api_versions.py +++ b/manilaclient/api_versions.py @@ -27,7 +27,7 @@ from manilaclient import utils LOG = logging.getLogger(__name__) -MAX_VERSION = '2.92' +MAX_VERSION = '2.93' MIN_VERSION = '2.0' DEPRECATED_VERSION = '1.0' _VERSIONED_METHOD_MAP = {} diff --git a/manilaclient/osc/v2/services.py b/manilaclient/osc/v2/services.py index 4206dcac9..757eeca4f 100644 --- a/manilaclient/osc/v2/services.py +++ b/manilaclient/osc/v2/services.py @@ -138,6 +138,13 @@ class ListShareService(command.Lister): default=None, help=_("Filter services by their availability zone."), ) + parser.add_argument( + "--ensuring", + metavar="", + choices=['True', 'False'], + default=None, + help=_("Filter services running ensure shares or not."), + ) return parser def take_action(self, parsed_args): @@ -150,6 +157,14 @@ class ListShareService(command.Lister): 'state': parsed_args.state, 'zone': parsed_args.zone, } + if parsed_args.ensuring: + if share_client.api_version < api_versions.APIVersion("2.93"): + raise exceptions.CommandError( + "Filtering services whether they are running ensure " + "shares or not is only supported by manila API version " + ">= 2.93" + ) + search_opts['ensuring'] = parsed_args.ensuring services = share_client.services.list(search_opts=search_opts) @@ -164,7 +179,7 @@ class ListShareService(command.Lister): ] if share_client.api_version >= api_versions.APIVersion("2.83"): columns.append('Disabled Reason') - if share_client.api_version >= api_versions.APIVersion("2.86"): + if share_client.api_version >= api_versions.APIVersion("2.93"): columns.append('Ensuring') data = ( diff --git a/releasenotes/notes/add-ensuring-filter-for-services-eedbead009d3505f.yaml b/releasenotes/notes/add-ensuring-filter-for-services-eedbead009d3505f.yaml new file mode 100644 index 000000000..3f560b6c1 --- /dev/null +++ b/releasenotes/notes/add-ensuring-filter-for-services-eedbead009d3505f.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + It is now possible to filter services that have their status set to + `ensuring` with a new option in the `service list` command.