I have some questions about TaskService and Task in Redfish Specification (DSP0266). 1. The Task resource describes a long-running operation that is spawned when a request takes longer than a few seconds. How to define a "long-running operation", does it mean the task will take more than a specified time limitation? Where can we find the definition of the time limitation?
2. Is there any time limitation on the state of a task? e.g. If a task takes more than a specified time, will the state of a task need to be changed to "Exception" or "Cancelled" from "Running"?
From my understanding, both questions depend on the implementation. However, a user won't wait too much time on the response. So, if the web service cannot get the response in a short time, the implementation should know it and prepare a task for the user. Then, a user can query the Task status until the task done.
shawn is correct; this is going to be based on how you've designed your service and what capabilities is has. This is mostly needed to help avoid timeouts at the HTTP layer. There's no formal definition of this as far as I know, but browsers seem to allow for up to 30 seconds; other HTTP libraries might default to 10 seconds.
There's also no time limitation from a Redfish standpoint; clients can't specify this. You can certainly add internal logic if you have your own policies for operations. For example, if a firmware update is expected to be completed within 2 minutes, you could have a timer running to cancel the task internally if it takes more than 10 minutes. This is entirely outside of any Redfish definition, but is allowed. In this case, you'd set the task to "Cancelled". The "Exception" state is more for cases where you encountered errors in the task.