From 505c784bad14d806dd5911c953eb95fe964d188b Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Fri, 5 Sep 2014 12:56:21 -0400 Subject: Add preliminary save container support Save all objects from a container implements bp: swift-client Change-Id: I7f2437236574e212033e63d768929d813289ed05 --- openstackclient/object/v1/container.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'openstackclient/object/v1/container.py') diff --git a/openstackclient/object/v1/container.py b/openstackclient/object/v1/container.py index 1ca07f3a..5a60a3e8 100644 --- a/openstackclient/object/v1/container.py +++ b/openstackclient/object/v1/container.py @@ -152,6 +152,30 @@ class ListContainer(lister.Lister): ) for s in data)) +class SaveContainer(command.Command): + """Save the contents of a container locally""" + + log = logging.getLogger(__name__ + ".SaveContainer") + + def get_parser(self, prog_name): + parser = super(SaveContainer, self).get_parser(prog_name) + parser.add_argument( + 'container', + metavar='', + help='Container name to save', + ) + return parser + + def take_action(self, parsed_args): + self.log.debug("take_action(%s)", parsed_args) + + lib_container.save_container( + self.app.client_manager.session, + self.app.client_manager.object_store.endpoint, + parsed_args.container + ) + + class ShowContainer(show.ShowOne): """Show container information""" -- cgit v1.2.1