Public bug reported: When listing images, several optional parameters can be used to filter the list of images retrieved by the API, these parameters can be found in the API documentation (http://developer.openstack.org/api-ref- image-v2.html#listImages-v2). As part of those filters, there are two that can be used with date time stamps in the ISO 8601 DateTime notation, these are the created_at and updated_at parameters.
These created_at and updated_at parameters can be used in the following two ways: - Without specifying an operator (which defaults to an eq operator) e.g. /v2/images?created_at=2016-04-18T21:38:55Z Note: This is currently not working, see bug https://bugs.launchpad.net/glance/+bug/1584415 - With an operator (using one of these: eq, new, lt, lte, gt, gte) e.g. /v2/images?created_at=lte:2016-04-18T21:38:55Z This works as documented when run in an OpenStack environment that has the default backend DataBase of Mysql, but if the environment has a Postgresql database the created_at and updated_at filters always return empty lists even when the filter criteria matches existing images. Steps to reproduce: 1) Install a devstack environment with the default db backend (mysql). 2) Try listing the images using the created_at or updated_at parameters, using an operator and using the DateTime stamp of an existing image. Like this: /v2/images?created_at=lte:2016-04-18T21:38:55Z. Expected Results: Glance API should return a list with 1 or more images that match the filter criteria. 3) Install a devstack environment with the postgresql DB backend (https://github.com/openstack-dev/devstack/blob/master/doc/source/configuration.rst#database-backend). 4) Try listing the images again using the same API call used in step 2 against the new environment. Expected Results: Glance API should work the same as with the mysql DB returning a list of 1 or more images that match the filter criteria. Actual Results: An empty list is always returned, even when the filter matches existing images. Extra note: You can also reproduce this bug using the parameters without using an operator but you would need to use the patch https://review.openstack.org/#/c/319682/ that is currently in review. ** Affects: glance Importance: Undecided Status: New -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to Glance. https://bugs.launchpad.net/bugs/1588007 Title: The created_at and updated_at filters don't work with a postgresql db Status in Glance: New Bug description: When listing images, several optional parameters can be used to filter the list of images retrieved by the API, these parameters can be found in the API documentation (http://developer.openstack.org/api-ref- image-v2.html#listImages-v2). As part of those filters, there are two that can be used with date time stamps in the ISO 8601 DateTime notation, these are the created_at and updated_at parameters. These created_at and updated_at parameters can be used in the following two ways: - Without specifying an operator (which defaults to an eq operator) e.g. /v2/images?created_at=2016-04-18T21:38:55Z Note: This is currently not working, see bug https://bugs.launchpad.net/glance/+bug/1584415 - With an operator (using one of these: eq, new, lt, lte, gt, gte) e.g. /v2/images?created_at=lte:2016-04-18T21:38:55Z This works as documented when run in an OpenStack environment that has the default backend DataBase of Mysql, but if the environment has a Postgresql database the created_at and updated_at filters always return empty lists even when the filter criteria matches existing images. Steps to reproduce: 1) Install a devstack environment with the default db backend (mysql). 2) Try listing the images using the created_at or updated_at parameters, using an operator and using the DateTime stamp of an existing image. Like this: /v2/images?created_at=lte:2016-04-18T21:38:55Z. Expected Results: Glance API should return a list with 1 or more images that match the filter criteria. 3) Install a devstack environment with the postgresql DB backend (https://github.com/openstack-dev/devstack/blob/master/doc/source/configuration.rst#database-backend). 4) Try listing the images again using the same API call used in step 2 against the new environment. Expected Results: Glance API should work the same as with the mysql DB returning a list of 1 or more images that match the filter criteria. Actual Results: An empty list is always returned, even when the filter matches existing images. Extra note: You can also reproduce this bug using the parameters without using an operator but you would need to use the patch https://review.openstack.org/#/c/319682/ that is currently in review. To manage notifications about this bug go to: https://bugs.launchpad.net/glance/+bug/1588007/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp