import logging

from netmiko.cisco import CiscoAsaSSH

logging.basicConfig(filename="test.log", level=logging.DEBUG)
logger = logging.getLogger("netmiko")


class AsaConnector:

    def _session_creator(self) -> CiscoAsaSSH:
        cisco_asa = {
            "device_type": "cisco_asa",
            "host": "172.31.142.14",
            "username": "user",
            "password": "T1Rules@123",
            "port": 22,
        }
        session = CiscoAsaSSH(**cisco_asa)
        session.asa_login()
        return session

    def session_login(self):
        asa_session = self._session_creator()
        asa_session.asa_login()
        version = asa_session.send_command("show version")
        print(version)
        return version


connector = AsaConnector().session_login()
