Sessions APIs

The Sessions APIs enable the management of user sessions. Siren Federate tracks the number of concurrent user sessions across the cluster. A user session must be specified for each search request with the header X-Federate-Session-Id. A same session id can be reused across multiple search requests.

Permissions: To use the sessions APIs, you must ensure that the following cluster-level actions are granted by the security system:

  • Get: cluster:admin/federate/sessions/get

  • Clear: cluster:admin/federate/sessions/clear

Get Sessions

The Get Sessions API allows to retrieve the list of the current active sessions.

curl -XGET 'http://localhost:9200/_siren/sessions'

The response includes the size of the session pool, the number of active sessions and the list of active session ids:

  "size": 5,
  "active": 2,
  "active_sessions_ids" : [ user_1, user_2 ]

Clear Sessions

Sessions are automatically removed when the session timeout since the last search request has been exceeded. However, it is recommended to clear the session as soon as the session is not being used anymore in order to free slots in the session pool:

curl -XDELETE 'http://localhost:9200/_siren/sessions/user_1'


curl -H 'Content-Type: application/json' -XDELETE 'http://localhost:9200/_siren/sessions' -d '
    "session_id" : "user_1"

Multiple session IDs can be passed as a comma separated list of values

curl -XDELETE 'http://localhost:9200/_siren/sessions/user_1,user_2'

or as an array:

curl -H 'Content-Type: application/json' -XDELETE 'http://localhost:9200/_siren/sessions' -d '
    "session_id" : [