<div dir="ltr"><div>Whoow, just missed a couple of days I see... thanks everybody for your already given support!! I will discuss this also with my colleague on Monday. And I must say I'm impressed about all the fedback! This could be indeed a very nice extension to oVirt, because I guess we are not the only ones who are in need of this or will be in the future.<br></div>Thanks again!<br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-10-31 22:51 GMT+01:00 Yair Zaslavsky <span dir="ltr"><<a href="mailto:yzaslavs@redhat.com" target="_blank">yzaslavs@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
----- Original Message -----<br>
> From: "Einav Cohen" <<a href="mailto:ecohen@redhat.com">ecohen@redhat.com</a>><br>
> To: "Vojtech Szocs" <<a href="mailto:vszocs@redhat.com">vszocs@redhat.com</a>><br>
> Cc: "Oved Ourfali" <<a href="mailto:ovedo@redhat.com">ovedo@redhat.com</a>>, <a href="mailto:users@ovirt.org">users@ovirt.org</a><br>
</span><span class="">> Sent: Friday, October 31, 2014 9:01:34 PM<br>
> Subject: Re: [ovirt-users] webhook<br>
><br>
</span><span class="">> > ----- Original Message -----<br>
> > From: "Vojtech Szocs" <<a href="mailto:vszocs@redhat.com">vszocs@redhat.com</a>><br>
> > Sent: Friday, October 31, 2014 11:51:53 AM<br>
> ><br>
> > Hi,<br>
> ><br>
> > if I get this correctly, you'd like to be notified when certain event<br>
> > happens (VM created/deleted/etc.) and react upon that. I see multiple<br>
> > possible approaches here:<br>
> ><br>
> > 0, improve Engine extension API (refer to Alon Bar-Lev for details)<br>
> > - if extensions can be packaged as JARs and these JARs could include<br>
> > web fragments [1] it would mean the possibility to deploy custom<br>
> > servlets onto existing Engine instance (in context of webapp that<br>
> > processes extensions)<br>
> > - your custom Java servlet could query REST interface (or be notified<br>
> > once something happens, but AFAIK we don't have that implemented yet)<br>
> > and do whatever logic is needed<br>
> > - once I asked Alon about ^^ but never got response from him<br>
> > - IMHO this would be a nice way to deploy custom Java code on Engine<br>
<br>
</span>Please allow me to step in as someone who worked on the extensions API as well,<br>
There are more "missing bits" here.<br>
You are referring to the "webapp side", but this is not enough.<br>
We have also the engine side which has to become more pluggable.<br>
In addition, we will probably need to handle all kinds of issues that rise from our singletons at engine - class loading might be an issue here, no?<br>
You don't want the "X-ton" (doubleton, tripleton, etc..) phenomena in your setup - you don't want for example X instances of AsyncTaskManager.<br>
I think that in general we should strive to turn engine into way more pluggable/modular than it is now, imagine an "engine microkernel" (for those of you who did not hear the term microkernel, I am referring you to jboss architecture) - we should have a "thin microkernel" and the rest of the code should be pluggable, using the extension API (and perhaps web fragments as well).<br>
What do you think?<br>
<div class="HOEnZb"><div class="h5"><br>
> ><br>
> > [1] <a href="https://blogs.oracle.com/swchan/entry/servlet_3_0_web_fragment" target="_blank">https://blogs.oracle.com/swchan/entry/servlet_3_0_web_fragment</a><br>
> ><br>
> > 1, improve UI plugin API<br>
> > - add "VirtualMachineDataLoaded" event fired upon each refresh of<br>
> > VM data in UI table (generalization -> "{Entity}DataLoaded")<br>
> > - this is similar to existing "{Entity}SelectionChange" events<br>
><br>
> relying on changes in the UI table is a bad idea:<br>
><br>
> (1) potentially missing events:<br>
> the UI displays paginated data; if my VMs are sorted by name, and<br>
> I have 1000 VMs in my setup, and I just added a VM named "z", it will<br>
> be added to the last "page" which is not displayed right now, so I<br>
> wouldn't even be aware that something was added.<br>
><br>
> (2) potentially "creating" "fake" events:<br>
> changes in the displayed data in the UI can occur due to change in the<br>
> Search query; if I have 50 VMs in my setup, and I initially had the<br>
> "Vms:" search query, and now I change it to "VMs: name = a*", which<br>
> results in displaying only 10 VMs, this may falsely hint on removal<br>
> of 40 VMs from the system.<br>
><br>
> ><br>
> > 2, write UI plugin that uses oVirtJS to periodically check VM events<br>
><br>
> not sure if this is referring to VM-related events in the code (e.g.<br>
> hooking to the click on "OK" within the New VM / Remove VM dialog,<br>
> or hooking to the "Success" callback of the action response, or<br>
> something similar), or to the VM-related "Events" (i.e. the ones that<br>
> are displayed in the GUI within the Events main-tab / bottom section).<br>
> If the former: can be done, I assume, though not sure how complex it<br>
> would be to implement the infrastructure for that.<br>
> If the latter: this will "catch" actions that were performed either<br>
> via the GUI or outside the GUI; in this case, it would probably be<br>
> better to use an Engine extension API (solution "0" above) rather<br>
> than a UI plugin, since it will be more reliable, will be active<br>
> even when the GUI is not in use, etc.<br>
><br>
> ><br>
> > The disadvantage of 1, and 2, is that WebAdmin GUI must be open.<br>
> > In any case, if you'd like to explore the possibility of doing this<br>
> > via UI plugin, I'm here to help.<br>
> ><br>
> > Vojtech<br>
> ><br>
> ><br>
> > ----- Original Message -----<br>
> > > From: "Oved Ourfali" <<a href="mailto:ovedo@redhat.com">ovedo@redhat.com</a>><br>
> > > To: "Yair Zaslavsky" <<a href="mailto:yzaslavs@redhat.com">yzaslavs@redhat.com</a>><br>
> > > Cc: "Koen Vanoppen" <<a href="mailto:vanoppen.koen@gmail.com">vanoppen.koen@gmail.com</a>>, <a href="mailto:users@ovirt.org">users@ovirt.org</a>, "Vojtech<br>
> > > Szocs" <<a href="mailto:vszocs@redhat.com">vszocs@redhat.com</a>><br>
> > > Sent: Thursday, October 30, 2014 2:10:12 PM<br>
> > > Subject: Re: [ovirt-users] webhook<br>
> > ><br>
> > > Hi<br>
> > ><br>
> > > CC-ing also Vojtech, the "father" of the UI plugins.<br>
> > ><br>
> > > Anyway, the only way to accomplish that via UI plugins at the moment is<br>
> > > via<br>
> > > adding a new "action menu item", that in the background deleted the VM,<br>
> > > and<br>
> > > reports to Foreman.<br>
> > > I would be nice to have a "hook" for different UI action items, but it<br>
> > > isn't<br>
> > > available at the moment.<br>
> > > There are plenty code samples for UI plugins, most of them available at:<br>
> > > <a href="http://www.ovirt.org/Features/UIPlugins" target="_blank">http://www.ovirt.org/Features/UIPlugins</a><br>
> > ><br>
> > > I must say that I'm not sure webhooks are the right approach for that, as<br>
> > > I<br>
> > > guess it is relevant only in environments in which one doesn't use the<br>
> > > API/CLI/SDK....<br>
> > > but.. it will be a cool feature!<br>
> > ><br>
> > > Regards,<br>
> > > Oved<br>
> > ><br>
> > > ----- Original Message -----<br>
> > > > From: "Yair Zaslavsky" <<a href="mailto:yzaslavs@redhat.com">yzaslavs@redhat.com</a>><br>
> > > > To: "Koen Vanoppen" <<a href="mailto:vanoppen.koen@gmail.com">vanoppen.koen@gmail.com</a>><br>
> > > > Cc: "Oved Ourfali" <<a href="mailto:ovedo@redhat.com">ovedo@redhat.com</a>>, <a href="mailto:users@ovirt.org">users@ovirt.org</a><br>
> > > > Sent: Thursday, October 30, 2014 1:44:38 PM<br>
> > > > Subject: Re: [ovirt-users] webhook<br>
> > > ><br>
> > > > Oved - can we implement something like this using ui-plugins?<br>
> > > ><br>
> > > ><br>
> > > > ----- Original Message -----<br>
> > > > > From: "Koen Vanoppen" <<a href="mailto:vanoppen.koen@gmail.com">vanoppen.koen@gmail.com</a>><br>
> > > > > To: <a href="mailto:users@ovirt.org">users@ovirt.org</a><br>
> > > > > Sent: Monday, October 27, 2014 4:06:40 PM<br>
> > > > > Subject: [ovirt-users] webhook<br>
> > > > ><br>
> > > > > Hi all,<br>
> > > > ><br>
> > > > > Just a quick question. Is it possible to set a webhook on the removal<br>
> > > > > and<br>
> > > > > creation of a new vm? So we can send to foreman a delete action when<br>
> > > > > the<br>
> > > > > VM<br>
> > > > > is deleted...<br>
> > > > ><br>
> > > > > Kind regards,<br>
> > > > ><br>
> > > > > Koen<br>
> > > > ><br>
> > > > > _______________________________________________<br>
> > > > > Users mailing list<br>
> > > > > <a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
> > > > > <a href="http://lists.ovirt.org/mailman/listinfo/users" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
> > > > ><br>
> > > > _______________________________________________<br>
> > > > Users mailing list<br>
> > > > <a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
> > > > <a href="http://lists.ovirt.org/mailman/listinfo/users" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
> > > ><br>
> > ><br>
> > _______________________________________________<br>
> > Users mailing list<br>
> > <a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
> > <a href="http://lists.ovirt.org/mailman/listinfo/users" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
> ><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
> <a href="http://lists.ovirt.org/mailman/listinfo/users" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>