image filtering not available

Bug #1401902 reported by Tim Bell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Medium
Dean Troyer

Bug Description

We use the image filtering facility in glance image-list to select a subset of images based on property key and sort them.

glance image-list --property-filter os=linux --sort-key updated_at

This is especially useful when we want to automatically find the latest image for a particular distribution.

The openstack CLI does not seem to have this equivalent capability.

Revision history for this message
Steve Martinelli (stevemar) wrote :

would you be using v1 or v2 of the image API?

Changed in python-openstackclient:
status: New → Confirmed
Revision history for this message
Tim Bell (tim-bell) wrote :

We are actually using v1 at CERN currently. However, if it is not easy to support both, I would propose to only implement for the v2 API.

DEBUG: openstackclient.shell compute API version 2, cmd group openstack.compute.v2
DEBUG: openstackclient.shell network API version 2, cmd group openstack.network.v2
DEBUG: openstackclient.shell image API version 1, cmd group openstack.image.v1
DEBUG: openstackclient.shell volume API version 1, cmd group openstack.volume.v1
DEBUG: openstackclient.shell identity API version 3, cmd group openstack.identity.v3
DEBUG: openstackclient.shell object_store API version 1, cmd group openstack.object_store.v1

Tim

Revision history for this message
Dean Troyer (dtroyer) wrote :

We should consider establishing the common set of filtering and sorting options here. Since the Python APIs always give us back the entire list in memory at once, filtering and sorting even when the server does not support it is easy and we can add this wherever it makes sense independent of server support.

Changed in python-openstackclient:
status: Confirmed → Triaged
importance: Undecided → Medium
Changed in python-openstackclient:
milestone: none → m8
Revision history for this message
Dean Troyer (dtroyer) wrote :

I'm going linkages wrong somehow: https://review.openstack.org/149066

Changed in python-openstackclient:
assignee: nobody → Dean Troyer (dtroyer)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-openstackclient (master)

Reviewed: https://review.openstack.org/149066
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=61a40343fdbb89a1c6404ab03fcfd84daee31c9e
Submitter: Jenkins
Branch: master

commit 61a40343fdbb89a1c6404ab03fcfd84daee31c9e
Author: Dean Troyer <email address hidden>
Date: Wed Jan 21 15:02:58 2015 -0600

    Add filter to image list

    * Hides previously broken --page-size option
    * Adds --property to image list for filtering on properties
    * Adds Visibility, Protected, Owner, Properties/Tags to --long output
    * Adds api.utils.simple_filter() for selecting matches out of a list
      of objects
    * Adds tests for all of the above
    * Updates image docs

    There are additional filtering options to be added in later reviews.

    Change-Id: I32feff0ad61aae749b33621c817658d7dc90c3aa
    Closes-bug: 1401902

Changed in python-openstackclient:
status: In Progress → Fix Committed
Dean Troyer (dtroyer)
Changed in python-openstackclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.