<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Thanks for your feedback.<br><br>Sandy, thank you for the link. I agree that the .start/.end<br>notification pattern that you propose seems to be the most appropriate<br>to monitor actions launched through the Horizon dashboard.<br><br>In the case of .start/.end notifications, the decorator should do the<br>job and has the advantage of being less intrusive than the function<br>call. Specific notifications may then be sent through ad-hoc<br>functions.<br><br>Lance, I agree with you that generic notification patterns should be<br>moved to Oslo-incubator. While Keystone's `notifications.py` module<br>implements the CrUD pattern, I believe that the .start/.end pattern<br>makes more sense in the case of Horizon.<br><br>I'll try and propose a generic .start/.end pattern implementation to<br>the Oslo-incubator, that will be based on Keystone's decorator<br>implementation.<br><br>Regards,<br>Florent Flament<br></div><div><br></div><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Lance D Bragstad" <ldbragst@us.ibm.com><br><b>To: </b>"OpenStack Development Mailing List (not for usage questions)" <openstack-dev@lists.openstack.org><br><b>Sent: </b>Monday, November 25, 2013 6:21:55 PM<br><b>Subject: </b>Re: [openstack-dev] Adding notifications to Horizon<br><div><br></div>
<p><tt><span style="font-size: small;" data-mce-style="font-size: small;" size="2">Sandy Walsh <sandy.walsh@rackspace.com> wrote on 11/25/2013 10:30:05 AM:<br>
<br>
> From: Sandy Walsh <sandy.walsh@rackspace.com></span></tt><br>
<tt><span style="font-size: small;" data-mce-style="font-size: small;" size="2">> To: <openstack-dev@lists.openstack.org>, </span></tt><br>
<tt><span style="font-size: small;" data-mce-style="font-size: small;" size="2">> Date: 11/25/2013 10:34 AM</span></tt><br>
<tt><span style="font-size: small;" data-mce-style="font-size: small;" size="2">> Subject: Re: [openstack-dev] Adding notifications to Horizon</span></tt><br>
<tt><span style="font-size: small;" data-mce-style="font-size: small;" size="2">> <br>
> +1 on the inline method. It makes it clear when a notification should be<br>
> emitted and, as you say, handles the exception handling better.</span></tt><br>
<br>
<tt><span style="font-size: small;" data-mce-style="font-size: small;" size="2">This might be a good opportunity to add the decorator from Keystone's </span></tt><br>
<tt><span style="font-size: small;" data-mce-style="font-size: small;" size="2">notification module to Oslo-incubator, and recycle some of that code.</span></tt><br>
<br>
<a href="https://github.com/openstack/keystone/blob/master/keystone/notifications.py#L26" target="_blank"><span style="color: #0000ff; font-family: serif; font-size: medium;" data-mce-style="color: #0000ff; font-family: serif; font-size: medium;" color="#0000FF" face="serif" size="3"><span style="text-decoration: underline;" data-mce-style="text-decoration: underline;">https://github.com/openstack/keystone/blob/master/keystone/notifications.py#L26</span></span></a><span style="font-family: serif; font-size: medium;" data-mce-style="font-family: serif; font-size: medium;" face="serif" size="3"> </span><br>
<br>
<tt><span style="font-size: small;" data-mce-style="font-size: small;" size="2">I know some projects may require more information to be sent in the event payload: </span></tt><br>
<a href="https://github.com/openstack/nova/blob/master/nova/compute/api.py#L783" target="_blank"><span style="color: #0000ff; font-family: serif; font-size: medium;" data-mce-style="color: #0000ff; font-family: serif; font-size: medium;" color="#0000FF" face="serif" size="3"><span style="text-decoration: underline;" data-mce-style="text-decoration: underline;">https://github.com/openstack/nova/blob/master/nova/compute/api.py#L783</span></span></a><span style="font-family: serif; font-size: medium;" data-mce-style="font-family: serif; font-size: medium;" face="serif" size="3"> </span><br>
<br>
<tt><span style="font-size: small;" data-mce-style="font-size: small;" size="2">but a general case (like Keystone) that requires only a UUID of the resource </span></tt><br>
<tt><span style="font-size: small;" data-mce-style="font-size: small;" size="2">and the type of action being created, the current decorator does this pretty well.</span></tt><br>
<a href="https://github.com/openstack/keystone/blob/master/keystone/assignment/core.py#L66" target="_blank"><span style="color: #0000ff; font-family: serif; font-size: medium;" data-mce-style="color: #0000ff; font-family: serif; font-size: medium;" color="#0000FF" face="serif" size="3"><span style="text-decoration: underline;" data-mce-style="text-decoration: underline;">https://github.com/openstack/keystone/blob/master/keystone/assignment/core.py#L66</span></span></a><span style="font-family: serif; font-size: medium;" data-mce-style="font-family: serif; font-size: medium;" face="serif" size="3"> </span><br>
<br>
<tt><span style="font-size: small;" data-mce-style="font-size: small;" size="2">If this is the direction of event notifications in Horizon, it would be nice to </span></tt><br>
<tt><span style="font-size: small;" data-mce-style="font-size: small;" size="2">settle on one implementation.</span></tt><br>
<tt><span style="font-size: small;" data-mce-style="font-size: small;" size="2"><br>
> <br>
> Also, if it makes sense for Horizon, consider bracketing long-running<br>
> operations in .start/.end pairs. This will help with performance tuning<br>
> and early error detection.<br>
> <br>
> More info on "well behaved notifications" in here:<br>
> <a href="http://www.sandywalsh.com/2013/09/notification-usage-in-openstack-report.html" target="_blank">http://www.sandywalsh.com/2013/09/notification-usage-in-openstack-report.html</a><br>
> <br>
> Great to see!<br>
> <br>
> -S<br>
> <br>
> <br>
> On 11/25/2013 11:58 AM, Florent Flament wrote:<br>
> > Hi,<br>
> > <br>
> > I am interested in adding AMQP notifications to the Horizon dashboard,<br>
> > as described in the following blueprint:<br>
> > <a href="https://blueprints.launchpad.net/horizon/+spec/horizon-notifications" target="_blank">https://blueprints.launchpad.net/horizon/+spec/horizon-notifications</a><br>
> > <br>
> > There are currently several implementations in Openstack. While<br>
> > Nova and Cinder define `notify_about_*` methods that are called<br>
> > whenever a notification has to be sent, Keystone uses decorators,<br>
> > which send appropriate notifications when decorated methods are<br>
> > called.<br>
> > <br>
> > I fed the blueprint's whiteboard with an implementation proposal,<br>
> > based on Nova and Cinder implementation. I would be interested in<br>
> > having your opinion about which method would fit best, and whether<br>
> > these notifications make sense at all.<br>
> > <br>
> > Cheers,<br>
> > Florent Flament<br>
> > <br>
> > _______________________________________________<br>
> > OpenStack-dev mailing list<br>
> > OpenStack-dev@lists.openstack.org<br>
> > <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
> > <br>
> <br>
> _______________________________________________<br>
> OpenStack-dev mailing list<br>
> OpenStack-dev@lists.openstack.org<br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
> <br>
</span></tt><br>
<span style="font-family: sans-serif; font-size: small;" data-mce-style="font-family: sans-serif; font-size: small;" face="sans-serif" size="2"><br>
<br>
Best Regards, <br>
<br>
Lance Bragstad <br>
</span><br>_______________________________________________<br>OpenStack-dev mailing list<br>OpenStack-dev@lists.openstack.org<br>http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev<br></p></div><div><br></div></div></body></html>