Skip to content

Commit eeac0c7

Browse files
committed
Nexus-Operation-Token
1 parent 3934057 commit eeac0c7

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed

SPEC.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ An operation is addressed using the following components:
1717
- The containing endpoint, a URL prefix (e.g. `http://api.mycompany.com/services/`)
1818
- Service Name - A grouping of operations (e.g. `payments.v1`)
1919
- 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.
2122

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.
2427

2528
## Schema Definitions
2629

@@ -57,10 +60,10 @@ The `OperationInfo` object MUST adhere to the given schema:
5760
```yaml
5861
type: object
5962
properties:
60-
id:
63+
token:
6164
type: string
6265
description: |
63-
An identifier for referencing this operation.
66+
A token for referencing this operation.
6467
6568
state:
6669
enum:
@@ -150,17 +153,22 @@ The body may contain arbitrary data. Headers should specify content type and enc
150153
Request to cancel an operation. The operation may later complete as canceled or any other outcome. Handlers should
151154
ignore multiple cancelations of the same operation and return successfully if cancelation was already requested.
152155

153-
**Path**: `/{service}/{operation}/{operation_id}/cancel`
156+
**Path**: `/{service}/{operation}/cancel`
154157

155158
**Method**: `POST`
156159

160+
#### Request Headers
161+
162+
The operation token received as a response to the Start Operation method must be delivered via the
163+
`Nexus-Operation-Token` header field.
164+
157165
#### Response Codes
158166

159167
- `202 Accepted`: Cancelation request accepted.
160168

161169
**Body**: Empty.
162170

163-
- `404 Not Found`: Operation ID not recognized or references deleted.
171+
- `404 Not Found`: Operation token not recognized or references deleted.
164172

165173
**Headers**:
166174

@@ -172,10 +180,15 @@ ignore multiple cancelations of the same operation and return successfully if ca
172180

173181
Retrieve operation result.
174182

175-
**Path**: `/{service}/{operation}/{operation_id}/result`
183+
**Path**: `/{service}/{operation}/result`
176184

177185
**Method**: `GET`
178186

187+
#### Request Headers
188+
189+
The operation token received as a response to the Start Operation method must be delivered via the
190+
`Nexus-Operation-Token` header field.
191+
179192
#### Query Parameters
180193

181194
- `wait`: Optional. Duration indicating the waiting period for a result, defaulting to no wait. If by the end of the
@@ -217,7 +230,7 @@ Retrieve operation result.
217230

218231
**Body**: A JSON serialized [`Failure`](#failure) object.
219232

220-
- `404 Not Found`: Operation ID not recognized or references deleted.
233+
- `404 Not Found`: Operation token not recognized or references deleted.
221234

222235
**Headers**:
223236

@@ -229,10 +242,15 @@ Retrieve operation result.
229242

230243
Retrieve operation details.
231244

232-
**Path**: `/{service}/{operation}/{operation_id}`
245+
**Path**: `/{service}/{operation}`
233246

234247
**Method**: `GET`
235248

249+
#### Request Headers
250+
251+
The operation token received as a response to the Start Operation method must be delivered via the
252+
`Nexus-Operation-Token` header field.
253+
236254
#### Response Codes
237255

238256
- `200 OK`: Successfully retrieved info.
@@ -245,7 +263,7 @@ Retrieve operation details.
245263

246264
A JSON serialized [`OperationInfo`](#operationinfo) object.
247265

248-
- `404 Not Found`: Operation ID not recognized or references deleted.
266+
- `404 Not Found`: Operation token not recognized or references deleted.
249267

250268
**Headers**:
251269

@@ -312,7 +330,7 @@ For invoking a callback URL:
312330
- Issue a POST request to the caller-provided URL.
313331
- Include any callback headers supplied in the originating StartOperation request, stripping away the `Nexus-Callback-`
314332
prefix.
315-
- Include the `Nexus-Operation-Id` header, `Nexus-Operation-Start-Time` and any `Nexus-Link` headers for resources
333+
- Include the `Nexus-Operation-Token` header, `Nexus-Operation-Start-Time` and any `Nexus-Link` headers for resources
316334
associated with this operation to support completing asynchronous operations before the response to StartOperation is
317335
received. `Nexus-Operation-Start-Time` should be in a valid HTTP format described
318336
[here](https://www.rfc-editor.org/rfc/rfc5322.html#section-3.3). If is omitted, the time the completion is received

0 commit comments

Comments
 (0)