REST HTTP Interface (2.2)

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

POST 
http://localhost:9090/PCRF/Rules/PROD/QoS_Information HTTP/1.0 
Content-Type: application/json 
Content-Length: 196

 The json-data should be structured as follows:

 {             
     "QoS_Information":{ 
         "APN_Agg_MBR_DL":0, 
         "APN_Agg_MBR_UL":0, 
         "Allocation_Retention_Priority":0, 
         "Bearer_Identifier":1, 
         "GBR_DL":100, 
         "GBR_UL":100, 
         "ID":100, 
         "MBR_DL":1000, 
         "MBR_UL":1000, 
         "QCI":1 
     }       
 }

Retrieving a UDR

The format for the response is determined by the  Accept  HTTP header.

Retrieving a specific RulesMapping UDR in area PROD as JSON

GET 
http://localhost:9090/PCRF/Rules/PROD/RulesMapping/1001 HTTP/1.0 
Accept: application/json

Example output:

{
    "ID": 1001,
    "Priority": 1,
    "Arguments": ["Arg1","Arg2"],
    "Targets": [1001],
    "StopFallthrough": false
}



Retrieving all RulesMapping UDRs in area PROD as JSON

GET 
http://localhost:9090/PCRF/Rules/PROD/RulesMapping HTTP/1.0 
Accept: application/json

Example output:

{
    "RulesMappings": [
        {
            "ID": 1001,
            "Priority": 1,
            "Arguments": ["Arg1","Arg2"],
            "Targets": [1001],
            "StopFallthrough": false
        },
        {
            "ID": 1002,
            "Priority": 2,
            "Arguments": ["Arg 3","Arg 4"],
            "Targets": [1002],
            "StopFallthrough": false
        }
    ]
}


Retrieving a specific PCC_Rule UDR in area PROD as JSON

GET 
http://localhost:9090/PCRF/Rules/PROD/PCC_Rule/1001 HTTP/1.0
Accept: application/Json

Example output:

{
    "ID": 1001,
    "Rule_Name": "Rule 1",
    "Charging_Rules": [1001],
    "Period": 1,
    "QoS": 2
}



Retrieving all PCC_Rule UDRs in area PROD as JSON

GET 
http://localhost:9090/PCRF/Rules/PROD/PCC_Rule HTTP/1.0 
Accept: application/json

Example output:

{
    "PCC_Rules": [
        {
            "ID": 1001,
            "Rule_Name": "Rule 1",
            "Charging_Rules": [1001],
            "Period": 1,
            "QoS": 2
        },
        {
            "ID": 1002,
            "Rule_Name": "Rule 2",
            "Charging_Rules": [1001],
            "Period": 5,
            "QoS": 12
        }
    ]       
}



Retrieving a specific QoS_Information UDR in area PROD as JSON

GET 
http://localhost:9090/PCRF/Rules/PROD/QoS_Information/1001 HTTP/1.0 
Accept: application/json

Example output:

{
    "ID": 1001,
    "Name": "QoS 1Mbps",
    "ARP": 0,
    "APN_Agg_MBR_DL": 1000,
    "APN_Agg_MBR_UL": 1000,
    "GBR_DL": 0,
    "GBR_UL": 0,
    "MBR_DL": 1000,
    "MBR_UL": 1000,
    "QCI": 9
}

Retrieving all QoS_Information UDRs in area PROD as JSON

GET 
http://localhost:9090/PCRF/Rules/PROD/QoS_Information HTTP/1.0 
Accept: application/json

Example output:

{
    "QoS_Informations": [
        {
            "ID": 1001,
            "Name": "QoS 1Mbps",
            "ARP": 0,
            "APN_Agg_MBR_DL": 1000,
            "APN_Agg_MBR_UL": 1000,
            "GBR_DL": 0,
            "GBR_UL": 0,
            "MBR_DL": 1000,
            "MBR_UL": 1000,
            "QCI": 9
        },
        {
            "ID": 1002,
            "Name": "QoS 7/2Mbps",
            "ARP": 0,
            "APN_Agg_MBR_DL": 7000,
            "APN_Agg_MBR_UL": 2000,
            "GBR_DL": 0,
            "GBR_UL": 0,
            "MBR_DL": 7000,
            "MBR_UL": 2000,
            "QCI": 9
        }
    ]
}

Retrieving a specific Charging_Rule UDR in area PROD as JSON

GET 
http://localhost:9090/PCRF/Rules/PROD/Charging_Rule/1001 HTTP/1.0 
Accept: application/json

Example output:

{
            "ID": 1001,
            "Name": "Charging Rule 1",
            "Dynamic_Rule": 0,
            "Final_Indication_Rule": 0,
            "Static_Rule": 1
}

Retrieving all Charging_Rule UDRs in area PROD as JSON

GET 
http://localhost:9090/PCRF/Rules/PROD/Charging_Rule HTTP/1.0 
Accept: application/json

Example output:

{
    "Charging_Rules": [
        {
            "ID": 1001,
            "Name": "Charging Rule 1",
            "Dynamic_Rule": 0,
            "Final_Indication_Rule": 0,
            "Static_Rule": 1001
        },
        {
            "ID": 1002,
            "Name": "Charging Rule 2",
            "Dynamic_Rule": 1001,
            "Final_Indication_Rule": 1001,
            "Static_Rule": 0
        }
    ]
}


Retrieving a specific Static_Rule UDR in area PROD as JSON

GET 
http://localhost:9090/PCRF/Rules/PROD/Static_Rule/1001 HTTP/1.0 
Accept: application/json

Example output:

{
    "ID": 1001,
    "Rule_Name": "Static Rule 1",
    "Rule_Base_Name": "rb-default"
}

Retrieving all Static_Rule UDRs in area PROD as JSON

GET 
http://localhost:9090/PCRF/Rules/PROD/Static_Rule HTTP/1.0 
Accept: application/json

Example output:

{
    "Static_Rules": [
        {
            "ID": 1001,
            "Rule_Name": "Static Rule 1",
            "Rule_Base_Name": "rb-default"
        },
        {
            "ID": 1002,
            "Rule_Name": "Static Rule 2",
            "Rule_Base_Name": "rb-redirect"
        }
    ]
}


Updating a UDR

Updates are made using  PUT.

Example Updating QoS Information UDRs in area PROD using XML

PUT http://localhost:9090/PCRF/Rules//PROD/QoS_Information/<id> HTTP/1.0
Content-Type: application/xml
Content-Length: 251

The format of 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>

Deleting a UDR

Deleting a resource is done by using the  DELETE method.

Example Deleting Rules UDR 2101 in area PROD

DELETE http://localhost:9090/PCRF/Rules/PROD/PCC_Rule/2101 HTTP/1.0

Clearing an area

Clearing an area is done with a HTTP DELETE call to <host>:<port>/PCRF/Rules/<source area>/admin/clear.

Example Clearing area TEST

DELETE http://localhost:9090/PCRF/Rules/TEST/admin/clear HTTP/1.0

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>. 

Example Copying data from TEST to PROD

PUT http://localhost:9090/PCRF/Rules/TEST/admin/copyArea?dest=PROD HTTP/1.0
Content-Length: 0

Error codes

There are several different codes that can be returned for the different operations.

For admin commands:

http://<host>:<port>/PCRF/Rules/<area>/admin/clear
http://<host>:<port>/PCRF/Rules/<area>/admin/copyArea
http://<host>:<port>/PCRF/Rules/<area>/admin/refresh

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:

http://<host>:<port>/PCRF/Rules/<area>/<udr-type>

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:

http://<host>:<port>/PCRF/Rules/<area>/<udr-type>/<id>

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:

http://<host>:<port>/PCRF/Rules/<area>/<udr-type>

Error code

Description

200

Will be returned with an empty list or with a list containing the UDRs.

When updating a UDR:

http://<host>:<port>/PCRF/Rules/<area>/<udr-type>/<id>

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:

http://<host>:<port>/PCRF/Rules/<area>/<udr-type>/<id>

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.