blob: 5449252dca8bcd86741752fefc8d7e576215f15a [file] [log] [blame]
elinuxhenrik93f015a2020-04-08 11:23:55 +02001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. SPDX-License-Identifier: CC-BY-4.0
BjornMagnussonXAddf58542021-10-06 11:05:01 +02003.. Copyright (C) 2021 Nordix
elinuxhenrik93f015a2020-04-08 11:23:55 +02004
5.. _simulator-api:
6
7=============
8Simulator API
9=============
10
11This document describes the API used to manage policy types and manipulate the simulator.
12
maximesson59e2b2a2021-06-02 12:45:34 +020013The simulator supports different versions of the A1 interface. Some functions are common for all versions, and some are
elinuxhenrik93f015a2020-04-08 11:23:55 +020014specific for a certain version.
15
elinuxhenrik93f015a2020-04-08 11:23:55 +020016Common Functions
17================
18
19Health Check
20------------
21
22The status of the simulator.
23
24/
25~~
26
27GET
28+++
29
elinuxhenrikc67ef9d2020-04-20 17:05:00 +020030Returns the status of the simulator.
elinuxhenrik93f015a2020-04-08 11:23:55 +020031
elinuxhenrikc67ef9d2020-04-20 17:05:00 +020032**URL path:**
BjornMagnussonXAddf58542021-10-06 11:05:01 +020033 /
elinuxhenrik93f015a2020-04-08 11:23:55 +020034
elinuxhenrikc67ef9d2020-04-20 17:05:00 +020035**Parameters:**
36 None.
elinuxhenrik93f015a2020-04-08 11:23:55 +020037
elinuxhenrikc67ef9d2020-04-20 17:05:00 +020038**Responses:**
39 200:
BjornMagnussonXAddf58542021-10-06 11:05:01 +020040 OK
elinuxhenrik93f015a2020-04-08 11:23:55 +020041
elinuxhenrikc67ef9d2020-04-20 17:05:00 +020042**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +020043
elinuxhenrik83a40db2020-04-23 07:47:44 +020044**Call**: ::
elinuxhenrik93f015a2020-04-08 11:23:55 +020045
elinuxhenrik83a40db2020-04-23 07:47:44 +020046 curl -X GET "http://localhost:8085/"
elinuxhenrik93f015a2020-04-08 11:23:55 +020047
elinuxhenrik83a40db2020-04-23 07:47:44 +020048**Result**:
49
50200: ::
51
BjornMagnussonXAddf58542021-10-06 11:05:01 +020052 OK
elinuxhenrik93f015a2020-04-08 11:23:55 +020053
54Supported Interfaces
55--------------------
56
57The simulator can support different versions of the A1 interface. With this API the supported versions can be listed.
58
59/container_interfaces
60~~~~~~~~~~~~~~~~~~~~~
61
62GET
63+++
64
elinuxhenrikc67ef9d2020-04-20 17:05:00 +020065Returns the status of the simulator. (Not available for A1 Standard 1.1.3)
elinuxhenrik93f015a2020-04-08 11:23:55 +020066
elinuxhenrikc67ef9d2020-04-20 17:05:00 +020067**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +020068
69/container_interfaces
elinuxhenrik93f015a2020-04-08 11:23:55 +020070
elinuxhenrikc67ef9d2020-04-20 17:05:00 +020071**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +020072
73None.
elinuxhenrik93f015a2020-04-08 11:23:55 +020074
elinuxhenrikc67ef9d2020-04-20 17:05:00 +020075**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +020076
77200:
elinuxhenrikc67ef9d2020-04-20 17:05:00 +020078 List of supported interfaces.
elinuxhenrik93f015a2020-04-08 11:23:55 +020079
elinuxhenrikc67ef9d2020-04-20 17:05:00 +020080**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +020081
elinuxhenrik83a40db2020-04-23 07:47:44 +020082**Call**: ::
elinuxhenrik93f015a2020-04-08 11:23:55 +020083
elinuxhenrik83a40db2020-04-23 07:47:44 +020084 curl -X GET "http://localhost:8085/container_interfaces"
elinuxhenrik93f015a2020-04-08 11:23:55 +020085
elinuxhenrik83a40db2020-04-23 07:47:44 +020086
87**Result**:
88
89200: ::
90
BjornMagnussonXAddf58542021-10-06 11:05:01 +020091 Current interface: STD_2.0.0 All supported A1 interface yamls in this container: ['OSC_2.1.0', 'STD_1.1.3', 'STD_2.0.0']
elinuxhenrik93f015a2020-04-08 11:23:55 +020092
93Counters
94--------
95
96The simulator keeps counts of different things that can be accessed.
97
98/counter
99~~~~~~~~
100
101GET
102+++
103
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200104Get a counter. Counter-name can be one of the following: 'num_instances', 'num_types', 'interface', 'remote_hosts' or 'datadelivery'.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200105
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200106**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200107
108/counter/{counter-name}
elinuxhenrik93f015a2020-04-08 11:23:55 +0200109
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200110**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200111
112None.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200113
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200114**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200115
116200:
117
118The counter value for the given counter.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200119
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200120**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +0200121
elinuxhenrik83a40db2020-04-23 07:47:44 +0200122**Call**: ::
elinuxhenrik93f015a2020-04-08 11:23:55 +0200123
elinuxhenrik83a40db2020-04-23 07:47:44 +0200124 curl -X GET "http://localhost:8085/counter/num_instances"
elinuxhenrik93f015a2020-04-08 11:23:55 +0200125
elinuxhenrik83a40db2020-04-23 07:47:44 +0200126**Result**:
127
128200: ::
129
130 10
elinuxhenrik93f015a2020-04-08 11:23:55 +0200131
elinuxhenrik93f015a2020-04-08 11:23:55 +0200132
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200133Reset simulator
134---------------
elinuxhenrik93f015a2020-04-08 11:23:55 +0200135
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200136There are two ways to reset the simulator, delete all instances or make a complete reset which resets the simulator to its original state.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200137
138/deleteinstances
139~~~~~~~~~~~~~~~~
140
141POST
142++++
143
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200144Delete all policy instances.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200145
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200146**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200147
148/deleteinstances
elinuxhenrik93f015a2020-04-08 11:23:55 +0200149
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200150**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200151
152None.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200153
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200154**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200155
156200:
157
158All policy instances deleted.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200159
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200160**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +0200161
elinuxhenrik83a40db2020-04-23 07:47:44 +0200162**Call**: ::
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200163
elinuxhenrik83a40db2020-04-23 07:47:44 +0200164 curl -X POST "http://localhost:8085/deleteinstances"
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200165
elinuxhenrik83a40db2020-04-23 07:47:44 +0200166**Result**:
167
168200: ::
169
170 All policy instances deleted.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200171
elinuxhenrik93f015a2020-04-08 11:23:55 +0200172/deleteall
173~~~~~~~~~~~~~~~~
174
175POST
176++++
177
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200178Full reset.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200179
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200180**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200181
182/deleteall
elinuxhenrik93f015a2020-04-08 11:23:55 +0200183
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200184**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200185
186None.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200187
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200188**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200189
190200:
191
192All policy instances and types deleted.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200193
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200194**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +0200195
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200196**Call**: ::
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200197
elinuxhenrik83a40db2020-04-23 07:47:44 +0200198 curl -X POST "http://localhost:8085/deleteall"
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200199
elinuxhenrik83a40db2020-04-23 07:47:44 +0200200**Result**:
201
202200: ::
203
204 All policy instances and types deleted.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200205
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200206200 ::
207 All policy instances deleted (Only for STD_1.1.3 since it has no types)
208
209Response manipulation
210---------------------
211It is possible to manipulate the response of all operations on the A1 interface (admin interface is not affected)
212
213/forceresponse
214~~~~~~~~~~~~~~
215
216POST
217++++
218
219Force a specific response code for one (the next) A1 operation. After that response, the reponse code will go back to normal.
220
221**URL path:**
222
223/forceresponse?code=<http-response-code>
224
225**Parameters:**
226
227code: (*Required*)
228
229The HTTP response code to return.
230
231**Responses:**
232
233200:
234
235Force response code: <expected code> set for one single A1 response
236
237**Examples:**
238
239**Call**: ::
240
241 curl -X POST "http://localhost:8085/forceresponse?code=400"
242
243**Result**:
244
245200: ::
246
247 Force response code: 400 set for one single A1 response
248
249/forcedelay
250~~~~~~~~~~~
251
252POST
253++++
254
255Force delayed response of all A1 responses. The setting will remain until the delay is set to '0'
256
257**URL path:**
258
259/forcedelay?delay=<delay-time-seconds>
260
261**Parameters:**
262
263delay: (*Required*)
264
265The time in seconds to delay all responses.
266
267**Responses:**
268
269200:
270
271Force delay: <expected delay> sec set for all A1 responses
272
273**Examples:**
274
275**Call**: ::
276
277 curl -X POST "http://localhost:8085/forcedelay?delay=2"
278
279**Result**:
280
281200: ::
282
283 Force delay: 2 sec set for all A1 responses
284
285
286Configure logging
287-----------------
288Detailed logging of the http headers and payload are activated by default. However, it is possible to turn this logging on or off.
289The 'off' state will only logg ip, url and respose code.
290
291/payload_logging/
292~~~~~~~~~~~~~~~~~
293
294POST
295++++
296
297Configure detailed logging on or off
298**URL path:**
299
300/payload_logging/<state>
301
302**Parameters:**
303
304state: (*Required*)
305
306The state, 'on' or 'off'.
307
308**Responses:**
309
310200:
311
312Force delay: <expected delay> sec set for all A1 responses
313
314**Examples:**
315
316**Call**: ::
317
318 curl -X POST "http://localhost:8085/payload_logging/on"
319
320**Result**:
321
322200: ::
323
324 Payload and header logging set to: on
325
326
327Version Specific Functions
328==========================
329
330The methods available to control the simulator depends on the version of the A1 API the simulator is simulating.
331
332OSC_2.1.0
333---------
334
335This section describes the available administrative functions for the OSC_2.1.0 version of A1.
336
337To see the A1 functions for this version, see `OSC_2.1.0 API`_.
338
339.. _OSC_2.1.0 API: https://gerrit.o-ran-sc.org/r/gitweb?p=sim/a1-interface.git;a=blob;f=near-rt-ric-simulator/api/OSC_2.1.0/openapi.yaml
340
341
342
elinuxhenrik93f015a2020-04-08 11:23:55 +0200343/policytype
344~~~~~~~~~~~
345
346PUT
347+++
348
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200349Create a policy type.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200350
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200351**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200352
353/policytype?id=<policy-type-id>
elinuxhenrik93f015a2020-04-08 11:23:55 +0200354
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200355**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200356
357id: (*Required*)
358
359The ID of the policy type.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200360
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200361**Body:** (*Required*)
elinuxhenrik83a40db2020-04-23 07:47:44 +0200362
363A JSON object containing the schema for the type.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200364
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200365**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200366
367200:
368
369Policy type <policy-type-id> is OK.
370
371201:
372
373Policy type <policy-type-id> is OK.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200374
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200375**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +0200376
elinuxhenrik83a40db2020-04-23 07:47:44 +0200377**Call**: ::
378
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200379 curl -X PUT "http://localhost:8085/policytype?id=1"
elinuxhenrik83a40db2020-04-23 07:47:44 +0200380 -H "Content-Type: application/json"
381 -d '{
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200382 "name": "pt1",
383 "description": "pt1 policy type",
384 "policy_type_id": 1,
385 "create_schema": {
elinuxhenrik83a40db2020-04-23 07:47:44 +0200386 "$schema": "http://json-schema.org/draft-07/schema#",
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200387 "title": "STD_QoSNudging_0.2.0",
388 "description": "QoS policy type",
elinuxhenrik83a40db2020-04-23 07:47:44 +0200389 "type": "object",
390 "properties": {
391 "scope": {
392 "type": "object",
393 "properties": {
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200394 "ueId": {
395 "type": "string"
elinuxhenrik83a40db2020-04-23 07:47:44 +0200396 },
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200397 "qosId": {
398 "type": "string"
399 }
400 },
401 "additionalProperties": false,
402 "required": [
403 "ueId",
404 "qosId"
405 ]
406 },
407 "statement": {
408 "type": "object",
409 "properties": {
410 "priorityLevel": {
411 "type": "number"
412 }
413 },
414 "additionalProperties": false,
415 "required": [
416 "priorityLevel"
417 ]
elinuxhenrik83a40db2020-04-23 07:47:44 +0200418 }
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200419 }
420 }
421 }'
elinuxhenrik93f015a2020-04-08 11:23:55 +0200422
elinuxhenrik83a40db2020-04-23 07:47:44 +0200423**Result**:
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200424
elinuxhenrik83a40db2020-04-23 07:47:44 +0200425201: ::
426
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200427 Policy type 1 is OK
elinuxhenrik93f015a2020-04-08 11:23:55 +0200428
429DELETE
430++++++
431
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200432Delete a policy type.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200433
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200434**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200435
436/policytype?id=<policy-type-id>
elinuxhenrik93f015a2020-04-08 11:23:55 +0200437
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200438**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200439
440id: (*Required*)
441
442The ID of the policy type.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200443
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200444**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200445
446204:
447
448Policy type <policy-type-id> is OK.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200449
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200450**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +0200451
elinuxhenrik83a40db2020-04-23 07:47:44 +0200452**Call**: ::
elinuxhenrik93f015a2020-04-08 11:23:55 +0200453
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200454 curl -X DELETE "http://localhost:8085/policytype?id=1"
elinuxhenrik93f015a2020-04-08 11:23:55 +0200455
elinuxhenrik83a40db2020-04-23 07:47:44 +0200456**Result**:
457
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200458204
elinuxhenrik83a40db2020-04-23 07:47:44 +0200459
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200460
elinuxhenrik93f015a2020-04-08 11:23:55 +0200461
462/policytypes
463~~~~~~~~~~~~
464
465GET
466+++
467
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200468Get a list of policy types.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200469
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200470**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200471
472/policytypes
elinuxhenrik93f015a2020-04-08 11:23:55 +0200473
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200474**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200475
476None.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200477
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200478**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200479
480200:
481
482A list of policy types.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200483
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200484**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +0200485
elinuxhenrik83a40db2020-04-23 07:47:44 +0200486**Call**: ::
elinuxhenrik93f015a2020-04-08 11:23:55 +0200487
elinuxhenrik83a40db2020-04-23 07:47:44 +0200488 curl -X GET "http://localhost:8085/policytypes"
elinuxhenrik93f015a2020-04-08 11:23:55 +0200489
elinuxhenrik83a40db2020-04-23 07:47:44 +0200490**Result**:
491
492200: ::
493
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200494 ["1"]
elinuxhenrik93f015a2020-04-08 11:23:55 +0200495
elinuxhenrik93f015a2020-04-08 11:23:55 +0200496
497/status
498~~~~~~~
499
500PUT
501+++
502
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200503Set status and optional reason, delete and time stamp.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200504
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200505**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200506
507/status?policyid=<policyid>&status=<status>&deleted=<value>&created_at=<time-stamp>
elinuxhenrik93f015a2020-04-08 11:23:55 +0200508
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200509**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200510
511policyid: (*Required*)
512
513The ID of a policy.
514
515status: (*Required*)
516
517The status of a policy.
518
519deleted: (*Optional*)
520
521True or false for real values, but accepts anything for error testing.
522
523created_at: (*Optional*)
524
525Time stamp for the status.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200526
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200527**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200528
529200:
530
531Status set to <status> for policy <policy-id>
elinuxhenrik93f015a2020-04-08 11:23:55 +0200532
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200533**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +0200534
elinuxhenrik83a40db2020-04-23 07:47:44 +0200535**Call**: ::
elinuxhenrik93f015a2020-04-08 11:23:55 +0200536
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200537 curl -X PUT "http://localhost:8085/status?policyid=1&status=Accepted"
elinuxhenrik93f015a2020-04-08 11:23:55 +0200538
elinuxhenrik83a40db2020-04-23 07:47:44 +0200539**Result**:
540
541200: ::
542
543 Status set to Accepted for policy Policy1.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200544
545A1 Standard 1.1.3
546-----------------
547
elinuxhenrikb11c3532020-04-22 11:01:08 +0200548This section describes the available administrative functions for the A1 Standard 1.1.3 version of A1.
549
550To see the A1 functions for this version, see `A1 Standard 1.1.3 API`_.
551
552.. _A1 Standard 1.1.3 API: https://gerrit.o-ran-sc.org/r/gitweb?p=sim/a1-interface.git;a=blob;f=near-rt-ric-simulator/api/STD_1.1.3/STD_A1.yaml
elinuxhenrik93f015a2020-04-08 11:23:55 +0200553
elinuxhenrik93f015a2020-04-08 11:23:55 +0200554
555/status
556~~~~~~~
557
558PUT
559+++
560
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200561Set status and optional reason, delete and time stamp.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200562
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200563**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200564
565/status?policyid=<policyid>&status=<status>&reason=<reason>
elinuxhenrik93f015a2020-04-08 11:23:55 +0200566
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200567**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200568
569policyid: (*Required*)
570
571The ID of a policy.
572
573status: (*Required*)
574
575The status of a policy.
576
577reason: (*Optional*)
578
579The reason for the status.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200580
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200581**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200582
583200:
584
585Status set to <status> for policy <policy-id>
elinuxhenrik93f015a2020-04-08 11:23:55 +0200586
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200587**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +0200588
elinuxhenrik83a40db2020-04-23 07:47:44 +0200589**Call**: ::
elinuxhenrik93f015a2020-04-08 11:23:55 +0200590
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200591 curl -X PUT "http://localhost:8085/status?policyid=Policy1&status=Accepted"
elinuxhenrik93f015a2020-04-08 11:23:55 +0200592
elinuxhenrik83a40db2020-04-23 07:47:44 +0200593**Result**:
594
595200: ::
596
597 Status set to Accepted for policy Policy1
elinuxhenrik93f015a2020-04-08 11:23:55 +0200598
599/sendstatus
600~~~~~~~~~~~
601
602POST
603++++
604
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200605Send status for policy.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200606
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200607**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200608
609/sendstatus?policyid=<policy-id>
elinuxhenrik93f015a2020-04-08 11:23:55 +0200610
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200611**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200612
613policyid: (*Required*)
614
615The ID of the policy to send status for.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200616
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200617**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200618
619200:
620
621Is a JSON with the response of the actual post request to the callback server, whatever that is.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200622
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200623**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +0200624
elinuxhenrik83a40db2020-04-23 07:47:44 +0200625**Call**: ::
elinuxhenrik93f015a2020-04-08 11:23:55 +0200626
elinuxhenrik83a40db2020-04-23 07:47:44 +0200627 curl -X POST "http://localhost:8085/sendstatus?policyid=Policy2"
628
629**Result**:
630
631200
elinuxhenrik93f015a2020-04-08 11:23:55 +0200632
elinuxhenrik93f015a2020-04-08 11:23:55 +0200633
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200634A1 Standard 2.0.0
635-----------------
elinuxhenrikb11c3532020-04-22 11:01:08 +0200636
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200637This section describes the available administrative functions for the A1 Standard 2.0.0 version of A1.
elinuxhenrikb11c3532020-04-22 11:01:08 +0200638
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200639To see the A1 functions for this version, see `A1 Standard 2.0.0 API`_.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200640
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200641.. _A1 Standard 2.0.0 API: https://gerrit.o-ran-sc.org/r/gitweb?p=sim/a1-interface.git;a=blob;f=near-rt-ric-simulator/api/STD_2.0.0/ORAN_A1-p_V2.0.0_api.yaml
elinuxhenrik93f015a2020-04-08 11:23:55 +0200642
elinuxhenrik93f015a2020-04-08 11:23:55 +0200643
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200644/policytype
645~~~~~~~~~~~
elinuxhenrik93f015a2020-04-08 11:23:55 +0200646
647PUT
648+++
649
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200650Create or update a policy type.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200651
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200652**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200653
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200654/policytype?id={policy-type-id}
elinuxhenrik93f015a2020-04-08 11:23:55 +0200655
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200656**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200657
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200658policy-type-id: (*Required*)
659
660The ID of the policy type.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200661
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200662**Body:** (*Required*)
elinuxhenrik83a40db2020-04-23 07:47:44 +0200663
664A JSON object containing the schema for the type.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200665
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200666**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200667
668200:
669
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200670The policy type <policy-type-id> is ok
671
672201:
673
674The policy type <policy-type-id> is ok
elinuxhenrik93f015a2020-04-08 11:23:55 +0200675
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200676**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +0200677
elinuxhenrik83a40db2020-04-23 07:47:44 +0200678**Call**: ::
679
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200680 curl -X PUT "http://localhost:8085/policytype?id=STD_PolicyModelUnconstrained_0.2.0"
elinuxhenrik83a40db2020-04-23 07:47:44 +0200681 -H "Content-Type: application/json"
682 -d '{
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200683 "policySchema": {
684 "$schema": "http://json-schema.org/draft-07/schema#",
685 "title": "STD_1_0.2.0",
686 "description": "STD 1 policy type",
687 "type": "object",
688 "properties": {
689 "scope": {
elinuxhenrik83a40db2020-04-23 07:47:44 +0200690 "type": "object",
691 "properties": {
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200692 "ueId": {
693 "type": "string"
elinuxhenrik83a40db2020-04-23 07:47:44 +0200694 },
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200695 "qosId": {
696 "type": "string"
697 }
elinuxhenrik83a40db2020-04-23 07:47:44 +0200698 },
699 "additionalProperties": false,
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200700 "required": [
701 "ueId",
702 "qosId"
703 ]
704 },
705 "statement": {
706 "type": "object",
707 "properties": {
708 "priorityLevel": {
709 "type": "number"
710 }
711 },
712 "additionalProperties": false,
713 "required": [
714 "priorityLevel"
715 ]
elinuxhenrik83a40db2020-04-23 07:47:44 +0200716 }
717 }
718 },
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200719 "statusSchema": {
720 "$schema": "http://json-schema.org/draft-07/schema#",
721 "title": "STD_1_0.2.0",
722 "description": "STD 1 policy type status",
723 "type": "object",
724 "properties": {
725 "enforceStatus": {
726 "type": "string"
727 },
728 "enforceReason": {
729 "type": "string"
730 },
731 "additionalProperties": false,
732 "required": [
733 "enforceStatus"
734 ]
735 }
736 }
elinuxhenrik83a40db2020-04-23 07:47:44 +0200737 }'
elinuxhenrik93f015a2020-04-08 11:23:55 +0200738
elinuxhenrik83a40db2020-04-23 07:47:44 +0200739**Result**:
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200740
elinuxhenrik83a40db2020-04-23 07:47:44 +0200741200: ::
742
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200743 Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
744
745201: ::
746
747 Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
elinuxhenrik93f015a2020-04-08 11:23:55 +0200748
749DELETE
750++++++
751
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200752Delete a policy type.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200753
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200754**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200755
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200756/policytype?id={policy-type-id}
757
758**Parameters:**
759
760None.
761
762**Responses:**
763
764204
765
766
767**Examples:**
768
769**Call**: ::
770
771 curl -X DELETE "http://localhost:8085/policytype?id=STD_PolicyModelUnconstrained_0.2.0"
772
773**Result**:
774
775204
776
777
778
779/policytypes
780~~~~~~~~~~~~
781
782GET
783+++
784
785Get a list of policy types.
786
787**URL path:**
788
789/policytypes
elinuxhenrik93f015a2020-04-08 11:23:55 +0200790
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200791**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200792
793None.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200794
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200795**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200796
797200:
798
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200799A list of policy types.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200800
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200801**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +0200802
elinuxhenrik83a40db2020-04-23 07:47:44 +0200803**Call**: ::
elinuxhenrik93f015a2020-04-08 11:23:55 +0200804
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200805 curl -X GET "http://localhost:8085/policytypes"
elinuxhenrik93f015a2020-04-08 11:23:55 +0200806
elinuxhenrik83a40db2020-04-23 07:47:44 +0200807**Result**:
808
809200: ::
810
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200811 ["STD_PolicyModelUnconstrained_0.2.0"]
812
elinuxhenrik93f015a2020-04-08 11:23:55 +0200813
814/{policyId}/{enforceStatus}
815~~~~~~~~~~~~~~~~~~~~~~~~~~~
816
817PUT
818+++
819
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200820Set a status to a policy instance with an enforceStatus parameter only.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200821
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200822**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200823
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200824/status?policyid={policyId}&status={status}&reason={reason}
elinuxhenrik93f015a2020-04-08 11:23:55 +0200825
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200826**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200827
828None.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200829
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200830**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200831
832200:
833
834Status updated for policy: <policyId>
elinuxhenrik93f015a2020-04-08 11:23:55 +0200835
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200836**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +0200837
elinuxhenrik83a40db2020-04-23 07:47:44 +0200838**Call**: ::
elinuxhenrik93f015a2020-04-08 11:23:55 +0200839
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200840 curl -X PUT "http://localhost:8085/status?policyid=Policy1&status=ENFORCED"
elinuxhenrik93f015a2020-04-08 11:23:55 +0200841
elinuxhenrik83a40db2020-04-23 07:47:44 +0200842**Result**:
843
844200: ::
845
846 Status updated for policy: Policy1
elinuxhenrik93f015a2020-04-08 11:23:55 +0200847
848/{policyId}/{enforceStatus}/{enforceReason}
849~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
850
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200851/sendstatus
852~~~~~~~~~~~
853
854POST
elinuxhenrik93f015a2020-04-08 11:23:55 +0200855++++
856
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200857Send status for policy.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200858
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200859**URL path:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200860
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200861/sendstatus?policyid=<policy-id>
elinuxhenrik93f015a2020-04-08 11:23:55 +0200862
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200863**Parameters:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200864
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200865policyid: (*Required*)
866
867The ID of the policy to send status for.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200868
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200869**Responses:**
elinuxhenrik83a40db2020-04-23 07:47:44 +0200870
871200:
872
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200873Is a JSON with the response of the actual post request to the callback server, whatever that is.
elinuxhenrik93f015a2020-04-08 11:23:55 +0200874
elinuxhenrikc67ef9d2020-04-20 17:05:00 +0200875**Examples:**
elinuxhenrik93f015a2020-04-08 11:23:55 +0200876
elinuxhenrik83a40db2020-04-23 07:47:44 +0200877**Call**: ::
elinuxhenrik93f015a2020-04-08 11:23:55 +0200878
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200879 curl -X POST "http://localhost:8085/sendstatus?policyid=Policy2"
elinuxhenrik93f015a2020-04-08 11:23:55 +0200880
elinuxhenrik83a40db2020-04-23 07:47:44 +0200881**Result**:
882
BjornMagnussonXAddf58542021-10-06 11:05:01 +0200883200