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 The available functions for the OSC_2.1.0 version of A1.
134 Delete all policy instances.
144 All policy instances deleted.
149 curl -X POST "http://localhost:8085/deleteinstances"
154 All policy instances deleted.
172 All policy instances and types deleted.
177 curl -X POST "http://localhost:8085/deleteall"
182 All policy instances and types deleted.
190 Create a policy type.
193 /policytype?id=<policy-type-id>
197 The ID of the policy type.
199 **Body:** (*Required*)
200 A JSON object containing the schema for the type.
204 Policy type <policy-type-id> is OK.
206 Policy type <policy-type-id> is OK.
211 curl -X PUT "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
212 -H "Content-Type: application/json"
214 "$schema": "http://json-schema.org/draft-07/schema#",
215 "title": "STD_PolicyModelUnconstrained_0.2.0",
216 "description": "Standard model of a policy with unconstrained scope id combinations",
222 "ueId": {"type": "string"},
223 "groupId": {"type": "string"},
224 "sliceId": {"type": "string"},
225 "qosId": {"type": "string"},
226 "cellId": {"type": "string"}
229 "additionalProperties": false
234 "gfbr": {"type": "number"},
235 "mfbr": {"type": "number"},
236 "priorityLevel": {"type": "number"},
237 "pdb": {"type": "number"}
239 "additionalProperties": false
244 "qoeScore": {"type": "number"},
245 "initialBuffering": {"type": "number"},
246 "reBuffFreq": {"type": "number"},
247 "stallRatio": {"type": "number"}
249 "additionalProperties": false
273 "primary": {"type": "boolean"}
275 "additionalProperties": false,
276 "required": ["cellIdList", "preference"]
281 "additionalProperties": false,
282 "required": ["scope"]
288 Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
293 Delete a policy type.
296 /policytype?id=<policy-type-id>
300 The ID of the policy type.
304 Policy type <policy-type-id> is OK.
309 curl -X DELETE "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
314 Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
322 Get a list of policy types.
332 A list of policy types.
337 curl -X GET "http://localhost:8085/policytypes"
342 STD_PolicyModelUnconstrained_0.2.0
350 Force a specific response code for an A1 operation.
353 /forceresponse?responsecode=<http-response-code>
356 responsecode: (*Required*)
357 The HTTP response code to return.
361 Force response code: <expected code> set for one single A1 response
366 curl -X POST "http://localhost:8085/forceresponse?responsecode=400"
371 Force response code: 400 set for one single A1 response
379 Force delayed response of all A1 operations.
382 /forcedelay?delay=<delay-time-seconds>
386 The time in seconds to delay all responses.
390 Force delay: <expected delay> sec set for all A1 responses
395 curl -X POST "http://localhost:8085/forcedelay?delay=2"
400 Force delay: 2 sec set for all A1 responses
408 Set status and optional reason, delete and time stamp.
411 /status?policyid=<policyid>&status=<status>&deleted=<value>&created_at=<time-stamp>
414 policyid: (*Required*)
417 The status of a policy.
418 deleted: (*Optional*)
419 True or false for real values, but accepts anything for error testing.
420 created_at: (*Optional*)
421 Time stamp for the status.
425 Status set to <status> for policy <policy-id>
430 curl -X PUT "http://localhost:8085/policyid=Policy1&status?status=Accepted
435 Status set to Accepted for policy Policy1.
440 The available functions for the A1 Standard 1.1.3 version of A1.
448 Delete all policy instances.
458 All policy instances deleted.
463 curl -X POST "http://localhost:8085/deleteinstances"
468 All policy instances deleted.
486 All policy instances deleted.
491 curl -X POST "http://localhost:8085/deleteall"
496 All policy instances deleted.
504 Force a specific response code for an A1 operation.
507 /forceresponse?responsecode=<http-response-code>
510 responsecode: (*Required*)
511 The HTTP response code to return.
515 Force response code: <expected code> set for one single A1 response
520 curl -X POST "http://localhost:8085/forceresponse?responsecode=400"
525 Force response code: 400 set for one single A1 response
533 Force delayed response of all A1 operations.
536 /forcedelay?delay=<delay-time-seconds>
540 The time in seconds to delay all responses.
544 Force delay: <expected delay> sec set for all A1 responses
549 curl -X POST "http://localhost:8085/forcedelay?delay=2"
554 Force delay: 2 sec set for all A1 responses
562 Set status and optional reason, delete and time stamp.
565 /status?policyid=<policyid>&status=<status>&reason=<reason>
568 policyid: (*Required*)
571 The status of a policy.
573 The reason for the status.
577 Status set to <status> for policy <policy-id>
582 curl -X PUT "http://localhost:8085/status?policyid=Policy1&status=Accepted
587 Status set to Accepted for policy Policy1
595 Send status for policy.
598 /sendstatus?policyid=<policy-id>
601 policyid: (*Required*)
602 The ID of the policy to send status for.
606 Is a JSON with the response of the actual post request to the callback server, whatever that is.
611 curl -X POST "http://localhost:8085/sendstatus?policyid=Policy2"
619 The available functions for the 1.1.x-alpha.2.
627 Delete all policy instances.
637 All policy instances deleted.
642 curl -X DELETE "http://localhost:8085/deleteinstances"
647 All policy instances deleted.
655 Delete all policy types.
665 All policy types deleted.
670 curl -X DELETE "http://localhost:8085/deletetypes"
675 All policy types deleted.
683 Create or update a policy type.
686 /policytypes/{policy-type-id}
691 **Body:** (*Required*)
692 A JSON object containing the schema for the type.
696 The policy type was either created or updated for policy type id: <policy-type-id>
701 curl -X PUT "http://localhost:8085/policytype/Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
702 -H "Content-Type: application/json"
704 "$schema": "http://json-schema.org/draft-07/schema#",
705 "title": "STD_PolicyModelUnconstrained_0.2.0",
706 "description": "Standard model of a policy with unconstrained scope id combinations",
712 "ueId": {"type": "string"},
713 "groupId": {"type": "string"},
714 "sliceId": {"type": "string"},
715 "qosId": {"type": "string"},
716 "cellId": {"type": "string"}
719 "additionalProperties": false
724 "gfbr": {"type": "number"},
725 "mfbr": {"type": "number"},
726 "priorityLevel": {"type": "number"},
727 "pdb": {"type": "number"}
729 "additionalProperties": false
734 "qoeScore": {"type": "number"},
735 "initialBuffering": {"type": "number"},
736 "reBuffFreq": {"type": "number"},
737 "stallRatio": {"type": "number"}
739 "additionalProperties": false
763 "primary": {"type": "boolean"}
765 "additionalProperties": false,
766 "required": ["cellIdList", "preference"]
771 "additionalProperties": false,
772 "required": ["scope"]
778 The policy type was either created or updated for policy type id: STD_PolicyModelUnconstrained_0.2.0
783 Delete a policy type.
786 /policytypes/{policy-type-id}
793 policy type successfully deleted for policy type id: <policy-type-id>
798 curl -X DELETE "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
803 policy type successfully deleted for policy type id: STD_PolicyModelUnconstrained_0.2.0
805 /{policyId}/{enforceStatus}
806 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
811 Set a status to a policy instance with an enforceStatus parameter only.
814 /{policyId}/{enforceStatus}
821 Status updated for policy: <policyId>
826 curl -X PUT "http://localhost:8085/Policy1/ENFORCED
831 Status updated for policy: Policy1
833 /{policyId}/{enforceStatus}/{enforceReason}
834 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
839 Send a status to a policy instance with both enforceStatus and enforceReason.
842 /{policyId}/{enforceStatus}/{enforceReason}
849 Status updated for policy: <policyId>
854 curl -X PUT "http://localhost:8085/Policy1/NOT_ENFORCED/100"
859 Status updated for policy: Policy1