RESTful API interaction [message #1709361] |
Sun, 27 September 2015 14:46  |
Eclipse User |
|
|
|
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 04:19   |
Eclipse User |
|
|
|
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 #1715112 is a reply to message #1714181] |
Thu, 19 November 2015 05:48  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.05481 seconds