REST HTTP Interface
Provisioning is supported via a REST HTTP Interface which is implemented using the standard HTTP methods GET
, PUT
, POST
 and DELETE
. The interface supports XML and JSON formats, and enables external systems to provision and update Rules.
The REST HTTP Interface runs on the EC Web Interface and is started when the EC process is started. Authentication is performed against the Platform, if possible. If the Platform is unreachable, the user is authenticated against the locally defined user (configured in  EC web interface properties).
The UDRs available in the Rules REST Interface are:
RulesMapping
PCC_Rule
QoS_Information
Charging_Rule
Static_Rule
To retrieve one UDR:
http://<host>:<port>/PCRF/Rules/<area>/<udr-type>/<udr-id>
To retrieve all UDR of a certain type:
http://<host>:<port>/PCRF/Rules/<area>/<udr-type>
Note!
In the examples in this chapter, HTTP/1.0 have been used, but REST supports HTTP/1.1 as well.
Creating a UDR
A UDR can be created by sending data to the HTTP Interface using POST
 to the base URL for the UDR. The response will be the created UDR. Default format for the response is XML if nothing is specified. The format for the response is decided by the Accept
 HTTP header.
Example Creating a Qos_Information UDR in area PROD using XML
POST
http://localhost:9090/PCRF/Rules/PROD/QoS_Information HTTP/1.0
Content-Type: application/xml
Content-Length: 251
The xml-data should be structured as follows:
<QoS_Information>
<APN_Agg_MBR_DL>0</APN_Agg_MBR_DL>
<APN_Agg_MBR_UL>0</APN_Agg_MBR_UL>
<Allocation_Retention_Priority>0
</Allocation_Retention_Priority>
<Bearer_Identifier>1</Bearer_Identifier>
<GBR_DL>100</GBR_DL>
<GBR_UL>100</GBR_UL>
<ID>100</ID>
<MBR_DL>1000</MBR_DL>
<MBR_UL>1000</MBR_UL>
<QCI>1</QCI>
</QoS_Information>
Example Creating a QoS Information_UDR in area PROD using JSON
Retrieving a UDR
The format for the response is determined by the Accept
 HTTP header.
Updating a UDR
Updates are made using PUT
.
Deleting a UDR
Deleting a resource is done by using the DELETE
 method.
Clearing an area
Clearing an area is done with a HTTPÂ DELETE
 call to <host>:<port>/PCRF/Rules/<source area>/admin/clear
.
Copy one area to another
Copying one area to another is done with a HTTPÂ PUT
 call to <host>:<port>/PCRF/Rules/<source area>/admin/copyArea?dest=<destination area>
.Â
Error codes
There are several different codes that can be returned for the different operations.
For admin commands:
Error code | Description |
---|---|
200 | Will be returned if the last operation was successful. |
500 | Will be returned if there was an error. |
When creating a UDR:
Error code | Description |
---|---|
201 | Will be returned if the UDR was created. |
409 | Will be returned if a UDR with the stated key already exists, or if there are dependencies missing. |
415 | Will be returned if the UDR key is of type string and the key is missing, or if the key type is incorrect. |
500 | Will be returned if the UDR requires references that are missing, or if there was an error. |
When retrieving one UDR:
Error code | Description |
---|---|
200 | Will be returned if the requested UDR was found. |
204 | Will be returned if there is no UDR with the stated ID. |
500 | If there was an error. |
When retrieving all UDRs:
Error code | Description |
---|---|
200 | Will be returned with an empty list or with a list containing the UDRs. |
When updating a UDR:
Error code | Description |
---|---|
200 | Will be returned if the UDR was updated successfully. |
408 | Will be returned if the keys in the URL and the XML are different, or the key in the URL is set to "0".. |
409 | Will be returned if the UDR requires references that are missing, or if there is not UDR with the stated key. |
500 | Will be returned if there was an error. |
When deleting a UDR:
Error code | Description |
---|---|
200 | Will be returned if the UDR was deleted successfully. |
204 | Will be returned if there is no UDR with the stated ID. |
409 | Will be returned if the UDR is referenced by another UDR. |
500 | Will be returned if there was an error. |