Connection
This script defines the Connection abstract base class, which specifies the common interface implemented by every way this SDK can talk to Ankaios (the control interface, used from inside a workload, or a direct gRPC connection to the Ankaios server, used from outside a workload).
Classes
Connection:Abstract base class for a connection to Ankaios.
Enums
ConnectionType:Represents which connection the Ankaios class should use.
Connection Class
- class ankaios_sdk._components.connection.connection.Connection(add_response_callback, add_log_callback, add_event_callback)[source]
Bases:
ABCAbstract base class that defines the common interface for every connection to Ankaios, so that the
Ankaiosclass can work identically regardless of which connection implementation is used.- __init__(add_response_callback, add_log_callback, add_event_callback)[source]
Stores the callbacks shared by every connection implementation for forwarding responses, logs and events to the Ankaios class.
- Parameters:
add_response_callback (Callable) – The callback function to add a response to the Ankaios class.
add_log_callback (Callable) – The callback function to add a log to the Ankaios class.
add_event_callback (Callable) – The callback function to add an event to the Ankaios class.
- abstract property connected: bool
Check if the connection is established.
- Returns:
True if connected, False otherwise.
- Return type:
bool
ConnectionType Enum
- class ankaios_sdk._components.connection.connection.ConnectionType(value)[source]
Bases:
EnumRepresents which connection the Ankaios class should use.
- CONTROL_INTERFACE = 1
Connect via the control interface (named pipes).
- Type:
(int)
- COMMAND_INTERFACE = 2
Connect via the command interface (direct gRPC).
- Type:
(int)