diff options
| author | Steve Martinelli <stevemar@ca.ibm.com> | 2014-09-05 12:56:21 -0400 |
|---|---|---|
| committer | Steve Martinelli <stevemar@ca.ibm.com> | 2014-09-15 01:57:54 +0000 |
| commit | 505c784bad14d806dd5911c953eb95fe964d188b (patch) | |
| tree | 7b75a483c213b244856f96c2678a2d192520b875 /openstackclient/object/v1/lib | |
| parent | e47787e12f4ed6f1568527bbc1218fe3edb412e0 (diff) | |
| download | python-openstackclient-505c784bad14d806dd5911c953eb95fe964d188b.tar.gz | |
Add preliminary save container support
Save all objects from a container
implements bp: swift-client
Change-Id: I7f2437236574e212033e63d768929d813289ed05
Diffstat (limited to 'openstackclient/object/v1/lib')
| -rw-r--r-- | openstackclient/object/v1/lib/container.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/openstackclient/object/v1/lib/container.py b/openstackclient/object/v1/lib/container.py index 63711838..4293ff4a 100644 --- a/openstackclient/object/v1/lib/container.py +++ b/openstackclient/object/v1/lib/container.py @@ -21,6 +21,8 @@ try: except ImportError: from urlparse import urlparse # noqa +from openstackclient.object.v1.lib import object as object_lib + def create_container( session, @@ -120,6 +122,23 @@ def list_containers( return session.get(url, params=params).json() +def save_container( + session, + url, + container +): + """Save all the content from a container + + :param session: an authenticated keystoneclient.session.Session object + :param url: endpoint + :param container: name of container to save + """ + + objects = object_lib.list_objects(session, url, container) + for object in objects: + object_lib.save_object(session, url, container, object['name']) + + def show_container( session, url, |
