Skip to content

Commit 18d8882

Browse files
m-mohrchristophfriedrichsoxofaan
authored
Clarify federation extension fields (#564)
Co-authored-by: Christoph Friedrich <christoph@friedrich-whv.de> Co-authored-by: Stefaan Lippens <soxofaan@users.noreply.github.com>
1 parent da9bf27 commit 18d8882

1 file changed

Lines changed: 65 additions & 54 deletions

File tree

extensions/federation/README.md

Lines changed: 65 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -106,71 +106,27 @@ schema:
106106
}
107107
```
108108

109-
## Lists of resources
109+
## Resources supported only by a subset of back-ends
110110

111-
Clients will assume that all lists of resources are the a combination of all back-ends listed in `GET /`.
112-
Federated APIs can expose if any of the back-ends is not available and thus is not part of the response.
111+
Discoverable resources can explicitly list the subset of back-ends that support or host the exposed resource or functionality with the property `federation:backends`.
113112

114-
Applies to:
113+
Schema-wise, this only applies to resources that are defined as an object and allow to contain additional properties.
114+
For example (**not** comprehensive):
115115

116116
- `GET /collections`
117-
- `GET /processes`
118-
- `GET /file_formats`
119-
- `GET /process_graphs`
120-
- `GET /files`
121-
- `GET /jobs`
122-
- `GET /jobs/{job_id}`
123-
- `GET /jobs/{job_id}/results`
124-
- `GET /jobs/{job_id}/logs`
125-
- `GET /services`
126-
127-
The following endpoints define the resources (UDF runtimes / service types) at the top level of their response as key-value pairs.
128-
Consequently, they are not extensible with additional properties for federation purposes.
129-
130-
- `GET /udf_runtimes`
131-
- `GET /service_types`
132-
133-
### OpenAPI fragment
134-
135-
```yaml
136-
schema:
137-
type: object
138-
properties:
139-
'federation:missing':
140-
description: >-
141-
Lists all back-ends that were not considered in the response (e.g. because they were not accessible).
142-
If not given or empty, all back-ends were considered for creating the response.
143-
Back-ends that were listed as offline in the capabilities still need to be listed here.
144-
type: array
145-
items:
146-
type: string
147-
description: The ID of a back-end.
148-
```
149-
150-
### Example
151-
152-
```json
153-
{
154-
"federation:missing": ["wwu"],
155-
"collections": [...],
156-
"links": [...]
157-
}
158-
```
159-
160-
## Resources supported only by a subset of back-ends
161-
162-
Every discoverable resource that is defined as an object and allows to contain additional properties, can list the subset of back-ends that support or host the exposed resource/functionality.
163-
Examples of where this could apply to (**not** comprehensive):
164-
165117
- `GET /collections/{id}`
166-
- `GET /processes` (per process, per parameter)
167-
- `GET /file_formats` (per file format)
118+
- `GET /processes` (global, per process, per parameter)
119+
- `GET /file_formats` (global, per file format)
168120
- `GET /service_types` (per service)
169121
- `GET /udf_runtimes` (per UDF runtime, per version)
170122
- `POST /validation` (the back-ends that can run the process, see below)
123+
- `GET /files`
124+
- `GET /process_graphs`
171125
- `GET /process_graphs/{id}`
126+
- `GET /jobs`
172127
- `GET /jobs/{job_id}` (the back-ends that generated the result)
173128
- `GET /jobs/{job_id}/results` (the back-ends that generated the result)
129+
- `GET /services`
174130
- `GET /services/{id}` (the back-ends that host the service)
175131

176132
This can also be embedded deeply into a hierarchical structure, e.g. for process or file format parameters.
@@ -240,3 +196,58 @@ This also covers the case where the federation supports splitting a process into
240196
...
241197
}
242198
```
199+
200+
## Temporarily or unintentionally unavailable resources
201+
202+
Resources and back-ends can be temporarily or unintentionally unavailable.
203+
It is especially important to communicate to users missing resources when compiling a **list of resources** across multiple back-ends.
204+
Clients will assume that all lists of resources are a combination of all back-ends listed under `federation` in `GET /`.
205+
Federated APIs can expose if any of the back-ends was not available when building the resource listing response with the property `federation:missing`.
206+
207+
Examples of where this could apply to (**not** comprehensive):
208+
209+
- `GET /collections`
210+
- `GET /processes`
211+
- `GET /file_formats`
212+
- `GET /process_graphs`
213+
- `GET /files`
214+
- `GET /jobs`
215+
- `GET /jobs/{job_id}`
216+
- `GET /jobs/{job_id}/results`
217+
- `GET /jobs/{job_id}/logs`
218+
- `GET /services`
219+
220+
### OpenAPI fragment
221+
222+
```yaml
223+
schema:
224+
type: object
225+
properties:
226+
'federation:missing':
227+
description: >-
228+
Lists all back-ends that were unexpectedly unavailable during compilation of the response.
229+
If not given or empty, all back-ends supporting this endpoint were considered for creating the response.
230+
Back-ends that are listed as offline in the capabilities still need to be listed here.
231+
type: array
232+
items:
233+
type: string
234+
description: The ID of a back-end.
235+
```
236+
237+
### Example
238+
239+
```json
240+
{
241+
"federation:missing": ["wwu"],
242+
"collections": [...],
243+
"links": [...]
244+
}
245+
```
246+
247+
## Endpoints that can't list federation details
248+
249+
The following endpoints define the resources (UDF runtimes / service types) at the top level of their response as key-value pairs.
250+
Consequently, they are not extensible with additional properties for federation purposes.
251+
252+
- `GET /udf_runtimes`
253+
- `GET /service_types`

0 commit comments

Comments
 (0)