gui/backend/gui_plugin/shell/Shell.py
def start_session(request_id, db_connection_id=None, shell_args=None, web_session=None):
    """Starts a new Shell Interactive Session
    Args:
        request_id (str): The request_id of the command.
        db_connection_id (int): The id of the connection id to use on the shell session.
        shell_args (list): The list of command line arguments required to execute a specific operation.
        web_session (object): The web_session object this session will belong to
    Returns:
        A dict holding the result message
    """
    options = None
    if db_connection_id is not None:
        db_type = None
        with BackendDatabase(web_session) as db:
            db_type, options = db.get_connection_details(db_connection_id)

        if db_type != "MySQL":
            raise Error.MSGException(Error.DB_INVALID_DB_TYPE,
                                     f'Shell operations only work with MySQL database connections.')

    new_session = ShellModuleSession(
        web_session, request_id, options=options, shell_args=shell_args)
    return Response.pending("New Shell session initiated...", {
        "module_session_id": new_session.module_session_id,
        "result": new_session._last_prompt
    })
Starts a new Shell Interactive Session
    Args:
        request_id (str): The request_id of the command.
        db_connection_id (int): The id of the connection id to use on the shell session.
        shell_args (list): The list of command line arguments required to execute a specific operation.
        web_session (object): The web_session object this session will belong to
    Returns:
        A dict holding the result message
    
Starts a new Shell Interactive Session
Starts a new Shell Interactive Session
def start_session(request_id, db_connection_id=None, shell_args=None, web_session=None):
    options = None
    if db_connection_id is not None:
        db_type = None
        with BackendDatabase(web_session) as db:
            db_type, options = db.get_connection_details(db_connection_id)
        if db_type != "MySQL":
            raise Error.MSGException(Error.DB_INVALID_DB_TYPE,
                                     f'Shell operations only work with MySQL database connections.')
    new_session = ShellModuleSession(
        web_session, request_id, options=options, shell_args=shell_args)
    return Response.pending("New Shell session initiated...", {
        "module_session_id": new_session.module_session_id,
        "result": new_session._last_prompt
    })
def start_session ( request_id , db_connection_id = None , shell_args = None , web_session = None ) : options = None if db_connection_id is not None : db_type = None with BackendDatabase ( web_session ) as db : db_type , options = db . get_connection_details ( db_connection_id ) if db_type != "MySQL" : raise Error . MSGException ( Error . DB_INVALID_DB_TYPE , f'Shell operations only work with MySQL database connections.' ) new_session = ShellModuleSession ( web_session , request_id , options = options , shell_args = shell_args ) return Response . pending ( "New Shell session initiated..." , { "module_session_id" : new_session . module_session_id , "result" : new_session . _last_prompt } )
Starts a new Shell Interactive Session
Starts a new Shell Interactive Session
"""Starts a new Shell Interactive Session
    Args:
        request_id (str): The request_id of the command.
        db_connection_id (int): The id of the connection id to use on the shell session.
        shell_args (list): The list of command line arguments required to execute a specific operation.
        web_session (object): The web_session object this session will belong to
    Returns:
        A dict holding the result message
    """
A dict holding the result message
A dict holding the result message
request_id
The request_id of the command.
The request_id of the command .
db_connection_id
The id of the connection id to use on the shell session.
The id of the connection id to use on the shell session .
shell_args
The list of command line arguments required to execute a specific operation.
The list of command line arguments required to execute a specific operation .
web_session
The web_session object this session will belong to
The web_session object this session will belong to