diff --git a/manilaclient/v1/shell.py b/manilaclient/v1/shell.py index 90e4afd4f..816d8880c 100644 --- a/manilaclient/v1/shell.py +++ b/manilaclient/v1/shell.py @@ -506,6 +506,11 @@ def do_access_list(cs, args): metavar='', default=None, help='Filter results by status') +@utils.arg( + '--share-server-id', + metavar='', + default=None, + help='Filter results by share-server id.') @utils.service_type('share') def do_list(cs, args): """List all NAS shares.""" @@ -514,6 +519,7 @@ def do_list(cs, args): 'all_tenants': all_tenants, 'name': args.name, 'status': args.status, + 'share_server_id': args.share_server_id, } shares = cs.shares.list(search_opts=search_opts) utils.print_list(shares, diff --git a/tests/v1/test_shell.py b/tests/v1/test_shell.py index f2226a340..f6ca552b3 100644 --- a/tests/v1/test_shell.py +++ b/tests/v1/test_shell.py @@ -90,6 +90,10 @@ class ShellTest(utils.TestCase): self.run_command('list --all-tenants=1') self.assert_called('GET', '/shares/detail?all_tenants=1') + def test_list_filter_share_server_id(self): + self.run_command('list --share-server-id=1234') + self.assert_called('GET', '/shares/detail?share_server_id=1234') + def test_show(self): self.run_command('show 1234') self.assert_called('GET', '/shares/1234')