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

How does a Consumer conforming to the Core Profile get a list of ongoing actions? #99

Closed
benfrancis opened this issue Sep 14, 2021 · 1 comment · Fixed by #103
Closed

Comments

@benfrancis
Copy link
Member

Through discussions around action semantics in the Thing Description specification I've realised that the current actions protocol binding has no operation for a Consumer to get a list of ongoing actions. This means that in the case of an Asynchronous Action Response only the Consumer which invoked the action can know the URL of its actionStatus resource.

There's a fairly obvious solution for how that might fit into the REST API used in the examples (a GET on /things/lamp/actions/fade could return a list of actionStatus objects), but it's less obvious how that endpoint would be described in a Thing Description.

@benfrancis
Copy link
Member Author

benfrancis commented Sep 16, 2021

I think we could solve this by adding a section under the actions protocol binding for the queryallactions operation proposed in w3c/wot-thing-description#1200 but there are still some ongoing discussions about the set of operations needed for actions in Thing Descriptions.

In particular, would you query the list of ongoing actions for a specific action name (e.g. /things/lamp/actions/fade) or for all actions at once (e.g. /things/lamp/actions), and what operation names correspond to those two different cases?

Below is a potential example payload of a queryallactions operation which could be a GET on /things/lamp/actions and return a map of action queues keyed by action name.

{
  "fade": [
    {
      "status": "completed",
      "href": "/things/lamp/actions/fade/123e4567-e89b-12d3-a456-426655"
    },
    {
      "status": "failed",
      "href": "/things/lamp/actions/fade/123e4567-e89b-12d3-a456-558329",
      "error": { ... }
    },
    {
      "status": "running",
      "href": "/things/lamp/actions/fade/123e4567-e89b-12d3-a457-434656"
    },
    {
      "status": "pending",
      "href": "/things/lamp/actions/fade/123e4567-e89b-12d3-a457-434656"
    }
  ],
  "strobe": [
    {
      "status": "completed",
      "href": "/things/lamp/actions/strobe/123f4567-e89b-12d3-a456-853950"
    },
    {
      "status": "running",
      "href": "/things/lamp/actions/strobe/123f4567-e89b-12d3-a457-589029"
    },
    {
      "status": "pending",
      "href": "/things/lamp/actions/strobe/123f4567-e89b-12d3-a457-589039"
    }
  ],
  "cool": [
    {
      "status": "completed",
      "href": "/things/lamp/actions/cool/423f4567-e89b-12d3-a456-853951",
      "output": 62
    },
    {
      "status": "completed",
      "href": "/things/lamp/actions/cool/423f4567-e89b-12d3-a457-589059",
      "output": 79
    },
    {
      "status": "running",
      "href": "/things/lamp/actions/cool/423f4567-e89b-12d3-a457-589063"
    }
  ]
}

My question is whether this is sufficient, or whether there should also be a way to query only a single action name, e.g. GET /things/lamp/actions/fade and if so what that operation would be called?

mlagally added a commit that referenced this issue Sep 23, 2021
Define protocol binding for `queryallactions` - closes #99 and #102
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

Successfully merging a pull request may close this issue.

1 participant