(self,
                 host_uri,
                 username,
                 password='',
                 verify=True,
                 client_id='',
                 client_secret='',
                 auth_mode='userpass',
                 create_session=True)
Initializes the TimesketchApi object.

        Args:
            host_uri: URI to the Timesketch server (https://<server>/).
            username: User username.
            password: User password.
            verify: Verify server SSL certificate.
            client_id: The client ID if OAUTH auth is used.
            client_secret: The OAUTH client secret if OAUTH is used.
            auth_mode: The authentication mode to use. Defaults to 'userpass'
                Supported values are 'userpass' (username/password combo),
                'http-basic' (HTTP Basic authentication) and oauth.
            create_session: Boolean indicating whether the client object
                should create a session object. If set to False the
                function "set_session" needs to be called before proceeding.

        Raises:
            ConnectionError: If the Timesketch server is unreachable.
            RuntimeError: If the client is unable to authenticate to the
                backend.
Initializes the TimesketchApi object.
Initializes the TimesketchApi object .
def __init__(self,
                 host_uri,
                 username,
                 password='',
                 verify=True,
                 client_id='',
                 client_secret='',
                 auth_mode='userpass',
                 create_session=True):
        """Initializes the TimesketchApi object.

        Args:
            host_uri: URI to the Timesketch server (https://<server>/).
            username: User username.
            password: User password.
            verify: Verify server SSL certificate.
            client_id: The client ID if OAUTH auth is used.
            client_secret: The OAUTH client secret if OAUTH is used.
            auth_mode: The authentication mode to use. Defaults to 'userpass'
                Supported values are 'userpass' (username/password combo),
                'http-basic' (HTTP Basic authentication) and oauth.
            create_session: Boolean indicating whether the client object
                should create a session object. If set to False the
                function "set_session" needs to be called before proceeding.

        Raises:
            ConnectionError: If the Timesketch server is unreachable.
            RuntimeError: If the client is unable to authenticate to the
                backend.
        """
        self._host_uri = host_uri
        self.api_root = '{0:s}/api/v1'.format(host_uri)
        self.credentials = None
        self._flow = None

        if not create_session:
            self.session = None
            return

        try:
            self.session = self._create_session(
                username, password, verify=verify, client_id=client_id,
                client_secret=client_secret, auth_mode=auth_mode)
        except ConnectionError as exc:
            raise ConnectionError('Timesketch server unreachable') from exc
        except RuntimeError as e:
            raise RuntimeError(
                'Unable to connect to server, error: {0!s}'.format(e)) from e
def __init__ ( self , host_uri , username , password = '' , verify = True , client_id = '' , client_secret = '' , auth_mode = 'userpass' , create_session = True ) : self . _host_uri = host_uri self . api_root = '{0:s}/api/v1' . format ( host_uri ) self . credentials = None self . _flow = None if not create_session : self . session = None return try : self . session = self . _create_session ( username , password , verify = verify , client_id = client_id , client_secret = client_secret , auth_mode = auth_mode ) except ConnectionError as exc : raise ConnectionError ( 'Timesketch server unreachable' ) from exc except RuntimeError as e : raise RuntimeError ( 'Unable to connect to server, error: {0!s}' . format ( e ) ) from e