Enable client V1 to download images

Added the CLI option image-download to download an image via API V1.
Based on commit 137b3cf975

Related to bp glance-client-v2

Change-Id: Ie587e208ad7433e468798cd9b1846b4a21e1c4ec
This commit is contained in:
Lars Gellrich
2012-08-13 09:21:58 +00:00
parent d64876424e
commit c24fc93142

View File

@@ -77,6 +77,17 @@ def do_image_show(gc, args):
_image_show(image)
@utils.arg('--file', metavar='<FILE>',
help='Local file to save downloaded image data to. '
'If this is not specified the image data will be '
'written to stdout.')
@utils.arg('id', metavar='<IMAGE_ID>', help='ID of image to download.')
def do_image_download(gc, args):
"""Download a specific image."""
body = gc.images.data(args.id)
utils.save_image(body, args.file)
@utils.arg('--id', metavar='<IMAGE_ID>',
help='ID of image to reserve.')
@utils.arg('--name', metavar='<NAME>',