Support to query cinder resources filter by changes-since

Support to query cinder resources filter by changes-since

Support users can query resources by specifying the time that resources are changed since or/and changed from before, and cinder will return the all which matches condition.

Problem description

Cinder(also other projects, like heat and neutron) API only supports filtering resources by discrete values, even though cinder resources have timestamp fields, users can only query resources operated at given time, not during given period. Users may be interested in resources operated in a specific period for monitoring or statistics purpose but currently they have to retrieve and filter the resources by themselves. This change can bring facility to users and also improve the efficiency of timestamp based query.

Use Cases

In large scale environment, lots of resources were created in system, for tracing the change of resource, user or manage system only need to get those resources which was changed from some time point, instead of querying all resources every time to see which was changed.

Proposed change

  • Introduce two new changes-since and changes-from-before filters for retrieving resources. It accepts one or two timestamps and projects will return resources whose update_at fields are later than or earlier than those timestamps.


As discussed in ‘Problem description’ section, user can retrieve and then filter resources by themselves, but this approach is neither convenient nor efficient. Leaving filtering work to database can utilize the optimization of database engine and also reduce data transmitted from server to client.

Data model impact


REST API impact

List API will accept new query string parameters changes-since or/and changes-from-before. User can pass time to the list API url to retrieve resources operated since or from before a specific time.

  • GET /v3/{project_id}/volumes/{detail}?changes-since=2016-01-01T01:00:00&changes-from-before=2016-12-01T01:00:00

Security impact


Notifications impact


Other end user impact

Python client may add help to inform users this new filter. Python client support dynamic assigning search fields so it is easy for it to support this new filter.

Performance Impact

As discussed in ‘Alternatives’ section, performance can be improved for timestamp based query by utilizing database engine. Additional, it also can add index to improve querying performance.

Other deployer impact


Developer impact




Primary assignee:


Work Items

  • Add API filter

  • Add querying support in sql

  • Add related test




  1. Unit test to test if those filters can be correctly applied.

  2. Tempest test if change filter work correctly from API perspective.

Documentation Impact

  1. The cinder API documentation will need to be updated to reflect the REST API changes.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

cinder-specs 0.0.1.dev525