You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't find a way to get the list of universes using the Java API.
I did find the son API for it: universe_plugin_list
And I didn't find the RPC documentation in order to see if such an API call exist with RPC (in which case I could implement the Java RPC for it in OlaClient.java)
Notice that the universe argument is mandatory int (not optional like in the RPC).
I assume that without setting a universe, the reply will include all universes.
So I guess a small fix in the Java API would solve it. Something like:
Activity
peternewman commentedon Apr 21, 2017
You want getPlugins. See the C++ code for the JSON API:
ola/olad/OladHTTPServer.cpp
Line 471 in 7d25bbd
peternewman commentedon Apr 21, 2017
RPC docs are here: http://docs.openlighting.org/ola/doc/latest/rpc_system.html#rpc_OLAServices
hepiyellow commentedon Apr 21, 2017
Well, I tried the Java version of
getPlugins(), which returns thePluginListReplyobject, which doesn't seem to have a universe list.Also looking at the
common/protocol/Ola.proto, it doesn't seem that it returns the universe list:peternewman commentedon Apr 21, 2017
Did you mean the JSON /json/universe_plugin_list? That's what that RPC returns.
The other likely one is FetchUniverseList
ola/ola/OlaClientCore.cpp
Line 331 in 3cf5575
Point us to the JSON you want, and I can tell you the appropriate RPC. Or look in the RPC directly.
hepiyellow commentedon Apr 21, 2017
Yes, it is the
/json/universe_plugin_listAPI that I was trying to find in Java API.The
FetchUniverseListthat you referenced call the RPCGetUniverseInfo.This RPC is defined in
Ola.proto:But in the Java API:
Notice that the
universeargument is mandatoryint(not optional like in the RPC).I assume that without setting a universe, the reply will include all universes.
So I guess a small fix in the Java API would solve it. Something like:
If it It sound good to you,
I'll test it and make a PR.
Thanks,
Erez
peternewman commentedon Apr 22, 2017
Hi @hepiyellow ,
It turns out the JSON API is cheating, it's doing GetPluginList, then GetUniverseInfo and combining the results as one chunk of JSON:
https://github.com/OpenLightingProject/ola/blob/master/olad/OladHTTPServer.cpp#L840
In terms of FetchUniverseList/FetchUniverseInfo, they're done as two methods in the C++ API, which you really ought to try and mirror:
https://github.com/OpenLightingProject/ola/blob/master/ola/OlaClientCore.cpp#L331
https://github.com/OpenLightingProject/ola/blob/master/ola/OlaClientCore.cpp#L348
So just add another method which has a different name and doesn't require a universe argument.
hepiyellow commentedon Apr 22, 2017
I submitted a PR for this:
#1231
peternewman commentedon Apr 22, 2017
Thanks @hepiyellow .
peternewman commentedon Dec 2, 2017
Closed in #1231