Skip to content

ark_connection

ArkConnection

Bases: ABC

Source code in ark_sdk_python/common/connections/ark_connection.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
class ArkConnection(ABC):
    def __init__(self) -> None:
        self._logger = get_logger(self.__class__.__name__)

    @abstractmethod
    def connect(self, connection_details: ArkConnectionDetails) -> None:
        """
        Connects to the target with given information

        Args:
            connection_details (ArkConnectionDetails): _description_
        """

    @abstractmethod
    def disconnect(self) -> None:
        """
        Disconnects the active session
        """

    @abstractmethod
    def suspend_connection(self) -> None:
        """
        Suspends the session from command execution
        """

    @abstractmethod
    def restore_connection(self) -> None:
        """
        Restores the session
        """

    @abstractmethod
    def is_suspended(self) -> bool:
        """
        Checks whether session is suspended

        Returns:
            bool: _description_
        """

    @abstractmethod
    def is_connected(self) -> bool:
        """
        Checks whether session is connected

        Returns:
            bool: _description_
        """

    @abstractmethod
    def run_command(self, command: ArkConnectionCommand) -> ArkConnectionResult:
        """
        Runs a remote connection command

        Args:
            command (ArkConnectionCommand): _description_

        Returns:
            ArkConnectionResult: _description_
        """

connect(connection_details) abstractmethod

Connects to the target with given information

Parameters:

Name Type Description Default
connection_details ArkConnectionDetails

description

required
Source code in ark_sdk_python/common/connections/ark_connection.py
11
12
13
14
15
16
17
18
@abstractmethod
def connect(self, connection_details: ArkConnectionDetails) -> None:
    """
    Connects to the target with given information

    Args:
        connection_details (ArkConnectionDetails): _description_
    """

disconnect() abstractmethod

Disconnects the active session

Source code in ark_sdk_python/common/connections/ark_connection.py
20
21
22
23
24
@abstractmethod
def disconnect(self) -> None:
    """
    Disconnects the active session
    """

is_connected() abstractmethod

Checks whether session is connected

Returns:

Name Type Description
bool bool

description

Source code in ark_sdk_python/common/connections/ark_connection.py
47
48
49
50
51
52
53
54
@abstractmethod
def is_connected(self) -> bool:
    """
    Checks whether session is connected

    Returns:
        bool: _description_
    """

is_suspended() abstractmethod

Checks whether session is suspended

Returns:

Name Type Description
bool bool

description

Source code in ark_sdk_python/common/connections/ark_connection.py
38
39
40
41
42
43
44
45
@abstractmethod
def is_suspended(self) -> bool:
    """
    Checks whether session is suspended

    Returns:
        bool: _description_
    """

restore_connection() abstractmethod

Restores the session

Source code in ark_sdk_python/common/connections/ark_connection.py
32
33
34
35
36
@abstractmethod
def restore_connection(self) -> None:
    """
    Restores the session
    """

run_command(command) abstractmethod

Runs a remote connection command

Parameters:

Name Type Description Default
command ArkConnectionCommand

description

required

Returns:

Name Type Description
ArkConnectionResult ArkConnectionResult

description

Source code in ark_sdk_python/common/connections/ark_connection.py
56
57
58
59
60
61
62
63
64
65
66
@abstractmethod
def run_command(self, command: ArkConnectionCommand) -> ArkConnectionResult:
    """
    Runs a remote connection command

    Args:
        command (ArkConnectionCommand): _description_

    Returns:
        ArkConnectionResult: _description_
    """

suspend_connection() abstractmethod

Suspends the session from command execution

Source code in ark_sdk_python/common/connections/ark_connection.py
26
27
28
29
30
@abstractmethod
def suspend_connection(self) -> None:
    """
    Suspends the session from command execution
    """