Both the get_images() and
get_images_detailed() methods take query
parameters that serve to filter the returned list of images.
When calling, simply pass an optional dictionary to the method containing the filters by which you wish to limit results, with the filter keys being one or more of the below:
name: NAMEFilters images having a
nameattribute matchingNAME.container_format: FORMATFilters images having a
container_formatattribute matchingFORMATdisk_format: FORMATFilters images having a
disk_formatattribute matchingFORMATstatus: STATUSFilters images having a
statusattribute matchingSTATUSsize_min: BYTESFilters images having a
sizeattribute greater than or equal toBYTESsize_max: BYTESFilters images having a
sizeattribute less than or equal toBYTES
Here's a quick example that will return all images less than or equal to 5G in size and in the `saving` status.
from glance.client import Client
c = Client("glance.example.com", 9292)
filters = {'status': 'saving', 'size_max': (5 * 1024 * 1024 * 1024)} print c.get_images_detailed(filters=filters)
