@@ -17,10 +17,14 @@ An operation is addressed using the following components:
17
17
- The containing endpoint, a URL prefix (e.g. ` http://api.mycompany.com/services/ ` )
18
18
- Service Name - A grouping of operations (e.g. ` payments.v1 ` )
19
19
- Operation Name - A unique name for the given (e.g. ` charge ` )
20
- - Operation ID - A unique ID assigned by the handler as a response to a [ StartOperation] ( #start-operation ) request.
20
+ - Operation Token - A unique token assigned by the handler as a response to a [ StartOperation] ( #start-operation )
21
+ request.
21
22
22
- The service name, operation name, and operation ID MUST not be empty and may contain any arbitrary character sequence as
23
- long as they're encoded into the URL.
23
+ The service name and operation name MUST not be empty and may contain any arbitrary character sequence as long as
24
+ they're encoded into the URL.
25
+
26
+ An operation token MUST not be empty and contain only characters that are valid HTTP header values. When passing a token
27
+ as part of a URL path make sure any special characters are encoded.
24
28
25
29
## Schema Definitions
26
30
@@ -57,10 +61,10 @@ The `OperationInfo` object MUST adhere to the given schema:
57
61
` ` ` yaml
58
62
type: object
59
63
properties:
60
- id :
64
+ token :
61
65
type: string
62
66
description: |
63
- An identifier for referencing this operation.
67
+ A token for referencing this operation.
64
68
65
69
state:
66
70
enum:
@@ -150,17 +154,27 @@ The body may contain arbitrary data. Headers should specify content type and enc
150
154
Request to cancel an operation. The operation may later complete as canceled or any other outcome. Handlers should
151
155
ignore multiple cancelations of the same operation and return successfully if cancelation was already requested.
152
156
153
- **Path**: `/{service}/{operation}/{operation_id}/ cancel`
157
+ **Path**: `/{service}/{operation}/cancel`
154
158
155
159
**Method**: `POST`
156
160
161
+ # ### Request Headers
162
+
163
+ The operation token received as a response to the Start Operation method. Must be delivered either via the `token` query
164
+ param or the `Nexus-Operation-Token` header field.
165
+
166
+ # ### Query Parameters
167
+
168
+ - `token` : The operation token received as a response to the Start Operation method. Must be delivered either via the
169
+ ` token` query param or the `Nexus-Operation-Token` header field.
170
+
157
171
# ### Response Codes
158
172
159
173
- `202 Accepted` : Cancelation request accepted.
160
174
161
175
**Body**: Empty.
162
176
163
- - `404 Not Found` : Operation ID not recognized or references deleted.
177
+ - `404 Not Found` : Operation token not recognized or references deleted.
164
178
165
179
**Headers**:
166
180
@@ -172,12 +186,20 @@ ignore multiple cancelations of the same operation and return successfully if ca
172
186
173
187
Retrieve operation result.
174
188
175
- **Path**: `/{service}/{operation}/{operation_id}/ result`
189
+ **Path**: `/{service}/{operation}/result`
176
190
177
191
**Method**: `GET`
178
192
193
+ # ### Request Headers
194
+
195
+ The operation token received as a response to the Start Operation method. Must be delivered either via the `token` query
196
+ param or the `Nexus-Operation-Token` header field.
197
+
179
198
# ### Query Parameters
180
199
200
+ - `token` : The operation token received as a response to the Start Operation method. Must be delivered either via the
201
+ ` token` query param or the `Nexus-Operation-Token` header field.
202
+
181
203
- `wait` : Optional. Duration indicating the waiting period for a result, defaulting to no wait. If by the end of the
182
204
wait period the operation is still running, the request should resolve with a 412 status code (see below).
183
205
@@ -217,7 +239,7 @@ Retrieve operation result.
217
239
218
240
**Body**: A JSON serialized [`Failure`](#failure) object.
219
241
220
- - `404 Not Found` : Operation ID not recognized or references deleted.
242
+ - `404 Not Found` : Operation token not recognized or references deleted.
221
243
222
244
**Headers**:
223
245
@@ -229,10 +251,20 @@ Retrieve operation result.
229
251
230
252
Retrieve operation details.
231
253
232
- **Path**: `/{service}/{operation}/{operation_id} `
254
+ **Path**: `/{service}/{operation}`
233
255
234
256
**Method**: `GET`
235
257
258
+ # ### Request Headers
259
+
260
+ The operation token received as a response to the Start Operation method. Must be delivered either via the `token` query
261
+ param or the `Nexus-Operation-Token` header field.
262
+
263
+ # ### Query Parameters
264
+
265
+ - `token` : The operation token received as a response to the Start Operation method. Must be delivered either via the
266
+ ` token` query param or the `Nexus-Operation-Token` header field.
267
+
236
268
# ### Response Codes
237
269
238
270
- `200 OK` : Successfully retrieved info.
@@ -245,7 +277,7 @@ Retrieve operation details.
245
277
246
278
A JSON serialized [`OperationInfo`](#operationinfo) object.
247
279
248
- - `404 Not Found` : Operation ID not recognized or references deleted.
280
+ - `404 Not Found` : Operation token not recognized or references deleted.
249
281
250
282
**Headers**:
251
283
@@ -312,7 +344,7 @@ For invoking a callback URL:
312
344
- Issue a POST request to the caller-provided URL.
313
345
- Include any callback headers supplied in the originating StartOperation request, stripping away the `Nexus-Callback-`
314
346
prefix.
315
- - Include the `Nexus-Operation-Id ` header, `Nexus-Operation-Start-Time` and any `Nexus-Link` headers for resources
347
+ - Include the `Nexus-Operation-Token ` header, `Nexus-Operation-Start-Time` and any `Nexus-Link` headers for resources
316
348
associated with this operation to support completing asynchronous operations before the response to StartOperation is
317
349
received. `Nexus-Operation-Start-Time` should be in a valid HTTP format described
318
350
[here](https://www.rfc-editor.org/rfc/rfc5322.html#section-3.3). If is omitted, the time the completion is received
0 commit comments