Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » Calling the Kura API methods?
Calling the Kura API methods? [message #1786855] Mon, 14 May 2018 10:28 Go to next message
M A is currently offline M AFriend
Messages: 4
Registered: February 2018
Junior Member
Hey,

I am experimenting with the Kura API and would like to use some of the methods within the API in the near future.

For now, I am interested in the "SystemService" as I would like to create a simple API that returns the Kura version as an example. The custom API is working, the problem is however to use the "getKuraVersion()" method that actually returns the version.

Does someone have any idea how that can be done?
Re: Calling the Kura API methods? [message #1786916 is a reply to message #1786855] Tue, 15 May 2018 14:41 Go to previous messageGo to next message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
Hi,
I'm sorry, but the question is not clear to me.
Could you please formalise it with an example?

Thanks
Best regards,
Matteo

[Updated on: Tue, 15 May 2018 14:41]

Report message to a moderator

Re: Calling the Kura API methods? [message #1787018 is a reply to message #1786916] Thu, 17 May 2018 11:44 Go to previous messageGo to next message
M A is currently offline M AFriend
Messages: 4
Registered: February 2018
Junior Member
I created a custom REST API that runs in Kura and I access it via
localhost:8080/services/sf/version
which currently just returns "Hello". Instead of that I want to return the currently running Kura version when someone makes a GET call. I assume that I'm am required to call the
getKuraVersion()
method from the "SystemService" class but I am not able to and I am wondering how I could get the current version?
Re: Calling the Kura API methods? [message #1787030 is a reply to message #1787018] Thu, 17 May 2018 12:52 Go to previous messageGo to next message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
Hi,
maybe have a look at the way we did for the existing Kura REST Apis: https://github.com/eclipse/kura/tree/develop/kura/org.eclipse.kura.rest.asset.provider
If you need to use the SystemService, you need to get the corresponding dependency, as done for example here: https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.rest.asset.provider/OSGI-INF/asset_rest_service.xml#L14
and then embed those references in your code: https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.rest.asset.provider/src/main/java/org/eclipse/kura/internal/rest/asset/AssetRestService.java#L58

Best regards,
Matteo
Re: Calling the Kura API methods? [message #1787109 is a reply to message #1787030] Fri, 18 May 2018 21:11 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hello,

I think the question pertains to how to use the Kura OSGi services. I have responded to the same question in StackOverflow [1].

[1] https://stackoverflow.com/questions/50328171/calling-the-kura-api-methods

--Dave
Re: Calling the Kura API methods? [message #1787223 is a reply to message #1787109] Tue, 22 May 2018 10:08 Go to previous message
M A is currently offline M AFriend
Messages: 4
Registered: February 2018
Junior Member
Hey, thanks for the help guys. I will take a close look at the suggested solutions.
Previous Topic:Kura 3.2.0 and Java 9
Next Topic: Can not connect Krua device to kapua server exception Not authorized to connect (5)
Goto Forum:
  


Current Time: Tue Apr 23 06:08:50 GMT 2024

Powered by FUDForum. Page generated in 0.03299 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top