Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discovery #139

Open
gghabri opened this issue Mar 4, 2024 · 1 comment
Open

Discovery #139

gghabri opened this issue Mar 4, 2024 · 1 comment

Comments

@gghabri
Copy link

gghabri commented Mar 4, 2024

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 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,

@ankraft
Copy link
Owner

ankraft commented Mar 4, 2024

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 "&"...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants