[Engine-devel] UI Plugin API improvements
Vojtech Szocs
vszocs at redhat.com
Fri Apr 5 20:49:48 UTC 2013
Hi Chris,
with patch [1] merged recently, default REST API session timeout is explicitly set to 180 minutes.
First, please check <session-config> in:
* $OVIRT_HOME/backend/manager/modules/restapi/webapp/src/main/webapp/WEB-INF/web.xml
* $JBOSS_HOME/standalone/deployments/engine.ear/restapi.war/WEB-INF/web.xml
(Both should contain <session-timeout> set to 180.)
When making REST API request, make sure not to accidentally close the session:
* set "JSESSIONID" cookie for "/api" path
* set "Prefer:persistent-auth" header --> without this, REST API session will perform logout after processing request
If you still experience timeouts:
* make REST API request that includes "Session-TTL:30" --> enforce timeout 30 minutes
Let me know how it goes.
[1] http://gerrit.ovirt.org/#/c/13044/
Regards,
Vojtech
----- Original Message -----
From: "Christopher Morrissey" <Christopher.Morrissey at netapp.com>
To: "Vojtech Szocs" <vszocs at redhat.com>, "engine-devel" <engine-devel at ovirt.org>
Cc: "Spenser Shumaker" <sshumake at redhat.com>, "René Koch" <r.koch at ovido.at>
Sent: Wednesday, April 3, 2013 1:17:31 AM
Subject: RE: [Engine-devel] UI Plugin API improvements
Great job on the dialog support, Vojtech! It's working very well for me.
I am having an issue with the REST session ID that I haven't been able to nail down. It seems to be timing out rather quickly. Somewhere between 15 and 30 seconds if I don't use it explicitly. I've seen the code that is scheduled to run every minute to keep it alive, but it looks like the timeout is happening so quickly that the heartbeat can't keep it alive. Any idea on why this would be happening?
-Chris
> -----Original Message-----
> From: engine-devel-bounces at ovirt.org [mailto:engine-devel-
> bounces at ovirt.org] On Behalf Of Vojtech Szocs
> Sent: Thursday, March 28, 2013 11:25 AM
> To: engine-devel
> Cc: Spenser Shumaker; René Koch; Morrissey, Christopher
> Subject: [Engine-devel] UI Plugin API improvements
>
> Hi guys,
>
> I've just merged some UI Plugin patches that improve existing API functions,
> as well as add some new API functions. Please read on to learn what's new.
>
>
> Modal dialog API
> ================
>
> Function improved: showDialog
>
> New signature:
> showDialog(title, dialogToken, contentUrl, width, height [, options])
>
> Example usage:
> showDialog('My Dialog', 'my-dialog', 'http://www.foobar.com/', '800px',
> '600px', {
> // Default value = empty array (no buttons)
> buttons: [
> {
> label: 'Do stuff',
> onClick: function() {
> alert('Bump!');
> }
> }
> ],
>
> // Default value = false
> resizeEnabled: true,
>
> // Default value = true
> closeIconVisible: true,
>
> // Default value = true
> closeOnEscKey: true
> });
>
> Notable changes:
> * modal dialogs now look & feel the same as standard WebAdmin dialogs
> * width & height are strings containing CSS units
> * the reason why buttons default to empty array is to give plugin authors the
> choice to provide custom buttons (or similar input elements) via dialog
> content (iframe), and use HTML5 window.postMessage to call the plugin
> (coming soon!)
>
> --
>
> New function: setDialogContentUrl
>
> New signature:
> setDialogContentUrl(dialogToken, contentUrl)
>
> Example usage:
> setDialogContentUrl('my-dialog', 'http://www.example.com/')
>
> --
>
> New function: closeDialog
>
> New signature:
> closeDialog(dialogToken)
>
> Example usage:
> closeDialog('my-dialog')
>
>
> Tab API
> =======
>
> Functions improved: addMainTab & addSubTab
>
> New signatures:
> addMainTab(label, historyToken, contentUrl [, options])
> addSubTab(entityTypeName, label, historyToken, contentUrl [, options])
>
> Example usage:
>
> // Tab is left-aligned by default
> addMainTab('Foo Tab', 'foo-tab', 'http://www.foo.com/');
>
> // Tab is right-aligned via options object
> addSubTab('VirtualMachine', 'Bar Tab', 'bar-tab', 'http://www.bar.com/', {
> alignRight: true
> });
>
> --
>
> Regards,
> Vojtech
> _______________________________________________
> Engine-devel mailing list
> Engine-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
More information about the Engine-devel
mailing list