diff --git a/senlinclient/tests/unit/v1/test_action.py b/senlinclient/tests/unit/v1/test_action.py index 80b4d762..60ee62d2 100644 --- a/senlinclient/tests/unit/v1/test_action.py +++ b/senlinclient/tests/unit/v1/test_action.py @@ -74,6 +74,7 @@ class TestActionList(TestAction): ]} defaults = { + 'global_project': False, 'marker': None, 'limit': None, 'sort': None, diff --git a/senlinclient/tests/unit/v1/test_shell.py b/senlinclient/tests/unit/v1/test_shell.py index 1be4874a..2c45d0fb 100644 --- a/senlinclient/tests/unit/v1/test_shell.py +++ b/senlinclient/tests/unit/v1/test_shell.py @@ -1612,6 +1612,7 @@ class ShellTest(testtools.TestCase): 'sort': 'status', 'limit': 20, 'marker': 'marker_id', + 'global_project': True, } queries = copy.deepcopy(args) args = self._make_args(args) diff --git a/senlinclient/v1/action.py b/senlinclient/v1/action.py index 1c4342d5..ba025f0a 100644 --- a/senlinclient/v1/action.py +++ b/senlinclient/v1/action.py @@ -58,6 +58,14 @@ class ListAction(command.Lister): metavar='', help=_('Only return actions that appear after the given action ID') ) + parser.add_argument( + '--global-project', + default=False, + action="store_true", + help=_('Whether actions from all projects should be listed. ' + ' Default to False. Setting this to True may demand ' + 'for an admin privilege') + ) parser.add_argument( '--full-id', default=False, @@ -78,6 +86,7 @@ class ListAction(command.Lister): 'sort': parsed_args.sort, 'limit': parsed_args.limit, 'marker': parsed_args.marker, + 'global_project': parsed_args.global_project, } if parsed_args.filters: diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index b28a036a..bbf4c038 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -1500,6 +1500,10 @@ def do_event_show(service, args): help=_('Limit the number of actions returned.')) @utils.arg('-m', '--marker', metavar='', help=_('Only return actions that appear after the given node ID.')) +@utils.arg('-g', '--global-project', default=False, action="store_true", + help=_('Whether actions from all projects should be listed. ' + ' Default to False. Setting this to True may demand ' + 'for an admin privilege.')) @utils.arg('-F', '--full-id', default=False, action="store_true", help=_('Print full IDs in list.')) def do_action_list(service, args): @@ -1512,6 +1516,7 @@ def do_action_list(service, args): 'sort': args.sort, 'limit': args.limit, 'marker': args.marker, + 'global_project': args.global_project, } if args.filters: