Add new option to the 'list' shell command

Manila API that is used by 'list' command is going to support
new key 'share_server_id'.

Partially implements bp add-admin-api-list-shares-for-share-server

Change-Id: I70822d2e6bfc16b8407f3bf917119dcb9a551bf0
This commit is contained in:
vponomaryov 2014-07-21 12:00:07 +03:00
parent 4c550a9534
commit 09b82536c6
2 changed files with 10 additions and 0 deletions

View File

@ -506,6 +506,11 @@ def do_access_list(cs, args):
metavar='<status>',
default=None,
help='Filter results by status')
@utils.arg(
'--share-server-id',
metavar='<share_server_id>',
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,

View File

@ -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')