Viewing and closing web sessions

Overview

Displays open web sessions and allows you to force them to be closed by different requests.

Requests

HTTP verb Endpoint Description

GET

/rest/v1/master/logicalroles/ws/sessions

Retrieve a list of open web sessions.

POST

/rest/v1/master/logicalroles/ws/sessions

Closing all web sessions of a user in the domain

DELETE

/rest/v1/master/logicalroles/ws/sessions/<session_id>

Closing a single web session

General query parameters

These parameters are passed in the query string portion of the URL (?param=value) for GET and DELETE requests, and in the case of POST requests, in the body of the request. Parameters are used to limit the application area of the request. Are optional and may not be available.

Table 1. Possible parameters
Name Type Description

sites

json<str> or json<list<str>>

A list of site names or a string with one of the special values in the format JSON.

For example ["SITE1", "SITE3"] or "all" (all sites) or "current" (current site, default value).


Retrieve a list of open web sessions.

Returns the list of open web sessions on the current site or on the site(s) specified in the request.

Request

There are no additional parameters. Only the general filter by sites is applied.

Request example
GET /rest/v1/master/master/logicalroles/ws/sessions?sites=["SITE1"] HTTP/1.1

Response

Contains a list of open web sessions.

Table 2. Object fields
Name Description

connections

Active websocket connections (only for sessions where session_type = webdocket).

domain

Web Session Domain.

login

Web session user login in the domain.

session_id

Web Session ID.

session_type

Web Session Type.

site

Web Session Site.

ttl

Remaining web session lifetime in sec.

user_id

The user ID of the web session in the domain.

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "domain": "master.domain",
    "login": "curl",
    "session_id": "a1cd9a88-0176-9a15-d1c0-e0d55e0cd303",
    "session_type": "http",
    "site": "central",
    "ttl": 43187,
    "user_id": "32328e08-016c-f61d-4ef4-e0d55e0cd303"
  },
  {
    "domain": "master.domain",
    "login": "adminma",
    "session_id": "0f274f6b-0176-99e4-5ca7-e0d55e0cd303",
    "session_type": "http",
    "site": "central",
    "ttl": 39946,
    "user_id": "37eca732-016d-2962-dbfa-e0d55e0cd303"
  },
  {
    "domain": "master.domain",
    "login": "adminma",
    "session_id": "16d72c4c-0176-99e7-5545-e0d55e0cd303",
    "session_type": "http",
    "site": "central",
    "ttl": 40141,
    "user_id": "37eca732-016d-2962-dbfa-e0d55e0cd303"
  },
  {
    "connections": [
      {
        "conn_id": "5476d54a-0176-9a16-92a0-e0d55e0cd303",
        "is_pid_alive": true,
        "node": "ws1@192.168.0.32",
        "pid": "<0.11647.54>"
      }
    ],
    "domain": "master.domain",
    "login": "adminma",
    "session_id": "16d72c4c-0176-99e7-5545-e0d55e0cd303",
    "session_type": "websocket",
    "site": "central",
    "ttl": 40141,
    "user_id": "37eca732-016d-2962-dbfa-e0d55e0cd303"
  }
]

Closing all web sessions of a user in the domain

Closes all web sessions of the user in the domain except the session used in the request.

Request

The request may contain additional coverage parameters.

Table 3. Object fields
Name Type Description

action

str

Action. The field must contain the value "logout".

domain

str

The domain for closing sessions.

user

str

User to close sessions. Accepts either the id or login of the entity user

Request example
POST /rest/v1/master/logicalroles/ws/sessions HTTP/1.1
Content-Type: application/json; charset=utf-8

{
  "action": "logout",
  "domain": "master.domain",
  "user": "admin",
  "sites": "all"
}

Response

Contains the status of the request execution.

Table 4. Object fields
Name Description

status

Text "logged out all sessions but current".

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "status": "logged out all sessions but current"
}

Closing a single web session

Closes the web session with the specified identifier.

Request

The request may contain additional coverage parameters.

Request example
DELETE /rest/v1/master/logicalroles/ws/sessions/51e6cad2-0176-8f8e-a432-e0d55e0cd303?sites="all" HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content