3.8. execution of a device module
- class nettoolkit.capture_it.exec_device.Execute_Device(ip: str, auth: dict, cmds: list, capture_path: str, cumulative: bool, forced_login: bool, parsed_output: bool, standard_output: bool, CustomClass: Any, fg: bool, mandatory_cmds_retries: int, append_capture: bool, missing_captures_only: bool)[source]
Bases:
objectExecute a device capture
- Parameters:
ip (str) – device ip
auth (dict) – authentication parameters
cmds (list, set, tuple) – set of commands to be executed.
capture_path (str) – path where output to be stored
cumulative (bool, optional) – True,False,both. Defaults to False.
forced_login (bool) – True will try login even if device ping fails.
parsed_output (bool) – parse output and generate Excel or not.
CustomClass (class) – Custom class definition to provide additinal custom variable commands
fg (bool) – facts generation
mandatory_cmds_retries (int) – number of retries for missing mandatory commands captures
append_capture (bool) – append capture to existing file instead of creating new.
missing_captures_only (bool) – capture only missing command outputs from existing output
- CustomClass: Any
- add_cmd_to_all_cmd_dict(cmds)[source]
add command to all cmd dictionary
- Parameters:
cmds (str, list, tuple, set, dict) – commands in any format
- add_cmds_to_self(cmds)[source]
add additional commands to cmds list
- Parameters:
cmds (list) – list of additinal or missed mandatory cmds to be captured
- append_capture: bool
- auth: dict
- capture_path: str
- check_facts_finder_requirements(c)[source]
checks and returns missed mandatory capture commands clone to is_any_ff_cmds_missed
- Parameters:
c (conn) – connection object
- Returns:
missed mandatory commands
- Return type:
set
- cmds: list
- command_capture(c)[source]
start command captures on connection object
- Parameters:
c (conn) – connection object
- cumulative: bool
- fg: bool
- forced_login: bool
- get_max_cmd_length(c, cmds)[source]
returns the length of longest command
- Parameters:
c (conn) – connection object
cmds (str,iterable) – commands list
- get_missing_commands(c, cmds, purpose)[source]
checks and returns missed capture commands
- Parameters:
c (conn) – connection object
cmds (list) – list of commands to check
- Returns:
missed mandatory commands
- Return type:
set
- ip: str
- is_any_ff_cmds_missed(c)[source]
checks and returns missed mandatory capture commands
- Parameters:
c (conn) – connection object
- Returns:
missed mandatory commands
- Return type:
set
- mandatory_cmds_retries: int
- missing_captures_only: bool
- parsed_output: bool
- standard_output: bool