Re: [Users] adding scripts

2014-03-21 Thread Vojtech Szocs


- Original Message -
> From: "Alexander Wels" 
> To: "R P Herrold" 
> Cc: "aditya mamidwar" , "oVirt Users ML" 
> 
> Sent: Friday, March 21, 2014 3:58:20 PM
> Subject: Re: [Users] adding scripts
> 
> On Friday, March 21, 2014 10:43:27 AM R P Herrold wrote:
> > the threading is not clear to me, and I hope I have the
> > attributions correct
> > 
> > On Fri, 21 Mar 2014, Greg Sheremeta wrote:
> > >> From: "aditya mamidwar" 
> > >> 
> > >> To: aw...@redhat.com, engine-de...@ovirt.org, users@ovirt.org
> > >> Sent: Friday, March 21, 2014 6:14:01 AM
> > >> Subject: Re: [Users] [Engine-devel] adding scripts
> > >> 
> > >> am thus facing following difficulties:
> > >> 
> > >> 1 : i wrote the required code using in bash scripting,
> > >> which i wish to invoke after a click of button in the
> > >> ovirt-portal. (which does not seem to be possible). can you
> > >> help on that? which programming language should i use, and
> > >> how that file should be invoked.
> > 
> > [I think Greg said:]
> > 
> > > This needs to be done in Java. You'll need to read up on
> > > oVirt's UI Plugin infrastructure, which Einav and others
> > > mentioned below. No, you cannot write a bash script and have
> > > a button click in oVirt invoke that.
> > 
> > Reading this:
> > http://www.ovirt.org/VDSM-Hooks
> > it states as a pull quote:
> > 
> > The hooks reside on every host in
> > /usr/libexec/vdsm/hooks/ A hook can be any executable
> > (bash/python/perl/binary/etc).
> > 
> > and then at:
> > http://www.ovirt.org/Features/UIPlugins
> > 
> > UI plugins integrate with WebAdmin directly on the
> > client (web browser) using JavaScript programming language.
> > Plugin invocation is driven by WebAdmin and happens right
> > within the context of browser's JavaScript runtime, using
> > JavaScript language as the lowest common denominator between
> > WebAdmin (GWT) and individual plugins. UI plugins can take
> > full advantage of JavaScript language and its rich ecosystem
> > of libraries. There are no specific rules on how to implement
> > UI plugins, plugin API is designed to be simple and not to get
> > in developer's way, regardless of how a developer chooses to
> > write the plugin
> > 
> > 
> > 
> > I thought I understood the model, but have gotten confused.
> > Iam left with two questions:
> > 
> > 1. is the plugin to be Java or JavaScript? (I think the answer
> > is the latter)
> > 
> 
> Javascript. But remember the UI plugins are running javascript in your
> browser, and don't directly communicate with VDSM.

Yes, this is an important point. Typically, you invoke operations on hosts 
through Engine's REST API.

As Alex mentioned below, you can also install custom VDSM hooks, these are 
invoked at certain points of VM lifecycle: http://www.ovirt.org/VDSM-Hooks

> 
> > 2. is there a constraint as to implementation language, or
> > not. I think a JS wrapper can call whatever it wishes, but
> > this is not clear to me
> > 
> > Thank you
> > 
> > -- Russ herrold
> 
> Note the VDSM hooks have nothing to do with the UI plugins. The VDSM hooks
> alter the way VDSM works. The UI plugins alter the way the UI works. The
> engine sits in between the UI and VDSM. Basically the UI issues a command to
> the engine, then the engine issues a command to VDSM.
> 
> For UI plugins it is easiest to communicate with the engine using the REST
> api. So your instance your UI plugin has a button, which when you click it
> issues a REST api call. The REST api call is part of the engine. The engine
> creates a command based on the URL and parameters of the REST call and uses
> that command to make a call to VDSM. Once the call reaches VDSM then the VDSM
> hooks come into play.
> 
> So I don't entirely understand what you are trying to do, but you might have
> to write some code in the engine to create the appropriate command to pass to
> VDSM. In addition to the UI plugin and the VDSM hook.
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
> 
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] adding scripts

2014-03-21 Thread Vojtech Szocs


- Original Message -
> From: "R P Herrold" 
> To: "oVirt Users ML" 
> Cc: "aditya mamidwar" 
> Sent: Friday, March 21, 2014 3:43:27 PM
> Subject: [Users] adding scripts
> 
> 
> the threading is not clear to me, and I hope I have the
> attributions correct
> 
> On Fri, 21 Mar 2014, Greg Sheremeta wrote:
> 
> >> From: "aditya mamidwar" 
> 
> >> To: aw...@redhat.com, engine-de...@ovirt.org, users@ovirt.org
> >> Sent: Friday, March 21, 2014 6:14:01 AM
> >> Subject: Re: [Users] [Engine-devel] adding scripts
> 
> >> am thus facing following difficulties:
> 
> >> 1 : i wrote the required code using in bash scripting,
> >> which i wish to invoke after a click of button in the
> >> ovirt-portal. (which does not seem to be possible). can you
> >> help on that? which programming language should i use, and
> >> how that file should be invoked.
> 
> [I think Greg said:]
> 
> > This needs to be done in Java. You'll need to read up on
> > oVirt's UI Plugin infrastructure, which Einav and others
> > mentioned below. No, you cannot write a bash script and have
> > a button click in oVirt invoke that.
> 
> Reading this:
>   http://www.ovirt.org/VDSM-Hooks
> it states as a pull quote:
> 
>   The hooks reside on every host in
>   /usr/libexec/vdsm/hooks/ A hook can be any executable
>   (bash/python/perl/binary/etc).
> 
> and then at:
>   http://www.ovirt.org/Features/UIPlugins
> 
>   UI plugins integrate with WebAdmin directly on the
>   client (web browser) using JavaScript programming language.
>   Plugin invocation is driven by WebAdmin and happens right
>   within the context of browser's JavaScript runtime, using
>   JavaScript language as the lowest common denominator between
>   WebAdmin (GWT) and individual plugins. UI plugins can take
>   full advantage of JavaScript language and its rich ecosystem
>   of libraries. There are no specific rules on how to implement
>   UI plugins, plugin API is designed to be simple and not to get
>   in developer's way, regardless of how a developer chooses to
>   write the plugin
> 
> 
> 
> I thought I understood the model, but have gotten confused.
> Iam left with two questions:
> 
> 1. is the plugin to be Java or JavaScript? (I think the answer
> is the latter)

Right, UI plugins are written in JavaScript as their code is dynamically loaded 
during WebAdmin startup.

Your UI plugin is technically a web application on its own, except that plugin 
host page [1] is rendered inside invisible  element.

[1] plugin host page = HTML page responsible for loading actual UI plugin code 
(no markup, just logic)

UI plugin code can make HTTP requests just like any other web application. This 
is how you would invoke operations on remote servers.

The easiest way (I think) is to add custom CGI/Bash script into Apache which 
sits in front of Engine (JBoss AS) server in a typicall oVirt deployment. Your 
UI plugin would simply hit URL mapped to custom CGI/Bash script, which would 
execute whatever command is necessary.

Alternatively, you could deploy custom Java web application (*.war) inside 
Engine Java deployment (engine.ear) so that it co-exists with existing Engine 
web applications (REST API, WebAdmin, UserPortal, etc).

Finally, a totally custom alternative, run your own HTTP server, enable CORS 
[2] for requests from Engine origin, and have your UI plugin talk to this 
custom server.

[2] http://en.wikipedia.org/wiki/Cross-origin_resource_sharing

> 
> 2. is there a constraint as to implementation language, or
> not. I think a JS wrapper can call whatever it wishes, but
> this is not clear to me

Correct, UI plugin itself is JavaScript, it makes no assumptions of server-side 
technology.

It is up to UI plugin developer to decide if/how the plugin should communicate 
with remote servers (Engine REST API, call Apache CGI, call custom server, etc).

> 
> Thank you
> 
> -- Russ herrold
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
> 
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] adding scripts

2014-03-21 Thread Alexander Wels
On Friday, March 21, 2014 10:43:27 AM R P Herrold wrote:
> the threading is not clear to me, and I hope I have the
> attributions correct
> 
> On Fri, 21 Mar 2014, Greg Sheremeta wrote:
> >> From: "aditya mamidwar" 
> >> 
> >> To: aw...@redhat.com, engine-de...@ovirt.org, users@ovirt.org
> >> Sent: Friday, March 21, 2014 6:14:01 AM
> >> Subject: Re: [Users] [Engine-devel] adding scripts
> >> 
> >> am thus facing following difficulties:
> >> 
> >> 1 : i wrote the required code using in bash scripting,
> >> which i wish to invoke after a click of button in the
> >> ovirt-portal. (which does not seem to be possible). can you
> >> help on that? which programming language should i use, and
> >> how that file should be invoked.
> 
> [I think Greg said:]
> 
> > This needs to be done in Java. You'll need to read up on
> > oVirt's UI Plugin infrastructure, which Einav and others
> > mentioned below. No, you cannot write a bash script and have
> > a button click in oVirt invoke that.
> 
> Reading this:
>   http://www.ovirt.org/VDSM-Hooks
> it states as a pull quote:
> 
>   The hooks reside on every host in
>   /usr/libexec/vdsm/hooks/ A hook can be any executable
>   (bash/python/perl/binary/etc).
> 
> and then at:
>   http://www.ovirt.org/Features/UIPlugins
> 
>   UI plugins integrate with WebAdmin directly on the
>   client (web browser) using JavaScript programming language.
>   Plugin invocation is driven by WebAdmin and happens right
>   within the context of browser's JavaScript runtime, using
>   JavaScript language as the lowest common denominator between
>   WebAdmin (GWT) and individual plugins. UI plugins can take
>   full advantage of JavaScript language and its rich ecosystem
>   of libraries. There are no specific rules on how to implement
>   UI plugins, plugin API is designed to be simple and not to get
>   in developer's way, regardless of how a developer chooses to
>   write the plugin
> 
> 
> 
> I thought I understood the model, but have gotten confused.
> Iam left with two questions:
> 
> 1. is the plugin to be Java or JavaScript? (I think the answer
> is the latter)
> 

Javascript. But remember the UI plugins are running javascript in your 
browser, and don't directly communicate with VDSM.

> 2. is there a constraint as to implementation language, or
> not. I think a JS wrapper can call whatever it wishes, but
> this is not clear to me
> 
> Thank you
> 
> -- Russ herrold

Note the VDSM hooks have nothing to do with the UI plugins. The VDSM hooks 
alter the way VDSM works. The UI plugins alter the way the UI works. The 
engine sits in between the UI and VDSM. Basically the UI issues a command to 
the engine, then the engine issues a command to VDSM.

For UI plugins it is easiest to communicate with the engine using the REST 
api. So your instance your UI plugin has a button, which when you click it 
issues a REST api call. The REST api call is part of the engine. The engine 
creates a command based on the URL and parameters of the REST call and uses 
that command to make a call to VDSM. Once the call reaches VDSM then the VDSM 
hooks come into play.

So I don't entirely understand what you are trying to do, but you might have 
to write some code in the engine to create the appropriate command to pass to 
VDSM. In addition to the UI plugin and the VDSM hook.
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[Users] adding scripts

2014-03-21 Thread R P Herrold

the threading is not clear to me, and I hope I have the 
attributions correct

On Fri, 21 Mar 2014, Greg Sheremeta wrote:

>> From: "aditya mamidwar"  

>> To: aw...@redhat.com, engine-de...@ovirt.org, users@ovirt.org 
>> Sent: Friday, March 21, 2014 6:14:01 AM 
>> Subject: Re: [Users] [Engine-devel] adding scripts 

>> am thus facing following difficulties: 

>> 1 : i wrote the required code using in bash scripting, 
>> which i wish to invoke after a click of button in the 
>> ovirt-portal. (which does not seem to be possible). can you 
>> help on that? which programming language should i use, and 
>> how that file should be invoked.

[I think Greg said:]

> This needs to be done in Java. You'll need to read up on 
> oVirt's UI Plugin infrastructure, which Einav and others 
> mentioned below. No, you cannot write a bash script and have 
> a button click in oVirt invoke that.

Reading this:
http://www.ovirt.org/VDSM-Hooks
it states as a pull quote:

The hooks reside on every host in 
/usr/libexec/vdsm/hooks/ A hook can be any executable 
(bash/python/perl/binary/etc). 

and then at:
http://www.ovirt.org/Features/UIPlugins

UI plugins integrate with WebAdmin directly on the 
client (web browser) using JavaScript programming language. 
Plugin invocation is driven by WebAdmin and happens right 
within the context of browser's JavaScript runtime, using 
JavaScript language as the lowest common denominator between 
WebAdmin (GWT) and individual plugins. UI plugins can take 
full advantage of JavaScript language and its rich ecosystem 
of libraries. There are no specific rules on how to implement 
UI plugins, plugin API is designed to be simple and not to get 
in developer's way, regardless of how a developer chooses to 
write the plugin



I thought I understood the model, but have gotten confused.  
Iam left with two questions:

1. is the plugin to be Java or JavaScript? (I think the answer 
is the latter)

2. is there a constraint as to implementation language, or 
not. I think a JS wrapper can call whatever it wishes, but 
this is not clear to me

Thank you

-- Russ herrold
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] adding scripts

2014-03-16 Thread Einav Cohen
may I ask what is the general purpose of these buttons that you 
would like to add and where (in the GUI) would you like to add 
them?

if you would like to add buttons to existing main-tab(s) / sub-
tab(s), the way to go is to write a UI Plugin that does that 
(especially if you intend these buttons to do something very 
specific for your needs). 

If you would like to add these buttons elsewhere, you will 
need to follow Greg's instructions and dig into the code for 
the specific needed location. 

> I want to commit changes to the engine... 

note that we can push into the code only things that make sense 
to include in oVirt (i.e. things that will be useful for typical 
oVirt users); again, if these buttons will do something very 
specific for your own needs, you should definitely utilize the 
UI Plugins infrastructure instead. 

> ... and make few tweaks for personal use...

if these tweaks are in the "branding" area (i.e. if you want to 
change main color themes, top-left image on the top banner, etc), 
then writing your own branding [1] is the way to go [you can 
override only part of the branding (depending on what you would 
like to tweak), you don't actually need to come up with a 
complete alternative branding].  


Thanks,
Einav

[1] http://www.ovirt.org/Feature/Branding

- Original Message -
> From: "Greg Sheremeta" 
> To: "Aditya Mamidwar" 
> Cc: engine-de...@ovirt.org, users@ovirt.org
> Sent: Saturday, March 15, 2014 10:15:59 AM
> Subject: Re: [Users] adding scripts
> 
> There's not one html file like that, since we use GWT [1]. However, if you
> search for *.ui.xml files, you'll find all the GWT UIBinder files. That's
> the place to start for simple UI tweaks. The application is partitioned into
> small components, so you'll have to do some digging. For example, each
> dialog has its own ui.xml file -- so if you want to tweak a specific dialog,
> you'll need to find the right file. Feel free to post questions about those
> to engine-devel and we can help you out.
> 
> Greg
> 
> [1] http://www.gwtproject.org/
> 
> 
> 
> 
> From: "Aditya Mamidwar" 
> To: "Einav Cohen" , "Vojtech Szocs" 
> Cc: engine-de...@ovirt.org, users@ovirt.org
> Sent: Saturday, March 15, 2014 8:30:21 AM
> Subject: Re: [Users] adding scripts
> 
> Hey thanks on the previous issue.
> Also is there a way i can access WebAdmin.Html to add custom buttons and make
> few tweaks for personal use?
> I just cant find that file after using git.
> 
> Aditya Mamidwar
> 
> From: Einav Cohen
> Sent: ‎14-‎03-‎2014 01:21
> To: aditya mamidwar ; Vojtech Szocs
> Cc: users@ovirt.org ; engine-de...@ovirt.org
> Subject: Re: [Users] adding scripts
> 
> if you are trying to hook into UI-specific events, it sounds
> like you will need to write an oVirt UI Plugin [1] in order to
> do that. However, I believe that the oVirt UI Plugins
> infrastructure doesn't support hooking to events such as "tab
> x was selected" and/or "button b was clicked".
> It does allow you to add new (custom) tabs/sub-tabs/buttons of
> your own, and there is a chance that it allows you to hook
> into events such as 'row x was selected in the grid'.
> 
> @Vojtech will know better. Vojtech?
> 
> if you are trying to hook into engine events (e.g. you want to
> run a script every time a VM is started in oVirt, no matter if
> the user started it by clicking the 'run' button in the oVirt-
> engine webadmin, or invoked a REST API request, or an SDK
> command), then it will require some sort of an "engine-plugin"
> infrastructure that we don't have at the moment AFAIK.
> there is a chance that for some of the events you will be able
> to utilize the VDSM hooks (at the Host level) [2].
> 
> 
> Thanks,
> Einav
> 
> [1] http://www.ovirt.org/Features/UIPlugins
> 
> [2] http://www.ovirt.org/VDSM-Hooks
> 
> 
> - Original Message -
> > From: "aditya mamidwar" 
> > To: users@ovirt.org, engine-de...@ovirt.org
> > Sent: Thursday, March 13, 2014 11:23:35 AM
> > Subject: [Users] adding scripts
> > 
> > 
> > I want to commit changes to the engine by adding some bash scripts.
> > the scripts should be invoked once a button or tab is selected in the
> > webadmin portal by the user.
> > 
> > can someone guide on achieving this.
> > 
> > --
> > -Aditya Mamidwar
> > 
> > ___
> > Users mailing list
> > Users@ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/users
> > 
> 
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
> 
> 
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] adding scripts

2014-03-15 Thread Greg Sheremeta
There's not one html file like that, since we use GWT [1]. However, if you 
search for *.ui.xml files, you'll find all the GWT UIBinder files. That's the 
place to start for simple UI tweaks. The application is partitioned into small 
components, so you'll have to do some digging. For example, each dialog has its 
own ui.xml file -- so if you want to tweak a specific dialog, you'll need to 
find the right file. Feel free to post questions about those to engine-devel 
and we can help you out. 

Greg 

[1] http://www.gwtproject.org/ 

- Original Message -

> From: "Aditya Mamidwar" 
> To: "Einav Cohen" , "Vojtech Szocs" 
> Cc: engine-de...@ovirt.org, users@ovirt.org
> Sent: Saturday, March 15, 2014 8:30:21 AM
> Subject: Re: [Users] adding scripts

> Hey thanks on the previous issue.
> Also is there a way i can access WebAdmin.Html to add custom buttons and make
> few tweaks for personal use?
> I just cant find that file after using git.

> Aditya Mamidwar

> From: Einav Cohen
> Sent: ‎14-‎03-‎2014 01:21
> To: aditya mamidwar ; Vojtech Szocs
> Cc: users@ovirt.org ; engine-de...@ovirt.org
> Subject: Re: [Users] adding scripts

> if you are trying to hook into UI-specific events, it sounds
> like you will need to write an oVirt UI Plugin [1] in order to
> do that. However, I believe that the oVirt UI Plugins
> infrastructure doesn't support hooking to events such as "tab
> x was selected" and/or "button b was clicked".
> It does allow you to add new (custom) tabs/sub-tabs/buttons of
> your own, and there is a chance that it allows you to hook
> into events such as 'row x was selected in the grid'.

> @Vojtech will know better. Vojtech?

> if you are trying to hook into engine events (e.g. you want to
> run a script every time a VM is started in oVirt, no matter if
> the user started it by clicking the 'run' button in the oVirt-
> engine webadmin, or invoked a REST API request, or an SDK
> command), then it will require some sort of an "engine-plugin"
> infrastructure that we don't have at the moment AFAIK.
> there is a chance that for some of the events you will be able
> to utilize the VDSM hooks (at the Host level) [2].

> 
> Thanks,
> Einav

> [1] http://www.ovirt.org/Features/UIPlugins

> [2] http://www.ovirt.org/VDSM-Hooks

> - Original Message -
> > From: "aditya mamidwar" 
> > To: users@ovirt.org, engine-de...@ovirt.org
> > Sent: Thursday, March 13, 2014 11:23:35 AM
> > Subject: [Users] adding scripts
> >
> >
> > I want to commit changes to the engine by adding some bash scripts.
> > the scripts should be invoked once a button or tab is selected in the
> > webadmin portal by the user.
> >
> > can someone guide on achieving this.
> >
> > --
> > -Aditya Mamidwar
> >
> > ___
> > Users mailing list
> > Users@ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/users
> >

> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] adding scripts

2014-03-15 Thread Aditya Mamidwar
Hey thanks on the previous issue.
Also is there a way i can access WebAdmin.Html to add custom buttons and make 
few tweaks for personal use?
I just cant find that file after using git.

Aditya Mamidwar

-Original Message-
From: "Einav Cohen" 
Sent: ‎14-‎03-‎2014 01:21
To: "aditya mamidwar" ; "Vojtech Szocs" 

Cc: "users@ovirt.org" ; "engine-de...@ovirt.org" 

Subject: Re: [Users] adding scripts

if you are trying to hook into UI-specific events, it sounds 
like you will need to write an oVirt UI Plugin [1] in order to 
do that. However, I believe that the oVirt UI Plugins 
infrastructure doesn't support hooking to events such as "tab 
x was selected" and/or "button b was clicked". 
It does allow you to add new (custom) tabs/sub-tabs/buttons of 
your own, and there is a chance that it allows you to hook 
into events such as 'row x was selected in the grid'. 

@Vojtech will know better. Vojtech?

if you are trying to hook into engine events (e.g. you want to 
run a script every time a VM is started in oVirt, no matter if 
the user started it by clicking the 'run' button in the oVirt-
engine webadmin, or invoked a REST API request, or an SDK 
command), then it will require some sort of an "engine-plugin" 
infrastructure that we don't have at the moment AFAIK. 
there is a chance that for some of the events you will be able 
to utilize the VDSM hooks (at the Host level) [2].


Thanks,
Einav

[1] http://www.ovirt.org/Features/UIPlugins

[2] http://www.ovirt.org/VDSM-Hooks


- Original Message -
> From: "aditya mamidwar" 
> To: users@ovirt.org, engine-de...@ovirt.org
> Sent: Thursday, March 13, 2014 11:23:35 AM
> Subject: [Users] adding scripts
> 
> 
> I want to commit changes to the engine by adding some bash scripts.
> the scripts should be invoked once a button or tab is selected in the
> webadmin portal by the user.
> 
> can someone guide on achieving this.
> 
> --
> -Aditya Mamidwar
> 
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
> 
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] adding scripts

2014-03-14 Thread Vojtech Szocs


- Original Message -
> From: "Einav Cohen" 
> To: "aditya mamidwar" , "Vojtech Szocs" 
> 
> Cc: users@ovirt.org, engine-de...@ovirt.org
> Sent: Thursday, March 13, 2014 8:51:52 PM
> Subject: Re: [Users] adding scripts
> 
> if you are trying to hook into UI-specific events, it sounds
> like you will need to write an oVirt UI Plugin [1] in order to
> do that. However, I believe that the oVirt UI Plugins
> infrastructure doesn't support hooking to events such as "tab
> x was selected" and/or "button b was clicked".
> It does allow you to add new (custom) tabs/sub-tabs/buttons of
> your own, and there is a chance that it allows you to hook
> into events such as 'row x was selected in the grid'.
> 
> @Vojtech will know better. Vojtech?

Einav is right; in general, UI plugins can extend existing UI,
i.e. add custom tab, show custom dialog, add custom button to
existing tab, etc. See [1] for details.

UI plugins can also hook into some application-wide events,
such as user login/logout, main tab item selection change, etc.
See [2] for details.

[1] http://www.ovirt.org/Features/UIPlugins#API_function_reference
[2] http://www.ovirt.org/Features/UIPlugins#Application_event_reference

What you can do is add your custom button on some existing
main tab with click handler that makes some HTTP call to
trigger the action you need.

If you need to add click handler for *existing* button on
existing main tab, or you want to be notified when current
(active) main tab changes, this is not supported yet. Please
create RFE for this if it's something you'd like in UI plugins.

> 
> if you are trying to hook into engine events (e.g. you want to
> run a script every time a VM is started in oVirt, no matter if
> the user started it by clicking the 'run' button in the oVirt-
> engine webadmin, or invoked a REST API request, or an SDK
> command), then it will require some sort of an "engine-plugin"
> infrastructure that we don't have at the moment AFAIK.
> there is a chance that for some of the events you will be able
> to utilize the VDSM hooks (at the Host level) [2].
> 
> 
> Thanks,
> Einav
> 
> [1] http://www.ovirt.org/Features/UIPlugins
> 
> [2] http://www.ovirt.org/VDSM-Hooks
> 
> 
> - Original Message -
> > From: "aditya mamidwar" 
> > To: users@ovirt.org, engine-de...@ovirt.org
> > Sent: Thursday, March 13, 2014 11:23:35 AM
> > Subject: [Users] adding scripts
> > 
> > 
> > I want to commit changes to the engine by adding some bash scripts.
> > the scripts should be invoked once a button or tab is selected in the
> > webadmin portal by the user.
> > 
> > can someone guide on achieving this.
> > 
> > --
> > -Aditya Mamidwar
> > 
> > ___
> > Users mailing list
> > Users@ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/users
> > 
> 
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [Users] adding scripts

2014-03-13 Thread Einav Cohen
if you are trying to hook into UI-specific events, it sounds 
like you will need to write an oVirt UI Plugin [1] in order to 
do that. However, I believe that the oVirt UI Plugins 
infrastructure doesn't support hooking to events such as "tab 
x was selected" and/or "button b was clicked". 
It does allow you to add new (custom) tabs/sub-tabs/buttons of 
your own, and there is a chance that it allows you to hook 
into events such as 'row x was selected in the grid'. 

@Vojtech will know better. Vojtech?

if you are trying to hook into engine events (e.g. you want to 
run a script every time a VM is started in oVirt, no matter if 
the user started it by clicking the 'run' button in the oVirt-
engine webadmin, or invoked a REST API request, or an SDK 
command), then it will require some sort of an "engine-plugin" 
infrastructure that we don't have at the moment AFAIK. 
there is a chance that for some of the events you will be able 
to utilize the VDSM hooks (at the Host level) [2].


Thanks,
Einav

[1] http://www.ovirt.org/Features/UIPlugins

[2] http://www.ovirt.org/VDSM-Hooks


- Original Message -
> From: "aditya mamidwar" 
> To: users@ovirt.org, engine-de...@ovirt.org
> Sent: Thursday, March 13, 2014 11:23:35 AM
> Subject: [Users] adding scripts
> 
> 
> I want to commit changes to the engine by adding some bash scripts.
> the scripts should be invoked once a button or tab is selected in the
> webadmin portal by the user.
> 
> can someone guide on achieving this.
> 
> --
> -Aditya Mamidwar
> 
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
> 
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[Users] adding scripts

2014-03-13 Thread aditya mamidwar
I want to commit changes to the engine by adding some bash scripts.
the scripts should be invoked once a button or tab is selected in the
webadmin portal by the user.

can someone guide on achieving this.

-- 
-Aditya Mamidwar
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users