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.
46 curl -X GET "http://localhost:8085/"
52 Simulator is living (OSC_2.1.0 responds OK)
57 The simulator can support different versions of the A1 interface. With this API the supported versions can be listed.
65 Returns the status of the simulator. (Not available for A1 Standard 1.1.3)
78 List of supported interfaces.
84 curl -X GET "http://localhost:8085/container_interfaces"
91 1.1.x-alpha.2 OSC_2.1.0 STD_1.1.3
96 The simulator keeps counts of different things that can be accessed.
104 Get a counter. Counter-name can be one of the following: 'num_instances', 'num_types' or 'interface'.
108 /counter/{counter-name}
118 The counter value for the given counter.
124 curl -X GET "http://localhost:8085/counter/num_instances"
132 Version Specific Functions
133 ==========================
135 The methods available to control the simulator depends on the version of the A1 API the simulator is simulating.
140 This section describes the available administrative functions for the OSC_2.1.0 version of A1.
142 To see the A1 functions for this version, see `OSC_2.1.0 API`_.
144 .. _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
152 Delete all policy instances.
166 All policy instances deleted.
172 curl -X POST "http://localhost:8085/deleteinstances"
178 All policy instances deleted.
200 All policy instances and types deleted.
206 curl -X POST "http://localhost:8085/deleteall"
212 All policy instances and types deleted.
220 Create a policy type.
224 /policytype?id=<policy-type-id>
230 The ID of the policy type.
232 **Body:** (*Required*)
234 A JSON object containing the schema for the type.
240 Policy type <policy-type-id> is OK.
244 Policy type <policy-type-id> is OK.
250 curl -X PUT "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
251 -H "Content-Type: application/json"
253 "$schema": "http://json-schema.org/draft-07/schema#",
254 "title": "STD_PolicyModelUnconstrained_0.2.0",
255 "description": "Standard model of a policy with unconstrained scope id combinations",
261 "ueId": {"type": "string"},
262 "groupId": {"type": "string"},
263 "sliceId": {"type": "string"},
264 "qosId": {"type": "string"},
265 "cellId": {"type": "string"}
268 "additionalProperties": false
273 "gfbr": {"type": "number"},
274 "mfbr": {"type": "number"},
275 "priorityLevel": {"type": "number"},
276 "pdb": {"type": "number"}
278 "additionalProperties": false
283 "qoeScore": {"type": "number"},
284 "initialBuffering": {"type": "number"},
285 "reBuffFreq": {"type": "number"},
286 "stallRatio": {"type": "number"}
288 "additionalProperties": false
312 "primary": {"type": "boolean"}
314 "additionalProperties": false,
315 "required": ["cellIdList", "preference"]
320 "additionalProperties": false,
321 "required": ["scope"]
328 Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
333 Delete a policy type.
337 /policytype?id=<policy-type-id>
343 The ID of the policy type.
349 Policy type <policy-type-id> is OK.
355 curl -X DELETE "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
361 Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
369 Get a list of policy types.
383 A list of policy types.
389 curl -X GET "http://localhost:8085/policytypes"
395 STD_PolicyModelUnconstrained_0.2.0
403 Force a specific response code for an A1 operation.
407 /forceresponse?responsecode=<http-response-code>
411 responsecode: (*Required*)
413 The HTTP response code to return.
419 Force response code: <expected code> set for one single A1 response
425 curl -X POST "http://localhost:8085/forceresponse?responsecode=400"
431 Force response code: 400 set for one single A1 response
439 Force delayed response of all A1 operations.
443 /forcedelay?delay=<delay-time-seconds>
449 The time in seconds to delay all responses.
455 Force delay: <expected delay> sec set for all A1 responses
461 curl -X POST "http://localhost:8085/forcedelay?delay=2"
467 Force delay: 2 sec set for all A1 responses
475 Set status and optional reason, delete and time stamp.
479 /status?policyid=<policyid>&status=<status>&deleted=<value>&created_at=<time-stamp>
483 policyid: (*Required*)
489 The status of a policy.
491 deleted: (*Optional*)
493 True or false for real values, but accepts anything for error testing.
495 created_at: (*Optional*)
497 Time stamp for the status.
503 Status set to <status> for policy <policy-id>
509 curl -X PUT "http://localhost:8085/policyid=Policy1&status?status=Accepted
515 Status set to Accepted for policy Policy1.
520 This section describes the available administrative functions for the A1 Standard 1.1.3 version of A1.
522 To see the A1 functions for this version, see `A1 Standard 1.1.3 API`_.
524 .. _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
532 Delete all policy instances.
546 All policy instances deleted.
552 curl -X POST "http://localhost:8085/deleteinstances"
558 All policy instances deleted.
580 All policy instances deleted.
586 curl -X POST "http://localhost:8085/deleteall"
592 All policy instances deleted.
600 Force a specific response code for an A1 operation.
604 /forceresponse?responsecode=<http-response-code>
608 responsecode: (*Required*)
610 The HTTP response code to return.
616 Force response code: <expected code> set for one single A1 response
622 curl -X POST "http://localhost:8085/forceresponse?responsecode=400"
628 Force response code: 400 set for one single A1 response
636 Force delayed response of all A1 operations.
640 /forcedelay?delay=<delay-time-seconds>
646 The time in seconds to delay all responses.
652 Force delay: <expected delay> sec set for all A1 responses
658 curl -X POST "http://localhost:8085/forcedelay?delay=2"
664 Force delay: 2 sec set for all A1 responses
672 Set status and optional reason, delete and time stamp.
676 /status?policyid=<policyid>&status=<status>&reason=<reason>
680 policyid: (*Required*)
686 The status of a policy.
690 The reason for the status.
696 Status set to <status> for policy <policy-id>
702 curl -X PUT "http://localhost:8085/status?policyid=Policy1&status=Accepted
708 Status set to Accepted for policy Policy1
716 Send status for policy.
720 /sendstatus?policyid=<policy-id>
724 policyid: (*Required*)
726 The ID of the policy to send status for.
732 Is a JSON with the response of the actual post request to the callback server, whatever that is.
738 curl -X POST "http://localhost:8085/sendstatus?policyid=Policy2"
747 This section describes the available administrative functions for the 1.1.x-alpha.2 version of A1.
749 To see the A1 functions for this version, see `1.1.x-alpha.2 API`_.
751 .. _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
759 Delete all policy instances.
773 All policy instances deleted.
779 curl -X DELETE "http://localhost:8085/deleteinstances"
785 All policy instances deleted.
793 Delete all policy types.
807 All policy types deleted.
813 curl -X DELETE "http://localhost:8085/deletetypes"
819 All policy types deleted.
827 Create or update a policy type.
831 /policytypes/{policy-type-id}
837 **Body:** (*Required*)
839 A JSON object containing the schema for the type.
845 The policy type was either created or updated for policy type id: <policy-type-id>
851 curl -X PUT "http://localhost:8085/policytype/Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
852 -H "Content-Type: application/json"
854 "$schema": "http://json-schema.org/draft-07/schema#",
855 "title": "STD_PolicyModelUnconstrained_0.2.0",
856 "description": "Standard model of a policy with unconstrained scope id combinations",
862 "ueId": {"type": "string"},
863 "groupId": {"type": "string"},
864 "sliceId": {"type": "string"},
865 "qosId": {"type": "string"},
866 "cellId": {"type": "string"}
869 "additionalProperties": false
874 "gfbr": {"type": "number"},
875 "mfbr": {"type": "number"},
876 "priorityLevel": {"type": "number"},
877 "pdb": {"type": "number"}
879 "additionalProperties": false
884 "qoeScore": {"type": "number"},
885 "initialBuffering": {"type": "number"},
886 "reBuffFreq": {"type": "number"},
887 "stallRatio": {"type": "number"}
889 "additionalProperties": false
913 "primary": {"type": "boolean"}
915 "additionalProperties": false,
916 "required": ["cellIdList", "preference"]
921 "additionalProperties": false,
922 "required": ["scope"]
929 The policy type was either created or updated for policy type id: STD_PolicyModelUnconstrained_0.2.0
934 Delete a policy type.
938 /policytypes/{policy-type-id}
948 policy type successfully deleted for policy type id: <policy-type-id>
954 curl -X DELETE "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
960 policy type successfully deleted for policy type id: STD_PolicyModelUnconstrained_0.2.0
962 /{policyId}/{enforceStatus}
963 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
968 Set a status to a policy instance with an enforceStatus parameter only.
972 /{policyId}/{enforceStatus}
982 Status updated for policy: <policyId>
988 curl -X PUT "http://localhost:8085/Policy1/ENFORCED
994 Status updated for policy: Policy1
996 /{policyId}/{enforceStatus}/{enforceReason}
997 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1002 Send a status to a policy instance with both enforceStatus and enforceReason.
1006 /{policyId}/{enforceStatus}/{enforceReason}
1016 Status updated for policy: <policyId>
1022 curl -X PUT "http://localhost:8085/Policy1/NOT_ENFORCED/100"
1028 Status updated for policy: Policy1