Skip to content

Commit c350ae0

Browse files
committed
More fixes for PR comments
1 parent 93dd383 commit c350ae0

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

azure/ConsiderationsForServiceDesign.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ sequenceDiagram
170170
Client->>API Endpoint: POST/DELETE
171171
API Endpoint->>Client: HTTP/1.1 202 Accepted<br/>Retry-After: 5<br/>{ "id": "22", "status": "NotStarted" }
172172
Client->>Status Monitor: GET
173-
Status Monitor->>Client: HTTP/1.1 200 Ok<br/>Retry-After: 5<br/>{ "id": "22", "status": "Running" }
173+
Status Monitor->>Client: HTTP/1.1 200 OK<br/>Retry-After: 5<br/>{ "id": "22", "status": "Running" }
174174
Client->>Status Monitor: GET
175-
Status Monitor->>Client: HTTP/1.1 200 Ok<br/>{ "id": "22", "status": "Succeeded" }
175+
Status Monitor->>Client: HTTP/1.1 200 OK<br/>{ "id": "22", "status": "Succeeded" }
176176
```
177177

178178
1. The client sends the request to initiate the long-running operation.
@@ -217,7 +217,7 @@ with the [Long Running Operations](#long-running-operations) pattern.
217217
The operation is initiated with a POST operation and the operation path ends in `:action`.
218218

219219
```text
220-
POST /<service-or-resource-url>:action
220+
POST /<service-or-resource-url>:action?api-version=2022-05-01
221221
Operation-Id: 22
222222
223223
{
@@ -248,7 +248,7 @@ GET https://<status-monitor-endpoint>/22?api-version=2022-05-01
248248
When the operation completes successfully, the result (if there is one) will be included in the `result` field of the status monitor.
249249

250250
```text
251-
HTTP/1.1 200 Ok
251+
HTTP/1.1 200 OK
252252
253253
{
254254
"id": "22",
@@ -257,9 +257,9 @@ HTTP/1.1 200 Ok
257257
}
258258
```
259259

260-
### Create (PUT) with additional long-running processing
260+
### PUT with additional long-running processing
261261

262-
A special case of long-running operation that occurs often is a PUT operation to create a resource
262+
A special case of long-running operation that occurs often is a PUT operation to create or replace a resource
263263
that involves some additional long-running processing.
264264
One example is a resource requires physical resources (e.g. servers) to be "provisioned" to make the resource functional.
265265
In this case, the request may contain an `operation-id` header that the service will use as
@@ -275,7 +275,8 @@ Operation-Id: 22
275275
}
276276
```
277277

278-
In this case the response to the initial request is a `201 Created` to indicate that the resource has been created.
278+
In this case the response to the initial request is a `201 Created` to indicate that the resource has been created
279+
or `200 OK` when the resource was replaced.
279280
The response body contains a representation of the created resource, which is the standard pattern for a create operation.
280281
A status monitor is created to track the additional processing and the ID of the status monitor
281282
is returned in the `Operation-Id` header of the response.
@@ -305,7 +306,7 @@ GET https://items/operations/22?api-version=2022-05-01
305306
When the additional processing completes, the status monitor will indicate if it succeeded or failed.
306307

307308
```text
308-
HTTP/1.1 200 Ok
309+
HTTP/1.1 200 OK
309310
310311
{
311312
"id": "22",
@@ -330,10 +331,10 @@ It might be necessary to support some control action on a long-running operation
330331
This is implemented as a POST on the status monitor endpoint with `:action` added.
331332

332333
```text
333-
POST /<status-monitor-url>:cancel
334+
POST /<status-monitor-url>:cancel?api-version=2022-05-01
334335
```
335336

336-
A successful response to a control operation should be a `200 Ok` with a representation of the status monitor.
337+
A successful response to a control operation should be a `200 OK` with a representation of the status monitor.
337338

338339
```text
339340
HTTP/1.1 200 OK

azure/Guidelines.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -786,11 +786,11 @@ a [status monitor](https://datatracker.ietf.org/doc/html/rfc7231#section-6.3.3)
786786

787787
:white_check_mark: **DO** generate an ID (typically a GUID) for the status monitor if the `Operation-Id` header was not passed by the client.
788788

789-
:white_check_mark: **DO** fail a request with a `400-BadRequest` if the `Operation-Id` header that matches an outstanding operation unless the request is identical to the prior request (a retry scenario).
789+
:white_check_mark: **DO** fail a request with a `400-BadRequest` if the `Operation-Id` header matches an outstanding operation unless the request is identical to the prior request (a retry scenario).
790790

791791
:white_check_mark: **DO** perform as much validation as practical when initiating the operation to alert clients of errors early.
792792

793-
:white_check_mark: **DO** return a `202-Accepted` status code from the request that initiates an LRO if the processing of the operation was successfully initiated (except for "create (PUT) with additional processing" type LRO).
793+
:white_check_mark: **DO** return a `202-Accepted` status code from the request that initiates an LRO if the processing of the operation was successfully initiated (except for "PUT with additional processing" type LRO).
794794

795795
:warning: **YOU SHOULD NOT** return any other `2xx` status code from the initial request of an LRO -- return `202-Accepted` and a status monitor even if processing was completed before the initiating request returns.
796796

@@ -800,9 +800,9 @@ a [status monitor](https://datatracker.ietf.org/doc/html/rfc7231#section-6.3.3)
800800

801801
:white_check_mark: **DO** return a status monitor in the response body as described in [Status and results of long-running operations](#status-and-results-of-long-running-operations).
802802

803-
#### Create (PUT) operation with additional long-running processing
803+
#### PUT operation with additional long-running processing
804804

805-
For a create (PUT) with additional long-running processing:
805+
For a PUT (create or replace) with additional long-running processing:
806806

807807
:white_check_mark: **DO** allow the client to pass an `Operation-Id` header with a ID for the status monitor for the operation.
808808

@@ -812,7 +812,7 @@ For a create (PUT) with additional long-running processing:
812812

813813
:white_check_mark: **DO** perform as much validation as practical when initiating the operation to alert clients of errors early.
814814

815-
:white_check_mark: **DO** return a `201-Created` status code from the initial request with a representation of the resource if the resource was created successfully.
815+
:white_check_mark: **DO** return a `201-Created` status code for create or `200-OK` for replace from the initial request with a representation of the resource if the resource was created successfully.
816816

817817
:white_check_mark: **DO** include an `Operation-Id` header in the response with the ID of the status monitor for the operation.
818818

0 commit comments

Comments
 (0)