Oracle® Communications Services Gatekeeper RESTful Application Developer's Guide Release 5.0 Part Number E16621-02 |
|
|
View PDF |
This chapter describes the operations in the Session Manager interface of the RESTful Web Services provided in Oracle Communications Services Gatekeeper.
Applications use the RESTful Session Manager interface to access the Session Manager Web Service to get a unique session ID. Each application then add this session ID to the header of all its requests. Services Gatekeeper uses this value to keep track of all the traffic that an application sends for the duration of the session, and to destroy a session.
The GeneralException
error will be thrown when any operation in the RESTful Session Manager interface fails.
When the Administration Server for your Services Gatekeeper domain is in the running state, the REST service descriptions of these operations can be found at
http://host:port/rest/session_manager/index.html
where host and port are the host name and port of the machine on which Services Gatekeeper is installed.
The Get Session operation creates a session with an ID.
If the Get Session operation is successful, the response body will contain the session ID. This string value is used by the application in the X-Session-ID header of all subsequent traffic requests.
Basic
POST
http://host:port/rest/session_manager/sessions
where host and port are the host name and port of the machine on which Services Gatekeeper is installed.
The MIME-type for the Content-Type header field is application/json.
There is no request body.
Standard header fields. If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Errors and Exceptions".
The response body is a JSON object containing the getSession Return attribute whose value is the session Id, returned as a string.
{"getSessionReturn":"String"}
The Get Session Remaining Lifetime operation retrieves the time remaining in this session, in milliseconds.
The Request-URI for the GET method contains the session ID.
If the Get Session Remaining Lifetime operation is successful, the response body will contain the time remaining in this session, in milliseconds.
Basic
GET
http://host:port/rest/session_manager/session/${sessionId}
where:
host and port are the host name and port of the machine on which Services Gatekeeper is installed.
${sessionID} is the session ID obtained from the response to the Get Session request.
The MIME-type for the Content-Type header field is application/json.
There is no request body.
Standard header fields. If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Errors and Exceptions".
The response body is a JSON object containing the getSessionRemainingLifeTimeReturn attribute whose value is an integer representing the time remaining in this session, in milliseconds.
{"getSessionRemainingLifeTimeReturn":"Integer"}
The Destroy Session operation destroys this session.
To do so, provide the appropriate session Id in the Request-URI for this operation. This identifier should have been obtained by the initial setup for this session.
There is no request or response body for Destroy Session. If the request fails, the body of the error response will contain the call identifier and the type of exception.
Basic
DELETE
http://host:port/rest/session_manager/session/${sessionId}
where:
host and port are the host name and port of the machine on which Services Gatekeeper is installed.
sessionId is the session ID obtained from the response to the Get Session request.
The MIME-type for the Content-Type header field is application/json.
There is no request body.
The response body is a JSON object containing the destroySessionReturn attribute whose value is a boolean.
{"destroySessionReturn":"Boolean"}
If the value for destroySessionReturn is true, the session was destroyed.