<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 08/12/2013 05:34 PM, Henry Nash
wrote:<br>
</div>
<blockquote
cite="mid:8BC0E8A2-3C25-4379-9D7B-B8059F4B79E4@linux.vnet.ibm.com"
type="cite">Hi
<div><br>
</div>
<div>I'm working on extending the pagination into the backends.
Right now, we handle the pagination in the v3 controller
class....and in fact it is disabled right now and we return the
whole list irrespective of whether page/per-page is set in the
query string, e.g.:</div>
</blockquote>
Pagination is a broken concept. We should not be returning lists so
long that we need to paginate. Instead, we should have query
limits, and filters to refine the queries.<br>
<br>
Some people are doing full user lists against LDAP. I don't need to
tell you how broken that is. Why do we allow user-list at the
Domain (or unscoped level)? <br>
<br>
I'd argue that we should drop enumeration of objects in general, and
certainly limit the number of results that come back. Pagination in
LDAP requires cursors, and thus continuos connections from Keystone
to LDAP...this is not a scalable solution.<br>
<br>
Do we really need this?<br>
<br>
<br>
<blockquote
cite="mid:8BC0E8A2-3C25-4379-9D7B-B8059F4B79E4@linux.vnet.ibm.com"
type="cite">
<div><br>
</div>
<div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom:
0px; margin-left: 0px; font: normal normal normal 10px/normal
Helvetica; "> <span style="color: #063ff4">def</span> <b>paginate</b>(cls,
context, refs):</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom:
0px; margin-left: 0px; font: normal normal normal 10px/normal
Helvetica; color: rgb(0, 179, 57); "><span style="color:
#000000"> </span><i>"""Paginates a list of
references by page & per_page query strings."""</i></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom:
0px; margin-left: 0px; font: normal normal normal 10px/normal
Helvetica; color: rgb(203, 203, 203); "><span style="color:
#000000"> </span># FIXME(<span
style="text-decoration: underline">dolph</span>): client
needs to support pagination first</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom:
0px; margin-left: 0px; font: normal normal normal 10px/normal
Helvetica; "> <span style="color: #063ff4">return</span>
refs</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom:
0px; margin-left: 0px; font: normal normal normal 10px/normal
Helvetica; min-height: 12px; "><br>
</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom:
0px; margin-left: 0px; font: normal normal normal 10px/normal
Helvetica; "> page = context[<span style="color:
#00b339"><i>'query_string'</i></span>].get(<span
style="color: #00b339"><i>'page'</i></span>, <span
style="color: #950f0b">1</span>)</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom:
0px; margin-left: 0px; font: normal normal normal 10px/normal
Helvetica; "> per_page = context[<span style="color:
#00b339"><i>'query_string'</i></span>].get(<span
style="color: #00b339"><i>'per_page'</i></span>, <span
style="color: #950f0b">30</span>)</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom:
0px; margin-left: 0px; font: normal normal normal 10px/normal
Helvetica; "> <span style="color: #063ff4">return</span>
refs[per_page * (page - <span style="color: #950f0b">1</span>):per_page
* page]</div>
</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom:
0px; margin-left: 0px; font: normal normal normal 10px/normal
Helvetica; "><br>
</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom:
0px; margin-left: 0px; font: normal normal normal 10px/normal
Helvetica; "><font class="Apple-style-span" size="3">I wonder
both for the V3 controller (which still needs to handle
pagination for backends that do not support it) and the
backends that do....whether we could use wether 'page' is
defined in the query-string as an indicator as to whether we
should paginate or not? That way clients who can handle it
can ask for it, those that don'twill just get everything. </font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom:
0px; margin-left: 0px; font: normal normal normal 10px/normal
Helvetica; "><font class="Apple-style-span" size="3"><br>
</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom:
0px; margin-left: 0px; font: normal normal normal 10px/normal
Helvetica; "><font class="Apple-style-span" size="3">Henry</font></div>
<div><br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
OpenStack-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>