Get cluster user sessions

Get users sessions based on a specific user ID. You can request a list of user sessions for a specific user ID in a specific environment.

Endpoint

/api/cluster/v1/userSessions

Parameters

Parameter Type Description In Required
userId string

User ID (optional)

query optional

Response format

The UserSession object

Managed user session instance

Element Type Description
userId string

User id

nodeId integer

Node on which user session exists

sessionId string

User session id

creationTime integer

User session creation timestamp

lastAccessedTimestamp integer

Timestamp when session was recently accessed

tenantUuid string

UUID of tenant to which user has logged in (or cluster UUID if user has logged in to CMC)

loginType string

The way user has logged in

The loginType element can hold these values.
device string

Device on which user has logged in

ip string

IP from which has logged in

Possible values

Possible values for the loginType element in the UserSession object:

  • LOCAL
  • LDAP
  • SSO_MANAGED
  • DEVOPSTOKEN

Response code

Code Description
200

Success

500

Operation failed

Example

In this example, the request lists user sessions in the myManaged.cluster.com cluster for user user.name.

Curl

curl -X GET "https://myManaged.cluster.com/api/cluster/v1/userSessions?userId=user.name" 
     -H  "accept: application/json"

Request URL

https://myManaged.cluster.com/api/cluster/v1/userSessions?userId=user.name

Response body

[
  {
    "userId": "user.name",
    "nodeId": 4,
    "sessionId": "string",
    "creationTime": 0,
    "lastAccessedTimestamp": 0,
    "tenantUuid": "string",
    "loginType": "LOCAL",
    "device": "string",
    "ip": "string"
  }
]

Response code

200