Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Please check the below code snippet to get size of image in OpenStack liberty.

from glanceclient import Client

OS_IMAGE_ENDPOINT = 'http://16.164.217.124:9292' OS_AUTH_TOKEN = '6aec4894efbc474d93b6ed139d023ad0'

glance = Client('1', endpoint=OS_IMAGE_ENDPOINT, token=OS_AUTH_TOKEN) images = glance.images.list() for image in images: image_dict = image.to_dict() print image_dict['size']

Please check the below code snippet to get size of image in OpenStack liberty.

from glanceclient import Clienthttp://pastebin.com/5Gr2DBm6

OS_IMAGE_ENDPOINT = 'http://16.164.217.124:9292' OS_AUTH_TOKEN = '6aec4894efbc474d93b6ed139d023ad0'

glance = Client('1', endpoint=OS_IMAGE_ENDPOINT, token=OS_AUTH_TOKEN) images = glance.images.list() for image in images: image_dict = image.to_dict() print image_dict['size']