-
Notifications
You must be signed in to change notification settings - Fork 2
/
openapi.yaml
448 lines (448 loc) · 14.5 KB
/
openapi.yaml
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
# ==================================================================================
# Copyright (c) 2019-2020 Nokia
# Copyright (c) 2018-2020 AT&T Intellectual Property.
# Copyright (c) 2020-2023 Nordix Foundation, Modifications
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==================================================================================
openapi: 3.0.1
info:
title: RIC A1
version: 2.1.0
servers:
- url: /
paths:
/a1-p/healthcheck:
get:
tags:
- A1 Mediator
description: |
Perform a healthcheck on a1
operationId: a1_controller_get_healthcheck
responses:
200:
description: |
A1 is healthy. Anything other than a 200 should be considered a1 as failing
content: {}
/a1-p/policytypes:
get:
tags:
- A1 Mediator
description: Get a list of all registered policy type ids
operationId: a1_controller_get_all_policy_types
responses:
200:
description: list of all registered policy type ids
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/policy_type_id'
example:
- 20000
- 20020
503:
description: Potentially transient backend database error. Client should
attempt to retry later.
content: {}
/a1-p/policytypes/{policy_type_id}:
get:
tags:
- A1 Mediator
description: |
Get this policy type
operationId: a1_controller_get_policy_type
parameters:
- name: policy_type_id
in: path
description: |
represents a policy type identifier. Currently this is restricted to an integer range.
required: true
schema:
maximum: 2147483647
minimum: 1
type: integer
responses:
200:
description: policy type successfully found
content:
application/json:
schema:
$ref: '#/components/schemas/policy_type_schema'
404:
description: |
policy type not found
content: {}
503:
description: Potentially transient backend database error. Client should
attempt to retry later.
content: {}
put:
tags:
- A1 Mediator
description: |
Create a new policy type . Replace is not currently allowed; to replace, for now do a DELETE and then a PUT again.
operationId: a1_controller_create_policy_type
parameters:
- name: policy_type_id
in: path
description: |
represents a policy type identifier. Currently this is restricted to an integer range.
required: true
schema:
maximum: 2147483647
minimum: 1
type: integer
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/policy_type_schema'
required: false
responses:
201:
description: policy type successfully created
content: {}
400:
description: illegal ID, or object already existed
content: {}
503:
description: Potentially transient backend database error. Client should
attempt to retry later.
content: {}
x-codegen-request-body-name: body
delete:
tags:
- A1 Mediator
description: |
Delete this policy type. Can only be performed if there are no instances of this type
operationId: a1_controller_delete_policy_type
parameters:
- name: policy_type_id
in: path
description: |
represents a policy type identifier. Currently this is restricted to an integer range.
required: true
schema:
maximum: 2147483647
minimum: 1
type: integer
responses:
204:
description: |
policy type successfully deleted
content: {}
400:
description: |
Policy type cannot be deleted because there are instances All instances must be removed before a policy type can be deleted
content: {}
404:
description: |
policy type not found
content: {}
503:
description: Potentially transient backend database error. Client should
attempt to retry later.
content: {}
/a1-p/policytypes/{policy_type_id}/policies:
get:
tags:
- A1 Mediator
description: get a list of all policy instance ids for this policy type id
operationId: a1_controller_get_all_instances_for_type
parameters:
- name: policy_type_id
in: path
description: |
represents a policy type identifier. Currently this is restricted to an integer range.
required: true
schema:
maximum: 2147483647
minimum: 1
type: integer
responses:
200:
description: list of all policy instance ids for this policy type id
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/policy_instance_id'
example:
- 3d2157af-6a8f-4a7c-810f-38c2f824bf12
- 06911bfc-c127-444a-8eb1-1bffad27cc3d
503:
description: Potentially transient backend database error. Client should
attempt to retry later.
content: {}
/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}:
get:
tags:
- A1 Mediator
description: |
Retrieve the policy instance
operationId: a1_controller_get_policy_instance
parameters:
- name: policy_type_id
in: path
description: |
represents a policy type identifier. Currently this is restricted to an integer range.
required: true
schema:
maximum: 2147483647
minimum: 1
type: integer
- name: policy_instance_id
in: path
description: |
represents a policy instance identifier. UUIDs are advisable but can be any string
required: true
schema:
type: string
- name: notificationDestination
in: query
description: |
URL send by non-RT RIC. This where non-RT RIC expects status updates on the policy creation
schema:
type: string
responses:
200:
description: |
The policy instance. the schema of this object is defined by the create_schema field of the policy type
content:
application/json:
schema:
type: object
404:
description: |
there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id
content: {}
503:
description: Potentially transient backend database error. Client should
attempt to retry later.
content: {}
put:
tags:
- A1 Mediator
description: |
Create or replace a policy instance of type policy_type_id. The schema of the PUT body is defined by the create_schema field of the policy type.
operationId: a1_controller_create_or_replace_policy_instance
parameters:
- name: policy_type_id
in: path
description: |
represents a policy type identifier. Currently this is restricted to an integer range.
required: true
schema:
maximum: 2147483647
minimum: 1
type: integer
- name: policy_instance_id
in: path
description: |
represents a policy instance identifier. UUIDs are advisable but can be any string
required: true
schema:
type: string
- name: notificationDestination
in: query
description: |
URL send by non-RT RIC. This where non-RT RIC expects status updates on the policy creation
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
description: |
the schema of this object is defined by the create_schema field of the policy type
required: false
responses:
202:
description: |
Policy instance creation initiated
content: {}
400:
description: |
Bad PUT body for this policy instance
content: {}
404:
description: |
There is no policy type with this policy_type_id
content: {}
503:
description: Potentially transient backend database error. Client should
attempt to retry later.
content: {}
x-codegen-request-body-name: body
delete:
tags:
- A1 Mediator
description: |
Delete this policy instance
operationId: a1_controller_delete_policy_instance
parameters:
- name: policy_type_id
in: path
description: |
represents a policy type identifier. Currently this is restricted to an integer range.
required: true
schema:
maximum: 2147483647
minimum: 1
type: integer
- name: policy_instance_id
in: path
description: |
represents a policy instance identifier. UUIDs are advisable but can be any string
required: true
schema:
type: string
- name: notificationDestination
in: query
description: |
URL send by non-RT RIC. This where non-RT RIC expects status updates on the policy creation
schema:
type: string
responses:
202:
description: |
policy instance deletion initiated
content: {}
404:
description: |
there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id
content: {}
503:
description: Potentially transient backend database error. Client should
attempt to retry later.
content: {}
/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}/status:
get:
tags:
- A1 Mediator
description: |
Retrieve the policy instance status across all handlers of the policy If this endpoint returns successfully (200),
it is either ENFORCED or NOT_ENFORCED. ENFORCED is returned if at least one policy handler in the RIC is implementing
the policy.
NOT_ENFORCED is returned otherwise If a policy instance is successfully deleted, this endpoint will return a 404 (not a 200).
operationId: a1_controller_get_policy_instance_status
parameters:
- name: policy_type_id
in: path
description: |
represents a policy type identifier. Currently this is restricted to an integer range.
required: true
schema:
maximum: 2147483647
minimum: 1
type: integer
- name: policy_instance_id
in: path
description: |
represents a policy instance identifier. UUIDs are advisable but can be any string
required: true
schema:
type: string
responses:
200:
description: |
successfully retrieved the status
content:
application/json:
schema:
type: object
properties:
enforceStatus:
type: string
enum:
- ENFORCED
- NOT_ENFORCED
enforceReason:
type: string
enum:
- SCOPE_NOT_APPLICABLE
- STATEMENT_NOT_APPLICABLE
- OTHER_REASON
404:
description: |
there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id
content: {}
503:
description: Potentially transient backend database error. Client should
attempt to retry later.
content: {}
/data-delivery:
post:
tags:
- A1 EI Data Delivery
description: |
Deliver data produced by data producer.
operationId: a1_controller_data_delivery
requestBody:
content:
application/json:
schema:
type: object
description: |
object to represent data object
required: false
responses:
200:
description: |
successfully delivered data from data producer
content: {}
404:
description: |
no job id defined for this data delivery
content: {}
x-codegen-request-body-name: body
components:
schemas:
policy_type_schema:
required:
- create_schema
- description
- name
- policy_type_id
type: object
properties:
name:
type: string
description: name of the policy type
description:
type: string
description: description of the policy type
policy_type_id:
type: integer
description: the integer of the policy type
create_schema:
type: object
properties: {}
description: |
jsonschema (following http://json-schema.org/draft-07/schema) of the CREATE payload to be sent to handlers of this policy
policy_type_id:
maximum: 2147483647
minimum: 1
type: integer
description: |
represents a policy type identifier. Currently this is restricted to an integer range.
policy_instance_id:
type: string
description: |
represents a policy instance identifier. UUIDs are advisable but can be any string
example: 3d2157af-6a8f-4a7c-810f-38c2f824bf12
x-components: {}