Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow omero.server.nodedescriptors to be queried from a client #37

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

chris-allan
Copy link
Member

It is useful for clients to know that specific services are disabled. In particular PixelData-0 for warning users about a lack of pyramid generation or Tables-0 for warning users about OMERO.tables services being unavailable.

/cc @sbesson, @stick, @atTODO

Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested against a server using the default configuration (property unset)

Python 3.6.8 (default, Aug  7 2019, 17:28:10) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import omero
>>> c=omero.client("localhost")
>>> s=c.createSession("root","omero")
>>> s.getConfigService().getConfigValue("omero.server.nodedescriptors")
''
>>> c.closeSession()

and with the property set

Python 3.6.8 (default, Aug  7 2019, 17:28:10) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import omero
>>> c=omero.client("localhost")
>>> s=c.createSession("root","omero")
>>> s.getConfigService().getConfigValue("omero.server.nodedescriptors")
'master:Blitz-0,Tables-0'
>>> c.closeSession()

Everything is working as expected. Exposing this property client-side makes sense to me.

Copy link
Member

@joshmoore joshmoore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seealso:

This seems safe and in keeping with the property's purpose.

NB: Having not looked at these in a while this makes me realize a couple of things that I'll list here but are obviously for elsewhere:

  • There likely should be a way to query all such accessible properties.
  • They should likely be listed as such in the documentation.
  • And possibly a way to do this is to read the security status from the .properties file rather than the Spring .xml.

@sbesson
Copy link
Member

sbesson commented Oct 31, 2022

There likely should be a way to query all such accessible properties.

From a quick testing, passing the wildcard to IConfig.getConfigValues() seems to be sufficient to retrieve all client-visible properties:

>>> s.getConfigService().getConfigValues(".*").keys()
dict_keys(['omero.client.ui.tree.orphans.name', 'omero.client.browser.thumb_default_size', 'omero.client.viewer.initial_zoom_level', 'omero.client.download_as.max_size', 'omero.sessions.max_user_time_to_idle', 'omero.cluster.read_only.runtime.repo', 'omero.client.ui.menu.dropdown.colleagues.label', 'omero.client.web.host', 'omero.security.password_required', 'omero.pixeldata.max_projection_bytes', 'omero.bioformats.version', 'omero.client.ui.menu.dropdown.leaders.label', 'omero.pixeldata.max_tile_length', 'omero.sessions.timeout', 'omero.upgrades.url', 'omero.client.ui.menu.dropdown.everyone.enabled', 'omero.pixeldata.tile_height', 'omero.version', 'omero.mail.config', 'omero.pixeldata.max_plane_width', 'omero.db.authority', 'omero.client.viewer.interpolate_pixels', 'omero.cluster.read_only.runtime.db', 'omero.client.ui.tree.orphans.enabled', 'omero.pixeldata.max_plane_float_override', 'omero.client.ui.tree.orphans.description', 'omero.client.ui.menu.dropdown.leaders.enabled', 'omero.client.ui.menu.dropdown.everyone.label', 'omero.pixeldata.max_plane_height', 'omero.sessions.maximum', 'omero.client.ui.menu.dropdown.colleagues.enabled', 'omero.sessions.max_user_time_to_live', 'omero.router.insecure', 'omero.bioformats.date', 'omero.bioformats.vcs_revision', 'omero.client.viewer.roi_limit', 'omero.server.nodedescriptors', 'omero.pixeldata.tile_width', 'omero.client.scripts_to_ignore', 'omero.client.ui.tree.type_order', 'omero.db.uuid#1', 'omero.pixeldata.backoff'])

They should likely be listed as such in the documentation.
And possibly a way to do this is to read the security status from the .properties file rather than the Spring .xml.

I was hoping the API above could be used integrated in the generation script but the properties glossary is create by the output of omero config parse which does not require an active session so it's longer than a 5min work.
I think it makes sense to capture the documentation RFE as an issue against omero-documentation.

@joshmoore
Copy link
Member

joshmoore commented Oct 31, 2022

From a quick testing, passing the wildcard to IConfig.getConfigValues() seems to be sufficient to retrieve all client-visible properties:

👍

I think it makes sense to capture the documentation RFE as an issue against omero-documentation.

👍 see ome/omero-documentation#2280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants