Page 1 of 1

getting a session key easily

PostPosted: Sat Jul 25, 2015 7:40 pm
by dsudar
Hi all,
I've been trying to automate various parts of our workflow using shell scripts and such and am finding that it would be very convenient to be able to simply get the session key of a session I just opened. Sure, I could extricate it from the "bin/omero sessions list" output but I keep thinking it would be so easy if the return value from "bin/omero login" were to be that session key or if there were an additional subcommand such as "bin/omero sessions getkey" that would return the most recent active session. Possible consideration?
Thanks,
- Damir

Re: getting a session key easily

PostPosted: Mon Jul 27, 2015 7:16 am
by sbesson
Hi Damir,

thanks for the feedback. You are right that there is not direct way to retrieve the session key at the moment. Your best workaround might be to use the output of the file subcommand, e.g.

Code: Select all
$ key=$(basename $(dist/bin/omero sessions file))
$ echo $key
d8b1159f-a56f-4306-9779-46da4cb100e6


We have a list of various CLI enhancements we consider for implementation in the near future. A specific `bin/omero sessions key` subcommand has already been listed so now may be a good time to have it implemented. We will keep you posted.

Best,
Sebastien