Module netmiko.adva
Adva Device Drivers
Expand source code
"""Adva Device Drivers"""
from netmiko.adva.adva_aos_fsp_150_f2 import AdvaAosFsp150F2SSH
from netmiko.adva.adva_aos_fsp_150_f3 import AdvaAosFsp150F3SSH
__all__ = [
"AdvaAosFsp150F2SSH",
"AdvaAosFsp150F3SSH",
]
Sub-modules
netmiko.adva.adva_aos_fsp_150_f2
-
Adva support.
netmiko.adva.adva_aos_fsp_150_f3
-
Adva F3 Device Support
Classes
class AdvaAosFsp150F2SSH (**kwargs: Any)
-
Adva AOS FSP 15P F2 SSH Base Class
F2 AOS applies for the following FSP150 device types: FSP150CC-825
These devices don't have an Enable Mode or a Config Mode.
Configuration Should be applied via the configuration context:
home configure snmp add v3user guytest noauth-nopriv home
configure system home
Use of home to return to CLI root context, home cannot be used from root LAB-R2-825-1:–> home Unrecognized command
for default enter causes some issues with the Adva so setting to .
Expand source code
class AdvaAosFsp150F2SSH(NoEnable, NoConfig, CiscoSSHConnection): """ Adva AOS FSP 15P F2 SSH Base Class F2 AOS applies for the following FSP150 device types: FSP150CC-825 These devices don't have an Enable Mode or a Config Mode. Configuration Should be applied via the configuration context: home configure snmp add v3user guytest noauth-nopriv home configure system home Use of home to return to CLI root context, home cannot be used from root LAB-R2-825-1:--> home Unrecognized command """ def __init__(self, **kwargs: Any) -> None: """ \n for default enter causes some issues with the Adva so setting to \r. """ if kwargs.get("default_enter") is None: kwargs["default_enter"] = "\r" return super().__init__(**kwargs) def session_preparation(self) -> None: """ Prepare the session after the connection has been established. Handles devices with security prompt enabled """ data = self.read_until_pattern( pattern=r"Do you wish to continue \[Y\|N\]-->|-->" ) if "continue" in data: self.write_channel(f"y{self.RETURN}") else: self.write_channel(f"help?{self.RETURN}") data = self.read_until_pattern(pattern=r"-->") self.set_base_prompt() def set_base_prompt( self, pri_prompt_terminator: str = r"(^.+?)-->$", alt_prompt_terminator: str = "", delay_factor: float = 1.0, pattern: Optional[str] = None, ) -> str: prompt = self.find_prompt() match = re.search(pri_prompt_terminator, prompt) if not match: raise ValueError(f"Router prompt not found: {repr(prompt)}") self.base_prompt = match[1] return self.base_prompt
Ancestors
Methods
def session_preparation(self) ‑> None
-
Prepare the session after the connection has been established.
Handles devices with security prompt enabled
Expand source code
def session_preparation(self) -> None: """ Prepare the session after the connection has been established. Handles devices with security prompt enabled """ data = self.read_until_pattern( pattern=r"Do you wish to continue \[Y\|N\]-->|-->" ) if "continue" in data: self.write_channel(f"y{self.RETURN}") else: self.write_channel(f"help?{self.RETURN}") data = self.read_until_pattern(pattern=r"-->") self.set_base_prompt()
Inherited members
CiscoSSHConnection
:check_config_mode
check_enable_mode
cleanup
clear_buffer
commit
config_mode
disable_paging
disconnect
enable
establish_connection
exit_config_mode
exit_enable_mode
find_prompt
is_alive
normalize_cmd
normalize_linefeeds
paramiko_cleanup
read_channel
read_channel_timing
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
send_multiline
set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
strip_backspaces
strip_command
strip_prompt
telnet_login
write_channel
class AdvaAosFsp150F3SSH (**kwargs: Any)
-
Adva AOS FSP 15P F3 SSH Base Class
F3 AOS applies for the following FSP150 device types: FSP150CC-XG21x FSP150CC-GE11x FSP150CC-GE20x
These devices don't have a Enable Mode or Config Mode
Configuration should be applied via the configuration context:
home configure communication add ip-route nexthop xxxxxxx
CLI:PORT N2A SHAPER-1-1-1-3-0 Create
home network-element ne-1
Use of home to return to CLI root context
for default enter causes some issues with the Adva so setting to .
Expand source code
class AdvaAosFsp150F3SSH(NoEnable, NoConfig, CiscoSSHConnection): """ Adva AOS FSP 15P F3 SSH Base Class F3 AOS applies for the following FSP150 device types: FSP150CC-XG21x FSP150CC-GE11x FSP150CC-GE20x These devices don't have a Enable Mode or Config Mode Configuration should be applied via the configuration context: home configure communication add ip-route nexthop xxxxxxx # #CLI:PORT N2A SHAPER-1-1-1-3-0 Create # home network-element ne-1 Use of home to return to CLI root context """ def __init__(self, **kwargs: Any) -> None: """ \n for default enter causes some issues with the Adva so setting to \r. """ if kwargs.get("default_enter") is None: kwargs["default_enter"] = "\r" return super().__init__(**kwargs) def session_preparation(self) -> None: """ Prepare the session after the connection has been established. Handles devices with security prompt enabled """ data = self.read_until_pattern( pattern=r"Do you wish to continue \[Y\|N\]-->|-->" ) if "continue" in data: self.write_channel(f"y{self.RETURN}") else: self.write_channel(f"home{self.RETURN}") data = self.read_until_pattern(pattern=r"-->") self.set_base_prompt() self.disable_paging(cmd_verify=False) def disable_paging( self, command: str = "", delay_factor: Optional[float] = None, cmd_verify: bool = True, pattern: Optional[str] = None, ) -> str: """Method to disable paging on the Adva, multi-line configuration command required.""" if command: raise ValueError( f"Unexpected value for command in disable_paging() method: {command}" ) commands = [ "configure user-security", f"config-user {self.username} cli-paging disabled", "home", ] return self.send_config_set( commands, delay_factor=delay_factor, cmd_verify=cmd_verify ) def set_base_prompt( self, pri_prompt_terminator: str = r"(^.+?)-->$", alt_prompt_terminator: str = "", delay_factor: float = 1.0, pattern: Optional[str] = None, ) -> str: prompt = self.find_prompt() match = re.search(pri_prompt_terminator, prompt) if not match: raise ValueError(f"Router prompt not found: {repr(prompt)}") self.base_prompt = match[1] return self.base_prompt def send_config_set( self, config_commands: Union[str, Sequence[str], Iterator[str], TextIO, None] = None, *, exit_config_mode: bool = True, read_timeout: Optional[float] = 2.0, delay_factor: Optional[float] = None, max_loops: Optional[int] = None, strip_prompt: bool = False, strip_command: bool = False, config_mode_command: Optional[str] = None, cmd_verify: bool = True, enter_config_mode: bool = True, error_pattern: str = "", terminator: str = r"#", bypass_commands: Optional[str] = None, ) -> str: if bypass_commands is None: categories = ( r"(?:superuser|crypto|maintenance|provisioning|retrieve|test-user)" ) bypass_commands = rf"(?:add\s+\S+\s+\S+\s+\S+\s+{categories}|secret.*)" return super().send_config_set( config_commands=config_commands, exit_config_mode=exit_config_mode, read_timeout=read_timeout, delay_factor=delay_factor, max_loops=max_loops, strip_prompt=strip_prompt, strip_command=strip_command, config_mode_command=config_mode_command, cmd_verify=cmd_verify, enter_config_mode=enter_config_mode, error_pattern=error_pattern, terminator=terminator, bypass_commands=bypass_commands, )
Ancestors
Methods
def disable_paging(self, command: str = '', delay_factor: Optional[float] = None, cmd_verify: bool = True, pattern: Optional[str] = None) ‑> str
-
Method to disable paging on the Adva, multi-line configuration command required.
Expand source code
def disable_paging( self, command: str = "", delay_factor: Optional[float] = None, cmd_verify: bool = True, pattern: Optional[str] = None, ) -> str: """Method to disable paging on the Adva, multi-line configuration command required.""" if command: raise ValueError( f"Unexpected value for command in disable_paging() method: {command}" ) commands = [ "configure user-security", f"config-user {self.username} cli-paging disabled", "home", ] return self.send_config_set( commands, delay_factor=delay_factor, cmd_verify=cmd_verify )
def session_preparation(self) ‑> None
-
Prepare the session after the connection has been established. Handles devices with security prompt enabled
Expand source code
def session_preparation(self) -> None: """ Prepare the session after the connection has been established. Handles devices with security prompt enabled """ data = self.read_until_pattern( pattern=r"Do you wish to continue \[Y\|N\]-->|-->" ) if "continue" in data: self.write_channel(f"y{self.RETURN}") else: self.write_channel(f"home{self.RETURN}") data = self.read_until_pattern(pattern=r"-->") self.set_base_prompt() self.disable_paging(cmd_verify=False)
Inherited members
CiscoSSHConnection
:check_config_mode
check_enable_mode
cleanup
clear_buffer
commit
config_mode
disconnect
enable
establish_connection
exit_config_mode
exit_enable_mode
find_prompt
is_alive
normalize_cmd
normalize_linefeeds
paramiko_cleanup
read_channel
read_channel_timing
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
send_multiline
set_base_prompt
set_terminal_width
special_login_handler
strip_ansi_escape_codes
strip_backspaces
strip_command
strip_prompt
telnet_login
write_channel