Module netmiko.oneaccess.oneaccess_oneos
Netmiko driver for OneAccess ONEOS
Source code
"""Netmiko driver for OneAccess ONEOS"""
from netmiko.cisco_base_connection import CiscoBaseConnection
import time
class OneaccessOneOSBase(CiscoBaseConnection):
def __init__(self, *args, **kwargs):
"""Init connection - similar as Cisco"""
default_enter = kwargs.get("default_enter")
kwargs["default_enter"] = "\r\n" if default_enter is None else default_enter
super().__init__(*args, **kwargs)
def session_preparation(self):
"""Prepare connection - disable paging"""
self._test_channel_read()
self.set_base_prompt()
self.set_terminal_width(command="stty columns 255", pattern="stty")
self.disable_paging(command="term len 0")
# Clear the read buffer
time.sleep(0.3 * self.global_delay_factor)
self.clear_buffer()
def save_config(self, cmd="write mem", confirm=False, confirm_response=""):
"""Save config: write mem"""
return super().save_config(
cmd=cmd, confirm=confirm, confirm_response=confirm_response
)
class OneaccessOneOSSSH(OneaccessOneOSBase):
pass
class OneaccessOneOSTelnet(OneaccessOneOSBase):
pass
Classes
class OneaccessOneOSBase (*args, **kwargs)
-
Base Class for cisco-like behavior.
Init connection - similar as Cisco
Source code
class OneaccessOneOSBase(CiscoBaseConnection): def __init__(self, *args, **kwargs): """Init connection - similar as Cisco""" default_enter = kwargs.get("default_enter") kwargs["default_enter"] = "\r\n" if default_enter is None else default_enter super().__init__(*args, **kwargs) def session_preparation(self): """Prepare connection - disable paging""" self._test_channel_read() self.set_base_prompt() self.set_terminal_width(command="stty columns 255", pattern="stty") self.disable_paging(command="term len 0") # Clear the read buffer time.sleep(0.3 * self.global_delay_factor) self.clear_buffer() def save_config(self, cmd="write mem", confirm=False, confirm_response=""): """Save config: write mem""" return super().save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
Ancestors
Subclasses
Methods
def save_config(self, cmd='write mem', confirm=False, confirm_response='')
-
Save config: write mem
Source code
def save_config(self, cmd="write mem", confirm=False, confirm_response=""): """Save config: write mem""" return super().save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
def session_preparation(self)
-
Prepare connection - disable paging
Source code
def session_preparation(self): """Prepare connection - disable paging""" self._test_channel_read() self.set_base_prompt() self.set_terminal_width(command="stty columns 255", pattern="stty") self.disable_paging(command="term len 0") # Clear the read buffer time.sleep(0.3 * self.global_delay_factor) self.clear_buffer()
Inherited members
CiscoBaseConnection
:check_config_mode
check_enable_mode
cleanup
clear_buffer
close_session_log
commit
config_mode
disable_paging
disconnect
enable
establish_connection
exit_config_mode
exit_enable_mode
find_prompt
is_alive
normalize_cmd
normalize_linefeeds
open_session_log
paramiko_cleanup
read_channel
read_until_pattern
read_until_prompt
read_until_prompt_or_pattern
run_ttp
select_delay_factor
send_command
send_command_expect
send_command_timing
send_config_from_file
send_config_set
set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
strip_backspaces
strip_command
strip_prompt
telnet_login
write_channel
class OneaccessOneOSSSH (*args, **kwargs)
-
Base Class for cisco-like behavior.
Init connection - similar as Cisco
Source code
class OneaccessOneOSSSH(OneaccessOneOSBase): pass
Ancestors
Inherited members
OneaccessOneOSBase
:check_config_mode
check_enable_mode
cleanup
clear_buffer
close_session_log
commit
config_mode
disable_paging
disconnect
enable
establish_connection
exit_config_mode
exit_enable_mode
find_prompt
is_alive
normalize_cmd
normalize_linefeeds
open_session_log
paramiko_cleanup
read_channel
read_until_pattern
read_until_prompt
read_until_prompt_or_pattern
run_ttp
save_config
select_delay_factor
send_command
send_command_expect
send_command_timing
send_config_from_file
send_config_set
session_preparation
set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
strip_backspaces
strip_command
strip_prompt
telnet_login
write_channel
class OneaccessOneOSTelnet (*args, **kwargs)
-
Base Class for cisco-like behavior.
Init connection - similar as Cisco
Source code
class OneaccessOneOSTelnet(OneaccessOneOSBase): pass
Ancestors
Inherited members
OneaccessOneOSBase
:check_config_mode
check_enable_mode
cleanup
clear_buffer
close_session_log
commit
config_mode
disable_paging
disconnect
enable
establish_connection
exit_config_mode
exit_enable_mode
find_prompt
is_alive
normalize_cmd
normalize_linefeeds
open_session_log
paramiko_cleanup
read_channel
read_until_pattern
read_until_prompt
read_until_prompt_or_pattern
run_ttp
save_config
select_delay_factor
send_command
send_command_expect
send_command_timing
send_config_from_file
send_config_set
session_preparation
set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
strip_backspaces
strip_command
strip_prompt
telnet_login
write_channel