1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3 .. Copyright (C) 2020 Nordix
11 This document describes the API used to manage policy types and manipulate the simulator.
13 The simulator supports different versions of the A1 interface. Some functions are common for all version, and some are
14 specific for a certain version.
22 The status of the simulator.
30 Returns the status of the simulator.
45 curl -X GET "http://localhost:8085/"
50 Simulator is living (OSC_2.1.0 responds OK)
55 The simulator can support different versions of the A1 interface. With this API the supported versions can be listed.
63 Returns the status of the simulator. (Not available for A1 Standard 1.1.3)
73 List of supported interfaces.
78 curl -X GET "http://localhost:8085/container_interfaces"
83 1.1.x-alpha.2 OSC_2.1.0 STD_1.1.3
88 The simulator keeps counts of different things that can be accessed.
96 Get a counter. Counter-name can be one of the following: 'num_instances', 'num_types' or 'interface'.
99 /counter/{counter-name}
106 The counter value for the given counter.
111 curl -X GET "http://localhost:8085/counter/num_instances"
118 Version Specific Functions
119 ==========================
121 The methods available to control the simulator depends on the version of the A1 API the simulator is simulating.
126 This section describes the available administrative functions for the OSC_2.1.0 version of A1.
128 To see the A1 functions for this version, see `OSC_2.1.0 API`_.
130 .. _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
138 Delete all policy instances.
148 All policy instances deleted.
153 curl -X POST "http://localhost:8085/deleteinstances"
158 All policy instances deleted.
176 All policy instances and types deleted.
181 curl -X POST "http://localhost:8085/deleteall"
186 All policy instances and types deleted.
194 Create a policy type.
197 /policytype?id=<policy-type-id>
201 The ID of the policy type.
203 **Body:** (*Required*)
204 A JSON object containing the schema for the type.
208 Policy type <policy-type-id> is OK.
210 Policy type <policy-type-id> is OK.
215 curl -X PUT "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
216 -H "Content-Type: application/json"
218 "$schema": "http://json-schema.org/draft-07/schema#",
219 "title": "STD_PolicyModelUnconstrained_0.2.0",
220 "description": "Standard model of a policy with unconstrained scope id combinations",
226 "ueId": {"type": "string"},
227 "groupId": {"type": "string"},
228 "sliceId": {"type": "string"},
229 "qosId": {"type": "string"},
230 "cellId": {"type": "string"}
233 "additionalProperties": false
238 "gfbr": {"type": "number"},
239 "mfbr": {"type": "number"},
240 "priorityLevel": {"type": "number"},
241 "pdb": {"type": "number"}
243 "additionalProperties": false
248 "qoeScore": {"type": "number"},
249 "initialBuffering": {"type": "number"},
250 "reBuffFreq": {"type": "number"},
251 "stallRatio": {"type": "number"}
253 "additionalProperties": false
277 "primary": {"type": "boolean"}
279 "additionalProperties": false,
280 "required": ["cellIdList", "preference"]
285 "additionalProperties": false,
286 "required": ["scope"]
292 Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
297 Delete a policy type.
300 /policytype?id=<policy-type-id>
304 The ID of the policy type.
308 Policy type <policy-type-id> is OK.
313 curl -X DELETE "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
318 Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
326 Get a list of policy types.
336 A list of policy types.
341 curl -X GET "http://localhost:8085/policytypes"
346 STD_PolicyModelUnconstrained_0.2.0
354 Force a specific response code for an A1 operation.
357 /forceresponse?responsecode=<http-response-code>
360 responsecode: (*Required*)
361 The HTTP response code to return.
365 Force response code: <expected code> set for one single A1 response
370 curl -X POST "http://localhost:8085/forceresponse?responsecode=400"
375 Force response code: 400 set for one single A1 response
383 Force delayed response of all A1 operations.
386 /forcedelay?delay=<delay-time-seconds>
390 The time in seconds to delay all responses.
394 Force delay: <expected delay> sec set for all A1 responses
399 curl -X POST "http://localhost:8085/forcedelay?delay=2"
404 Force delay: 2 sec set for all A1 responses
412 Set status and optional reason, delete and time stamp.
415 /status?policyid=<policyid>&status=<status>&deleted=<value>&created_at=<time-stamp>
418 policyid: (*Required*)
421 The status of a policy.
422 deleted: (*Optional*)
423 True or false for real values, but accepts anything for error testing.
424 created_at: (*Optional*)
425 Time stamp for the status.
429 Status set to <status> for policy <policy-id>
434 curl -X PUT "http://localhost:8085/policyid=Policy1&status?status=Accepted
439 Status set to Accepted for policy Policy1.
444 This section describes the available administrative functions for the A1 Standard 1.1.3 version of A1.
446 To see the A1 functions for this version, see `A1 Standard 1.1.3 API`_.
448 .. _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
456 Delete all policy instances.
466 All policy instances deleted.
471 curl -X POST "http://localhost:8085/deleteinstances"
476 All policy instances deleted.
494 All policy instances deleted.
499 curl -X POST "http://localhost:8085/deleteall"
504 All policy instances deleted.
512 Force a specific response code for an A1 operation.
515 /forceresponse?responsecode=<http-response-code>
518 responsecode: (*Required*)
519 The HTTP response code to return.
523 Force response code: <expected code> set for one single A1 response
528 curl -X POST "http://localhost:8085/forceresponse?responsecode=400"
533 Force response code: 400 set for one single A1 response
541 Force delayed response of all A1 operations.
544 /forcedelay?delay=<delay-time-seconds>
548 The time in seconds to delay all responses.
552 Force delay: <expected delay> sec set for all A1 responses
557 curl -X POST "http://localhost:8085/forcedelay?delay=2"
562 Force delay: 2 sec set for all A1 responses
570 Set status and optional reason, delete and time stamp.
573 /status?policyid=<policyid>&status=<status>&reason=<reason>
576 policyid: (*Required*)
579 The status of a policy.
581 The reason for the status.
585 Status set to <status> for policy <policy-id>
590 curl -X PUT "http://localhost:8085/status?policyid=Policy1&status=Accepted
595 Status set to Accepted for policy Policy1
603 Send status for policy.
606 /sendstatus?policyid=<policy-id>
609 policyid: (*Required*)
610 The ID of the policy to send status for.
614 Is a JSON with the response of the actual post request to the callback server, whatever that is.
619 curl -X POST "http://localhost:8085/sendstatus?policyid=Policy2"
627 This section describes the available administrative functions for the 1.1.x-alpha.2 version of A1.
629 To see the A1 functions for this version, see `1.1.x-alpha.2 API`_.
631 .. _1.1.x-alpha.2 API: https://gerrit.o-ran-sc.org/r/gitweb?p=sim/a1-interface.git;a=blob;f=near-rt-ric-simulator/api/1.1.x-alpha.2/a1-openapi.yaml
639 Delete all policy instances.
649 All policy instances deleted.
654 curl -X DELETE "http://localhost:8085/deleteinstances"
659 All policy instances deleted.
667 Delete all policy types.
677 All policy types deleted.
682 curl -X DELETE "http://localhost:8085/deletetypes"
687 All policy types deleted.
695 Create or update a policy type.
698 /policytypes/{policy-type-id}
703 **Body:** (*Required*)
704 A JSON object containing the schema for the type.
708 The policy type was either created or updated for policy type id: <policy-type-id>
713 curl -X PUT "http://localhost:8085/policytype/Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
714 -H "Content-Type: application/json"
716 "$schema": "http://json-schema.org/draft-07/schema#",
717 "title": "STD_PolicyModelUnconstrained_0.2.0",
718 "description": "Standard model of a policy with unconstrained scope id combinations",
724 "ueId": {"type": "string"},
725 "groupId": {"type": "string"},
726 "sliceId": {"type": "string"},
727 "qosId": {"type": "string"},
728 "cellId": {"type": "string"}
731 "additionalProperties": false
736 "gfbr": {"type": "number"},
737 "mfbr": {"type": "number"},
738 "priorityLevel": {"type": "number"},
739 "pdb": {"type": "number"}
741 "additionalProperties": false
746 "qoeScore": {"type": "number"},
747 "initialBuffering": {"type": "number"},
748 "reBuffFreq": {"type": "number"},
749 "stallRatio": {"type": "number"}
751 "additionalProperties": false
775 "primary": {"type": "boolean"}
777 "additionalProperties": false,
778 "required": ["cellIdList", "preference"]
783 "additionalProperties": false,
784 "required": ["scope"]
790 The policy type was either created or updated for policy type id: STD_PolicyModelUnconstrained_0.2.0
795 Delete a policy type.
798 /policytypes/{policy-type-id}
805 policy type successfully deleted for policy type id: <policy-type-id>
810 curl -X DELETE "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
815 policy type successfully deleted for policy type id: STD_PolicyModelUnconstrained_0.2.0
817 /{policyId}/{enforceStatus}
818 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
823 Set a status to a policy instance with an enforceStatus parameter only.
826 /{policyId}/{enforceStatus}
833 Status updated for policy: <policyId>
838 curl -X PUT "http://localhost:8085/Policy1/ENFORCED
843 Status updated for policy: Policy1
845 /{policyId}/{enforceStatus}/{enforceReason}
846 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
851 Send a status to a policy instance with both enforceStatus and enforceReason.
854 /{policyId}/{enforceStatus}/{enforceReason}
861 Status updated for policy: <policyId>
866 curl -X PUT "http://localhost:8085/Policy1/NOT_ENFORCED/100"
871 Status updated for policy: Policy1