Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » RESTful API interaction (Adding query parameters to HTTP request.)
RESTful API interaction [message #1709361] Sun, 27 September 2015 18:46 Go to next message
Andrew Cloete is currently offline Andrew CloeteFriend
Messages: 18
Registered: February 2015
Junior Member
Hi all,

I'm wondering if it is possible to add parameters to an HTTP request in order to access a specific content instance. I know that it is possible to get the latest content instance of a container by simply adding */latest to the end of the URL. But what I am asking is if it is possible to select a specific instance (or range) by adding a key=value parameter to the request. e.g.

http://www.mysite.co.za:8080/om2m/nscl/applications/myapp/containers/DATA/contentInstances?creationTime=2015-09-27T20:34:56.887+02:00

I've tried this and it doesn't work so I would just like to know if I'm doing something wrong or if it is simply not possible?

In the case that it is NOT possible, I would like to know why? It would seem to me like a fairly common requirement to select a specific contentInstance. It seems inefficient to get the whole set each time a specific (or range of) instance is desired.

I believe I'm touching on RESTful web services here, and as far as I understand the OM2M platform is NOT a web service. What would be the reason that the SmartM2M standards are not designed as a web service? (I hope this is not a stupid question).

Regards
Andrew
Re: RESTful API interaction [message #1709952 is a reply to message #1709361] Fri, 02 October 2015 08:19 Go to previous messageGo to next message
Francois AissaouiFriend
Messages: 38
Registered: April 2015
Member
Hello Andew,

Indeed, the easiest way to access the last content instance is to use the "virtual resource" latest on the Container.
The filtering via attributes is specific to Discovery procedure in smartM2M. There you can add a lot of information to create a specific filter to get a list of the resources you want.

In the OM2M platform, complex mechanism of attributes filtering are not all implemented. We only support simple filters (like limit, searchStrings).

I agree with you on the point that if you want a specific set of contentInstances you have to get the whole set of resources and then filter in your client application. But we prefer to let users implement that kind of specific features in line with their needs (in the Discovery component for instance).

Regarding to the web services, smartM2M specifies an architecture and service layer that is independent of communication protocols (HTTP, CoAP, ...). But still, the standard is inspired of some web services mechanisms even if it is not defined as one.

Best regards,
François

Re: RESTful API interaction [message #1714181 is a reply to message #1709952] Tue, 10 November 2015 14:34 Go to previous messageGo to next message
Andrew Cloete is currently offline Andrew CloeteFriend
Messages: 18
Registered: February 2015
Junior Member
Hi François,

Thank you very much for the reply.

Could you possibly provide a small example of filtering specific data inside a contentInstance collection using the Discovery mechanism?

Say for example only filtering out the data for the last hour.

Kind regards
Andrew
Re: RESTful API interaction [message #1715112 is a reply to message #1714181] Thu, 19 November 2015 10:48 Go to previous message
Francois AissaouiFriend
Messages: 38
Registered: April 2015
Member
Hi Andrew,

This can of approach is not present in the smartM2M v1 that we are implementing in OM2M. Maybe this has been described in the v2 ETSI M2M specification.

But what I can tell is that the new standard oneM2M will introduce this kind of request with a lot of discovery filter possibilities. You will be able to select a specific container for discovery and then say "I want this parameter/attribute to have those properties". For the filter possibilities, you can check out the oneM2M specification.
However, this will NOT be implemented in the first release, that is oneM2M compliant, of OM2M.

Best regards,
François
Previous Topic:Maximum number of content instances in a Container
Next Topic:"Accept" field for subscriptions
Goto Forum:
  


Current Time: Tue Sep 25 10:44:32 GMT 2018

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

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

Back to the top