ACME-oneM2M-CSE icon indicating copy to clipboard operation
ACME-oneM2M-CSE copied to clipboard

Discovery

Open gghabri opened this issue 11 months ago • 1 comments

Hello,

I'm attempting to discover resources based on labels.

I'm running ACME as an in-cse and executing the following command in the terminal:

curl -X GET -H 'X-M2M-Origin:Cmysensor' -H 'X-M2M-RI:123' -H 'X-M2M-RVI:3' -H 'Content-Type:application/json' -H 'Accept:application/json' http://localhost:8080/cse-in/MySensor/Container?fu=2&lbl=tag:temperature&rcn=8

However, I'm receiving the representation of the Container resource in the response body instead of the representation of the <contentInstance> resource containing 'tag:temperature' as the label attribute value.

When I execute the request using the RESTClient provided by the ACME web interface, I get the expected result.

Could you please explain why it's not working with the terminal?

Best regards,

gghabri avatar Mar 04 '24 14:03 gghabri

Your request with the rcn request parameter with value "8" (child resources) is targeted at the container, but it should only produces a stub representation of the container, like this, if there are no further child resources in the result.

{"m2m:cnt": {}}

There is no further content because this rcn doesn't include any attributes of the target resource (only for child resources). If you change the rcn to, for example "4" (attributes and child resources), it would include the container's attributes.

I am not sure what the difference is with the WebUI, though.

Another point: I would use quotes for the URL as well in your curl request, otherwise a shell interprets the special characters in a URL, especially "&"...

ankraft avatar Mar 04 '24 14:03 ankraft