-
Notifications
You must be signed in to change notification settings - Fork 63
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
Is there a need for invokeanyaction
/queryallactions
operations?
#1200
Comments
I would say that once querying actions is possible, such an endpoint would be needed. |
@egekorkan wrote:
The same argument could apply to querying actions, as a I think there are three possible use cases for "querying" an action:
|
I would be ok for having |
No it's really just a single endpoint from which you can invoke any action, rather than using the endpoint specific to a particular action affordance. In the Web Thing API it's mostly just provided for symmetry (you can send both a |
from today's TD call:
invokeaction - POST /actions/fade {"level": 100, "duration": 10} |
As discussed in the call, we probably need to agree how to cancel and query the status of an action request (#302) first, before deciding on these operations for top level action forms. The proposal I'm hoping to get feedback on is #302 (comment), which demonstrates proposed |
Another thought, what about |
As a starting point, I could create a PR to add See #302 (comment) for a proposal regarding operation naming ( |
As raised in #302 (comment), what should the default data schema of a For the meta interactions of properties the specification says the following:
We could apply a similar approach to We could define that the response data schema of
We could define no default data schema for a |
There's a somewhat similar issue with events with the |
@egekorkan wrote:
Hmm, I guess that depends on how the subscription mechanism works. I imagine in most cases each event will be pushed separately when it occurs so there's no need for a combined schema.
I'm not sure I understand, if the affordance name is omitted then how would a Consumer distinguish between instances of different actions? E.g. {
"fade": [
{
"status": "completed",
"href": "/things/lamp/actions/fade/123e4567-e89b-12d3-a456-426655"
},
{
"status": "pending",
"href": "/things/lamp/actions/fade/123e4567-e89b-12d3-a456-431553"
},
{
"status": "pending",
"href": "/things/lamp/actions/fade/123e4567-e89b-12d3-a456-51ff16"
}
],
"reboot": [
{
"status": "pending",
"href": "/things/lamp/actions/reboot/123e4567-e89b-12d3-a456-f3dea"
}
]
} vs. [
{
"status": "completed",
"href": "/things/lamp/actions/fade/123e4567-e89b-12d3-a456-426655"
},
{
"status": "pending",
"href": "/things/lamp/actions/fade/123e4567-e89b-12d3-a456-431553"
},
{
"status": "pending",
"href": "/things/lamp/actions/fade/123e4567-e89b-12d3-a456-51ff16"
},
{
"status": "pending",
"href": "/things/lamp/actions/reboot/123e4567-e89b-12d3-a456-f3dea"
}
] |
Sorry about the confusion. What I meant is the first example posted in the above comment. If one action does not return something for querying, either the action name is omitted from the map or its value is left empty. Leaving the value empty could be reserved for empty payloads though. So in the example above, if reboot cannot be queried, the response of {
"fade": [
{
"status": "completed",
"href": "/things/lamp/actions/fade/123e4567-e89b-12d3-a456-426655"
},
{
"status": "pending",
"href": "/things/lamp/actions/fade/123e4567-e89b-12d3-a456-431553"
},
{
"status": "pending",
"href": "/things/lamp/actions/fade/123e4567-e89b-12d3-a456-51ff16"
}
]
// nothing here since reboot does not allow querying
} |
I think that with having |
Now that we have
subscribeallevents
/unsubscribeallevents
operations it is possible to have top level forms in a Thing Description for both properties and events. E.g.In addition to these top level
Properties
andEvents
endpoints, WebThings also provides a top levelActions
endpoint for things. This endpoint has a couple of functions:The Actions endpoint is really just provided as a convenience since:
Action
endpointsI'm curious to know whether people would find value in
invokeanyaction
/queryallactions
operations such that actions could also have a top level form, e.g.I think it would be neat to have all three, but how useful is it?
(The alternative is that we drop this feature from WebThings).
The text was updated successfully, but these errors were encountered: