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.
16 .. contents:: Operations
26 The status of the simulator.
34 Returns the status of the simulator.
52 curl -X GET "http://localhost:8085/"
56 Simulator is living (OSC_2.1.0 responds OK)
61 The simulator can support different versions of the A1 interface. With this API the supported versions can be listed.
69 Returns the status of the simulator. (Not available for A1 Standard 1.1.3)
81 List of supported interfaces.
87 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'.
107 /counter/{counter-name}
116 The counter value for the given counter.
122 curl -X GET "http://localhost:8085/counter/num_instances"
128 Version Specific Functions
129 ==========================
131 The methods available to control the simulator depends on the version of the A1 API the simulator is simulating.
136 The available functions for the OSC_2.1.0 version of A1.
144 Delete all policy instances.
156 All policy instances deleted.
162 curl -X POST "http://localhost:8085/deleteinstances"
166 All policy instances deleted.
186 All policy instances and types deleted.
192 curl -X POST "http://localhost:8085/deleteall"
196 All policy instances and types deleted.
204 Create a policy type.
207 /policytype?id=<policy-type-id>
212 The ID of the policy type.
214 **Body:** (*Required*)
215 A JSON object containing the schema for the type.
220 Policy type <policy-type-id> is OK.
223 Policy type <policy-type-id> is OK.
229 curl -X PUT "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
230 -H "Content-Type: application/json"
233 "$schema": "http://json-schema.org/draft-07/schema#",
234 "title": "STD_PolicyModelUnconstrained_0.2.0",
235 "description": "Standard model of a policy with unconstrained scope id combinations",
241 "ueId": {"type": "string"},
242 "groupId": {"type": "string"},
243 "sliceId": {"type": "string"},
244 "qosId": {"type": "string"},
245 "cellId": {"type": "string"}
248 "additionalProperties": false
253 "gfbr": {"type": "number"},
254 "mfbr": {"type": "number"},
255 "priorityLevel": {"type": "number"},
256 "pdb": {"type": "number"}
258 "additionalProperties": false
263 "qoeScore": {"type": "number"},
264 "initialBuffering": {"type": "number"},
265 "reBuffFreq": {"type": "number"},
266 "stallRatio": {"type": "number"}
268 "additionalProperties": false
292 "primary": {"type": "boolean"}
294 "additionalProperties": false,
295 "required": ["cellIdList", "preference"]
300 "additionalProperties": false,
301 "required": ["scope"]
307 Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
312 Delete a policy type.
315 /policytype?id=<policy-type-id>
320 The ID of the policy type.
325 Policy type <policy-type-id> is OK.
331 curl -X DELETE "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
335 Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
343 Get a list of policy types.
355 A list of policy types.
361 curl -X GET "http://localhost:8085/policytypes"
365 STD_PolicyModelUnconstrained_0.2.0
373 Force a specific response code for an A1 operation.
376 /forceresponse?responsecode=<http-response-code>
380 responsecode: (*Required*)
381 The HTTP response code to return.
386 Force response code: <expected code> set for one single A1 response
392 curl -X POST "http://localhost:8085/forceresponse?responsecode=400"
396 Force response code: 400 set for one single A1 response
404 Force delayed response of all A1 operations.
407 /forcedelay?delay=<delay-time-seconds>
412 The time in seconds to delay all responses.
417 Force delay: <expected delay> sec set for all A1 responses
423 curl -X POST "http://localhost:8085/forcedelay?delay=2"
427 Force delay: 2 sec set for all A1 responses
435 Set status and optional reason, delete and time stamp.
438 /status?policyid=<policyid>&status=<status>&deleted=<value>&created_at=<time-stamp>
442 policyid: (*Required*)
446 The status of a policy.
448 deleted: (*Optional*)
449 True or false for real values, but accepts anything for error testing.
451 created_at: (*Optional*)
452 Time stamp for the status.
457 Status set to <status> for policy <policy-id>
463 curl -X PUT "http://localhost:8085/policyid=Policy1&status?status=Accepted
467 Status set to Accepted for policy Policy1.
472 The available functions for the A1 Standard 1.1.3 version of A1.
480 Delete all policy instances.
492 All policy instances deleted.
498 curl -X POST "http://localhost:8085/deleteinstances"
502 All policy instances deleted.
522 All policy instances deleted.
528 curl -X POST "http://localhost:8085/deleteall"
532 All policy instances deleted.
540 Force a specific response code for an A1 operation.
543 /forceresponse?responsecode=<http-response-code>
547 responsecode: (*Required*)
548 The HTTP response code to return.
553 Force response code: <expected code> set for one single A1 response
559 curl -X POST "http://localhost:8085/forceresponse?responsecode=400"
563 Force response code: 400 set for one single A1 response
571 Force delayed response of all A1 operations.
574 /forcedelay?delay=<delay-time-seconds>
579 The time in seconds to delay all responses.
584 Force delay: <expected delay> sec set for all A1 responses
590 curl -X POST "http://localhost:8085/forcedelay?delay=2"
594 Force delay: 2 sec set for all A1 responses
602 Set status and optional reason, delete and time stamp.
605 /status?policyid=<policyid>&status=<status>&reason=<reason>
609 policyid: (*Required*)
613 The status of a policy.
616 The reason for the status.
621 Status set to <status> for policy <policy-id>
627 curl -X PUT "http://localhost:8085/status?policyid=Policy1&status=Accepted
631 Status set to Accepted for policy Policy1
639 Send status for policy.
642 /sendstatus?policyid=<policy-id>
646 policyid: (*Required*)
647 The ID of the policy to send status for.
652 Is a JSON with the response of the actual post request to the callback server, whatever that is.
658 curl -X POST "http://localhost:8085/sendstatus?policyid=Policy2"
666 The available functions for the 1.1.x-alpha.2.
674 Delete all policy instances.
686 All policy instances deleted.
692 curl -X DELETE "http://localhost:8085/deleteinstances"
696 All policy instances deleted.
704 Delete all policy types.
716 All policy types deleted.
722 curl -X DELETE "http://localhost:8085/deletetypes"
726 All policy types deleted.
734 Create or update a policy type.
737 /policytypes/{policy-type-id}
743 **Body:** (*Required*)
744 A JSON object containing the schema for the type.
749 The policy type was either created or updated for policy type id: <policy-type-id>
755 curl -X PUT "http://localhost:8085/policytype/Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
756 -H "Content-Type: application/json"
759 "$schema": "http://json-schema.org/draft-07/schema#",
760 "title": "STD_PolicyModelUnconstrained_0.2.0",
761 "description": "Standard model of a policy with unconstrained scope id combinations",
767 "ueId": {"type": "string"},
768 "groupId": {"type": "string"},
769 "sliceId": {"type": "string"},
770 "qosId": {"type": "string"},
771 "cellId": {"type": "string"}
774 "additionalProperties": false
779 "gfbr": {"type": "number"},
780 "mfbr": {"type": "number"},
781 "priorityLevel": {"type": "number"},
782 "pdb": {"type": "number"}
784 "additionalProperties": false
789 "qoeScore": {"type": "number"},
790 "initialBuffering": {"type": "number"},
791 "reBuffFreq": {"type": "number"},
792 "stallRatio": {"type": "number"}
794 "additionalProperties": false
818 "primary": {"type": "boolean"}
820 "additionalProperties": false,
821 "required": ["cellIdList", "preference"]
826 "additionalProperties": false,
827 "required": ["scope"]
833 The policy type was either created or updated for policy type id: STD_PolicyModelUnconstrained_0.2.0
838 Delete a policy type.
841 /policytypes/{policy-type-id}
850 policy type successfully deleted for policy type id: <policy-type-id>
856 curl -X DELETE "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
860 policy type successfully deleted for policy type id: STD_PolicyModelUnconstrained_0.2.0
862 /{policyId}/{enforceStatus}
863 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
868 Set a status to a policy instance with an enforceStatus parameter only.
871 /{policyId}/{enforceStatus}
880 Status updated for policy: <policyId>
886 curl -X PUT "http://localhost:8085/Policy1/ENFORCED
890 Status updated for policy: Policy1
892 /{policyId}/{enforceStatus}/{enforceReason}
893 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
898 Send a status to a policy instance with both enforceStatus and enforceReason.
901 /{policyId}/{enforceStatus}/{enforceReason}
910 Status updated for policy: <policyId>
916 curl -X PUT "http://localhost:8085/Policy1/NOT_ENFORCED/100"
920 Status updated for policy: Policy1