Skip to content

Commit ef1a953

Browse files
committed
added RELO cancel
1 parent 3ce798d commit ef1a953

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed

graph/patterns/LRO.gif

343 Bytes
Loading

graph/patterns/RELO.gif

462 Bytes
Loading

graph/patterns/longRunningOperations.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ heuristics:
9898
prior to being purged from the system.
9999

100100
- Services that provides a new operation resource MUST support GET semantics on the operation.
101+
- Services that returns a new operation MUST always return an LRO (even if the LRO is created in the completed state) that way API consumers don't have to deal with two different shapes of response.
101102

102103

103104

@@ -118,19 +119,62 @@ POST https://graph.microsoft.com/v1.0/databases/
118119

119120
The API responds synchronously that the database has been created and indicates
120121
that the provisioning operation is not fully completed by including the
121-
Operation-Location header and status property in the response payload.
122+
Content-Location header and status property in the response payload.
122123

123124
```
124125
HTTP/1.1 201 Created
125126
Content-Location: https://graph.microsoft.com/v1.0/databases/db1
126127
127128
{
128129
"id": "db1",
129-
"Status": "Provisioning",
130+
"status": "provisioning",
130131
[ … other fields for "database" …]
131132
}
132133
```
134+
The client waits for a period of time then invokes another request to try to get the database status.
133135

136+
```
137+
GET https://graph.microsoft.com/v1.0/databases/db1
138+
139+
HTTP/1.1 200 Ok
140+
{
141+
"id": "db1",
142+
"status": "succeeded",
143+
[ … other fields for "database" …]
144+
}
145+
```
146+
147+
148+
### Cancel RELO operation
149+
150+
A client wants to cancel provisioning of a new database
151+
152+
```
153+
DELETE https://graph.microsoft.com/v1.0/databases/db1
154+
155+
```
156+
157+
The API responds synchronously that the database is being deleted and indicates
158+
that the operation is accepted and is not fully completed by including the
159+
Content-Location header and status property in the response payload.
160+
161+
```
162+
HTTP/1.1 202 Accepted
163+
Content-Location: https://graph.microsoft.com/v1.0/databases/db1
164+
165+
{
166+
"id": "db1",
167+
"status": "deleting",
168+
[ … other fields for "database" …]
169+
}
170+
```
171+
The client waits for a period of time then invokes another request to try to get the deletion status.
172+
173+
```
174+
GET https://graph.microsoft.com/v1.0/databases/db1
175+
176+
HTTP/1.1 404 Not Found
177+
```
134178
### Create a new resource using the Stepwise Operation
135179

136180
```

0 commit comments

Comments
 (0)