<div class="gmail_quote">On Fri Nov 28 2014 at 5:58:00 AM Tripp, Travis S <<a href="mailto:travis.tripp@hp.com">travis.tripp@hp.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>Hi Richard,</div>
<div><br>
</div>
<div>You are right, we should put this out on the main ML, so copying thread out to there. ML: FYI that this started after some impromptu IRC discussions about a specific patch led into an impromptu google hangout discussion with all the people on the thread
below.</div></div></blockquote><div><br></div><div>Thanks Travis!</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>As I mentioned in the review[1], Thai and I were mainly discussing the possible performance implications of network hops from client to horizon server and whether or not any aggregation should occur server side. In other words, some views require several
APIs to be queried before any data can displayed and it would eliminate some extra network requests from client to server if some of the data was first collected on the server side across service APIs. For example, the launch instance wizard will need to
collect data from quite a few APIs before even the first step is displayed (I’ve listed those out in the blueprint [2]).<br></div>
<div><br>
</div>
<div>The flip side to that (as you also pointed out) is that if we keep the API’s fine grained then the wizard will be able to optimize in one place the calls for data as it is needed. For example, the first step may only need half of the API calls. It also
could lead to perceived performance increases just due to the wizard making a call for different data independently and displaying it as soon as it can.</div></div></blockquote><div><br></div><div>Indeed, looking at the current launch wizard code it seems like you wouldn't need to load all that data for the wizard to be displayed, since only some subset of it would be necessary to display any given panel of the wizard.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>I tend to lean towards your POV and starting with discrete API calls and letting the client optimize calls. If there are performance problems or other reasons then doing data aggregation on the server side could be considered at that point.</div></div></blockquote><div><br></div><div>I'm glad to hear it. I'm a fan of optimising when necessary, and not beforehand :)</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><div>Of course
if anybody is able to do some performance testing between the two approaches then that could affect the direction taken.<br></div></div></blockquote><div><br></div><div>I would certainly like to see us take some measurements when performance issues pop up. Optimising without solid metrics is bad idea :)</div><div><br></div><div><br></div><div> Richard</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><div></div>
<div><br>
</div>
<div>[1] <a href="https://review.openstack.org/#/c/136676/8/openstack_dashboard/api/rest/urls.py" target="_blank">https://review.openstack.org/#/c/136676/8/openstack_dashboard/api/rest/urls.py</a></div>
<div>[2] <a href="https://blueprints.launchpad.net/horizon/+spec/launch-instance-redesign" target="_blank">https://blueprints.launchpad.net/horizon/+spec/launch-instance-redesign</a></div>
<div><br>
</div>
<div>-Travis</div>
<div><br>
</div>
<span>
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt">
<span style="font-weight:bold">From: </span>Richard Jones <<a href="mailto:r1chardj0n3s@gmail.com" target="_blank">r1chardj0n3s@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Wednesday, November 26, 2014 at 11:55 PM<br>
<span style="font-weight:bold">To: </span>Travis Tripp <<a href="mailto:travis.tripp@hp.com" target="_blank">travis.tripp@hp.com</a>>, Thai Q Tran/Silicon Valley/IBM <<a href="mailto:tqtran@us.ibm.com" target="_blank">tqtran@us.ibm.com</a>>, David Lyle <<a href="mailto:dklyle0@gmail.com" target="_blank">dklyle0@gmail.com</a>>,
Maxime Vidori <<a href="mailto:maxime.vidori@enovance.com" target="_blank">maxime.vidori@enovance.com</a>>, "Wroblewski, Szymon" <<a href="mailto:szymon.wroblewski@intel.com" target="_blank">szymon.wroblewski@intel.com</a>>, "Wood, Matthew David (HP Cloud - Horizon)" <<a href="mailto:matt.wood@hp.com" target="_blank">matt.wood@hp.com</a>>,
"Chen, Shaoquan" <<a href="mailto:sean.chen2@hp.com" target="_blank">sean.chen2@hp.com</a>>, "Farina, Matt (HP Cloud)" <<a href="mailto:matthew.farina@hp.com" target="_blank">matthew.farina@hp.com</a>>, Cindy Lu/Silicon Valley/IBM <<a href="mailto:clu@us.ibm.com" target="_blank">clu@us.ibm.com</a>>, Justin
Pomeroy/Rochester/IBM <<a href="mailto:jpomero@us.ibm.com" target="_blank">jpomero@us.ibm.com</a>>, Neill Cox <<a href="mailto:neill.cox@ingenious.com.au" target="_blank">neill.cox@ingenious.com.au</a>><br>
<span style="font-weight:bold">Subject: </span>Re: REST and Django<br>
</div>
<div><br>
</div>
<div>
<div>I'm not sure whether this is the appropriate place to discuss this, or whether I should be posting to the list under [Horizon] but I think we need to have a clear idea of what goes in the REST API and what goes in the client (angular) code.<br>
<div><br>
</div>
<div>In my mind, the thinner the REST API the better. Indeed if we can get away with proxying requests through without touching any *client code, that would be great.</div>
<div><br>
</div>
<div>Coding additional logic into the REST API means that a developer would need to look in two places, instead of one, to determine what was happening for a particular call. If we keep it thin then the API presented to the client developer is very, very similar
to the API presented by the services. Minimum surprise.</div>
<div><br>
</div>
<div>Your thoughts?</div>
<div></div>
<div><br>
</div>
<div><br>
</div>
<div> Richard</div>
<div><br>
</div>
<br>
<div class="gmail_quote">On Wed Nov 26 2014 at 2:40:52 PM Richard Jones <<a href="mailto:r1chardj0n3s@gmail.com" target="_blank">r1chardj0n3s@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for the great summary, Travis.
<div><br>
</div>
<div>I've completed the work I pledged this morning, so now the REST API change set has:</div>
<div><br>
</div>
<div>- no rest framework dependency</div>
<div>- AJAX scaffolding in openstack_dashboard.api.rest.utils</div>
<div>- code in openstack_dashboard/api/rest/</div>
<div>- renamed the API from "identity" to "keystone" to be consistent</div>
<div>- added a sample of testing, mostly for my own sanity to check things were working</div>
<div><br>
</div>
<div><a href="https://review.openstack.org/#/c/136676" target="_blank">https://review.openstack.org/#/c/136676</a><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div> Richard</div>
<div><br>
<div class="gmail_quote">On Wed Nov 26 2014 at 12:18:25 PM Tripp, Travis S <<a href="mailto:travis.tripp@hp.com" target="_blank">travis.tripp@hp.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>Hello all,</div>
<div><br>
</div>
<div>Great discussion on the REST urls today! I think that we are on track to come to a common REST API usage pattern. To provide quick summary:</div>
<div><br>
</div>
<div>We all agreed that going to a straight REST pattern rather than through tables was a good idea. We discussed using direct get / post in Django views like what Max originally used[1][2] and Thai also started[3] with the identity table rework or to go with
djangorestframework [5] like what Richard was prototyping with[4].</div>
<div><br>
</div>
<div>The main things we would use from Django Rest Framework were built in JSON serialization (avoid boilerplate), better exception handling, and some request wrapping. However, we all weren’t sure about the need for a full new framework just for that. At
the end of the conversation, we decided that it was a cleaner approach, but Richard would see if he could provide some utility code to do that much for us without requiring the full framework. David voiced that he doesn’t want us building out a whole framework
on our own either.</div>
<div><br>
</div>
<div>So, Richard will do some investigation during his day today and get back to us. Whatever the case, we’ll get a patch in horizon for the base dependency (framework or Richard’s utilities) that both Thai’s work and the launch instance work is dependent
upon. We’ll build REST style API’s using the same pattern. We will likely put the rest api’s in horizon/openstack_dashboard/<u></u>api/rest/.</div>
<div><br>
</div>
<div>[1] <a href="https://review.openstack.org/#/c/133178/1/openstack_dashboard/workflow/keypair.py" target="_blank">https://review.openstack.<u></u>org/#/c/133178/1/openstack_<u></u>dashboard/workflow/keypair.py</a></div>
<div>[2] <a href="https://review.openstack.org/#/c/133178/1/openstack_dashboard/workflow/launch.py" target="_blank">https://review.openstack.<u></u>org/#/c/133178/1/openstack_<u></u>dashboard/workflow/launch.py</a></div>
<div>[3] <a href="https://review.openstack.org/#/c/133767/8/openstack_dashboard/dashboards/identity/users/views.py" target="_blank">https://review.openstack.<u></u>org/#/c/133767/8/openstack_<u></u>dashboard/dashboards/identity/<u></u>users/views.py</a></div>
<div>[4] <a href="https://review.openstack.org/#/c/136676/4/openstack_dashboard/rest_api/identity.py" target="_blank">https://review.openstack.<u></u>org/#/c/136676/4/openstack_<u></u>dashboard/rest_api/identity.py</a></div>
<div>[5] <a href="http://www.django-rest-framework.org/" target="_blank">http://www.django-rest-<u></u>framework.org/</a></div>
<div><br>
</div>
<div>Thanks,</div>
<div>Travis</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</span>
</div>
</blockquote></div>