fortrace.utility.server_interaction package
Submodules
fortrace.utility.server_interaction.ftp_interaction module
- class fortrace.utility.server_interaction.ftp_interaction.FTPServerInteraction(server: VirshDomain, config: dict, ftps: bool = False)[source]
Bases:
GenericServerInteractionClass for interaction with a domain hosting an FTP server.
- _generated_files
list of files on the server, grouped by users/owners
- _ftp
handle to FTP/FTPS connection
- Type:
ftplib.FTP | ftplib.FTP_TLS
- perform_interaction(action: dict) ServerFeedback | None[source]
Performs an interaction with the FTP server, based on the provided action config.
- Parameters:
action – action configuration with the following structure type: “server_interaction” service: “ProFTPD” name: “stor” | “retr” source: <collection> | “ProFTPD” (target: <path to file>) user: <username>
- Returns:
ServerFeedback enum for an issue, otherwise None (“No news, are good news”)
- class fortrace.utility.server_interaction.ftp_interaction.SFTPServerInteraction(server: VirshDomain, config: dict)[source]
Bases:
GenericServerInteractionClass to interact with a domain hosting a SFTP server.
- _sftp
SFTP client object
- Type:
paramiko.sftp_client.SFTPClient
- _transport
SSH Transport
- Type:
paramiko.transport.Transport
- _generated_files
list of files on the server, grouped by users/owners
- perform_interaction(action: dict) ServerFeedback | None[source]
Performs an interaction with the SFTP server, based on the provided action config.
- Parameters:
action – action configuration with the following structure type: “server_interaction” service: “ProFTPD” name: “stor” | “retr” source: <collection> | “ProFTPD” (target: <path to file>) user: <username>
- Returns:
ServerFeedback enum for an issue, otherwise None (“No news, are good news”)
fortrace.utility.server_interaction.server_interaction module
- class fortrace.utility.server_interaction.server_interaction.GenericServerInteraction(server: VirshDomain, config: dict)[source]
Bases:
ABCGeneric interface for the Generator to perform interactions with services offered by servers.
- _login_data
dict containing username <-> password entries
- Type:
dict[str, str]
- abstractmethod perform_interaction(action: dict) ServerFeedback | None[source]
Method to be called by the generator component.
It is allowed to generate a random action inside, e.g., choose whether to store or retrieve a file)
- Parameters:
action – dictionary describing the action. Orientate on action design of Generator
- Returns:
ServerFeedback to communicate back to the generator (or None, if there is nothing to tell the generator)