<html><body>
<p><font size="2" face="sans-serif">While investigating some REST API updates I've discovered that there is a lot of duplicated code across the various OpenStack components.</font><br>
<br>
<font size="2" face="sans-serif">For example, the paginate_query function exists in all these locations and there are a few slight differences between most of them:</font><br>
<br>
<font size="2" face="sans-serif"><a href="https://github.com/openstack/ceilometer/blob/master/ceilometer/openstack/common/db/sqlalchemy/utils.py#L61">https://github.com/openstack/ceilometer/blob/master/ceilometer/openstack/common/db/sqlalchemy/utils.py#L61</a></font><br>
<font size="2" face="sans-serif"><a href="https://github.com/openstack/cinder/blob/master/cinder/openstack/common/db/sqlalchemy/utils.py#L37">https://github.com/openstack/cinder/blob/master/cinder/openstack/common/db/sqlalchemy/utils.py#L37</a></font><br>
<font size="2" face="sans-serif"><a href="https://github.com/openstack/glance/blob/master/glance/openstack/common/db/sqlalchemy/utils.py#L64">https://github.com/openstack/glance/blob/master/glance/openstack/common/db/sqlalchemy/utils.py#L64</a></font><br>
<font size="2" face="sans-serif"><a href="https://github.com/openstack/heat/blob/master/heat/openstack/common/db/sqlalchemy/utils.py#L62">https://github.com/openstack/heat/blob/master/heat/openstack/common/db/sqlalchemy/utils.py#L62</a></font><br>
<font size="2" face="sans-serif"><a href="https://github.com/openstack/keystone/blob/master/keystone/openstack/common/db/sqlalchemy/utils.py#L64">https://github.com/openstack/keystone/blob/master/keystone/openstack/common/db/sqlalchemy/utils.py#L64</a></font><br>
<font size="2" face="sans-serif"><a href="https://github.com/openstack/neutron/blob/master/neutron/openstack/common/db/sqlalchemy/utils.py#L61">https://github.com/openstack/neutron/blob/master/neutron/openstack/common/db/sqlalchemy/utils.py#L61</a></font><br>
<font size="2" face="sans-serif"><a href="https://github.com/openstack/nova/blob/master/nova/openstack/common/db/sqlalchemy/utils.py#L64">https://github.com/openstack/nova/blob/master/nova/openstack/common/db/sqlalchemy/utils.py#L64</a></font><br>
<br>
<font size="2" face="sans-serif">Does anyone know if there is any work going on to move stuff like this into oslo and then deprecate these functions?  There are also many functions that process the REST API request parameters (getting the limit, marker, sort data, etc.) that are also replicated across many components.</font><br>
<br>
<font size="2" face="sans-serif">If no existing work is done in this area, how should this be tackled?  As a blueprint for Juno?</font><br>
<br>
<font size="2" face="sans-serif">Thanks,</font><br>
<br>
<font size="2" face="sans-serif">Steven Kaufer<br>
Cloud Systems Software<br>
kaufer@us.ibm.com     507-253-5104<br>
Dept HMYS / Bld 015-2 / G119 / Rochester, MN 55901</font></body></html>