-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
526 lines (501 loc) · 22 KB
/
openapi.yaml
File metadata and controls
526 lines (501 loc) · 22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
openapi: 3.0.3
info:
title: SourceOS/SociOS Metadata Plane API
version: 2.0.0
description: |
The SourceOS/SociOS Metadata Plane API provides REST endpoints for cataloguing physical
assets, managing datasets and schemas, evaluating access policies, issuing capability
tokens, recording workflow runs, capturing provenance, and supporting collaboration.
All request and response bodies are JSON. All identifiers are stable URNs of the form
`urn:srcos:<type>:<local-id>`.
## Authentication
All endpoints require a Bearer token in the `Authorization` header.
## Error format
Error responses use a standard `{ "code": "...", "message": "...", "details": [...] }`
envelope defined in the `Error` component schema.
servers:
- url: https://api.srcos.local
description: Local development server
tags:
- name: Physical Assets
description: Connectors and physical data store assets
- name: Metadata
description: Datasets, schemas, fields, glossary, and field mappings
- name: Governance
description: Policies, decisions, and capability tokens
- name: Execution
description: Workflows, runs, and provenance records
- name: Collaboration
description: Comments and ratings
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: JWT or opaque bearer token issued by the SourceOS identity service.
schemas:
Error:
type: object
description: Standard error response envelope.
required: [code, message]
properties:
code:
type: string
description: Machine-readable error code (e.g. "validation_error", "not_found").
message:
type: string
description: Human-readable error message.
details:
type: array
description: Optional list of field-level error details.
items:
type: object
additionalProperties: true
security:
- bearerAuth: []
paths:
/v2/connectors:
post:
operationId: upsertConnector
summary: Upsert a Connector
description: Creates or updates a named connection configuration for a physical data store. Idempotent on `id`.
tags: [Physical Assets]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/Connector.json' }
responses:
'200':
description: Connector created or updated successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to upsert connectors.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/assets:
post:
operationId: upsertPhysicalAsset
summary: Upsert a PhysicalAsset
description: Creates or updates a physical resource record that references a Connector. Idempotent on `id`.
tags: [Physical Assets]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/PhysicalAsset.json' }
responses:
'200':
description: PhysicalAsset created or updated successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to upsert assets.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/schemas:
post:
operationId: upsertSchemaDefinition
summary: Upsert a SchemaDefinition
description: Creates or updates a logical schema composed of EntityFields. Idempotent on `id`.
tags: [Metadata]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/SchemaDefinition.json' }
responses:
'200':
description: SchemaDefinition created or updated successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to upsert schemas.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/agreements:
post:
operationId: upsertAgreement
summary: Upsert an Agreement
description: Creates or updates a data-sharing agreement between one or more parties. Idempotent on `id`.
tags: [Governance]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/Agreement.json' }
responses:
'200':
description: Agreement created or updated successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to upsert agreements.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/glossary:
post:
operationId: upsertGlossaryTerm
summary: Upsert a GlossaryTerm
description: Creates or updates a business glossary term with synonyms, tags, and authority links. Idempotent on `id`.
tags: [Metadata]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/GlossaryTerm.json' }
responses:
'200':
description: GlossaryTerm created or updated successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to upsert glossary terms.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/datasets:
post:
operationId: upsertDataset
summary: Upsert a Dataset
description: Creates or updates a governance-annotated logical view of a PhysicalAsset. Idempotent on `id`.
tags: [Metadata]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/Dataset.json' }
responses:
'200':
description: Dataset created or updated successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to upsert datasets.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/fields:
post:
operationId: upsertField
summary: Upsert a Field
description: Creates or updates a fully annotated, quality-profiled field bound to a Dataset. Idempotent on `id`.
tags: [Metadata]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/Field.json' }
responses:
'200':
description: Field created or updated successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to upsert fields.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/mappings:
post:
operationId: upsertMapping
summary: Upsert a MappingSpec
description: Creates or updates a field-to-field semantic mapping with confidence evidence. Idempotent on `id`.
tags: [Metadata]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/MappingSpec.json' }
responses:
'200':
description: MappingSpec created or updated successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to upsert mappings.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/policies:
post:
operationId: upsertPolicy
summary: Upsert a Policy
description: Creates or updates an access-control policy with subject/object/purpose scope and rules. Idempotent on `id`.
tags: [Governance]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/Policy.json' }
responses:
'200':
description: Policy created or updated successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to upsert policies.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/decisions/evaluate:
post:
operationId: evaluatePolicy
summary: Evaluate a policy decision
description: |
Evaluates all applicable Policies for the given subject, object, and purpose triple and
returns a signed PolicyDecision (permit, deny, or permitWithObligations).
The decision is persisted for audit purposes and its URN is returned in the response.
Use the returned `id` to call `POST /v2/tokens/issue` to receive a CapabilityToken.
tags: [Governance]
requestBody:
required: true
description: The access request context to evaluate.
content:
application/json:
schema:
type: object
required: [subject, object, purpose]
properties:
subject:
$ref: './schemas/SubjectContext.json'
object:
$ref: './schemas/ObjectContext.json'
purpose:
type: string
description: The declared purpose of the access request (e.g. "export", "analytics").
environment:
type: object
description: Optional ambient environment attributes (device, location, time) for condition evaluation.
responses:
'200':
description: Policy decision evaluated and persisted.
content:
application/json:
schema: { $ref: './schemas/PolicyDecision.json' }
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to call the policy evaluation endpoint.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/tokens/issue:
post:
operationId: issueToken
summary: Issue a CapabilityToken
description: |
Issues a short-lived, signed CapabilityToken derived from a PolicyDecision with outcome
`permit` or `permitWithObligations`. The token scopes the holder to the datasets, fields,
assets, and operations approved by the decision.
tags: [Governance]
requestBody:
required: true
description: The PolicyDecision from which to derive the token.
content:
application/json:
schema: { $ref: './schemas/PolicyDecision.json' }
responses:
'200':
description: CapabilityToken issued successfully.
content:
application/json:
schema: { $ref: './schemas/CapabilityToken.json' }
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: The PolicyDecision does not permit token issuance (outcome is deny).
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/workflows:
post:
operationId: upsertWorkflow
summary: Upsert a WorkflowSpec
description: Creates or updates a directed acyclic graph of WorkflowNodes with triggers and policy bindings. Idempotent on `id`.
tags: [Execution]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/WorkflowSpec.json' }
responses:
'200':
description: WorkflowSpec created or updated successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to upsert workflows.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/runs:
post:
operationId: recordRun
summary: Record a RunRecord
description: Persists the audit record of a completed workload execution, referencing the CapabilityToken and DataSphere used. Idempotent on `id`.
tags: [Execution]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/RunRecord.json' }
responses:
'200':
description: RunRecord persisted successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to record runs.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/provenance:
post:
operationId: recordProvenance
summary: Record a ProvenanceRecord
description: Persists a W3C PROV-compatible lineage record linking a RunRecord to its input and output entities. Idempotent on `id`.
tags: [Execution]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/ProvenanceRecord.json' }
responses:
'200':
description: ProvenanceRecord persisted successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to record provenance.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/comments:
post:
operationId: createComment
summary: Create a Comment
description: Creates a free-text annotation attached to any addressable object identified by a URN. Idempotent on `id`.
tags: [Collaboration]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/Comment.json' }
responses:
'200':
description: Comment created successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to create comments.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
/v2/ratings:
post:
operationId: createRating
summary: Create a Rating
description: Creates a 1–5 star rating attached to any addressable object. Idempotent on `id`.
tags: [Collaboration]
requestBody:
required: true
content:
application/json:
schema: { $ref: './schemas/Rating.json' }
responses:
'200':
description: Rating created successfully.
'400':
description: Request body is malformed JSON.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'401':
description: Missing or invalid authentication token.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'403':
description: Authenticated subject is not permitted to create ratings.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }
'422':
description: Request body is valid JSON but fails schema validation.
content: { application/json: { schema: { $ref: '#/components/schemas/Error' } } }