We're Hiring!

Server Address from Blitz Gateway object

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Server Address from Blitz Gateway object

Postby bhcho » Mon Feb 13, 2012 8:03 pm

Hi all,

quick question.
Could anyone tell me about how to get the server address (or unique server name or anything) using the Blitz Gateway object (in python)?

BK
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm

Re: Server Address from Blitz Gateway object

Postby jmoore » Mon Feb 13, 2012 10:43 pm

Hi BK,

the most complete definition of what you are connected to is stored under the "Ice.Default.Router" property:

Code: Select all
In [1]: from omero.gateway import BlitzGateway
...
In [5]: bg = BlitzGateway(host="localhost")
...
In [8]: bg.c.getProperty("Ice.Default.Router")
Out[8]: 'OMERO.Glacier2/router:ssl -p 4064 -h localhost'


but if you just want the host, "omero.host" might work:
Code: Select all
In [9]: bg.c.getProperty("omero.host")
Out[9]: 'localhost'


Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest