Session API
TPOSS Session API exposes different models depending on the requested session type. The current version of the Session API supports the following session types:
ggsn- network sessionscg- service sessioncombinedGGSNandSCG- combined network and service session
TPOSS HTTP Session API allows you to read and manage PCS sessions using the following RPC methods:
- Session.List - to fetch the list of PCS sessions filtered by the given criteria
- Session.Stop - to stop a network session by the given identifier
Data model
Network session
A network session is represented by an object with the following properties:
Service session
A service session is represented by an object with the following properties:
Combined network and service session
The combined network and service sessions object has the following properties:
API methods
Session.List
The method allows you to fetch the list of sessions based on the given query parameters. If the number of sessions exceeds the internal query limit, only the initial subset is returned. In the case when query parameters are invalid, TPOSS returns an error.
You can pass the following parameters in the request:
Note
The Limit, Offset, Sort, and Fields parameters are supported only for the ggsn and scg session types. The combinedGGSNandSCG session type supports only theFilter parameter which is mandatory.
The Filter field allows you to filter sessions. The filter format is: FilterKey:FilterOperator:FilterValue. The FilterKey parameter represents the session field name. The possible fields are listed in the data model section. The FilterOperator values can be one of the following:
is- equal toneq- not equal tolte- lower than or equal togt- greater thanlt- lower thangte- greater than or equal tostarts_with- match objects which start with the given patternends_with- match objects which end with the given patterncontains- match objects which contain the given pattern
For example, this query requests sessions with IMSI that ends with 5:
This query requests sessions with the BalanceId equal to test_balance:
In the case of the combinedGGSNandSCG session type, only these filter operations are supported:
is- equal toin- match objects contained in the given set of values. The limit is 30 values.
For example:
Example of the SessionType="ggsn" request:
Example of the successful response:
Example of the SessionType="combinedGGSNandSCG" request:
Example of the successful response:
In the case of an error, the response contains the error object with an error code and message:
The following error codes may be returned:
-30000- Required field is missing.-31411- Invalid list parameter. This error may occur under different circumstances, such as the wrong format of theFilterparameter or the missingFilterparameter.-32700- Can't decode JSON request body.-33333- Not authenticated.
Session.Stop
The method allows you to stop a running session with the given IMSI. The method works only for network sessions and only if the radius.ggsn_creation_on_accounting configuration parameter is set to false.
You can pass the following parameters in the request:
Example of the request:
Example of the successful response:
In the case of an error, the response contains the error object with an error code and message:
The following error codes may be returned:
-30000- Required field is missing.-31808- Session for the given IMSI was not found.-32700- Can't decode JSON request body.-33333- Not authenticated.