Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

Retrieving Buckets

To retrieve all buckets for a subscriber:

Info
titleExample Retrieving Buckets

GET http://localhost:9090/PCC/Buckets/<subscriber key>/Bucket HTTP/1.0

Example output:

Code Block
{
    "Buckets": [
        {
            "Product": 1001,
            "Counters": [
                {
                    "Usage": {
                        "entry": [
                            {
                                "key": 0,
                                "value": 0
                            },
                            {
                                "key": 1,
                                "value": 0
                            },
                            {
                                "key": 2,
                                "value": 0
                            }
                        ]
                    }
                }
            ],
            "ID": "1",
            "StartTime": "2014-08-04 12:00:00",
            "StopTime": "2014-08-12 00:00:00"
        }
    ]
}


Return Codes

No return codes will be sent. A list with 0 or more elements will be returned.

Retrieving a Specific Bucket

To retrieve a specific bucket with a certain ID:

Info
titleExample Retrieving a specific bucket

GET http://localhost:9090/PCC/Buckets/<subscriber key>/Bucket/<id> HTTP/1.0

Example output:

Code Block
{
    "Product": 1001,
    "Counters": [
        {
            "Usage": {
                "entry": [
                    {
                        "key": 0,
                        "value": 0
                    },
                    {
                        "key": 1,
                        "value": 0
                    },
                    {
                        "key": 2,
                        "value": 0
                    }
                ]
            }
        }
    ],
    "ID": "1",
    "StartTime": "2014-08-04 12:00:00",
    "StopTime": "2014-08-12 00:00:00"
}


Return Codes

CodeDescription
200Will be returned if the bucket was successfully retrieved.
204Will be returned if the bucket did not exist.
500Will be returned if a server error occurred. 

Creating a Bucket

To create a bucket:

Info
titleExample Creating a bucket using xml


Code Block
POST http://localhost:9090/PCC/Buckets/<subscriber key>/Bucket 
 Bucket HTTP/1.0 
 Content-Type: application/xml

 The xml-data should be structured as follows:
    <Bucket> 
         <Counters> 
             <Usage> 
                 <entry> 
                     <key>0</key>

                              <value>100</value> 
                 </entry>
                <entry>
                    <key>1</key>
                    <value>200</value>
                </entry>
                <entry>
                    <key>2</key>
                    <value>300</value>
                </entry>
            </Usage>
        </Counters>
        <ID>1016</ID> 
        <Misc>
            <entry>
                <key>mykey</key>
                <type>string</type>
                <value>myvalue</value>
            </entry>
        </Misc>
        <Product>1006</Product>
        <StartTime>2015-01-02 18:00:00</StartTime>
    </Bucket>


...

Note
titleNote!

The subscriber is created if it does not exist when the command is called.

Return Codes

CodeDescription
201Will be returned if the bucket was successfully created.
500Will be returned if a server error occurred.

Updating a Bucket

Updates are made using  PUT .

Info
titleExample Updating a bucket


Code Block
PUT http://localhost:9090/PCC/Buckets/<subscriber key>/Bucket/<id> HTTP/1.0


Return Codes

CodeDescription
200Will be returned if the bucket was successfully updated.
500Will be returned if a server error occurred.

Deleting a Bucket

To delete a bucket:

Info
titleExample Deleting a bucket


Code Block
DELETE http://localhost:9090/PCC/Buckets/<subscriber key>/Bucket/<id> HTTP/1.0


Return Codes

CodeDescription
200Will be returned if the bucket was successfully deleted.
204Will be returned if the bucket that was intended to be deleted did not exist.
500Will be returned if a server error occurred.

Retrieving All Sessions for a Subscriber

To retrieve all sessions for a subscriber:

Info
titleExample Retrieving sessions

GET http://localhost:9090/PCC/Buckets/<subscriber key>/Session HTTP/1.0

Example output:

Code Block
{
    "Sessions": [
        {
            "ID": "gx;222;1000009",
            "Misc": {
                "entry": [
                    {
                        "key": "origin_host",
                        "type": "string",
                        "value": "sim"
                    },
                    {
                        "key": "origin_realm",
                        "type": "string",
                        "value": "example.com"
                    }
                ]
            },
            "InstalledRules": [
                {
                    "Rules": [],
                    "QoS": 0
                }
            ],
            "Reservations": [
                {
                    "Granted": {
                        "entry": [
                            {
                                "key": 1,
                                "value": 1
                            }
                        ]
                    },
                    "Products": [
                        2
                    ],
                    "Misc": {
                        "entry": []
                    }
                }
            ],
            "LastActive": "2015-10-30 11:02:55"
        }
    ]
}


Return Codes

No return codes will be sent. A list with 0 or more elements will be returned.

Deleting a Subscriber

To delete a subscriber:

Info
titleExample Deleting a subscriber


Code Block
DELETE http://localhost:9090/PCC/Buckets/<subscriber key> HTTP/1.0


...

Note
titleNote!

Deleting a subscriber means deleting the whole object found at:

Code Block
http://localhost:9090/PCC/Buckets/<subscriber key>

Any Buckets and Subscribers belonging to this <subscriber key>-object will get deleted as well.

Return Codes

CodeDescription
200Will be returned if the subscriber was successfully deleted.
204Will be returned if the subscriber that was intended to be deleted did not exist.
500Will be returned if a server error occurred.

Retrieving Information about a Subscriber

To retrieve information about a subscriber:

Info
titleExample Retrieving information about a subscriber

GET http://localhost:9090/PCC/Buckets/<subscriber key>/Subscriber HTTP/1.0

Example output:

Code Block
{
    "Groups": [
        "Group1"
    ],
    "IsChanged": false,
    "SentNotifications": [2],
    "Misc": {
        "entry": [
            {
                "key": "billing_system",
                "type": "string",
                "value": "test"
            }
        ]
    },
    "Notifications": [1]
}


Return Codes

CodeDescription
200Will be returned if the information about the subscriber was successfully retrieved.
204Will be returned if the subscriber did not exist.
500Will be returned if a server error occurred.

Updating a Subscriber

To update a subscriber:

Info
titleExample Updating a subscriber


Code Block
PUT http://localhost:9090/PCC/Buckets/<id>/Subscriber HTTP/1.0


Return Codes

CodeDescription
200Will be returned if the subscriber was successfully updated.
50Will be returned if a server error occurred.

Error Codes

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

...