api-guidelines icon indicating copy to clipboard operation
api-guidelines copied to clipboard

[Azure REST API guidelines] Conflicting guidance on `status` values for resource-based LROs

Open DominikMe opened this issue 4 years ago • 2 comments

The section Resource-based long-running operations states

✅ DO define the "status" field of the resource as an enum with all the values it may contain including the "terminal" values "Succeeded", "Failed", and "Canceled". See Enums & SDKs.

However, this doesn't seem to make much sense as succeeded|failed|canceled describe the status of the action on a resource but not the status of the resource itself.

The same section gives an example of setting status values as provisioning and active. These values describe the effect of the action on the state of resource, which is more logical.

A "create" operation (PUT, PATCH, or POST) for a resource where the basic structure of the resource is created immediately and includes a status field that indicates when the create has completed, e.g. "provisioning" -> "active".

A hypothetical other example can be POST /myThings/123:disable where a "status": "succeeded" on the myThing resource wouldn't communicate that myThing is now disabled.

DominikMe avatar Dec 09 '21 19:12 DominikMe

cc @navali-msft, @mikekistler

DominikMe avatar Dec 09 '21 19:12 DominikMe

Agreed that this is confusing and we should clarify/fix.

mikekistler avatar Dec 10 '21 13:12 mikekistler