Session

consul4s.v1.api.Session
trait Session[F[_]]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ConsulApi[F]
class ConsulClient[F]
Self type

Members list

Value members

Concrete methods

def createSession(newSession: NewSession, dc: Option[String], token: Option[String]): F[Result[SessionId]]

PUT /session/create This endpoint initializes a new session. Sessions must be associated with a node and may be associated with any number of checks.

PUT /session/create This endpoint initializes a new session. Sessions must be associated with a node and may be associated with any number of checks.

Value parameters

dc
  • Specifies the datacenter to query. This will default to the datacenter of the agent being queried. This is specified as part of the URL as a query parameter. Using this across datacenters is not recommended.
newSession
  • session definition
token
  • consul token

Attributes

Returns
  • ID of the created session
def deleteSession(sessionId: SessionId, dc: Option[String], token: Option[String]): F[Result[Boolean]]

PUT /session/destroy/:uuid This endpoint destroys the session with the given name. If the session UUID is malformed, an error is returned. If the session UUID does not exist or already expired, a 200 is still returned (the operation is idempotent).

PUT /session/destroy/:uuid This endpoint destroys the session with the given name. If the session UUID is malformed, an error is returned. If the session UUID does not exist or already expired, a 200 is still returned (the operation is idempotent).

Value parameters

dc
  • Specifies the datacenter to query. This will default to the datacenter of the agent being queried. This is specified as part of the URL as a query parameter. Using this across datacenters is not recommended.
sessionId
  • session ID
token
  • consul token

Attributes

Returns
  • true if session was deleted otherwise false
def getListOfActiveNodeSessions(node: String, dc: Option[String], consistencyMode: ConsistencyMode, token: Option[String]): F[Result[List[SessionInfo]]]

GET /session/node/:node This endpoint returns the active sessions for a given node.

GET /session/node/:node This endpoint returns the active sessions for a given node.

Value parameters

consistencyMode
dc
  • Specifies the datacenter to query. This will default to the datacenter of the agent being queried. This is specified as part of the URL as a query parameter. Using this across datacenters is not recommended.
node
  • Specifies the name or ID of the node to query. This is required and is specified as part of the URL path.
token
  • consul token

Attributes

Returns
  • list of active sessions for specified node
def getListOfActiveSessions(dc: Option[String], consistencyMode: ConsistencyMode, token: Option[String]): F[Result[List[SessionInfo]]]

GET /session/list This endpoint returns the list of active sessions.

GET /session/list This endpoint returns the list of active sessions.

Value parameters

consistencyMode
dc
  • Specifies the datacenter to query. This will default to the datacenter of the agent being queried. This is specified as part of the URL as a query parameter. Using this across datacenters is not recommended.
token
  • consul token

Attributes

Returns
  • list of active sessions
def getSessionInfo(sessionId: SessionId, dc: Option[String], consistencyMode: ConsistencyMode, token: Option[String]): F[Result[List[SessionInfo]]]

GET /session/info/:uuid This endpoint returns the requested session information.

GET /session/info/:uuid This endpoint returns the requested session information.

Value parameters

consistencyMode
dc
  • Specifies the datacenter to query. This will default to the datacenter of the agent being queried. This is specified as part of the URL as a query parameter. Using this across datacenters is not recommended.
sessionId
  • session id
token
  • consul token

Attributes

Returns
  • session info if session exists otherwise None
def renewSession(sessionId: SessionId, dc: Option[String], token: Option[String]): F[Result[Option[SessionInfo]]]

PUT /session/renew/:uuid This endpoint renews the given session. This is used with sessions that have a TTL, and it extends the expiration by the TTL.

PUT /session/renew/:uuid This endpoint renews the given session. This is used with sessions that have a TTL, and it extends the expiration by the TTL.

Value parameters

dc
  • Specifies the datacenter to query. This will default to the datacenter of the agent being queried. This is specified as part of the URL as a query parameter. Using this across datacenters is not recommended.
sessionId
  • Specifies the UUID of the session to renew. This is required and is specified as part of the URL path.
token
  • consul token

Attributes

Returns
  • updated session or None if session does not exist