7.21. juniper parser - arp

juniper arp table command output parser

nettoolkit.facts_finder.generators.juniper._cmd_parse_arp_table.get_arp_table(cmd_op, *args)[source]

parser - show arp command output

Parsed Fields:
  • port/interface

  • ip

  • mac, mac2, mac4

  • dns

  • vlan

Parameters:

cmd_op (list, str) – command output in list/multiline string.

Returns:

output dictionary with parsed fields

Return type:

dict

7.22. juniper parser - hardware

juniper show chassis hardware command output parser

class nettoolkit.facts_finder.generators.juniper._cmd_parse_chassis_hardware.JuniperChassisHardware(output)[source]

Bases: object

read the show chassis hardware output from juniper and returns port type(sfp)

Parameters:

output (list) – show chassis hardware output in list

get_sfp(port)[source]

get the SFP details for given port

Parameters:

port (str) – port number only (port type to be excluded)

Returns:

SFP type

Return type:

str

nettoolkit.facts_finder.generators.juniper._cmd_parse_chassis_hardware.get_chassis_hardware(cmd_op, *args)[source]

parser - show chassis hardware command output

Parsed Fields:
  • port/interface

  • port_type

Parameters:

cmd_op (list, str) – command output in list/multiline string.

Returns:

output dictionary with parsed fields

Return type:

dict

nettoolkit.facts_finder.generators.juniper._cmd_parse_chassis_hardware.get_chassis_serial(cmd_op, *args)[source]

parser - show chassis hardware command output

Parsed Fields:
  • device chassis serial number

Parameters:

cmd_op (list, str) – command output in list/multiline string.

Returns:

output dictionary with parsed fields

Return type:

dict

7.23. juniper parser - if description

juniper interface description command output parser

nettoolkit.facts_finder.generators.juniper._cmd_parse_int_description.get_int_description(cmd_op, *args)[source]

parser - show interfaces description command output

Parsed Fields:
  • port/interface

  • description

Parameters:

cmd_op (list, str) – command output in list/multiline string.

Returns:

output dictionary with parsed fields

Return type:

dict

7.24. juniper parser - lldp

juniper lldp neighbour command output parser

nettoolkit.facts_finder.generators.juniper._cmd_parse_lldp.get_lldp_neighbour(cmd_op, *args, dsr=True)[source]

parser - show lldp neighbor command output

Parsed Fields:
  • port/interface

  • neighbor hostname

  • neighbor interface

Parameters:
  • cmd_op (list, str) – command output in list/multiline string.

  • dsr (bool, optional) – DOMAIN SUFFIX REMOVAL. Defaults to True.

Returns:

output dictionary with parsed fields

Return type:

dict

7.25. juniper parser - bgp

juniper bgp protocol routing instances parsing from set config

class nettoolkit.facts_finder.generators.juniper._cmd_parse_running_bgp.RunningIntanceBGP(cmd_op)[source]

Bases: Running

object for instance level config parser

Parameters:

cmd_op (list, str) – config output, either list of multiline string

bgp_grp_info()[source]

update the bgp group detail - description, peer group, peer ip, auth-key, vrf, peer as

bgp_nbr_info()[source]

update the bgp neighbor detail - description, peer group, peer ip, auth-key, vrf, peer as

static get_bgp_grp_info(port_dict, l, spl, proto_idx)[source]

parser function to update bgp group detail - description, peer group, peer ip, auth-key, vrf, peer as

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

  • proto_idx (int) – index value from where protocol bgp starts in provided list

Returns:

None

Return type:

None

static get_bgp_nbr_info(port_dict, l, spl, proto_idx)[source]

parser function to update bgp neighbor detail - description, peer group, peer ip, auth-key, vrf, peer as

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

  • proto_idx (int) – index value from where protocol bgp starts in provided list

Returns:

None

Return type:

None

instance_bgp_nbr_read(func)[source]

directive function to get the various instance level output for bgp neighbours only

Parameters:

func (method) – method to be executed on interface config line

Returns:

parsed output dictionary

Return type:

dict

instance_read(func)[source]

directive function to get the various instance level output

Parameters:

func (method) – method to be executed on interface config line

Returns:

parsed output dictionary

Return type:

dict

nettoolkit.facts_finder.generators.juniper._cmd_parse_running_bgp.get_instances_bgps(cmd_op, *args)[source]

defines set of methods executions. to get various instance parameters. uses RunningIntanceBGP in order to get all.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with system fields

Return type:

dict

7.26. juniper parser - interfaces

juniper interface from config command output parser

class nettoolkit.facts_finder.generators.juniper._cmd_parse_running_interfaces.RunningInterfaces(cmd_op)[source]

Bases: Running

object for interface level config parser

Parameters:

cmd_op (list, str) – config output, either list or multiline string

static get_int_description(port_dict, l, spl, p)[source]

parser function to update interface description details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

get_int_filter(port_dict, l, spl, p)[source]

parser function to update interface type details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

get_int_vlan_details(port_dict, l, spl, p)[source]

parser function to update interface vlan details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_interface_channel_grp(port_dict, l, spl, p)[source]

parser function to update interface port channel details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_interface_mode(port_dict, l, spl, p)[source]

parser function to update interface port mode trunk/access details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_ip_details(port_dict, l, spl, p)[source]

parser function to update interface ipv4 ip address details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_ipv6_details(port_dict, l, spl, p)[source]

parser function to update interface ipv6 ip address details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_ospf_authentication_details(port_dict, l, spl, ospf_idx)[source]

parser function to update interface ospf authentication details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

  • ospf_idx (int) – index value from where ospf information starting on set commands list

Returns:

None

Return type:

None

int_dot_zero_merge_to_parent1()[source]

merges the value of two keys for parent and parent unit 0 configs

int_filter()[source]

update the interface type details

int_to_int_number()[source]

creates an arbirary unique number for each interface on interface types

interface_channel_grp()[source]

update the interface port channel details

interface_description()[source]

update the interface description details

interface_ips()[source]

update the interface ipv4 ip address details

interface_mode()[source]

update the interface port mode trunk/access details

interface_read(func)[source]

directive function to get the various interface level output

Parameters:

func (method) – method to be executed on interface config line

Returns:

parsed output dictionary

Return type:

dict

interface_v6_ips()[source]

update the interface ipv6 ip address details

interface_vlans()[source]

update the interface vlan details

ospf_auth_para_read(func)[source]

directive function to get the various protocol ospf level output

Parameters:

func (method) – method to be executed on ospf config lines

Returns:

parsed output dictionary

Return type:

dict

ospf_authentication_details()[source]

update the interface ospf authentication details

routing_instance_read()[source]

directive function to set the various routing instance level output from interface.

nettoolkit.facts_finder.generators.juniper._cmd_parse_running_interfaces.get_interfaces_running(cmd_op, *args)[source]

defines set of methods executions. to get various inteface parameters. uses RunningInterfaces in order to get all.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with system fields

Return type:

dict

nettoolkit.facts_finder.generators.juniper._cmd_parse_running_interfaces.get_logical_port_number(port)[source]

physical interface - logical interface number calculator.

Parameters:

port (str) – string lateral for various types of juniper interface/port

Returns:

a logical port number assign to port value (sequencial)

Return type:

int

nettoolkit.facts_finder.generators.juniper._cmd_parse_running_interfaces.get_physical_port_number(port)[source]

physical interface - interface number calculator.

Parameters:

port (str) – string lateral for various types of juniper interface/port

Returns:

a number assign to port value (sequencial)

Return type:

int

nettoolkit.facts_finder.generators.juniper._cmd_parse_running_interfaces.set_of_voice_vlans(set_cmd_op)[source]

get the set of voice vlans configured in provided set commands configuration.

Parameters:

set_cmd_op (list) – set command output

Returns:

set of voice vlans found in output

Return type:

set

7.27. juniper parser - ospf

juniper ospf parsing from set config

class nettoolkit.facts_finder.generators.juniper._cmd_parse_running_ospf.RunningOSPF(cmd_op)[source]

Bases: Running

object for ospf level config parser

Parameters:

cmd_op (list, str) – config output, either list or multiline string

static get_interface_type(vrf_op_dict, l, spl)[source]

parser function to get ospf interface type

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_ospf_authentication(vrf_op_dict, l, spl)[source]

parser function to get ospf authentication parameters

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_passive_interfaces(vrf_op_dict, l, spl)[source]

parser function to get passive interfaces

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_summaries(vrf_op_dict, l, spl)[source]

parser function to get ospf area range summaries

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

interface_type()[source]

update the ospf interface type

ospf_authentication()[source]

update the ospf authentication parameters

ospf_read(func)[source]

directive function to get the various instance level output

Parameters:

func (method) – method to be executed on interface config line

Returns:

parsed output dictionary

Return type:

dict

passive_interfaces()[source]

update the passive interfaces

summaries()[source]

update the ospf area range summaries

nettoolkit.facts_finder.generators.juniper._cmd_parse_running_ospf.get_instances_ospfs(cmd_op, *args)[source]

defines set of methods executions. to get various instance of ospf parameters. uses RunningOSPF in order to get all.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with system fields

Return type:

dict

7.28. juniper parser - routes

juniper routes parsing from set config

class nettoolkit.facts_finder.generators.juniper._cmd_parse_running_routes.RunningRoutes(cmd_op)[source]

Bases: Running

object for routes level config parser

static get_route_dict(dic, l, vrf_spl_sect, route_spl_sect, v)[source]

parser function to update route details

Parameters:
  • dic (dict) – blank dictionary to update a route info

  • l (str) – line to parse

Returns:

None

Return type:

None

route_read(func, v=4)[source]

directive function to get the various static routes level output

Parameters:

func (method) – method to be executed on set commands

Returns:

parsed output dictionary

Return type:

dict

routes_dict()[source]

update the route details

v6routes_dict()[source]

update the route details

nettoolkit.facts_finder.generators.juniper._cmd_parse_running_routes.get_system_running_routes(cmd_op, *args)[source]

defines set of methods executions. to get various instance of route parameters. uses RunningRoutes in order to get all.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with system fields

Return type:

dict

7.29. juniper parser - bgp instances

juniper routing instances parsing from set config

class nettoolkit.facts_finder.generators.juniper._cmd_parse_running_routing_instances.RunningIntances(cmd_op)[source]

Bases: Running

object for instance level config parser

Parameters:

cmd_op (list, str) – config output, either list of multiline string

static get_vrf_description(port_dict, l, spl)[source]

parser function to update vrf description details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_vrf_route_target(port_dict, l, spl)[source]

parser function to update vrf route target details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

instance_read(func)[source]

directive function to get the various instance level output

Parameters:

func (method) – method to be executed on interface config line

Returns:

parsed output dictionary

Return type:

dict

vrf_description()[source]

update the vrf description

vrf_route_target()[source]

update the vrf route target

nettoolkit.facts_finder.generators.juniper._cmd_parse_running_routing_instances.get_instances_running(cmd_op, *args)[source]

defines set of methods executions. to get various instance parameters. uses RunningIntances in order to get all.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with system fields

Return type:

dict

7.30. juniper parser - system

juniper system config parser from set config

class nettoolkit.facts_finder.generators.juniper._cmd_parse_running_system.RunningSystem(cmd_op)[source]

Bases: Running

object for system level config parser

Parameters:

cmd_op (list, str) – config output, either list of multiline string

club_list_items(key)[source]

concatenate items with carriage return character for the provided key in system_dict dictionary. general implementation.

Parameters:

key (str) – key for which items to be concatenate.

convert_sets_to_strs()[source]

convert set to string, general implementation

static get_banner(op_dict, l, spl)[source]

parser function to update system banner details

Parameters:
  • op_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_gtac_servers(op_dict, l, spl)[source]

parser function to update system gtac servers details

Parameters:
  • op_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_hostname(op_dict, l, spl)[source]

parser function to update system hostname details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_mgmt_ip(op_dict, l, spl)[source]

parser function to update system management ip details

Parameters:
  • op_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_nameservers(op_dict, l, spl)[source]

parser function to update system name servers details

Parameters:
  • op_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_ntp_servers(op_dict, l, spl)[source]

parser function to update system ntp servers details

Parameters:
  • op_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_syslog_servers(op_dict, l, spl)[source]

parser function to update system syslog servers details

Parameters:
  • op_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_system_as_number(op_dict, l, spl)[source]

parser function to update system as details

Parameters:
  • op_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

system_as_number()[source]

update the system as details

system_banner()[source]

update the system banner details

system_gtac_servers()[source]

update the system gtac server details

system_hostname()[source]

update the system hostname details

system_mgmt_ip()[source]

update the system management ip details

system_nameservers()[source]

update the system name server details

system_ntp_servers()[source]

update the system ntp server details

system_read(func)[source]

directive function to get the various system level output

Parameters:

func (method) – method to be executed on system config line

Returns:

parsed output dictionary

Return type:

dict

system_syslog_servers()[source]

update the system syslog server details

nettoolkit.facts_finder.generators.juniper._cmd_parse_running_system.get_running_system(cmd_op, *args)[source]

defines set of methods executions. to get various system parameters. uses RunningSystem in order to get all.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with system fields

Return type:

dict

7.31. juniper parser - configuration

juniper set config initiator - parent

class nettoolkit.facts_finder.generators.juniper._cmd_parse_running.Running(cmd_op)[source]

Bases: object

parent object for config parser

Parameters:

cmd_op (list, str) – config output, either list of multiline string

7.32. juniper parser - version

juniper show version command output parser

nettoolkit.facts_finder.generators.juniper._cmd_parse_version.get_version(cmd_op, *args)[source]

parser - show version command output

Parsed Fields:
  • version

  • model

Parameters:

cmd_op (list, str) – command output in list/multiline string.

Returns:

output dictionary with parsed fields

Return type:

dict