...
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 |
---|
title | Example 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 |
---|
title | Example 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
Code | Description |
---|
200 | Will be returned if the bucket was successfully retrieved. |
204 | Will be returned if the bucket did not exist. |
500 | Will be returned if a server error occurred. |
Creating a Bucket
To create a bucket:
Info |
---|
title | Example 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 |
---|
|
The subscriber is created if it does not exist when the command is called. |
Return Codes
Code | Description |
---|
201 | Will be returned if the bucket was successfully created. |
500 | Will be returned if a server error occurred. |
Updating a Bucket
Updates are made using PUT
.
Info |
---|
title | Example Updating a bucket |
---|
|
Code Block |
---|
PUT http://localhost:9090/PCC/Buckets/<subscriber key>/Bucket/<id> HTTP/1.0 |
|
Return Codes
Code | Description |
---|
200 | Will be returned if the bucket was successfully updated. |
500 | Will be returned if a server error occurred. |
Deleting a Bucket
To delete a bucket:
Info |
---|
title | Example Deleting a bucket |
---|
|
Code Block |
---|
DELETE http://localhost:9090/PCC/Buckets/<subscriber key>/Bucket/<id> HTTP/1.0 |
|
Return Codes
Code | Description |
---|
200 | Will be returned if the bucket was successfully deleted. |
204 | Will be returned if the bucket that was intended to be deleted did not exist. |
500 | Will be returned if a server error occurred. |
Retrieving All Sessions for a Subscriber
To retrieve all sessions for a subscriber:
Info |
---|
title | Example 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 |
---|
title | Example Deleting a subscriber |
---|
|
Code Block |
---|
DELETE http://localhost:9090/PCC/Buckets/<subscriber key> HTTP/1.0 |
|
...
Note |
---|
|
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
Code | Description |
---|
200 | Will be returned if the subscriber was successfully deleted. |
204 | Will be returned if the subscriber that was intended to be deleted did not exist. |
500 | Will be returned if a server error occurred. |
To retrieve information about a subscriber:
Info |
---|
title | Example 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
Code | Description |
---|
200 | Will be returned if the information about the subscriber was successfully retrieved. |
204 | Will be returned if the subscriber did not exist. |
500 | Will be returned if a server error occurred. |
Updating a Subscriber
To update a subscriber:
Info |
---|
title | Example Updating a subscriber |
---|
|
Code Block |
---|
PUT http://localhost:9090/PCC/Buckets/<id>/Subscriber HTTP/1.0 |
|
Return Codes
Code | Description |
---|
200 | Will be returned if the subscriber was successfully updated. |
50 | Will be returned if a server error occurred. |
Error Codes
There are several different codes that can be returned for the different operations.
...