.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. SPDX-License-Identifier: CC-BY-4.0
-.. Copyright (C) 2020 Nordix
+.. Copyright (C) 2021 Nordix
.. _simulator-api:
This document describes the API used to manage policy types and manipulate the simulator.
-The simulator supports different versions of the A1 interface. Some functions are common for all version, and some are
+The simulator supports different versions of the A1 interface. Some functions are common for all versions, and some are
specific for a certain version.
Common Functions
Returns the status of the simulator.
**URL path:**
- /
+ /
**Parameters:**
None.
**Responses:**
200:
- Simulator is living.
+ OK
**Examples:**
- **Call**: ::
- curl -X GET "http://localhost:8085/"
+**Call**: ::
- Result:
- 200: ::
+ curl -X GET "http://localhost:8085/"
- Simulator is living (OSC_2.1.0 responds OK)
+**Result**:
+
+200: ::
+
+ OK
Supported Interfaces
--------------------
Returns the status of the simulator. (Not available for A1 Standard 1.1.3)
**URL path:**
- /container_interfaces
+
+/container_interfaces
**Parameters:**
- None.
+
+None.
**Responses:**
- 200:
+
+200:
List of supported interfaces.
**Examples:**
- **Call**: ::
- curl -X GET "http://localhost:8085/container_interfaces"
+**Call**: ::
+
+ curl -X GET "http://localhost:8085/container_interfaces"
- Result:
- 200: ::
- 1.1.x-alpha.2 OSC_2.1.0 STD_1.1.3
+**Result**:
+
+200: ::
+
+ 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']
Counters
--------
-The simulator keeps counts of different things that can be accessed.
+The simulator keeps count of different things that can be accessed.
/counter
~~~~~~~~
GET
+++
-Get a counter. Counter-name can be one of the following: 'num_instances', 'num_types' or 'interface'.
+Get a counter. Counter-name can be one of the following: 'num_instances', 'num_types', 'interface', 'remote_hosts' or 'datadelivery'.
**URL path:**
- /counter/{counter-name}
+
+/counter/{counter-name}
**Parameters:**
- None.
+
+None.
**Responses:**
- 200:
- The counter value for the given counter.
+
+200:
+
+The counter value for the given counter.
**Examples:**
- **Call**: ::
- curl -X GET "http://localhost:8085/counter/num_instances"
+**Call**: ::
- Result:
- 200: ::
+ curl -X GET "http://localhost:8085/counter/num_instances"
- 10
+**Result**:
-Version Specific Functions
-==========================
+200: ::
-The methods available to control the simulator depends on the version of the A1 API the simulator is simulating.
+ 10
-OSC_2.1.0
----------
-The available functions for the OSC_2.1.0 version of A1.
+Reset simulator
+---------------
+
+There are two ways to reset the simulator, delete all instances or make a complete reset which resets the simulator to its original state.
/deleteinstances
~~~~~~~~~~~~~~~~
Delete all policy instances.
**URL path:**
- /deleteinstances
+
+/deleteinstances
**Parameters:**
- None.
+
+None.
**Responses:**
- 200:
- All policy instances deleted.
+
+200:
+
+All policy instances deleted.
**Examples:**
- **Call**: ::
- curl -X POST "http://localhost:8085/deleteinstances"
+**Call**: ::
+
+ curl -X POST "http://localhost:8085/deleteinstances"
+
+**Result**:
- Result:
- 200: ::
+200: ::
- All policy instances deleted.
+ All policy instances deleted.
/deleteall
~~~~~~~~~~~~~~~~
Full reset.
**URL path:**
- /deleteall
+
+/deleteall
**Parameters:**
- None.
+
+None.
**Responses:**
- 200:
- All policy instances and types deleted.
-**Examples:**
- **Call**: ::
+200:
- curl -X POST "http://localhost:8085/deleteall"
+All policy instances and types deleted.
- Result:
- 200: ::
+**Examples:**
- All policy instances and types deleted.
+**Call**: ::
-/policytype
-~~~~~~~~~~~
+ curl -X POST "http://localhost:8085/deleteall"
-PUT
-+++
-
-Create a policy type.
+**Result**:
-**URL path:**
- /policytype?id=<policy-type-id>
+200: ::
-**Parameters:**
- id: (*Required*)
- The ID of the policy type.
+ All policy instances and types deleted.
-**Body:** (*Required*)
- A JSON object containing the schema for the type.
+200 ::
+ All policy instances deleted (Only for STD_1.1.3 since it has no types)
-**Responses:**
- 200:
- Policy type <policy-type-id> is OK.
- 201:
- Policy type <policy-type-id> is OK.
+Response manipulation
+---------------------
+It is possible to manipulate the response of all operations on the A1 interface (admin interface is not affected)
-**Examples:**
- **Call**: ::
+/forceresponse
+~~~~~~~~~~~~~~
- curl -X PUT "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
- -H "Content-Type: application/json"
- -d '{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "title": "STD_PolicyModelUnconstrained_0.2.0",
- "description": "Standard model of a policy with unconstrained scope id combinations",
- "type": "object",
- "properties": {
- "scope": {
- "type": "object",
- "properties": {
- "ueId": {"type": "string"},
- "groupId": {"type": "string"},
- "sliceId": {"type": "string"},
- "qosId": {"type": "string"},
- "cellId": {"type": "string"}
- },
- "minProperties": 1,
- "additionalProperties": false
- },
- "qosObjectives": {
- "type": "object",
- "properties": {
- "gfbr": {"type": "number"},
- "mfbr": {"type": "number"},
- "priorityLevel": {"type": "number"},
- "pdb": {"type": "number"}
- },
- "additionalProperties": false
- },
- "qoeObjectives": {
- "type": "object",
- "properties": {
- "qoeScore": {"type": "number"},
- "initialBuffering": {"type": "number"},
- "reBuffFreq": {"type": "number"},
- "stallRatio": {"type": "number"}
- },
- "additionalProperties": false
- },
- "resources": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "cellIdList": {
- "type": "array",
- "minItems": 1,
- "uniqueItems": true,
- "items": {
- "type": "string"
- }
- },
- "preference": {
- "type": "string",
- "enum": [
- "SHALL",
- "PREFER",
- "AVOID",
- "FORBID"
- ]
- },
- "primary": {"type": "boolean"}
- },
- "additionalProperties": false,
- "required": ["cellIdList", "preference"]
- }
- }
- },
- "minProperties": 2,
- "additionalProperties": false,
- "required": ["scope"]
- }'
+POST
+++++
- Result:
- 201: ::
+Force a specific response code for one (the next) A1 operation. After that response, the reponse code will go back to normal.
- Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
+**URL path:**
-DELETE
-++++++
+/forceresponse?code=<http-response-code>
-Delete a policy type.
+**Parameters:**
-**URL path:**
- /policytype?id=<policy-type-id>
+code: (*Required*)
-**Parameters:**
- id: (*Required*)
- The ID of the policy type.
+The HTTP response code to return.
**Responses:**
- 204:
- Policy type <policy-type-id> is OK.
+
+200:
+
+Force response code: <expected code> set for one single A1 response
**Examples:**
- **Call**: ::
- curl -X DELETE "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
+**Call**: ::
- Result:
- 204: ::
+ curl -X POST "http://localhost:8085/forceresponse?code=400"
- Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
+**Result**:
-/policytypes
-~~~~~~~~~~~~
+200: ::
-GET
-+++
+ Force response code: 400 set for one single A1 response
-Get a list of policy types.
+/forcedelay
+~~~~~~~~~~~
+
+POST
+++++
+
+Force delayed response of all A1 responses. The setting will remain until the delay is set to '0'
**URL path:**
- /policytypes
+
+/forcedelay?delay=<delay-time-seconds>
**Parameters:**
- None.
+
+delay: (*Required*)
+
+The time in seconds to delay all responses.
**Responses:**
- 200:
- A list of policy types.
+
+200:
+
+Force delay: <expected delay> sec set for all A1 responses
**Examples:**
- **Call**: ::
- curl -X GET "http://localhost:8085/policytypes"
+**Call**: ::
- Result:
- 200: ::
+ curl -X POST "http://localhost:8085/forcedelay?delay=2"
- STD_PolicyModelUnconstrained_0.2.0
+**Result**:
-/forceresponse
-~~~~~~~~~~~~~~
+200: ::
+
+ Force delay: 2 sec set for all A1 responses
+
+
+Configure logging
+-----------------
+Detailed logging of the http headers and payload are activated by default. However, it is possible to turn this logging on or off.
+The 'off' state will only log ip, url and respose code.
+
+/payload_logging/
+~~~~~~~~~~~~~~~~~
POST
++++
-Force a specific response code for an A1 operation.
-
+Configure detailed logging on or off
**URL path:**
- /forceresponse?responsecode=<http-response-code>
+
+/payload_logging/<state>
**Parameters:**
- responsecode: (*Required*)
- The HTTP response code to return.
+
+state: (*Required*)
+
+The state, 'on' or 'off'.
**Responses:**
- 200:
- Force response code: <expected code> set for one single A1 response
+
+200:
+
+Force delay: <expected delay> sec set for all A1 responses
**Examples:**
- **Call**: ::
- curl -X POST "http://localhost:8085/forceresponse?responsecode=400"
+**Call**: ::
- Result:
- 200: ::
+ curl -X POST "http://localhost:8085/payload_logging/on"
- Force response code: 400 set for one single A1 response
+**Result**:
-/forcedelay
-~~~~~~~~~~~
+200: ::
-POST
-++++
+ Payload and header logging set to: on
-Force delayed response of all A1 operations.
-**URL path:**
- /forcedelay?delay=<delay-time-seconds>
+Version Specific Functions
+==========================
-**Parameters:**
- delay: (*Required*)
- The time in seconds to delay all responses.
+The methods available to control the simulator depends on the version of the A1 API the simulator is simulating.
-**Responses:**
- 200:
- Force delay: <expected delay> sec set for all A1 responses
+OSC_2.1.0
+---------
-**Examples:**
- **Call**: ::
+This section describes the available administrative functions for the OSC_2.1.0 version of A1.
- curl -X POST "http://localhost:8085/forcedelay?delay=2"
+To see the A1 functions for this version, see `OSC_2.1.0 API`_.
- Result:
- 200: ::
+.. _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
- Force delay: 2 sec set for all A1 responses
-/status
-~~~~~~~
+
+/policytype
+~~~~~~~~~~~
PUT
+++
-Set status and optional reason, delete and time stamp.
+Create a policy type.
**URL path:**
- /status?policyid=<policyid>&status=<status>&deleted=<value>&created_at=<time-stamp>
+
+/policytype?id=<policy-type-id>
**Parameters:**
- policyid: (*Required*)
- The ID of a policy.
- status: (*Required*)
- The status of a policy.
- deleted: (*Optional*)
- True or false for real values, but accepts anything for error testing.
- created_at: (*Optional*)
- Time stamp for the status.
+
+id: (*Required*)
+
+The ID of the policy type.
+
+**Body:** (*Required*)
+
+A JSON object containing the schema for the type.
**Responses:**
- 200:
- Status set to <status> for policy <policy-id>
-**Examples:**
- **Call**: ::
+200:
- curl -X PUT "http://localhost:8085/policyid=Policy1&status?status=Accepted
+Policy type <policy-type-id> is OK.
- Result:
- 200: ::
+201:
- Status set to Accepted for policy Policy1.
+Policy type <policy-type-id> is OK.
-A1 Standard 1.1.3
------------------
+**Examples:**
-The available functions for the A1 Standard 1.1.3 version of A1.
+**Call**: ::
+
+ curl -X PUT "http://localhost:8085/policytype?id=1"
+ -H "Content-Type: application/json"
+ -d '{
+ "name": "pt1",
+ "description": "pt1 policy type",
+ "policy_type_id": 1,
+ "create_schema": {
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "STD_QoSNudging_0.2.0",
+ "description": "QoS policy type",
+ "type": "object",
+ "properties": {
+ "scope": {
+ "type": "object",
+ "properties": {
+ "ueId": {
+ "type": "string"
+ },
+ "qosId": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "ueId",
+ "qosId"
+ ]
+ },
+ "statement": {
+ "type": "object",
+ "properties": {
+ "priorityLevel": {
+ "type": "number"
+ }
+ },
+ "additionalProperties": false,
+ "required": [
+ "priorityLevel"
+ ]
+ }
+ }
+ }
+ }'
-/deleteinstances
-~~~~~~~~~~~~~~~~
+**Result**:
-POST
-++++
+201: ::
-Delete all policy instances.
+ Policy type 1 is OK
+
+DELETE
+++++++
+
+Delete a policy type.
**URL path:**
- /deleteinstances
+
+/policytype?id=<policy-type-id>
**Parameters:**
- None.
+
+id: (*Required*)
+
+The ID of the policy type.
**Responses:**
- 200:
- All policy instances deleted.
+
+204:
+
+Policy type <policy-type-id> is OK.
**Examples:**
- **Call**: ::
- curl -X POST "http://localhost:8085/deleteinstances"
+**Call**: ::
- Result:
- 200: ::
+ curl -X DELETE "http://localhost:8085/policytype?id=1"
- All policy instances deleted.
+**Result**:
-/deleteall
-~~~~~~~~~~
+204
-POST
-++++
-Full reset.
+
+/policytypes
+~~~~~~~~~~~~
+
+GET
++++
+
+Get a list of policy types.
**URL path:**
- /deleteinstances
+
+/policytypes
**Parameters:**
- None.
+
+None.
**Responses:**
- 200:
- All policy instances deleted.
+
+200:
+
+A list of policy types.
**Examples:**
- **Call**: ::
- curl -X POST "http://localhost:8085/deleteall"
+**Call**: ::
- Result:
- 200: ::
+ curl -X GET "http://localhost:8085/policytypes"
- All policy instances deleted.
+**Result**:
-/forceresponse
-~~~~~~~~~~~~~~
+200: ::
-POST
-++++
+ ["1"]
-Force a specific response code for an A1 operation.
+
+/status
+~~~~~~~
+
+PUT
++++
+
+Set status and optional reason, delete and time stamp.
**URL path:**
- /forceresponse?responsecode=<http-response-code>
+
+/status?policyid=<policyid>&status=<status>&deleted=<value>&created_at=<time-stamp>
**Parameters:**
- responsecode: (*Required*)
- The HTTP response code to return.
-**Responses:**
- 200:
- Force response code: <expected code> set for one single A1 response
+policyid: (*Required*)
-**Examples:**
- **Call**: ::
+The ID of a policy.
- curl -X POST "http://localhost:8085/forceresponse?responsecode=400"
+status: (*Required*)
- Result:
- 200: ::
+The status of a policy.
- Force response code: 400 set for one single A1 response
+deleted: (*Optional*)
-/forcedelay
-~~~~~~~~~~~
+True or false for real values, but accepts anything for error testing.
-POST
-++++
+created_at: (*Optional*)
-Force delayed response of all A1 operations.
+Time stamp for the status.
-**URL path:**
- /forcedelay?delay=<delay-time-seconds>
+**Responses:**
-**Parameters:**
- delay: (*Required*)
- The time in seconds to delay all responses.
+200:
-**Responses:**
- 200:
- Force delay: <expected delay> sec set for all A1 responses
+Status set to <status> for policy <policy-id>
**Examples:**
- **Call**: ::
- curl -X POST "http://localhost:8085/forcedelay?delay=2"
+**Call**: ::
+
+ curl -X PUT "http://localhost:8085/status?policyid=1&status=Accepted"
+
+**Result**:
+
+200: ::
+
+ Status set to Accepted for policy Policy1.
+
+A1 Standard 1.1.3
+-----------------
+
+This section describes the available administrative functions for the A1 Standard 1.1.3 version of A1.
+
+To see the A1 functions for this version, see `A1 Standard 1.1.3 API`_.
- Result:
- 200: ::
+.. _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
- Force delay: 2 sec set for all A1 responses
/status
~~~~~~~
Set status and optional reason, delete and time stamp.
**URL path:**
- /status?policyid=<policyid>&status=<status>&reason=<reason>
+
+/status?policyid=<policyid>&status=<status>&reason=<reason>
**Parameters:**
- policyid: (*Required*)
- The ID of a policy.
- status: (*Required*)
- The status of a policy.
- reason: (*Optional*)
- The reason for the status.
-**Responses:**
- 200:
- Status set to <status> for policy <policy-id>
+policyid: (*Required*)
-**Examples:**
- **Call**: ::
+The ID of a policy.
- curl -X PUT "http://localhost:8085/status?policyid=Policy1&status=Accepted
+status: (*Required*)
- Result:
- 200: ::
+The status of a policy.
- Status set to Accepted for policy Policy1
+reason: (*Optional*)
-/sendstatus
-~~~~~~~~~~~
-
-POST
-++++
-
-Send status for policy.
+The reason for the status.
-**URL path:**
- /sendstatus?policyid=<policy-id>
+**Responses:**
-**Parameters:**
- policyid: (*Required*)
- The ID of the policy to send status for.
+200:
-**Responses:**
- 200:
- Is a JSON with the response of the actual post request to the callback server, whatever that is.
+Status set to <status> for policy <policy-id>
**Examples:**
- **Call**: ::
- curl -X POST "http://localhost:8085/sendstatus?policyid=Policy2"
+**Call**: ::
- Result:
- 200
+ curl -X PUT "http://localhost:8085/status?policyid=Policy1&status=Accepted"
-1.1.x-alpha.2
--------------
+**Result**:
-The available functions for the 1.1.x-alpha.2.
+200: ::
-/deleteinstances
-~~~~~~~~~~~~~~~~
+ Status set to Accepted for policy Policy1
-DELETE
-++++++
+/sendstatus
+~~~~~~~~~~~
-Delete all policy instances.
+POST
+++++
+
+Send status for policy.
**URL path:**
- /deleteinstances
+
+/sendstatus?policyid=<policy-id>
**Parameters:**
- None.
-**Responses:**
- 200:
- All policy instances deleted.
+policyid: (*Required*)
-**Examples:**
- **Call**: ::
+The ID of the policy to send status for.
- curl -X DELETE "http://localhost:8085/deleteinstances"
+**Responses:**
- Result:
- 200: ::
+200:
- All policy instances deleted.
+Is a JSON with the response of the actual post request to the callback server, whatever that is.
-/deletetypes
-~~~~~~~~~~~~
+**Examples:**
-DELETE
-++++++
+**Call**: ::
-Delete all policy types.
+ curl -X POST "http://localhost:8085/sendstatus?policyid=Policy2"
-**URL path:**
- /deletetypes
+**Result**:
-**Parameters:**
- None.
+200
-**Responses:**
- 200:
- All policy types deleted.
-**Examples:**
- **Call**: ::
+A1 Standard 2.0.0
+-----------------
- curl -X DELETE "http://localhost:8085/deletetypes"
+This section describes the available administrative functions for the A1 Standard 2.0.0 version of A1.
- Result:
- 200: ::
+To see the A1 functions for this version, see `A1 Standard 2.0.0 API`_.
- All policy types deleted.
+.. _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
-/policytypes
-~~~~~~~~~~~~
+
+/policytype
+~~~~~~~~~~~
PUT
+++
Create or update a policy type.
**URL path:**
- /policytypes/{policy-type-id}
+
+/policytype?id={policy-type-id}
**Parameters:**
- None.
+
+policy-type-id: (*Required*)
+
+The ID of the policy type.
**Body:** (*Required*)
- A JSON object containing the schema for the type.
+
+A JSON object containing the schema for the type.
**Responses:**
- 200:
- The policy type was either created or updated for policy type id: <policy-type-id>
+
+200:
+
+The policy type <policy-type-id> is ok
+
+201:
+
+The policy type <policy-type-id> is ok
**Examples:**
- **Call**: ::
- curl -X PUT "http://localhost:8085/policytype/Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
- -H "Content-Type: application/json"
- -d '{
+**Call**: ::
+
+ curl -X PUT "http://localhost:8085/policytype?id=STD_PolicyModelUnconstrained_0.2.0"
+ -H "Content-Type: application/json"
+ -d '{
+ "policySchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
- "title": "STD_PolicyModelUnconstrained_0.2.0",
- "description": "Standard model of a policy with unconstrained scope id combinations",
+ "title": "STD_1_0.2.0",
+ "description": "STD 1 policy type",
"type": "object",
"properties": {
"scope": {
"type": "object",
"properties": {
- "ueId": {"type": "string"},
- "groupId": {"type": "string"},
- "sliceId": {"type": "string"},
- "qosId": {"type": "string"},
- "cellId": {"type": "string"}
+ "ueId": {
+ "type": "string"
+ },
+ "qosId": {
+ "type": "string"
+ }
},
- "minProperties": 1,
- "additionalProperties": false
+ "additionalProperties": false,
+ "required": [
+ "ueId",
+ "qosId"
+ ]
},
- "qosObjectives": {
+ "statement": {
"type": "object",
"properties": {
- "gfbr": {"type": "number"},
- "mfbr": {"type": "number"},
- "priorityLevel": {"type": "number"},
- "pdb": {"type": "number"}
+ "priorityLevel": {
+ "type": "number"
+ }
},
- "additionalProperties": false
+ "additionalProperties": false,
+ "required": [
+ "priorityLevel"
+ ]
+ }
+ }
+ },
+ "statusSchema": {
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "STD_1_0.2.0",
+ "description": "STD 1 policy type status",
+ "type": "object",
+ "properties": {
+ "enforceStatus": {
+ "type": "string"
},
- "qoeObjectives": {
- "type": "object",
- "properties": {
- "qoeScore": {"type": "number"},
- "initialBuffering": {"type": "number"},
- "reBuffFreq": {"type": "number"},
- "stallRatio": {"type": "number"}
- },
- "additionalProperties": false
+ "enforceReason": {
+ "type": "string"
},
- "resources": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "cellIdList": {
- "type": "array",
- "minItems": 1,
- "uniqueItems": true,
- "items": {
- "type": "string"
- }
- },
- "preference": {
- "type": "string",
- "enum": [
- "SHALL",
- "PREFER",
- "AVOID",
- "FORBID"
- ]
- },
- "primary": {"type": "boolean"}
- },
- "additionalProperties": false,
- "required": ["cellIdList", "preference"]
- }
- }
- },
- "minProperties": 2,
- "additionalProperties": false,
- "required": ["scope"]
- }'
+ "additionalProperties": false,
+ "required": [
+ "enforceStatus"
+ ]
+ }
+ }
+ }'
+
+**Result**:
- Result:
- 200: ::
+200: ::
- The policy type was either created or updated for policy type id: STD_PolicyModelUnconstrained_0.2.0
+ Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
+
+201: ::
+
+ Policy type STD_PolicyModelUnconstrained_0.2.0 is OK
DELETE
++++++
Delete a policy type.
**URL path:**
- /policytypes/{policy-type-id}
+
+/policytype?id={policy-type-id}
**Parameters:**
- None.
+
+None.
**Responses:**
- 200:
- policy type successfully deleted for policy type id: <policy-type-id>
+
+204
+
**Examples:**
- **Call**: ::
- curl -X DELETE "http://localhost:8085/policytype?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0"
+**Call**: ::
+
+ curl -X DELETE "http://localhost:8085/policytype?id=STD_PolicyModelUnconstrained_0.2.0"
+
+**Result**:
+
+204
- Result:
- 200: ::
- policy type successfully deleted for policy type id: STD_PolicyModelUnconstrained_0.2.0
+
+/policytypes
+~~~~~~~~~~~~
+
+GET
++++
+
+Get a list of policy types.
+
+**URL path:**
+
+/policytypes
+
+**Parameters:**
+
+None.
+
+**Responses:**
+
+200:
+
+A list of policy types.
+
+**Examples:**
+
+**Call**: ::
+
+ curl -X GET "http://localhost:8085/policytypes"
+
+**Result**:
+
+200: ::
+
+ ["STD_PolicyModelUnconstrained_0.2.0"]
+
/{policyId}/{enforceStatus}
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set a status to a policy instance with an enforceStatus parameter only.
**URL path:**
- /{policyId}/{enforceStatus}
+
+/status?policyid={policyId}&status={status}&reason={reason}
**Parameters:**
- None.
+
+None.
**Responses:**
- 200:
- Status updated for policy: <policyId>
+
+200:
+
+Status updated for policy: <policyId>
**Examples:**
- **Call**: ::
- curl -X PUT "http://localhost:8085/Policy1/ENFORCED
+**Call**: ::
- Result:
- 200: ::
+ curl -X PUT "http://localhost:8085/status?policyid=Policy1&status=ENFORCED"
- Status updated for policy: Policy1
+**Result**:
+
+200: ::
+
+ Status updated for policy: Policy1
/{policyId}/{enforceStatus}/{enforceReason}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-PUT
+/sendstatus
+~~~~~~~~~~~
+
+POST
++++
-Send a status to a policy instance with both enforceStatus and enforceReason.
+Send status for policy.
**URL path:**
- /{policyId}/{enforceStatus}/{enforceReason}
+
+/sendstatus?policyid=<policy-id>
**Parameters:**
- None.
+
+policyid: (*Required*)
+
+The ID of the policy to send status for.
**Responses:**
- 200:
- Status updated for policy: <policyId>
+
+200:
+
+Is a JSON with the response of the actual post request to the callback server, whatever that is.
**Examples:**
- **Call**: ::
- curl -X PUT "http://localhost:8085/Policy1/NOT_ENFORCED/100"
+**Call**: ::
+
+ curl -X POST "http://localhost:8085/sendstatus?policyid=Policy2"
- Result:
- 200: ::
+**Result**:
- Status updated for policy: Policy1
+200