Session

class SessionClient
Canonical

kortex_api.autogen.client_stubs.SessionClientRpc

__init__(router, namespace=None)

Constructs a SessionClient with an initialized RouterClient and an optional namespace.

Parameters
  • router (RouterClient) – RouterClient used for the communication

  • namespace (string) – Optional namespace on which to initialize the SessionClient (defaults to None)

IsAlive(timeoutMs: int = 1000)

Returns True if the Service Server is detected online before timeoutMs is expired, False otherwise.

Parameters

timeoutMs (unsigned int) – The maximum time to wait for an answer from the server

Return type

bool

CreateSession(createsessioninfo, deviceId=0, options=RouterClientSendOptions())
The READ_ONLY permission is necessary to call this RPC.

Creates a new session on the robot using given values for user name, session timeout value, and password
Parameters
CloseSession(deviceId = 0, options = RouterClientSendOptions())
The READ_ONLY permission is necessary to call this RPC.

Closes an existing open session
Parameters
  • deviceId (int) – Device’s Id called by rpc (optional)

  • options (RouterClientSendOptions) – Router options for sending the message

KeepAlive(deviceId = 0, options = RouterClientSendOptions())
The READ_ONLY permission is necessary to call this RPC.

Sends message to robot to keep current session alive
Parameters
  • deviceId (int) – Device’s Id called by rpc (optional)

  • options (RouterClientSendOptions) – Router options for sending the message

AddTemporaryUserRole(temporaryrolerequest, deviceId=0, options=RouterClientSendOptions())
The OPERATE permission is necessary to call this RPC.

Adds a temporary role to a user’s session
Parameters
RemoveTemporaryUserRole(deviceId = 0, options = RouterClientSendOptions())
The OPERATE permission is necessary to call this RPC.

Removes the temporary role to a user’s session
Parameters
  • deviceId (int) – Device’s Id called by rpc (optional)

  • options (RouterClientSendOptions) – Router options for sending the message