repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | parse_intf_section | def parse_intf_section(interface):
"""Parse a single entry from show interfaces output.
Different cases:
mgmt0 is up
admin state is up
Ethernet2/1 is up
admin state is up, Dedicated Interface
Vlan1 is down (Administratively down), line protocol is down, autostate enabled
Ethernet154/... | python | def parse_intf_section(interface):
"""Parse a single entry from show interfaces output.
Different cases:
mgmt0 is up
admin state is up
Ethernet2/1 is up
admin state is up, Dedicated Interface
Vlan1 is down (Administratively down), line protocol is down, autostate enabled
Ethernet154/... | [
"def",
"parse_intf_section",
"(",
"interface",
")",
":",
"interface",
"=",
"interface",
".",
"strip",
"(",
")",
"re_protocol",
"=",
"(",
"r\"^(?P<intf_name>\\S+?)\\s+is\\s+(?P<status>.+?)\"",
"r\",\\s+line\\s+protocol\\s+is\\s+(?P<protocol>\\S+).*$\"",
")",
"re_intf_name_state"... | Parse a single entry from show interfaces output.
Different cases:
mgmt0 is up
admin state is up
Ethernet2/1 is up
admin state is up, Dedicated Interface
Vlan1 is down (Administratively down), line protocol is down, autostate enabled
Ethernet154/1/48 is up (with no 'admin state') | [
"Parse",
"a",
"single",
"entry",
"from",
"show",
"interfaces",
"output",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L78-L201 | train | Parse a single entry from show interfaces output. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | convert_hhmmss | def convert_hhmmss(hhmmss):
"""Convert hh:mm:ss to seconds."""
fields = hhmmss.split(":")
if len(fields) != 3:
raise ValueError("Received invalid HH:MM:SS data: {}".format(hhmmss))
fields = [int(x) for x in fields]
hours, minutes, seconds = fields
return (hours * 3600) + (minutes * 60) +... | python | def convert_hhmmss(hhmmss):
"""Convert hh:mm:ss to seconds."""
fields = hhmmss.split(":")
if len(fields) != 3:
raise ValueError("Received invalid HH:MM:SS data: {}".format(hhmmss))
fields = [int(x) for x in fields]
hours, minutes, seconds = fields
return (hours * 3600) + (minutes * 60) +... | [
"def",
"convert_hhmmss",
"(",
"hhmmss",
")",
":",
"fields",
"=",
"hhmmss",
".",
"split",
"(",
"\":\"",
")",
"if",
"len",
"(",
"fields",
")",
"!=",
"3",
":",
"raise",
"ValueError",
"(",
"\"Received invalid HH:MM:SS data: {}\"",
".",
"format",
"(",
"hhmmss",
... | Convert hh:mm:ss to seconds. | [
"Convert",
"hh",
":",
"mm",
":",
"ss",
"to",
"seconds",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L204-L211 | train | Convert hh : mm : ss to seconds. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | bgp_normalize_table_data | def bgp_normalize_table_data(bgp_table):
"""The 'show bgp all summary vrf all' table can have entries that wrap multiple lines.
2001:db8:4:701::2
4 65535 163664 163693 145 0 0 3w2d 3
2001:db8:e0:dd::1
4 10 327491 327278 145 0 0 3w1d 4
... | python | def bgp_normalize_table_data(bgp_table):
"""The 'show bgp all summary vrf all' table can have entries that wrap multiple lines.
2001:db8:4:701::2
4 65535 163664 163693 145 0 0 3w2d 3
2001:db8:e0:dd::1
4 10 327491 327278 145 0 0 3w1d 4
... | [
"def",
"bgp_normalize_table_data",
"(",
"bgp_table",
")",
":",
"bgp_table",
"=",
"bgp_table",
".",
"strip",
"(",
")",
"bgp_multiline_pattern",
"=",
"r\"({})\\s*\\n\"",
".",
"format",
"(",
"IPV4_OR_IPV6_REGEX",
")",
"# Strip out the newline",
"return",
"re",
".",
"su... | The 'show bgp all summary vrf all' table can have entries that wrap multiple lines.
2001:db8:4:701::2
4 65535 163664 163693 145 0 0 3w2d 3
2001:db8:e0:dd::1
4 10 327491 327278 145 0 0 3w1d 4
Normalize this so the line wrap doesn't exit. | [
"The",
"show",
"bgp",
"all",
"summary",
"vrf",
"all",
"table",
"can",
"have",
"entries",
"that",
"wrap",
"multiple",
"lines",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L263-L276 | train | Normalize bgp table data so that the line wrap doesn t exit. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | bgp_table_parser | def bgp_table_parser(bgp_table):
"""Generator that parses a line of bgp summary table and returns a dict compatible with NAPALM
Example line:
10.2.1.14 4 10 472516 472238 361 0 0 3w1d 9
"""
bgp_table = bgp_table.strip()
for bgp_entry in bgp_table.splitlines():
... | python | def bgp_table_parser(bgp_table):
"""Generator that parses a line of bgp summary table and returns a dict compatible with NAPALM
Example line:
10.2.1.14 4 10 472516 472238 361 0 0 3w1d 9
"""
bgp_table = bgp_table.strip()
for bgp_entry in bgp_table.splitlines():
... | [
"def",
"bgp_table_parser",
"(",
"bgp_table",
")",
":",
"bgp_table",
"=",
"bgp_table",
".",
"strip",
"(",
")",
"for",
"bgp_entry",
"in",
"bgp_table",
".",
"splitlines",
"(",
")",
":",
"bgp_table_fields",
"=",
"bgp_entry",
".",
"split",
"(",
")",
"try",
":",... | Generator that parses a line of bgp summary table and returns a dict compatible with NAPALM
Example line:
10.2.1.14 4 10 472516 472238 361 0 0 3w1d 9 | [
"Generator",
"that",
"parses",
"a",
"line",
"of",
"bgp",
"summary",
"table",
"and",
"returns",
"a",
"dict",
"compatible",
"with",
"NAPALM"
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L279-L347 | train | Generator that parses a line of BGP summary table and returns a dict compatible with NAPALM. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | bgp_summary_parser | def bgp_summary_parser(bgp_summary):
"""Parse 'show bgp all summary vrf' output information from NX-OS devices."""
bgp_summary_dict = {}
# Check for BGP summary information lines that have no data
if len(bgp_summary.strip().splitlines()) <= 1:
return {}
allowed_afi = ["ipv4", "ipv6", "l2vp... | python | def bgp_summary_parser(bgp_summary):
"""Parse 'show bgp all summary vrf' output information from NX-OS devices."""
bgp_summary_dict = {}
# Check for BGP summary information lines that have no data
if len(bgp_summary.strip().splitlines()) <= 1:
return {}
allowed_afi = ["ipv4", "ipv6", "l2vp... | [
"def",
"bgp_summary_parser",
"(",
"bgp_summary",
")",
":",
"bgp_summary_dict",
"=",
"{",
"}",
"# Check for BGP summary information lines that have no data",
"if",
"len",
"(",
"bgp_summary",
".",
"strip",
"(",
")",
".",
"splitlines",
"(",
")",
")",
"<=",
"1",
":",
... | Parse 'show bgp all summary vrf' output information from NX-OS devices. | [
"Parse",
"show",
"bgp",
"all",
"summary",
"vrf",
"output",
"information",
"from",
"NX",
"-",
"OS",
"devices",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L350-L426 | train | Parse show bgp all summary vrf output information from NX - OS devices. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | NXOSSSHDriver._send_command_list | def _send_command_list(self, commands):
"""Wrapper for Netmiko's send_command method (for list of commands."""
output = ""
for command in commands:
output += self.device.send_command(
command, strip_prompt=False, strip_command=False
)
return output | python | def _send_command_list(self, commands):
"""Wrapper for Netmiko's send_command method (for list of commands."""
output = ""
for command in commands:
output += self.device.send_command(
command, strip_prompt=False, strip_command=False
)
return output | [
"def",
"_send_command_list",
"(",
"self",
",",
"commands",
")",
":",
"output",
"=",
"\"\"",
"for",
"command",
"in",
"commands",
":",
"output",
"+=",
"self",
".",
"device",
".",
"send_command",
"(",
"command",
",",
"strip_prompt",
"=",
"False",
",",
"strip_... | Wrapper for Netmiko's send_command method (for list of commands. | [
"Wrapper",
"for",
"Netmiko",
"s",
"send_command",
"method",
"(",
"for",
"list",
"of",
"commands",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L452-L459 | train | Wrapper for Netmiko s send_command method for list of commands. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | NXOSSSHDriver.parse_uptime | def parse_uptime(uptime_str):
"""
Extract the uptime string from the given Cisco IOS Device.
Return the uptime in seconds as an integer
"""
# Initialize to zero
(years, weeks, days, hours, minutes) = (0, 0, 0, 0, 0)
uptime_str = uptime_str.strip()
time_li... | python | def parse_uptime(uptime_str):
"""
Extract the uptime string from the given Cisco IOS Device.
Return the uptime in seconds as an integer
"""
# Initialize to zero
(years, weeks, days, hours, minutes) = (0, 0, 0, 0, 0)
uptime_str = uptime_str.strip()
time_li... | [
"def",
"parse_uptime",
"(",
"uptime_str",
")",
":",
"# Initialize to zero",
"(",
"years",
",",
"weeks",
",",
"days",
",",
"hours",
",",
"minutes",
")",
"=",
"(",
"0",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
")",
"uptime_str",
"=",
"uptime_str",
".",
... | Extract the uptime string from the given Cisco IOS Device.
Return the uptime in seconds as an integer | [
"Extract",
"the",
"uptime",
"string",
"from",
"the",
"given",
"Cisco",
"IOS",
"Device",
".",
"Return",
"the",
"uptime",
"in",
"seconds",
"as",
"an",
"integer"
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L467-L499 | train | Extract the uptime string from the Cisco IOS Device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | NXOSSSHDriver.is_alive | def is_alive(self):
"""Returns a flag with the state of the SSH connection."""
null = chr(0)
try:
if self.device is None:
return {"is_alive": False}
else:
# Try sending ASCII null byte to maintain the connection alive
self._... | python | def is_alive(self):
"""Returns a flag with the state of the SSH connection."""
null = chr(0)
try:
if self.device is None:
return {"is_alive": False}
else:
# Try sending ASCII null byte to maintain the connection alive
self._... | [
"def",
"is_alive",
"(",
"self",
")",
":",
"null",
"=",
"chr",
"(",
"0",
")",
"try",
":",
"if",
"self",
".",
"device",
"is",
"None",
":",
"return",
"{",
"\"is_alive\"",
":",
"False",
"}",
"else",
":",
"# Try sending ASCII null byte to maintain the connection ... | Returns a flag with the state of the SSH connection. | [
"Returns",
"a",
"flag",
"with",
"the",
"state",
"of",
"the",
"SSH",
"connection",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L501-L514 | train | Returns a flag with the state of the SSH connection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | NXOSSSHDriver.get_facts | def get_facts(self):
"""Return a set of facts from the devices."""
# default values.
vendor = "Cisco"
uptime = -1
serial_number, fqdn, os_version, hostname, domain_name, model = ("",) * 6
# obtain output from device
show_ver = self._send_command("show version")
... | python | def get_facts(self):
"""Return a set of facts from the devices."""
# default values.
vendor = "Cisco"
uptime = -1
serial_number, fqdn, os_version, hostname, domain_name, model = ("",) * 6
# obtain output from device
show_ver = self._send_command("show version")
... | [
"def",
"get_facts",
"(",
"self",
")",
":",
"# default values.",
"vendor",
"=",
"\"Cisco\"",
"uptime",
"=",
"-",
"1",
"serial_number",
",",
"fqdn",
",",
"os_version",
",",
"hostname",
",",
"domain_name",
",",
"model",
"=",
"(",
"\"\"",
",",
")",
"*",
"6",... | Return a set of facts from the devices. | [
"Return",
"a",
"set",
"of",
"facts",
"from",
"the",
"devices",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L563-L639 | train | Return a set of facts from the devices. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | NXOSSSHDriver.get_interfaces | def get_interfaces(self):
"""
Get interface details.
last_flapped is not implemented
Example Output:
{ u'Vlan1': { 'description': u'',
'is_enabled': True,
'is_up': True,
'last_flapped': -1.0,
... | python | def get_interfaces(self):
"""
Get interface details.
last_flapped is not implemented
Example Output:
{ u'Vlan1': { 'description': u'',
'is_enabled': True,
'is_up': True,
'last_flapped': -1.0,
... | [
"def",
"get_interfaces",
"(",
"self",
")",
":",
"interfaces",
"=",
"{",
"}",
"command",
"=",
"\"show interface\"",
"output",
"=",
"self",
".",
"_send_command",
"(",
"command",
")",
"if",
"not",
"output",
":",
"return",
"{",
"}",
"# Break output into per-interf... | Get interface details.
last_flapped is not implemented
Example Output:
{ u'Vlan1': { 'description': u'',
'is_enabled': True,
'is_up': True,
'last_flapped': -1.0,
'mac_address': u'a493.4cc1.67a7',
... | [
"Get",
"interface",
"details",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L641-L707 | train | Get the list of interfaces. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | NXOSSSHDriver.get_bgp_neighbors | def get_bgp_neighbors(self):
"""BGP neighbor information.
Supports VRFs and IPv4 and IPv6 AFIs
{
"global": {
"router_id": "1.1.1.103",
"peers": {
"10.99.99.2": {
"is_enabled": true,
"uptime": -1,
... | python | def get_bgp_neighbors(self):
"""BGP neighbor information.
Supports VRFs and IPv4 and IPv6 AFIs
{
"global": {
"router_id": "1.1.1.103",
"peers": {
"10.99.99.2": {
"is_enabled": true,
"uptime": -1,
... | [
"def",
"get_bgp_neighbors",
"(",
"self",
")",
":",
"bgp_dict",
"=",
"{",
"}",
"# get summary output from device",
"cmd_bgp_all_sum",
"=",
"\"show bgp all summary vrf all\"",
"bgp_summary_output",
"=",
"self",
".",
"_send_command",
"(",
"cmd_bgp_all_sum",
")",
".",
"stri... | BGP neighbor information.
Supports VRFs and IPv4 and IPv6 AFIs
{
"global": {
"router_id": "1.1.1.103",
"peers": {
"10.99.99.2": {
"is_enabled": true,
"uptime": -1,
"remote_as": 22,
... | [
"BGP",
"neighbor",
"information",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L709-L754 | train | Get BGP neighbor information. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | NXOSSSHDriver.get_environment | def get_environment(self):
"""
Get environment facts.
power and fan are currently not implemented
cpu is using 1-minute average
"""
environment = {}
# sys_resources contains cpu and mem output
sys_resources = self._send_command("show system resources")
... | python | def get_environment(self):
"""
Get environment facts.
power and fan are currently not implemented
cpu is using 1-minute average
"""
environment = {}
# sys_resources contains cpu and mem output
sys_resources = self._send_command("show system resources")
... | [
"def",
"get_environment",
"(",
"self",
")",
":",
"environment",
"=",
"{",
"}",
"# sys_resources contains cpu and mem output",
"sys_resources",
"=",
"self",
".",
"_send_command",
"(",
"\"show system resources\"",
")",
"temp_cmd",
"=",
"\"show environment temperature\"",
"#... | Get environment facts.
power and fan are currently not implemented
cpu is using 1-minute average | [
"Get",
"environment",
"facts",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L766-L837 | train | Get the environment of the current state of the user. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | NXOSSSHDriver.get_interfaces_ip | def get_interfaces_ip(self):
"""
Get interface IP details. Returns a dictionary of dictionaries.
Sample output:
{
"Ethernet2/3": {
"ipv4": {
"4.4.4.4": {
"prefix_length": 16
}
},
... | python | def get_interfaces_ip(self):
"""
Get interface IP details. Returns a dictionary of dictionaries.
Sample output:
{
"Ethernet2/3": {
"ipv4": {
"4.4.4.4": {
"prefix_length": 16
}
},
... | [
"def",
"get_interfaces_ip",
"(",
"self",
")",
":",
"interfaces_ip",
"=",
"{",
"}",
"ipv4_command",
"=",
"\"show ip interface vrf all\"",
"ipv6_command",
"=",
"\"show ipv6 interface vrf all\"",
"output_v4",
"=",
"self",
".",
"_send_command",
"(",
"ipv4_command",
")",
"... | Get interface IP details. Returns a dictionary of dictionaries.
Sample output:
{
"Ethernet2/3": {
"ipv4": {
"4.4.4.4": {
"prefix_length": 16
}
},
"ipv6": {
"20... | [
"Get",
"interface",
"IP",
"details",
".",
"Returns",
"a",
"dictionary",
"of",
"dictionaries",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L934-L1024 | train | Get the interfaces IP details. Returns a dictionary of dictionaries. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | NXOSSSHDriver._get_bgp_route_attr | def _get_bgp_route_attr(self, destination, vrf, next_hop, ip_version=4):
"""
BGP protocol attributes for get_route_tp
Only IPv4 supported
"""
CMD_SHIBNV = 'show ip bgp neighbors vrf {vrf} | include "is {neigh}"'
search_re_dict = {
"aspath": {
... | python | def _get_bgp_route_attr(self, destination, vrf, next_hop, ip_version=4):
"""
BGP protocol attributes for get_route_tp
Only IPv4 supported
"""
CMD_SHIBNV = 'show ip bgp neighbors vrf {vrf} | include "is {neigh}"'
search_re_dict = {
"aspath": {
... | [
"def",
"_get_bgp_route_attr",
"(",
"self",
",",
"destination",
",",
"vrf",
",",
"next_hop",
",",
"ip_version",
"=",
"4",
")",
":",
"CMD_SHIBNV",
"=",
"'show ip bgp neighbors vrf {vrf} | include \"is {neigh}\"'",
"search_re_dict",
"=",
"{",
"\"aspath\"",
":",
"{",
"\... | BGP protocol attributes for get_route_tp
Only IPv4 supported | [
"BGP",
"protocol",
"attributes",
"for",
"get_route_tp",
"Only",
"IPv4",
"supported"
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L1164-L1286 | train | Get BGP protocol attributes for get_route_tp
Only IPv4 supported | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos_ssh/nxos_ssh.py | NXOSSSHDriver.get_route_to | def get_route_to(self, destination="", protocol=""):
"""
Only IPv4 supported, vrf aware, longer_prefixes parameter ready
"""
longer_pref = "" # longer_prefixes support, for future use
vrf = ""
ip_version = None
try:
ip_version = IPNetwork(destination... | python | def get_route_to(self, destination="", protocol=""):
"""
Only IPv4 supported, vrf aware, longer_prefixes parameter ready
"""
longer_pref = "" # longer_prefixes support, for future use
vrf = ""
ip_version = None
try:
ip_version = IPNetwork(destination... | [
"def",
"get_route_to",
"(",
"self",
",",
"destination",
"=",
"\"\"",
",",
"protocol",
"=",
"\"\"",
")",
":",
"longer_pref",
"=",
"\"\"",
"# longer_prefixes support, for future use",
"vrf",
"=",
"\"\"",
"ip_version",
"=",
"None",
"try",
":",
"ip_version",
"=",
... | Only IPv4 supported, vrf aware, longer_prefixes parameter ready | [
"Only",
"IPv4",
"supported",
"vrf",
"aware",
"longer_prefixes",
"parameter",
"ready"
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos_ssh/nxos_ssh.py#L1288-L1394 | train | Get route to destination. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/base.py | NetworkDriver._netmiko_open | def _netmiko_open(self, device_type, netmiko_optional_args=None):
"""Standardized method of creating a Netmiko connection using napalm attributes."""
if netmiko_optional_args is None:
netmiko_optional_args = {}
try:
self._netmiko_device = ConnectHandler(
d... | python | def _netmiko_open(self, device_type, netmiko_optional_args=None):
"""Standardized method of creating a Netmiko connection using napalm attributes."""
if netmiko_optional_args is None:
netmiko_optional_args = {}
try:
self._netmiko_device = ConnectHandler(
d... | [
"def",
"_netmiko_open",
"(",
"self",
",",
"device_type",
",",
"netmiko_optional_args",
"=",
"None",
")",
":",
"if",
"netmiko_optional_args",
"is",
"None",
":",
"netmiko_optional_args",
"=",
"{",
"}",
"try",
":",
"self",
".",
"_netmiko_device",
"=",
"ConnectHandl... | Standardized method of creating a Netmiko connection using napalm attributes. | [
"Standardized",
"method",
"of",
"creating",
"a",
"Netmiko",
"connection",
"using",
"napalm",
"attributes",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/base.py#L76-L94 | train | Standardized method of creating a Netmiko connection using napalm attributes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/base.py | NetworkDriver.load_template | def load_template(
self, template_name, template_source=None, template_path=None, **template_vars
):
"""
Will load a templated configuration on the device.
:param cls: Instance of the driver class.
:param template_name: Identifies the template name.
:param template_s... | python | def load_template(
self, template_name, template_source=None, template_path=None, **template_vars
):
"""
Will load a templated configuration on the device.
:param cls: Instance of the driver class.
:param template_name: Identifies the template name.
:param template_s... | [
"def",
"load_template",
"(",
"self",
",",
"template_name",
",",
"template_source",
"=",
"None",
",",
"template_path",
"=",
"None",
",",
"*",
"*",
"template_vars",
")",
":",
"return",
"napalm",
".",
"base",
".",
"helpers",
".",
"load_template",
"(",
"self",
... | Will load a templated configuration on the device.
:param cls: Instance of the driver class.
:param template_name: Identifies the template name.
:param template_source (optional): Custom config template rendered and loaded on device
:param template_path (optional): Absolute path to dire... | [
"Will",
"load",
"a",
"templated",
"configuration",
"on",
"the",
"device",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/base.py#L148-L172 | train | Load a templated configuration on the device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/base.py | NetworkDriver.traceroute | def traceroute(
self,
destination,
source=c.TRACEROUTE_SOURCE,
ttl=c.TRACEROUTE_TTL,
timeout=c.TRACEROUTE_TIMEOUT,
vrf=c.TRACEROUTE_VRF,
):
"""
Executes traceroute on the device and returns a dictionary with the result.
:param destination: Hos... | python | def traceroute(
self,
destination,
source=c.TRACEROUTE_SOURCE,
ttl=c.TRACEROUTE_TTL,
timeout=c.TRACEROUTE_TIMEOUT,
vrf=c.TRACEROUTE_VRF,
):
"""
Executes traceroute on the device and returns a dictionary with the result.
:param destination: Hos... | [
"def",
"traceroute",
"(",
"self",
",",
"destination",
",",
"source",
"=",
"c",
".",
"TRACEROUTE_SOURCE",
",",
"ttl",
"=",
"c",
".",
"TRACEROUTE_TTL",
",",
"timeout",
"=",
"c",
".",
"TRACEROUTE_TIMEOUT",
",",
"vrf",
"=",
"c",
".",
"TRACEROUTE_VRF",
",",
"... | Executes traceroute on the device and returns a dictionary with the result.
:param destination: Host or IP Address of the destination
:param source (optional): Use a specific IP Address to execute the traceroute
:param ttl (optional): Maimum number of hops
:param timeout (optional): Num... | [
"Executes",
"traceroute",
"on",
"the",
"device",
"and",
"returns",
"a",
"dictionary",
"with",
"the",
"result",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/base.py#L1295-L1407 | train | Execute a traceroute on the device and returns the result. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/base.py | NetworkDriver.compliance_report | def compliance_report(self, validation_file=None, validation_source=None):
"""
Return a compliance report.
Verify that the device complies with the given validation file and writes a compliance
report file. See https://napalm.readthedocs.io/en/latest/validate/index.html.
:param... | python | def compliance_report(self, validation_file=None, validation_source=None):
"""
Return a compliance report.
Verify that the device complies with the given validation file and writes a compliance
report file. See https://napalm.readthedocs.io/en/latest/validate/index.html.
:param... | [
"def",
"compliance_report",
"(",
"self",
",",
"validation_file",
"=",
"None",
",",
"validation_source",
"=",
"None",
")",
":",
"return",
"validate",
".",
"compliance_report",
"(",
"self",
",",
"validation_file",
"=",
"validation_file",
",",
"validation_source",
"=... | Return a compliance report.
Verify that the device complies with the given validation file and writes a compliance
report file. See https://napalm.readthedocs.io/en/latest/validate/index.html.
:param validation_file: Path to the file containing compliance definition. Default is None.
:... | [
"Return",
"a",
"compliance",
"report",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/base.py#L1652-L1666 | train | Returns a compliance report. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/base.py | NetworkDriver._canonical_int | def _canonical_int(self, interface):
"""Expose the helper function within this class."""
if self.use_canonical_interface is True:
return napalm.base.helpers.canonical_interface_name(
interface, addl_name_map=None
)
else:
return interface | python | def _canonical_int(self, interface):
"""Expose the helper function within this class."""
if self.use_canonical_interface is True:
return napalm.base.helpers.canonical_interface_name(
interface, addl_name_map=None
)
else:
return interface | [
"def",
"_canonical_int",
"(",
"self",
",",
"interface",
")",
":",
"if",
"self",
".",
"use_canonical_interface",
"is",
"True",
":",
"return",
"napalm",
".",
"base",
".",
"helpers",
".",
"canonical_interface_name",
"(",
"interface",
",",
"addl_name_map",
"=",
"N... | Expose the helper function within this class. | [
"Expose",
"the",
"helper",
"function",
"within",
"this",
"class",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/base.py#L1668-L1675 | train | Expose the helper function within this class. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.open | def open(self):
"""Open the connection with the device."""
try:
self.device.open()
except ConnectTimeoutError as cte:
raise ConnectionException(cte.msg)
self.device.timeout = self.timeout
self.device._conn._session.transport.set_keepalive(self.keepalive)
... | python | def open(self):
"""Open the connection with the device."""
try:
self.device.open()
except ConnectTimeoutError as cte:
raise ConnectionException(cte.msg)
self.device.timeout = self.timeout
self.device._conn._session.transport.set_keepalive(self.keepalive)
... | [
"def",
"open",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"device",
".",
"open",
"(",
")",
"except",
"ConnectTimeoutError",
"as",
"cte",
":",
"raise",
"ConnectionException",
"(",
"cte",
".",
"msg",
")",
"self",
".",
"device",
".",
"timeout",
"=",
... | Open the connection with the device. | [
"Open",
"the",
"connection",
"with",
"the",
"device",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L118-L132 | train | Open the connection with the device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.close | def close(self):
"""Close the connection."""
if not self.lock_disable and self.session_config_lock:
self._unlock()
self.device.close() | python | def close(self):
"""Close the connection."""
if not self.lock_disable and self.session_config_lock:
self._unlock()
self.device.close() | [
"def",
"close",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"lock_disable",
"and",
"self",
".",
"session_config_lock",
":",
"self",
".",
"_unlock",
"(",
")",
"self",
".",
"device",
".",
"close",
"(",
")"
] | Close the connection. | [
"Close",
"the",
"connection",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L134-L138 | train | Close the connection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver._lock | def _lock(self):
"""Lock the config DB."""
if not self.locked:
try:
self.device.cu.lock()
self.locked = True
except JnprLockError as jle:
raise LockError(py23_compat.text_type(jle)) | python | def _lock(self):
"""Lock the config DB."""
if not self.locked:
try:
self.device.cu.lock()
self.locked = True
except JnprLockError as jle:
raise LockError(py23_compat.text_type(jle)) | [
"def",
"_lock",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"locked",
":",
"try",
":",
"self",
".",
"device",
".",
"cu",
".",
"lock",
"(",
")",
"self",
".",
"locked",
"=",
"True",
"except",
"JnprLockError",
"as",
"jle",
":",
"raise",
"LockErro... | Lock the config DB. | [
"Lock",
"the",
"config",
"DB",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L140-L147 | train | Lock the config DB. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver._unlock | def _unlock(self):
"""Unlock the config DB."""
if self.locked:
try:
self.device.cu.unlock()
self.locked = False
except JnrpUnlockError as jue:
raise UnlockError(jue.messsage) | python | def _unlock(self):
"""Unlock the config DB."""
if self.locked:
try:
self.device.cu.unlock()
self.locked = False
except JnrpUnlockError as jue:
raise UnlockError(jue.messsage) | [
"def",
"_unlock",
"(",
"self",
")",
":",
"if",
"self",
".",
"locked",
":",
"try",
":",
"self",
".",
"device",
".",
"cu",
".",
"unlock",
"(",
")",
"self",
".",
"locked",
"=",
"False",
"except",
"JnrpUnlockError",
"as",
"jue",
":",
"raise",
"UnlockErro... | Unlock the config DB. | [
"Unlock",
"the",
"config",
"DB",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L149-L156 | train | Unlock the config DB. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver._rpc | def _rpc(self, get, child=None, **kwargs):
"""
This allows you to construct an arbitrary RPC call to retreive common stuff. For example:
Configuration: get: "<get-configuration/>"
Interface information: get: "<get-interface-information/>"
A particular interfacece information:
... | python | def _rpc(self, get, child=None, **kwargs):
"""
This allows you to construct an arbitrary RPC call to retreive common stuff. For example:
Configuration: get: "<get-configuration/>"
Interface information: get: "<get-interface-information/>"
A particular interfacece information:
... | [
"def",
"_rpc",
"(",
"self",
",",
"get",
",",
"child",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"rpc",
"=",
"etree",
".",
"fromstring",
"(",
"get",
")",
"if",
"child",
":",
"rpc",
".",
"append",
"(",
"etree",
".",
"fromstring",
"(",
"child"... | This allows you to construct an arbitrary RPC call to retreive common stuff. For example:
Configuration: get: "<get-configuration/>"
Interface information: get: "<get-interface-information/>"
A particular interfacece information:
get: "<get-interface-information/>"
... | [
"This",
"allows",
"you",
"to",
"construct",
"an",
"arbitrary",
"RPC",
"call",
"to",
"retreive",
"common",
"stuff",
".",
"For",
"example",
":",
"Configuration",
":",
"get",
":",
"<get",
"-",
"configuration",
"/",
">",
"Interface",
"information",
":",
"get",
... | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L158-L173 | train | This method is used to construct an arbitrary RPC call to obtain common stuff. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.load_replace_candidate | def load_replace_candidate(self, filename=None, config=None):
"""Open the candidate config and merge."""
self.config_replace = True
self._load_candidate(filename, config, True) | python | def load_replace_candidate(self, filename=None, config=None):
"""Open the candidate config and merge."""
self.config_replace = True
self._load_candidate(filename, config, True) | [
"def",
"load_replace_candidate",
"(",
"self",
",",
"filename",
"=",
"None",
",",
"config",
"=",
"None",
")",
":",
"self",
".",
"config_replace",
"=",
"True",
"self",
".",
"_load_candidate",
"(",
"filename",
",",
"config",
",",
"True",
")"
] | Open the candidate config and merge. | [
"Open",
"the",
"candidate",
"config",
"and",
"merge",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L244-L247 | train | Open the candidate config and merge. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.load_merge_candidate | def load_merge_candidate(self, filename=None, config=None):
"""Open the candidate config and replace."""
self.config_replace = False
self._load_candidate(filename, config, False) | python | def load_merge_candidate(self, filename=None, config=None):
"""Open the candidate config and replace."""
self.config_replace = False
self._load_candidate(filename, config, False) | [
"def",
"load_merge_candidate",
"(",
"self",
",",
"filename",
"=",
"None",
",",
"config",
"=",
"None",
")",
":",
"self",
".",
"config_replace",
"=",
"False",
"self",
".",
"_load_candidate",
"(",
"filename",
",",
"config",
",",
"False",
")"
] | Open the candidate config and replace. | [
"Open",
"the",
"candidate",
"config",
"and",
"replace",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L249-L252 | train | Open the candidate config and replace. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.commit_config | def commit_config(self, message=""):
"""Commit configuration."""
commit_args = {"comment": message} if message else {}
self.device.cu.commit(ignore_warning=self.ignore_warning, **commit_args)
if not self.lock_disable and not self.session_config_lock:
self._unlock() | python | def commit_config(self, message=""):
"""Commit configuration."""
commit_args = {"comment": message} if message else {}
self.device.cu.commit(ignore_warning=self.ignore_warning, **commit_args)
if not self.lock_disable and not self.session_config_lock:
self._unlock() | [
"def",
"commit_config",
"(",
"self",
",",
"message",
"=",
"\"\"",
")",
":",
"commit_args",
"=",
"{",
"\"comment\"",
":",
"message",
"}",
"if",
"message",
"else",
"{",
"}",
"self",
".",
"device",
".",
"cu",
".",
"commit",
"(",
"ignore_warning",
"=",
"se... | Commit configuration. | [
"Commit",
"configuration",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L263-L268 | train | Commits the current configuration. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.discard_config | def discard_config(self):
"""Discard changes (rollback 0)."""
self.device.cu.rollback(rb_id=0)
if not self.lock_disable and not self.session_config_lock:
self._unlock() | python | def discard_config(self):
"""Discard changes (rollback 0)."""
self.device.cu.rollback(rb_id=0)
if not self.lock_disable and not self.session_config_lock:
self._unlock() | [
"def",
"discard_config",
"(",
"self",
")",
":",
"self",
".",
"device",
".",
"cu",
".",
"rollback",
"(",
"rb_id",
"=",
"0",
")",
"if",
"not",
"self",
".",
"lock_disable",
"and",
"not",
"self",
".",
"session_config_lock",
":",
"self",
".",
"_unlock",
"("... | Discard changes (rollback 0). | [
"Discard",
"changes",
"(",
"rollback",
"0",
")",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L270-L274 | train | Discard changes ( rollback 0 ). | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_interfaces | def get_interfaces(self):
"""Return interfaces details."""
result = {}
interfaces = junos_views.junos_iface_table(self.device)
interfaces.get()
interfaces_logical = junos_views.junos_logical_iface_table(self.device)
interfaces_logical.get()
# convert all the tup... | python | def get_interfaces(self):
"""Return interfaces details."""
result = {}
interfaces = junos_views.junos_iface_table(self.device)
interfaces.get()
interfaces_logical = junos_views.junos_logical_iface_table(self.device)
interfaces_logical.get()
# convert all the tup... | [
"def",
"get_interfaces",
"(",
"self",
")",
":",
"result",
"=",
"{",
"}",
"interfaces",
"=",
"junos_views",
".",
"junos_iface_table",
"(",
"self",
".",
"device",
")",
"interfaces",
".",
"get",
"(",
")",
"interfaces_logical",
"=",
"junos_views",
".",
"junos_lo... | Return interfaces details. | [
"Return",
"interfaces",
"details",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L302-L362 | train | Return the details of all interfaces on the device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_interfaces_counters | def get_interfaces_counters(self):
"""Return interfaces counters."""
query = junos_views.junos_iface_counter_table(self.device)
query.get()
interface_counters = {}
for interface, counters in query.items():
interface_counters[interface] = {
k: v if v is... | python | def get_interfaces_counters(self):
"""Return interfaces counters."""
query = junos_views.junos_iface_counter_table(self.device)
query.get()
interface_counters = {}
for interface, counters in query.items():
interface_counters[interface] = {
k: v if v is... | [
"def",
"get_interfaces_counters",
"(",
"self",
")",
":",
"query",
"=",
"junos_views",
".",
"junos_iface_counter_table",
"(",
"self",
".",
"device",
")",
"query",
".",
"get",
"(",
")",
"interface_counters",
"=",
"{",
"}",
"for",
"interface",
",",
"counters",
... | Return interfaces counters. | [
"Return",
"interfaces",
"counters",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L364-L373 | train | Return interfaces counters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_environment | def get_environment(self):
"""Return environment details."""
environment = junos_views.junos_environment_table(self.device)
routing_engine = junos_views.junos_routing_engine_table(self.device)
temperature_thresholds = junos_views.junos_temperature_thresholds(self.device)
power_su... | python | def get_environment(self):
"""Return environment details."""
environment = junos_views.junos_environment_table(self.device)
routing_engine = junos_views.junos_routing_engine_table(self.device)
temperature_thresholds = junos_views.junos_temperature_thresholds(self.device)
power_su... | [
"def",
"get_environment",
"(",
"self",
")",
":",
"environment",
"=",
"junos_views",
".",
"junos_environment_table",
"(",
"self",
".",
"device",
")",
"routing_engine",
"=",
"junos_views",
".",
"junos_routing_engine_table",
"(",
"self",
".",
"device",
")",
"temperat... | Return environment details. | [
"Return",
"environment",
"details",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L375-L542 | train | Return the environment details. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver._get_address_family | def _get_address_family(table, instance):
"""
Function to derive address family from a junos table name.
:params table: The name of the routing table
:returns: address family
"""
address_family_mapping = {"inet": "ipv4", "inet6": "ipv6", "inetflow": "flow"}
if in... | python | def _get_address_family(table, instance):
"""
Function to derive address family from a junos table name.
:params table: The name of the routing table
:returns: address family
"""
address_family_mapping = {"inet": "ipv4", "inet6": "ipv6", "inetflow": "flow"}
if in... | [
"def",
"_get_address_family",
"(",
"table",
",",
"instance",
")",
":",
"address_family_mapping",
"=",
"{",
"\"inet\"",
":",
"\"ipv4\"",
",",
"\"inet6\"",
":",
"\"ipv6\"",
",",
"\"inetflow\"",
":",
"\"flow\"",
"}",
"if",
"instance",
"==",
"\"master\"",
":",
"fa... | Function to derive address family from a junos table name.
:params table: The name of the routing table
:returns: address family | [
"Function",
"to",
"derive",
"address",
"family",
"from",
"a",
"junos",
"table",
"name",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L545-L561 | train | Function to derive the address family from a junos routing table name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_lldp_neighbors_detail | def get_lldp_neighbors_detail(self, interface=""):
"""Detailed view of the LLDP neighbors."""
lldp_neighbors = defaultdict(list)
lldp_table = junos_views.junos_lldp_neighbors_detail_table(self.device)
if not interface:
try:
lldp_table.get()
except ... | python | def get_lldp_neighbors_detail(self, interface=""):
"""Detailed view of the LLDP neighbors."""
lldp_neighbors = defaultdict(list)
lldp_table = junos_views.junos_lldp_neighbors_detail_table(self.device)
if not interface:
try:
lldp_table.get()
except ... | [
"def",
"get_lldp_neighbors_detail",
"(",
"self",
",",
"interface",
"=",
"\"\"",
")",
":",
"lldp_neighbors",
"=",
"defaultdict",
"(",
"list",
")",
"lldp_table",
"=",
"junos_views",
".",
"junos_lldp_neighbors_detail_table",
"(",
"self",
".",
"device",
")",
"if",
"... | Detailed view of the LLDP neighbors. | [
"Detailed",
"view",
"of",
"the",
"LLDP",
"neighbors",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L787-L854 | train | Detailed view of the LLDP neighbors. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.cli | def cli(self, commands):
"""Execute raw CLI commands and returns their output."""
cli_output = {}
def _count(txt, none): # Second arg for consistency only. noqa
"""
Return the exact output, as Junos displays
e.g.:
> show system processes extensiv... | python | def cli(self, commands):
"""Execute raw CLI commands and returns their output."""
cli_output = {}
def _count(txt, none): # Second arg for consistency only. noqa
"""
Return the exact output, as Junos displays
e.g.:
> show system processes extensiv... | [
"def",
"cli",
"(",
"self",
",",
"commands",
")",
":",
"cli_output",
"=",
"{",
"}",
"def",
"_count",
"(",
"txt",
",",
"none",
")",
":",
"# Second arg for consistency only. noqa",
"\"\"\"\n Return the exact output, as Junos displays\n e.g.:\n ... | Execute raw CLI commands and returns their output. | [
"Execute",
"raw",
"CLI",
"commands",
"and",
"returns",
"their",
"output",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L856-L980 | train | Execute raw CLI commands and returns their output. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_bgp_config | def get_bgp_config(self, group="", neighbor=""):
"""Return BGP configuration."""
def _check_nhs(policies, nhs_policies):
if not isinstance(policies, list):
# Make it a list if it is a single policy
policies = [policies]
# Return True if "next-hop ... | python | def get_bgp_config(self, group="", neighbor=""):
"""Return BGP configuration."""
def _check_nhs(policies, nhs_policies):
if not isinstance(policies, list):
# Make it a list if it is a single policy
policies = [policies]
# Return True if "next-hop ... | [
"def",
"get_bgp_config",
"(",
"self",
",",
"group",
"=",
"\"\"",
",",
"neighbor",
"=",
"\"\"",
")",
":",
"def",
"_check_nhs",
"(",
"policies",
",",
"nhs_policies",
")",
":",
"if",
"not",
"isinstance",
"(",
"policies",
",",
"list",
")",
":",
"# Make it a ... | Return BGP configuration. | [
"Return",
"BGP",
"configuration",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L982-L1236 | train | Return BGP configuration. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_bgp_neighbors_detail | def get_bgp_neighbors_detail(self, neighbor_address=""):
"""Detailed view of the BGP neighbors operational data."""
bgp_neighbors = {}
default_neighbor_details = {
"up": False,
"local_as": 0,
"remote_as": 0,
"router_id": "",
"local_addr... | python | def get_bgp_neighbors_detail(self, neighbor_address=""):
"""Detailed view of the BGP neighbors operational data."""
bgp_neighbors = {}
default_neighbor_details = {
"up": False,
"local_as": 0,
"remote_as": 0,
"router_id": "",
"local_addr... | [
"def",
"get_bgp_neighbors_detail",
"(",
"self",
",",
"neighbor_address",
"=",
"\"\"",
")",
":",
"bgp_neighbors",
"=",
"{",
"}",
"default_neighbor_details",
"=",
"{",
"\"up\"",
":",
"False",
",",
"\"local_as\"",
":",
"0",
",",
"\"remote_as\"",
":",
"0",
",",
... | Detailed view of the BGP neighbors operational data. | [
"Detailed",
"view",
"of",
"the",
"BGP",
"neighbors",
"operational",
"data",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L1238-L1397 | train | Detailed view of the BGP neighbors operational data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_arp_table | def get_arp_table(self, vrf=""):
"""Return the ARP table."""
# could use ArpTable
# from jnpr.junos.op.phyport import ArpTable
# and simply use it
# but
# we need:
# - filters
# - group by VLAN ID
# - hostname & TTE fields as well
if ... | python | def get_arp_table(self, vrf=""):
"""Return the ARP table."""
# could use ArpTable
# from jnpr.junos.op.phyport import ArpTable
# and simply use it
# but
# we need:
# - filters
# - group by VLAN ID
# - hostname & TTE fields as well
if ... | [
"def",
"get_arp_table",
"(",
"self",
",",
"vrf",
"=",
"\"\"",
")",
":",
"# could use ArpTable",
"# from jnpr.junos.op.phyport import ArpTable",
"# and simply use it",
"# but",
"# we need:",
"# - filters",
"# - group by VLAN ID",
"# - hostname & TTE fields as well",
"if",
... | Return the ARP table. | [
"Return",
"the",
"ARP",
"table",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L1399-L1425 | train | Return the ARP table. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_ipv6_neighbors_table | def get_ipv6_neighbors_table(self):
"""Return the IPv6 neighbors table."""
ipv6_neighbors_table = []
ipv6_neighbors_table_raw = junos_views.junos_ipv6_neighbors_table(self.device)
ipv6_neighbors_table_raw.get()
ipv6_neighbors_table_items = ipv6_neighbors_table_raw.items()
... | python | def get_ipv6_neighbors_table(self):
"""Return the IPv6 neighbors table."""
ipv6_neighbors_table = []
ipv6_neighbors_table_raw = junos_views.junos_ipv6_neighbors_table(self.device)
ipv6_neighbors_table_raw.get()
ipv6_neighbors_table_items = ipv6_neighbors_table_raw.items()
... | [
"def",
"get_ipv6_neighbors_table",
"(",
"self",
")",
":",
"ipv6_neighbors_table",
"=",
"[",
"]",
"ipv6_neighbors_table_raw",
"=",
"junos_views",
".",
"junos_ipv6_neighbors_table",
"(",
"self",
".",
"device",
")",
"ipv6_neighbors_table_raw",
".",
"get",
"(",
")",
"ip... | Return the IPv6 neighbors table. | [
"Return",
"the",
"IPv6",
"neighbors",
"table",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L1427-L1441 | train | Return the IPv6 neighbors table. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_ntp_stats | def get_ntp_stats(self):
"""Return NTP stats (associations)."""
# NTP Peers does not have XML RPC defined
# thus we need to retrieve raw text and parse...
# :(
ntp_stats = []
REGEX = (
r"^\s?(\+|\*|x|-)?([a-zA-Z0-9\.+-:]+)"
r"\s+([a-zA-Z0-9\.]+)\... | python | def get_ntp_stats(self):
"""Return NTP stats (associations)."""
# NTP Peers does not have XML RPC defined
# thus we need to retrieve raw text and parse...
# :(
ntp_stats = []
REGEX = (
r"^\s?(\+|\*|x|-)?([a-zA-Z0-9\.+-:]+)"
r"\s+([a-zA-Z0-9\.]+)\... | [
"def",
"get_ntp_stats",
"(",
"self",
")",
":",
"# NTP Peers does not have XML RPC defined",
"# thus we need to retrieve raw text and parse...",
"# :(",
"ntp_stats",
"=",
"[",
"]",
"REGEX",
"=",
"(",
"r\"^\\s?(\\+|\\*|x|-)?([a-zA-Z0-9\\.+-:]+)\"",
"r\"\\s+([a-zA-Z0-9\\.]+)\\s+([0-9]... | Return NTP stats (associations). | [
"Return",
"NTP",
"stats",
"(",
"associations",
")",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L1467-L1510 | train | Return NTP stats. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_interfaces_ip | def get_interfaces_ip(self):
"""Return the configured IP addresses."""
interfaces_ip = {}
interface_table = junos_views.junos_ip_interfaces_table(self.device)
interface_table.get()
interface_table_items = interface_table.items()
_FAMILY_VMAP_ = {
"inet": "ip... | python | def get_interfaces_ip(self):
"""Return the configured IP addresses."""
interfaces_ip = {}
interface_table = junos_views.junos_ip_interfaces_table(self.device)
interface_table.get()
interface_table_items = interface_table.items()
_FAMILY_VMAP_ = {
"inet": "ip... | [
"def",
"get_interfaces_ip",
"(",
"self",
")",
":",
"interfaces_ip",
"=",
"{",
"}",
"interface_table",
"=",
"junos_views",
".",
"junos_ip_interfaces_table",
"(",
"self",
".",
"device",
")",
"interface_table",
".",
"get",
"(",
")",
"interface_table_items",
"=",
"i... | Return the configured IP addresses. | [
"Return",
"the",
"configured",
"IP",
"addresses",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L1512-L1555 | train | Return the configured IP addresses. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_mac_address_table | def get_mac_address_table(self):
"""Return the MAC address table."""
mac_address_table = []
switch_style = self.device.facts.get("switch_style", "")
if switch_style == "VLAN_L2NG":
mac_table = junos_views.junos_mac_address_table_switch_l2ng(self.device)
elif switch_s... | python | def get_mac_address_table(self):
"""Return the MAC address table."""
mac_address_table = []
switch_style = self.device.facts.get("switch_style", "")
if switch_style == "VLAN_L2NG":
mac_table = junos_views.junos_mac_address_table_switch_l2ng(self.device)
elif switch_s... | [
"def",
"get_mac_address_table",
"(",
"self",
")",
":",
"mac_address_table",
"=",
"[",
"]",
"switch_style",
"=",
"self",
".",
"device",
".",
"facts",
".",
"get",
"(",
"\"switch_style\"",
",",
"\"\"",
")",
"if",
"switch_style",
"==",
"\"VLAN_L2NG\"",
":",
"mac... | Return the MAC address table. | [
"Return",
"the",
"MAC",
"address",
"table",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L1557-L1603 | train | Return the MAC address table. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_route_to | def get_route_to(self, destination="", protocol=""):
"""Return route details to a specific destination, learned from a certain protocol."""
routes = {}
if not isinstance(destination, py23_compat.string_types):
raise TypeError("Please specify a valid destination!")
if protoc... | python | def get_route_to(self, destination="", protocol=""):
"""Return route details to a specific destination, learned from a certain protocol."""
routes = {}
if not isinstance(destination, py23_compat.string_types):
raise TypeError("Please specify a valid destination!")
if protoc... | [
"def",
"get_route_to",
"(",
"self",
",",
"destination",
"=",
"\"\"",
",",
"protocol",
"=",
"\"\"",
")",
":",
"routes",
"=",
"{",
"}",
"if",
"not",
"isinstance",
"(",
"destination",
",",
"py23_compat",
".",
"string_types",
")",
":",
"raise",
"TypeError",
... | Return route details to a specific destination, learned from a certain protocol. | [
"Return",
"route",
"details",
"to",
"a",
"specific",
"destination",
"learned",
"from",
"a",
"certain",
"protocol",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L1605-L1725 | train | Get route details to a specific destination learned from a certain protocol. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_snmp_information | def get_snmp_information(self):
"""Return the SNMP configuration."""
snmp_information = {}
snmp_config = junos_views.junos_snmp_config_table(self.device)
snmp_config.get()
snmp_items = snmp_config.items()
if not snmp_items:
return snmp_information
s... | python | def get_snmp_information(self):
"""Return the SNMP configuration."""
snmp_information = {}
snmp_config = junos_views.junos_snmp_config_table(self.device)
snmp_config.get()
snmp_items = snmp_config.items()
if not snmp_items:
return snmp_information
s... | [
"def",
"get_snmp_information",
"(",
"self",
")",
":",
"snmp_information",
"=",
"{",
"}",
"snmp_config",
"=",
"junos_views",
".",
"junos_snmp_config_table",
"(",
"self",
".",
"device",
")",
"snmp_config",
".",
"get",
"(",
")",
"snmp_items",
"=",
"snmp_config",
... | Return the SNMP configuration. | [
"Return",
"the",
"SNMP",
"configuration",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L1727-L1763 | train | Return the SNMP configuration. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver._get_root | def _get_root(self):
"""get root user password."""
_DEFAULT_USER_DETAILS = {"level": 20, "password": "", "sshkeys": []}
root = {}
root_table = junos_views.junos_root_table(self.device)
root_table.get()
root_items = root_table.items()
for user_entry in root_items:
... | python | def _get_root(self):
"""get root user password."""
_DEFAULT_USER_DETAILS = {"level": 20, "password": "", "sshkeys": []}
root = {}
root_table = junos_views.junos_root_table(self.device)
root_table.get()
root_items = root_table.items()
for user_entry in root_items:
... | [
"def",
"_get_root",
"(",
"self",
")",
":",
"_DEFAULT_USER_DETAILS",
"=",
"{",
"\"level\"",
":",
"20",
",",
"\"password\"",
":",
"\"\"",
",",
"\"sshkeys\"",
":",
"[",
"]",
"}",
"root",
"=",
"{",
"}",
"root_table",
"=",
"junos_views",
".",
"junos_root_table"... | get root user password. | [
"get",
"root",
"user",
"password",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L2070-L2092 | train | get root user password | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_users | def get_users(self):
"""Return the configuration of the users."""
users = {}
_JUNOS_CLASS_CISCO_PRIVILEGE_LEVEL_MAP = {
"super-user": 15,
"superuser": 15,
"operator": 5,
"read-only": 1,
"unauthorized": 0,
}
_DEFAULT_US... | python | def get_users(self):
"""Return the configuration of the users."""
users = {}
_JUNOS_CLASS_CISCO_PRIVILEGE_LEVEL_MAP = {
"super-user": 15,
"superuser": 15,
"operator": 5,
"read-only": 1,
"unauthorized": 0,
}
_DEFAULT_US... | [
"def",
"get_users",
"(",
"self",
")",
":",
"users",
"=",
"{",
"}",
"_JUNOS_CLASS_CISCO_PRIVILEGE_LEVEL_MAP",
"=",
"{",
"\"super-user\"",
":",
"15",
",",
"\"superuser\"",
":",
"15",
",",
"\"operator\"",
":",
"5",
",",
"\"read-only\"",
":",
"1",
",",
"\"unauth... | Return the configuration of the users. | [
"Return",
"the",
"configuration",
"of",
"the",
"users",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L2094-L2131 | train | Return the configuration of the users. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/junos.py | JunOSDriver.get_optics | def get_optics(self):
"""Return optics information."""
optics_table = junos_views.junos_intf_optics_table(self.device)
optics_table.get()
optics_items = optics_table.items()
# optics_items has no lane information, so we need to re-format data
# inserting lane 0 for all o... | python | def get_optics(self):
"""Return optics information."""
optics_table = junos_views.junos_intf_optics_table(self.device)
optics_table.get()
optics_items = optics_table.items()
# optics_items has no lane information, so we need to re-format data
# inserting lane 0 for all o... | [
"def",
"get_optics",
"(",
"self",
")",
":",
"optics_table",
"=",
"junos_views",
".",
"junos_intf_optics_table",
"(",
"self",
".",
"device",
")",
"optics_table",
".",
"get",
"(",
")",
"optics_items",
"=",
"optics_table",
".",
"items",
"(",
")",
"# optics_items ... | Return optics information. | [
"Return",
"optics",
"information",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/junos.py#L2133-L2232 | train | Return optics information. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/junos/utils/junos_views.py | _preprocess_yml | def _preprocess_yml(path):
"""Dynamically create PY3 version of the file by re-writing 'unicode' to 'str'."""
with open(path) as f:
tmp_yaml = f.read()
return re.sub(r"unicode", "str", tmp_yaml) | python | def _preprocess_yml(path):
"""Dynamically create PY3 version of the file by re-writing 'unicode' to 'str'."""
with open(path) as f:
tmp_yaml = f.read()
return re.sub(r"unicode", "str", tmp_yaml) | [
"def",
"_preprocess_yml",
"(",
"path",
")",
":",
"with",
"open",
"(",
"path",
")",
"as",
"f",
":",
"tmp_yaml",
"=",
"f",
".",
"read",
"(",
")",
"return",
"re",
".",
"sub",
"(",
"r\"unicode\"",
",",
"\"str\"",
",",
"tmp_yaml",
")"
] | Dynamically create PY3 version of the file by re-writing 'unicode' to 'str'. | [
"Dynamically",
"create",
"PY3",
"version",
"of",
"the",
"file",
"by",
"re",
"-",
"writing",
"unicode",
"to",
"str",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/junos/utils/junos_views.py#L11-L15 | train | Dynamically create PY3 version of the file by re - writing unicode to str. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/helpers.py | cisco_conf_parse_parents | def cisco_conf_parse_parents(parent, child, config):
"""
Use CiscoConfParse to find parent lines that contain a specific child line.
:param parent: The parent line to search for
:param child: The child line required under the given parent
:param config: The device running/startup config
"""
... | python | def cisco_conf_parse_parents(parent, child, config):
"""
Use CiscoConfParse to find parent lines that contain a specific child line.
:param parent: The parent line to search for
:param child: The child line required under the given parent
:param config: The device running/startup config
"""
... | [
"def",
"cisco_conf_parse_parents",
"(",
"parent",
",",
"child",
",",
"config",
")",
":",
"if",
"type",
"(",
"config",
")",
"==",
"str",
":",
"config",
"=",
"config",
".",
"splitlines",
"(",
")",
"parse",
"=",
"CiscoConfParse",
"(",
"config",
")",
"cfg_ob... | Use CiscoConfParse to find parent lines that contain a specific child line.
:param parent: The parent line to search for
:param child: The child line required under the given parent
:param config: The device running/startup config | [
"Use",
"CiscoConfParse",
"to",
"find",
"parent",
"lines",
"that",
"contain",
"a",
"specific",
"child",
"line",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/helpers.py#L113-L125 | train | Use CiscoConfParse to find parents that contain a specific child line. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/helpers.py | cisco_conf_parse_objects | def cisco_conf_parse_objects(cfg_section, config):
"""
Use CiscoConfParse to find and return a section of Cisco IOS config.
Similar to "show run | section <cfg_section>"
:param cfg_section: The section of the config to return eg. "router bgp"
:param config: The running/startup config of the device ... | python | def cisco_conf_parse_objects(cfg_section, config):
"""
Use CiscoConfParse to find and return a section of Cisco IOS config.
Similar to "show run | section <cfg_section>"
:param cfg_section: The section of the config to return eg. "router bgp"
:param config: The running/startup config of the device ... | [
"def",
"cisco_conf_parse_objects",
"(",
"cfg_section",
",",
"config",
")",
":",
"return_config",
"=",
"[",
"]",
"if",
"type",
"(",
"config",
")",
"is",
"str",
":",
"config",
"=",
"config",
".",
"splitlines",
"(",
")",
"parse",
"=",
"CiscoConfParse",
"(",
... | Use CiscoConfParse to find and return a section of Cisco IOS config.
Similar to "show run | section <cfg_section>"
:param cfg_section: The section of the config to return eg. "router bgp"
:param config: The running/startup config of the device to parse | [
"Use",
"CiscoConfParse",
"to",
"find",
"and",
"return",
"a",
"section",
"of",
"Cisco",
"IOS",
"config",
".",
"Similar",
"to",
"show",
"run",
"|",
"section",
"<cfg_section",
">"
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/helpers.py#L128-L145 | train | Use CiscoConfParse to find and return a section of Cisco IOS config. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/helpers.py | regex_find_txt | def regex_find_txt(pattern, text, default=""):
"""""
RegEx search for pattern in text. Will try to match the data type of the "default" value
or return the default value if no match is found.
This is to parse IOS config like below:
regex_find_txt(r"remote-as (65000)", "neighbor 10.0.0.1 remote-as 65... | python | def regex_find_txt(pattern, text, default=""):
"""""
RegEx search for pattern in text. Will try to match the data type of the "default" value
or return the default value if no match is found.
This is to parse IOS config like below:
regex_find_txt(r"remote-as (65000)", "neighbor 10.0.0.1 remote-as 65... | [
"def",
"regex_find_txt",
"(",
"pattern",
",",
"text",
",",
"default",
"=",
"\"\"",
")",
":",
"text",
"=",
"str",
"(",
"text",
")",
"value",
"=",
"re",
".",
"findall",
"(",
"pattern",
",",
"text",
")",
"try",
":",
"if",
"not",
"value",
":",
"raise",... | RegEx search for pattern in text. Will try to match the data type of the "default" value
or return the default value if no match is found.
This is to parse IOS config like below:
regex_find_txt(r"remote-as (65000)", "neighbor 10.0.0.1 remote-as 65000", default=0)
RETURNS: 65001
:param pattern: RegE... | [
"RegEx",
"search",
"for",
"pattern",
"in",
"text",
".",
"Will",
"try",
"to",
"match",
"the",
"data",
"type",
"of",
"the",
"default",
"value",
"or",
"return",
"the",
"default",
"value",
"if",
"no",
"match",
"is",
"found",
".",
"This",
"is",
"to",
"parse... | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/helpers.py#L148-L171 | train | RegEx search for pattern in text and return the value of the default value. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/helpers.py | textfsm_extractor | def textfsm_extractor(cls, template_name, raw_text):
"""
Applies a TextFSM template over a raw text and return the matching table.
Main usage of this method will be to extract data form a non-structured output
from a network device and return the values in a table format.
:param cls: Instance of t... | python | def textfsm_extractor(cls, template_name, raw_text):
"""
Applies a TextFSM template over a raw text and return the matching table.
Main usage of this method will be to extract data form a non-structured output
from a network device and return the values in a table format.
:param cls: Instance of t... | [
"def",
"textfsm_extractor",
"(",
"cls",
",",
"template_name",
",",
"raw_text",
")",
":",
"textfsm_data",
"=",
"list",
"(",
")",
"fsm_handler",
"=",
"None",
"for",
"c",
"in",
"cls",
".",
"__class__",
".",
"mro",
"(",
")",
":",
"if",
"c",
"is",
"object",... | Applies a TextFSM template over a raw text and return the matching table.
Main usage of this method will be to extract data form a non-structured output
from a network device and return the values in a table format.
:param cls: Instance of the driver class
:param template_name: Specifies the name of t... | [
"Applies",
"a",
"TextFSM",
"template",
"over",
"a",
"raw",
"text",
"and",
"return",
"the",
"matching",
"table",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/helpers.py#L174-L225 | train | This method extracts the data from a TextFSM template over a raw text and returns the matching table. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/helpers.py | ip | def ip(addr, version=None):
"""
Converts a raw string to a valid IP address. Optional version argument will detect that \
object matches specified version.
Motivation: the groups of the IP addreses may contain leading zeros. IPv6 addresses can \
contain sometimes uppercase characters. E.g.: 2001:0d... | python | def ip(addr, version=None):
"""
Converts a raw string to a valid IP address. Optional version argument will detect that \
object matches specified version.
Motivation: the groups of the IP addreses may contain leading zeros. IPv6 addresses can \
contain sometimes uppercase characters. E.g.: 2001:0d... | [
"def",
"ip",
"(",
"addr",
",",
"version",
"=",
"None",
")",
":",
"addr_obj",
"=",
"IPAddress",
"(",
"addr",
")",
"if",
"version",
"and",
"addr_obj",
".",
"version",
"!=",
"version",
":",
"raise",
"ValueError",
"(",
"\"{} is not an ipv{} address\"",
".",
"f... | Converts a raw string to a valid IP address. Optional version argument will detect that \
object matches specified version.
Motivation: the groups of the IP addreses may contain leading zeros. IPv6 addresses can \
contain sometimes uppercase characters. E.g.: 2001:0dB8:85a3:0000:0000:8A2e:0370:7334 has \
... | [
"Converts",
"a",
"raw",
"string",
"to",
"a",
"valid",
"IP",
"address",
".",
"Optional",
"version",
"argument",
"will",
"detect",
"that",
"\\",
"object",
"matches",
"specified",
"version",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/helpers.py#L307-L333 | train | Converts a raw string to a valid IP address. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/helpers.py | as_number | def as_number(as_number_val):
"""Convert AS Number to standardized asplain notation as an integer."""
as_number_str = py23_compat.text_type(as_number_val)
if "." in as_number_str:
big, little = as_number_str.split(".")
return (int(big) << 16) + int(little)
else:
return int(as_num... | python | def as_number(as_number_val):
"""Convert AS Number to standardized asplain notation as an integer."""
as_number_str = py23_compat.text_type(as_number_val)
if "." in as_number_str:
big, little = as_number_str.split(".")
return (int(big) << 16) + int(little)
else:
return int(as_num... | [
"def",
"as_number",
"(",
"as_number_val",
")",
":",
"as_number_str",
"=",
"py23_compat",
".",
"text_type",
"(",
"as_number_val",
")",
"if",
"\".\"",
"in",
"as_number_str",
":",
"big",
",",
"little",
"=",
"as_number_str",
".",
"split",
"(",
"\".\"",
")",
"ret... | Convert AS Number to standardized asplain notation as an integer. | [
"Convert",
"AS",
"Number",
"to",
"standardized",
"asplain",
"notation",
"as",
"an",
"integer",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/helpers.py#L336-L343 | train | Convert AS Number to standardized asplain notation as an integer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/helpers.py | split_interface | def split_interface(intf_name):
"""Split an interface name based on first digit, slash, or space match."""
head = intf_name.rstrip(r"/\0123456789. ")
tail = intf_name[len(head) :].lstrip()
return (head, tail) | python | def split_interface(intf_name):
"""Split an interface name based on first digit, slash, or space match."""
head = intf_name.rstrip(r"/\0123456789. ")
tail = intf_name[len(head) :].lstrip()
return (head, tail) | [
"def",
"split_interface",
"(",
"intf_name",
")",
":",
"head",
"=",
"intf_name",
".",
"rstrip",
"(",
"r\"/\\0123456789. \"",
")",
"tail",
"=",
"intf_name",
"[",
"len",
"(",
"head",
")",
":",
"]",
".",
"lstrip",
"(",
")",
"return",
"(",
"head",
",",
"tai... | Split an interface name based on first digit, slash, or space match. | [
"Split",
"an",
"interface",
"name",
"based",
"on",
"first",
"digit",
"slash",
"or",
"space",
"match",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/helpers.py#L346-L350 | train | Split an interface name based on first digit slash or space match. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/helpers.py | canonical_interface_name | def canonical_interface_name(interface, addl_name_map=None):
"""Function to return an interface's canonical name (fully expanded name).
Use of explicit matches used to indicate a clear understanding on any potential
match. Regex and other looser matching methods were not implmented to avoid false
posit... | python | def canonical_interface_name(interface, addl_name_map=None):
"""Function to return an interface's canonical name (fully expanded name).
Use of explicit matches used to indicate a clear understanding on any potential
match. Regex and other looser matching methods were not implmented to avoid false
posit... | [
"def",
"canonical_interface_name",
"(",
"interface",
",",
"addl_name_map",
"=",
"None",
")",
":",
"name_map",
"=",
"{",
"}",
"name_map",
".",
"update",
"(",
"base_interfaces",
")",
"interface_type",
",",
"interface_number",
"=",
"split_interface",
"(",
"interface"... | Function to return an interface's canonical name (fully expanded name).
Use of explicit matches used to indicate a clear understanding on any potential
match. Regex and other looser matching methods were not implmented to avoid false
positive matches. As an example, it would make sense to do "[P|p][O|o]" w... | [
"Function",
"to",
"return",
"an",
"interface",
"s",
"canonical",
"name",
"(",
"fully",
"expanded",
"name",
")",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/helpers.py#L353-L380 | train | Function to return an interface s canonical name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/helpers.py | abbreviated_interface_name | def abbreviated_interface_name(interface, addl_name_map=None, addl_reverse_map=None):
"""Function to return an abbreviated representation of the interface name.
:param interface: The interface you are attempting to abbreviate.
:param addl_name_map (optional): A dict containing key/value pairs that updates
... | python | def abbreviated_interface_name(interface, addl_name_map=None, addl_reverse_map=None):
"""Function to return an abbreviated representation of the interface name.
:param interface: The interface you are attempting to abbreviate.
:param addl_name_map (optional): A dict containing key/value pairs that updates
... | [
"def",
"abbreviated_interface_name",
"(",
"interface",
",",
"addl_name_map",
"=",
"None",
",",
"addl_reverse_map",
"=",
"None",
")",
":",
"name_map",
"=",
"{",
"}",
"name_map",
".",
"update",
"(",
"base_interfaces",
")",
"interface_type",
",",
"interface_number",
... | Function to return an abbreviated representation of the interface name.
:param interface: The interface you are attempting to abbreviate.
:param addl_name_map (optional): A dict containing key/value pairs that updates
the base mapping. Used if an OS has specific differences. e.g. {"Po": "PortChannel"} vs
... | [
"Function",
"to",
"return",
"an",
"abbreviated",
"representation",
"of",
"the",
"interface",
"name",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/helpers.py#L383-L423 | train | Function to return an abbreviated representation of the interface name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.close | def close(self):
"""Close the connection to the device and do the necessary cleanup."""
# Return file prompt quiet to the original state
if self.auto_file_prompt and self.prompt_quiet_changed is True:
self.device.send_config_set(["no file prompt quiet"])
self.prompt_quie... | python | def close(self):
"""Close the connection to the device and do the necessary cleanup."""
# Return file prompt quiet to the original state
if self.auto_file_prompt and self.prompt_quiet_changed is True:
self.device.send_config_set(["no file prompt quiet"])
self.prompt_quie... | [
"def",
"close",
"(",
"self",
")",
":",
"# Return file prompt quiet to the original state",
"if",
"self",
".",
"auto_file_prompt",
"and",
"self",
".",
"prompt_quiet_changed",
"is",
"True",
":",
"self",
".",
"device",
".",
"send_config_set",
"(",
"[",
"\"no file promp... | Close the connection to the device and do the necessary cleanup. | [
"Close",
"the",
"connection",
"to",
"the",
"device",
"and",
"do",
"the",
"necessary",
"cleanup",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L164-L172 | train | Close the connection to the device and do the necessary cleanup. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver._send_command | def _send_command(self, command):
"""Wrapper for self.device.send.command().
If command is a list will iterate through commands until valid command.
"""
try:
if isinstance(command, list):
for cmd in command:
output = self.device.send_comma... | python | def _send_command(self, command):
"""Wrapper for self.device.send.command().
If command is a list will iterate through commands until valid command.
"""
try:
if isinstance(command, list):
for cmd in command:
output = self.device.send_comma... | [
"def",
"_send_command",
"(",
"self",
",",
"command",
")",
":",
"try",
":",
"if",
"isinstance",
"(",
"command",
",",
"list",
")",
":",
"for",
"cmd",
"in",
"command",
":",
"output",
"=",
"self",
".",
"device",
".",
"send_command",
"(",
"cmd",
")",
"if"... | Wrapper for self.device.send.command().
If command is a list will iterate through commands until valid command. | [
"Wrapper",
"for",
"self",
".",
"device",
".",
"send",
".",
"command",
"()",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L174-L189 | train | Wrapper for self. device. send. command. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.is_alive | def is_alive(self):
"""Returns a flag with the state of the connection."""
null = chr(0)
if self.device is None:
return {"is_alive": False}
if self.transport == "telnet":
try:
# Try sending IAC + NOP (IAC is telnet way of sending command
... | python | def is_alive(self):
"""Returns a flag with the state of the connection."""
null = chr(0)
if self.device is None:
return {"is_alive": False}
if self.transport == "telnet":
try:
# Try sending IAC + NOP (IAC is telnet way of sending command
... | [
"def",
"is_alive",
"(",
"self",
")",
":",
"null",
"=",
"chr",
"(",
"0",
")",
"if",
"self",
".",
"device",
"is",
"None",
":",
"return",
"{",
"\"is_alive\"",
":",
"False",
"}",
"if",
"self",
".",
"transport",
"==",
"\"telnet\"",
":",
"try",
":",
"# T... | Returns a flag with the state of the connection. | [
"Returns",
"a",
"flag",
"with",
"the",
"state",
"of",
"the",
"connection",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L191-L216 | train | Returns a flag with the state of the connection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver._normalize_compare_config | def _normalize_compare_config(self, diff):
"""Filter out strings that should not show up in the diff."""
ignore_strings = [
"Contextual Config Diffs",
"No changes were found",
"ntp clock-period",
]
if self.auto_file_prompt:
ignore_strings.a... | python | def _normalize_compare_config(self, diff):
"""Filter out strings that should not show up in the diff."""
ignore_strings = [
"Contextual Config Diffs",
"No changes were found",
"ntp clock-period",
]
if self.auto_file_prompt:
ignore_strings.a... | [
"def",
"_normalize_compare_config",
"(",
"self",
",",
"diff",
")",
":",
"ignore_strings",
"=",
"[",
"\"Contextual Config Diffs\"",
",",
"\"No changes were found\"",
",",
"\"ntp clock-period\"",
",",
"]",
"if",
"self",
".",
"auto_file_prompt",
":",
"ignore_strings",
".... | Filter out strings that should not show up in the diff. | [
"Filter",
"out",
"strings",
"that",
"should",
"not",
"show",
"up",
"in",
"the",
"diff",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L306-L323 | train | Filter out strings that should not show up in the diff. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver._normalize_merge_diff_incr | def _normalize_merge_diff_incr(diff):
"""Make the compare config output look better.
Cisco IOS incremental-diff output
No changes:
!List of Commands:
end
!No changes were found
"""
new_diff = []
changes_found = False
for line in diff.spl... | python | def _normalize_merge_diff_incr(diff):
"""Make the compare config output look better.
Cisco IOS incremental-diff output
No changes:
!List of Commands:
end
!No changes were found
"""
new_diff = []
changes_found = False
for line in diff.spl... | [
"def",
"_normalize_merge_diff_incr",
"(",
"diff",
")",
":",
"new_diff",
"=",
"[",
"]",
"changes_found",
"=",
"False",
"for",
"line",
"in",
"diff",
".",
"splitlines",
"(",
")",
":",
"if",
"re",
".",
"search",
"(",
"r\"order-dependent line.*re-ordered\"",
",",
... | Make the compare config output look better.
Cisco IOS incremental-diff output
No changes:
!List of Commands:
end
!No changes were found | [
"Make",
"the",
"compare",
"config",
"output",
"look",
"better",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L326-L359 | train | Make the compare config output look better. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver._normalize_merge_diff | def _normalize_merge_diff(diff):
"""Make compare_config() for merge look similar to replace config diff."""
new_diff = []
for line in diff.splitlines():
# Filter blank lines and prepend +sign
if line.strip():
new_diff.append("+" + line)
if new_diff... | python | def _normalize_merge_diff(diff):
"""Make compare_config() for merge look similar to replace config diff."""
new_diff = []
for line in diff.splitlines():
# Filter blank lines and prepend +sign
if line.strip():
new_diff.append("+" + line)
if new_diff... | [
"def",
"_normalize_merge_diff",
"(",
"diff",
")",
":",
"new_diff",
"=",
"[",
"]",
"for",
"line",
"in",
"diff",
".",
"splitlines",
"(",
")",
":",
"# Filter blank lines and prepend +sign",
"if",
"line",
".",
"strip",
"(",
")",
":",
"new_diff",
".",
"append",
... | Make compare_config() for merge look similar to replace config diff. | [
"Make",
"compare_config",
"()",
"for",
"merge",
"look",
"similar",
"to",
"replace",
"config",
"diff",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L362-L375 | train | Make compare_config() for merge look similar to replace config diff. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.compare_config | def compare_config(self):
"""
show archive config differences <base_file> <new_file>.
Default operation is to compare system:running-config to self.candidate_cfg
"""
# Set defaults
base_file = "running-config"
base_file_system = "system:"
if self.config_r... | python | def compare_config(self):
"""
show archive config differences <base_file> <new_file>.
Default operation is to compare system:running-config to self.candidate_cfg
"""
# Set defaults
base_file = "running-config"
base_file_system = "system:"
if self.config_r... | [
"def",
"compare_config",
"(",
"self",
")",
":",
"# Set defaults",
"base_file",
"=",
"\"running-config\"",
"base_file_system",
"=",
"\"system:\"",
"if",
"self",
".",
"config_replace",
":",
"new_file",
"=",
"self",
".",
"candidate_cfg",
"else",
":",
"new_file",
"=",... | show archive config differences <base_file> <new_file>.
Default operation is to compare system:running-config to self.candidate_cfg | [
"show",
"archive",
"config",
"differences",
"<base_file",
">",
"<new_file",
">",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L377-L423 | train | Compare the archive config with the current configuration. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver._file_prompt_quiet | def _file_prompt_quiet(f):
"""Decorator to toggle 'file prompt quiet' for methods that perform file operations."""
@functools.wraps(f)
def wrapper(self, *args, **kwargs):
if not self.prompt_quiet_configured:
if self.auto_file_prompt:
# disable fil... | python | def _file_prompt_quiet(f):
"""Decorator to toggle 'file prompt quiet' for methods that perform file operations."""
@functools.wraps(f)
def wrapper(self, *args, **kwargs):
if not self.prompt_quiet_configured:
if self.auto_file_prompt:
# disable fil... | [
"def",
"_file_prompt_quiet",
"(",
"f",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"f",
")",
"def",
"wrapper",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"prompt_quiet_configured",
":",
"if",
"self"... | Decorator to toggle 'file prompt quiet' for methods that perform file operations. | [
"Decorator",
"to",
"toggle",
"file",
"prompt",
"quiet",
"for",
"methods",
"that",
"perform",
"file",
"operations",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L425-L453 | train | Decorator to toggle file prompt quiet for methods that perform file operations. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver._commit_handler | def _commit_handler(self, cmd):
"""
Special handler for hostname change on commit operation. Also handles username removal
which prompts for confirmation (username removal prompts for each user...)
"""
current_prompt = self.device.find_prompt().strip()
terminating_char = ... | python | def _commit_handler(self, cmd):
"""
Special handler for hostname change on commit operation. Also handles username removal
which prompts for confirmation (username removal prompts for each user...)
"""
current_prompt = self.device.find_prompt().strip()
terminating_char = ... | [
"def",
"_commit_handler",
"(",
"self",
",",
"cmd",
")",
":",
"current_prompt",
"=",
"self",
".",
"device",
".",
"find_prompt",
"(",
")",
".",
"strip",
"(",
")",
"terminating_char",
"=",
"current_prompt",
"[",
"-",
"1",
"]",
"# Look for trailing pattern that in... | Special handler for hostname change on commit operation. Also handles username removal
which prompts for confirmation (username removal prompts for each user...) | [
"Special",
"handler",
"for",
"hostname",
"change",
"on",
"commit",
"operation",
".",
"Also",
"handles",
"username",
"removal",
"which",
"prompts",
"for",
"confirmation",
"(",
"username",
"removal",
"prompts",
"for",
"each",
"user",
"...",
")"
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L456-L482 | train | Handles hostname change on commit operation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.commit_config | def commit_config(self, message=""):
"""
If replacement operation, perform 'configure replace' for the entire config.
If merge operation, perform copy <file> running-config.
"""
if message:
raise NotImplementedError(
"Commit message not implemented fo... | python | def commit_config(self, message=""):
"""
If replacement operation, perform 'configure replace' for the entire config.
If merge operation, perform copy <file> running-config.
"""
if message:
raise NotImplementedError(
"Commit message not implemented fo... | [
"def",
"commit_config",
"(",
"self",
",",
"message",
"=",
"\"\"",
")",
":",
"if",
"message",
":",
"raise",
"NotImplementedError",
"(",
"\"Commit message not implemented for this platform\"",
")",
"# Always generate a rollback config on commit",
"self",
".",
"_gen_rollback_c... | If replacement operation, perform 'configure replace' for the entire config.
If merge operation, perform copy <file> running-config. | [
"If",
"replacement",
"operation",
"perform",
"configure",
"replace",
"for",
"the",
"entire",
"config",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L484-L537 | train | Perform configuration changes on the current running - config. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver._discard_config | def _discard_config(self):
"""Set candidate_cfg to current running-config. Erase the merge_cfg file."""
discard_candidate = "copy running-config {}".format(
self._gen_full_path(self.candidate_cfg)
)
discard_merge = "copy null: {}".format(self._gen_full_path(self.merge_cfg))
... | python | def _discard_config(self):
"""Set candidate_cfg to current running-config. Erase the merge_cfg file."""
discard_candidate = "copy running-config {}".format(
self._gen_full_path(self.candidate_cfg)
)
discard_merge = "copy null: {}".format(self._gen_full_path(self.merge_cfg))
... | [
"def",
"_discard_config",
"(",
"self",
")",
":",
"discard_candidate",
"=",
"\"copy running-config {}\"",
".",
"format",
"(",
"self",
".",
"_gen_full_path",
"(",
"self",
".",
"candidate_cfg",
")",
")",
"discard_merge",
"=",
"\"copy null: {}\"",
".",
"format",
"(",
... | Set candidate_cfg to current running-config. Erase the merge_cfg file. | [
"Set",
"candidate_cfg",
"to",
"current",
"running",
"-",
"config",
".",
"Erase",
"the",
"merge_cfg",
"file",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L544-L551 | train | Set candidate_cfg to current running - config. Erase the merge_cfg file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.rollback | def rollback(self):
"""Rollback configuration to filename or to self.rollback_cfg file."""
filename = self.rollback_cfg
cfg_file = self._gen_full_path(filename)
if not self._check_file_exists(cfg_file):
raise ReplaceConfigException("Rollback config file does not exist")
... | python | def rollback(self):
"""Rollback configuration to filename or to self.rollback_cfg file."""
filename = self.rollback_cfg
cfg_file = self._gen_full_path(filename)
if not self._check_file_exists(cfg_file):
raise ReplaceConfigException("Rollback config file does not exist")
... | [
"def",
"rollback",
"(",
"self",
")",
":",
"filename",
"=",
"self",
".",
"rollback_cfg",
"cfg_file",
"=",
"self",
".",
"_gen_full_path",
"(",
"filename",
")",
"if",
"not",
"self",
".",
"_check_file_exists",
"(",
"cfg_file",
")",
":",
"raise",
"ReplaceConfigEx... | Rollback configuration to filename or to self.rollback_cfg file. | [
"Rollback",
"configuration",
"to",
"filename",
"or",
"to",
"self",
".",
"rollback_cfg",
"file",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L553-L566 | train | Rollback configuration to filename or to self. rollback_cfg file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver._inline_tcl_xfer | def _inline_tcl_xfer(
self, source_file=None, source_config=None, dest_file=None, file_system=None
):
"""
Use Netmiko InlineFileTransfer (TCL) to transfer file or config to remote device.
Return (status, msg)
status = boolean
msg = details on what happened
""... | python | def _inline_tcl_xfer(
self, source_file=None, source_config=None, dest_file=None, file_system=None
):
"""
Use Netmiko InlineFileTransfer (TCL) to transfer file or config to remote device.
Return (status, msg)
status = boolean
msg = details on what happened
""... | [
"def",
"_inline_tcl_xfer",
"(",
"self",
",",
"source_file",
"=",
"None",
",",
"source_config",
"=",
"None",
",",
"dest_file",
"=",
"None",
",",
"file_system",
"=",
"None",
")",
":",
"if",
"source_file",
":",
"return",
"self",
".",
"_xfer_file",
"(",
"sourc... | Use Netmiko InlineFileTransfer (TCL) to transfer file or config to remote device.
Return (status, msg)
status = boolean
msg = details on what happened | [
"Use",
"Netmiko",
"InlineFileTransfer",
"(",
"TCL",
")",
"to",
"transfer",
"file",
"or",
"config",
"to",
"remote",
"device",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L568-L592 | train | Inline File Transfer | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver._scp_file | def _scp_file(self, source_file, dest_file, file_system):
"""
SCP file to remote device.
Return (status, msg)
status = boolean
msg = details on what happened
"""
return self._xfer_file(
source_file=source_file,
dest_file=dest_file,
... | python | def _scp_file(self, source_file, dest_file, file_system):
"""
SCP file to remote device.
Return (status, msg)
status = boolean
msg = details on what happened
"""
return self._xfer_file(
source_file=source_file,
dest_file=dest_file,
... | [
"def",
"_scp_file",
"(",
"self",
",",
"source_file",
",",
"dest_file",
",",
"file_system",
")",
":",
"return",
"self",
".",
"_xfer_file",
"(",
"source_file",
"=",
"source_file",
",",
"dest_file",
"=",
"dest_file",
",",
"file_system",
"=",
"file_system",
",",
... | SCP file to remote device.
Return (status, msg)
status = boolean
msg = details on what happened | [
"SCP",
"file",
"to",
"remote",
"device",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L594-L607 | train | SCP file to remote device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver._xfer_file | def _xfer_file(
self,
source_file=None,
source_config=None,
dest_file=None,
file_system=None,
TransferClass=FileTransfer,
):
"""Transfer file to remote device.
By default, this will use Secure Copy if self.inline_transfer is set, then will use
... | python | def _xfer_file(
self,
source_file=None,
source_config=None,
dest_file=None,
file_system=None,
TransferClass=FileTransfer,
):
"""Transfer file to remote device.
By default, this will use Secure Copy if self.inline_transfer is set, then will use
... | [
"def",
"_xfer_file",
"(",
"self",
",",
"source_file",
"=",
"None",
",",
"source_config",
"=",
"None",
",",
"dest_file",
"=",
"None",
",",
"file_system",
"=",
"None",
",",
"TransferClass",
"=",
"FileTransfer",
",",
")",
":",
"if",
"not",
"source_file",
"and... | Transfer file to remote device.
By default, this will use Secure Copy if self.inline_transfer is set, then will use
Netmiko InlineTransfer method to transfer inline using either SSH or telnet (plus TCL
onbox).
Return (status, msg)
status = boolean
msg = details on what ... | [
"Transfer",
"file",
"to",
"remote",
"device",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L609-L683 | train | Transfer file to remote device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver._send_command_postprocess | def _send_command_postprocess(output):
"""
Cleanup actions on send_command() for NAPALM getters.
Remove "Load for five sec; one minute if in output"
Remove "Time source is"
"""
output = re.sub(r"^Load for five secs.*$", "", output, flags=re.M)
output = re.sub(r"^... | python | def _send_command_postprocess(output):
"""
Cleanup actions on send_command() for NAPALM getters.
Remove "Load for five sec; one minute if in output"
Remove "Time source is"
"""
output = re.sub(r"^Load for five secs.*$", "", output, flags=re.M)
output = re.sub(r"^... | [
"def",
"_send_command_postprocess",
"(",
"output",
")",
":",
"output",
"=",
"re",
".",
"sub",
"(",
"r\"^Load for five secs.*$\"",
",",
"\"\"",
",",
"output",
",",
"flags",
"=",
"re",
".",
"M",
")",
"output",
"=",
"re",
".",
"sub",
"(",
"r\"^Time source is ... | Cleanup actions on send_command() for NAPALM getters.
Remove "Load for five sec; one minute if in output"
Remove "Time source is" | [
"Cleanup",
"actions",
"on",
"send_command",
"()",
"for",
"NAPALM",
"getters",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L727-L736 | train | Cleanup actions on send_command for NAPALM getters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.get_interfaces_ip | def get_interfaces_ip(self):
"""
Get interface ip details.
Returns a dict of dicts
Example Output:
{ u'FastEthernet8': { 'ipv4': { u'10.66.43.169': { 'prefix_length': 22}}},
u'Loopback555': { 'ipv4': { u'192.168.1.1': { 'prefix_length': 24}},
... | python | def get_interfaces_ip(self):
"""
Get interface ip details.
Returns a dict of dicts
Example Output:
{ u'FastEthernet8': { 'ipv4': { u'10.66.43.169': { 'prefix_length': 22}}},
u'Loopback555': { 'ipv4': { u'192.168.1.1': { 'prefix_length': 24}},
... | [
"def",
"get_interfaces_ip",
"(",
"self",
")",
":",
"interfaces",
"=",
"{",
"}",
"command",
"=",
"\"show ip interface\"",
"show_ip_interface",
"=",
"self",
".",
"_send_command",
"(",
"command",
")",
"command",
"=",
"\"show ipv6 interface\"",
"show_ipv6_interface",
"=... | Get interface ip details.
Returns a dict of dicts
Example Output:
{ u'FastEthernet8': { 'ipv4': { u'10.66.43.169': { 'prefix_length': 22}}},
u'Loopback555': { 'ipv4': { u'192.168.1.1': { 'prefix_length': 24}},
'ipv6': { u'1::1': { ... | [
"Get",
"interface",
"ip",
"details",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L1092-L1163 | train | Get interface ip details. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.get_bgp_config | def get_bgp_config(self, group="", neighbor=""):
"""
Parse BGP config params into a dict
:param group='':
:param neighbor='':
"""
bgp_config = {}
def build_prefix_limit(af_table, limit, prefix_percent, prefix_timeout):
prefix_limit = {}
... | python | def get_bgp_config(self, group="", neighbor=""):
"""
Parse BGP config params into a dict
:param group='':
:param neighbor='':
"""
bgp_config = {}
def build_prefix_limit(af_table, limit, prefix_percent, prefix_timeout):
prefix_limit = {}
... | [
"def",
"get_bgp_config",
"(",
"self",
",",
"group",
"=",
"\"\"",
",",
"neighbor",
"=",
"\"\"",
")",
":",
"bgp_config",
"=",
"{",
"}",
"def",
"build_prefix_limit",
"(",
"af_table",
",",
"limit",
",",
"prefix_percent",
",",
"prefix_timeout",
")",
":",
"prefi... | Parse BGP config params into a dict
:param group='':
:param neighbor='': | [
"Parse",
"BGP",
"config",
"params",
"into",
"a",
"dict",
":",
"param",
"group",
"=",
":",
":",
"param",
"neighbor",
"=",
":"
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L1217-L1461 | train | Parse the BGP config and return a dict of all the information that can be used to configure the BGP routing table. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.get_bgp_neighbors | def get_bgp_neighbors(self):
"""BGP neighbor information.
Currently no VRF support. Supports both IPv4 and IPv6.
"""
supported_afi = ["ipv4", "ipv6"]
bgp_neighbor_data = dict()
bgp_neighbor_data["global"] = {}
# get summary output from device
cmd_bgp_al... | python | def get_bgp_neighbors(self):
"""BGP neighbor information.
Currently no VRF support. Supports both IPv4 and IPv6.
"""
supported_afi = ["ipv4", "ipv6"]
bgp_neighbor_data = dict()
bgp_neighbor_data["global"] = {}
# get summary output from device
cmd_bgp_al... | [
"def",
"get_bgp_neighbors",
"(",
"self",
")",
":",
"supported_afi",
"=",
"[",
"\"ipv4\"",
",",
"\"ipv6\"",
"]",
"bgp_neighbor_data",
"=",
"dict",
"(",
")",
"bgp_neighbor_data",
"[",
"\"global\"",
"]",
"=",
"{",
"}",
"# get summary output from device",
"cmd_bgp_all... | BGP neighbor information.
Currently no VRF support. Supports both IPv4 and IPv6. | [
"BGP",
"neighbor",
"information",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L1463-L1817 | train | Get BGP neighbor information. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.get_interfaces_counters | def get_interfaces_counters(self):
"""
Return interface counters and errors.
'tx_errors': int,
'rx_errors': int,
'tx_discards': int,
'rx_discards': int,
'tx_octets': int,
'rx_octets': int,
'tx_unicast_packets': int,
'rx_unicast_packets': i... | python | def get_interfaces_counters(self):
"""
Return interface counters and errors.
'tx_errors': int,
'rx_errors': int,
'tx_discards': int,
'rx_discards': int,
'tx_octets': int,
'rx_octets': int,
'tx_unicast_packets': int,
'rx_unicast_packets': i... | [
"def",
"get_interfaces_counters",
"(",
"self",
")",
":",
"counters",
"=",
"{",
"}",
"command",
"=",
"\"show interfaces\"",
"output",
"=",
"self",
".",
"_send_command",
"(",
"command",
")",
"sh_int_sum_cmd",
"=",
"\"show interface summary\"",
"sh_int_sum_cmd_out",
"=... | Return interface counters and errors.
'tx_errors': int,
'rx_errors': int,
'tx_discards': int,
'rx_discards': int,
'tx_octets': int,
'rx_octets': int,
'tx_unicast_packets': int,
'rx_unicast_packets': int,
'tx_multicast_packets': int,
'rx_mu... | [
"Return",
"interface",
"counters",
"and",
"errors",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L1962-L2070 | train | Get the counters for all interfaces. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.get_environment | def get_environment(self):
"""
Get environment facts.
power and fan are currently not implemented
cpu is using 1-minute average
cpu hard-coded to cpu0 (i.e. only a single CPU)
"""
environment = {}
cpu_cmd = "show proc cpu"
mem_cmd = "show memory s... | python | def get_environment(self):
"""
Get environment facts.
power and fan are currently not implemented
cpu is using 1-minute average
cpu hard-coded to cpu0 (i.e. only a single CPU)
"""
environment = {}
cpu_cmd = "show proc cpu"
mem_cmd = "show memory s... | [
"def",
"get_environment",
"(",
"self",
")",
":",
"environment",
"=",
"{",
"}",
"cpu_cmd",
"=",
"\"show proc cpu\"",
"mem_cmd",
"=",
"\"show memory statistics\"",
"temp_cmd",
"=",
"\"show env temperature status\"",
"output",
"=",
"self",
".",
"_send_command",
"(",
"c... | Get environment facts.
power and fan are currently not implemented
cpu is using 1-minute average
cpu hard-coded to cpu0 (i.e. only a single CPU) | [
"Get",
"environment",
"facts",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L2072-L2147 | train | Get the environment of the current system. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.get_ntp_peers | def get_ntp_peers(self):
"""Implementation of get_ntp_peers for IOS."""
ntp_stats = self.get_ntp_stats()
return {
ntp_peer.get("remote"): {}
for ntp_peer in ntp_stats
if ntp_peer.get("remote")
} | python | def get_ntp_peers(self):
"""Implementation of get_ntp_peers for IOS."""
ntp_stats = self.get_ntp_stats()
return {
ntp_peer.get("remote"): {}
for ntp_peer in ntp_stats
if ntp_peer.get("remote")
} | [
"def",
"get_ntp_peers",
"(",
"self",
")",
":",
"ntp_stats",
"=",
"self",
".",
"get_ntp_stats",
"(",
")",
"return",
"{",
"ntp_peer",
".",
"get",
"(",
"\"remote\"",
")",
":",
"{",
"}",
"for",
"ntp_peer",
"in",
"ntp_stats",
"if",
"ntp_peer",
".",
"get",
"... | Implementation of get_ntp_peers for IOS. | [
"Implementation",
"of",
"get_ntp_peers",
"for",
"IOS",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L2246-L2254 | train | Implementation of get_ntp_peers for IOS. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.get_ntp_servers | def get_ntp_servers(self):
"""Implementation of get_ntp_servers for IOS.
Returns the NTP servers configuration as dictionary.
The keys of the dictionary represent the IP Addresses of the servers.
Inner dictionaries do not have yet any available keys.
Example::
{
... | python | def get_ntp_servers(self):
"""Implementation of get_ntp_servers for IOS.
Returns the NTP servers configuration as dictionary.
The keys of the dictionary represent the IP Addresses of the servers.
Inner dictionaries do not have yet any available keys.
Example::
{
... | [
"def",
"get_ntp_servers",
"(",
"self",
")",
":",
"ntp_servers",
"=",
"{",
"}",
"command",
"=",
"\"show run | include ntp server\"",
"output",
"=",
"self",
".",
"_send_command",
"(",
"command",
")",
"for",
"line",
"in",
"output",
".",
"splitlines",
"(",
")",
... | Implementation of get_ntp_servers for IOS.
Returns the NTP servers configuration as dictionary.
The keys of the dictionary represent the IP Addresses of the servers.
Inner dictionaries do not have yet any available keys.
Example::
{
'192.168.0.1': {},
... | [
"Implementation",
"of",
"get_ntp_servers",
"for",
"IOS",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L2256-L2281 | train | Implementation of get_ntp_servers for IOS. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.get_ntp_stats | def get_ntp_stats(self):
"""Implementation of get_ntp_stats for IOS."""
ntp_stats = []
command = "show ntp associations"
output = self._send_command(command)
for line in output.splitlines():
# Skip first two lines and last line of command output
if line ... | python | def get_ntp_stats(self):
"""Implementation of get_ntp_stats for IOS."""
ntp_stats = []
command = "show ntp associations"
output = self._send_command(command)
for line in output.splitlines():
# Skip first two lines and last line of command output
if line ... | [
"def",
"get_ntp_stats",
"(",
"self",
")",
":",
"ntp_stats",
"=",
"[",
"]",
"command",
"=",
"\"show ntp associations\"",
"output",
"=",
"self",
".",
"_send_command",
"(",
"command",
")",
"for",
"line",
"in",
"output",
".",
"splitlines",
"(",
")",
":",
"# Sk... | Implementation of get_ntp_stats for IOS. | [
"Implementation",
"of",
"get_ntp_stats",
"for",
"IOS",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L2283-L2322 | train | Implementation of get_ntp_stats for IOS. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.get_mac_address_table | def get_mac_address_table(self):
"""
Returns a lists of dictionaries. Each dictionary represents an entry in the MAC Address
Table, having the following keys
* mac (string)
* interface (string)
* vlan (int)
* active (boolean)
* static (... | python | def get_mac_address_table(self):
"""
Returns a lists of dictionaries. Each dictionary represents an entry in the MAC Address
Table, having the following keys
* mac (string)
* interface (string)
* vlan (int)
* active (boolean)
* static (... | [
"def",
"get_mac_address_table",
"(",
"self",
")",
":",
"RE_MACTABLE_DEFAULT",
"=",
"r\"^\"",
"+",
"MAC_REGEX",
"RE_MACTABLE_6500_1",
"=",
"r\"^\\*\\s+{}\\s+{}\\s+\"",
".",
"format",
"(",
"VLAN_REGEX",
",",
"MAC_REGEX",
")",
"# 7 fields",
"RE_MACTABLE_6500_2",
"=",
"r\... | Returns a lists of dictionaries. Each dictionary represents an entry in the MAC Address
Table, having the following keys
* mac (string)
* interface (string)
* vlan (int)
* active (boolean)
* static (boolean)
* moves (int)
* last... | [
"Returns",
"a",
"lists",
"of",
"dictionaries",
".",
"Each",
"dictionary",
"represents",
"an",
"entry",
"in",
"the",
"MAC",
"Address",
"Table",
"having",
"the",
"following",
"keys",
"*",
"mac",
"(",
"string",
")",
"*",
"interface",
"(",
"string",
")",
"*",
... | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L2324-L2559 | train | Returns a list of dictionaries representing the MAC Address Table and the MAC Address Types of the Mac Address. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.get_snmp_information | def get_snmp_information(self):
"""
Returns a dict of dicts
Example Output:
{ 'chassis_id': u'Asset Tag 54670',
'community': { u'private': { 'acl': u'12', 'mode': u'rw'},
u'public': { 'acl': u'11', 'mode': u'ro'},
u'publ... | python | def get_snmp_information(self):
"""
Returns a dict of dicts
Example Output:
{ 'chassis_id': u'Asset Tag 54670',
'community': { u'private': { 'acl': u'12', 'mode': u'rw'},
u'public': { 'acl': u'11', 'mode': u'ro'},
u'publ... | [
"def",
"get_snmp_information",
"(",
"self",
")",
":",
"# default values",
"snmp_dict",
"=",
"{",
"\"chassis_id\"",
":",
"\"unknown\"",
",",
"\"community\"",
":",
"{",
"}",
",",
"\"contact\"",
":",
"\"unknown\"",
",",
"\"location\"",
":",
"\"unknown\"",
",",
"}",... | Returns a dict of dicts
Example Output:
{ 'chassis_id': u'Asset Tag 54670',
'community': { u'private': { 'acl': u'12', 'mode': u'rw'},
u'public': { 'acl': u'11', 'mode': u'ro'},
u'public_named_acl': { 'acl': u'ALLOW-SNMP-ACL',
... | [
"Returns",
"a",
"dict",
"of",
"dicts"
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L2597-L2648 | train | Returns a dict of dicts with the SNMP information for the current locale. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.get_users | def get_users(self):
"""
Returns a dictionary with the configured users.
The keys of the main dictionary represents the username.
The values represent the details of the user,
represented by the following keys:
* level (int)
* password (str)
*... | python | def get_users(self):
"""
Returns a dictionary with the configured users.
The keys of the main dictionary represents the username.
The values represent the details of the user,
represented by the following keys:
* level (int)
* password (str)
*... | [
"def",
"get_users",
"(",
"self",
")",
":",
"username_regex",
"=",
"(",
"r\"^username\\s+(?P<username>\\S+)\\s+(?:privilege\\s+(?P<priv_level>\\S+)\"",
"r\"\\s+)?(?:secret \\d+\\s+(?P<pwd_hash>\\S+))?$\"",
")",
"pub_keychain_regex",
"=",
"(",
"r\"^\\s+username\\s+(?P<username>\\S+)(?P<k... | Returns a dictionary with the configured users.
The keys of the main dictionary represents the username.
The values represent the details of the user,
represented by the following keys:
* level (int)
* password (str)
* sshkeys (list)
*Note: sshkeys o... | [
"Returns",
"a",
"dictionary",
"with",
"the",
"configured",
"users",
".",
"The",
"keys",
"of",
"the",
"main",
"dictionary",
"represents",
"the",
"username",
".",
"The",
"values",
"represent",
"the",
"details",
"of",
"the",
"user",
"represented",
"by",
"the",
... | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L2650-L2696 | train | Returns a dictionary with the configured users. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.ping | def ping(
self,
destination,
source=C.PING_SOURCE,
ttl=C.PING_TTL,
timeout=C.PING_TIMEOUT,
size=C.PING_SIZE,
count=C.PING_COUNT,
vrf=C.PING_VRF,
):
"""
Execute ping on the device and returns a dictionary with the result.
Output... | python | def ping(
self,
destination,
source=C.PING_SOURCE,
ttl=C.PING_TTL,
timeout=C.PING_TIMEOUT,
size=C.PING_SIZE,
count=C.PING_COUNT,
vrf=C.PING_VRF,
):
"""
Execute ping on the device and returns a dictionary with the result.
Output... | [
"def",
"ping",
"(",
"self",
",",
"destination",
",",
"source",
"=",
"C",
".",
"PING_SOURCE",
",",
"ttl",
"=",
"C",
".",
"PING_TTL",
",",
"timeout",
"=",
"C",
".",
"PING_TIMEOUT",
",",
"size",
"=",
"C",
".",
"PING_SIZE",
",",
"count",
"=",
"C",
".",... | Execute ping on the device and returns a dictionary with the result.
Output dictionary has one of following keys:
* success
* error
In case of success, inner dictionary will have the followin keys:
* probes_sent (int)
* packet_loss (int)
* rtt... | [
"Execute",
"ping",
"on",
"the",
"device",
"and",
"returns",
"a",
"dictionary",
"with",
"the",
"result",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L2698-L2781 | train | Execute ping on the device and returns the result. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/ios/ios.py | IOSDriver.get_ipv6_neighbors_table | def get_ipv6_neighbors_table(self):
"""
Get IPv6 neighbors table information.
Return a list of dictionaries having the following set of keys:
* interface (string)
* mac (string)
* ip (string)
* age (float) in seconds
* state (string)
... | python | def get_ipv6_neighbors_table(self):
"""
Get IPv6 neighbors table information.
Return a list of dictionaries having the following set of keys:
* interface (string)
* mac (string)
* ip (string)
* age (float) in seconds
* state (string)
... | [
"def",
"get_ipv6_neighbors_table",
"(",
"self",
")",
":",
"ipv6_neighbors_table",
"=",
"[",
"]",
"command",
"=",
"\"show ipv6 neighbors\"",
"output",
"=",
"self",
".",
"_send_command",
"(",
"command",
")",
"ipv6_neighbors",
"=",
"\"\"",
"fields",
"=",
"re",
".",... | Get IPv6 neighbors table information.
Return a list of dictionaries having the following set of keys:
* interface (string)
* mac (string)
* ip (string)
* age (float) in seconds
* state (string)
For example::
[
{
... | [
"Get",
"IPv6",
"neighbors",
"table",
"information",
".",
"Return",
"a",
"list",
"of",
"dictionaries",
"having",
"the",
"following",
"set",
"of",
"keys",
":",
"*",
"interface",
"(",
"string",
")",
"*",
"mac",
"(",
"string",
")",
"*",
"ip",
"(",
"string",
... | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/ios/ios.py#L2984-L3035 | train | Get the IPv6 neighbors table information. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/eos/eos.py | EOSDriver.open | def open(self):
"""Implementation of NAPALM method open."""
try:
connection = self.transport_class(
host=self.hostname,
username=self.username,
password=self.password,
timeout=self.timeout,
**self.eapi_kwargs
... | python | def open(self):
"""Implementation of NAPALM method open."""
try:
connection = self.transport_class(
host=self.hostname,
username=self.username,
password=self.password,
timeout=self.timeout,
**self.eapi_kwargs
... | [
"def",
"open",
"(",
"self",
")",
":",
"try",
":",
"connection",
"=",
"self",
".",
"transport_class",
"(",
"host",
"=",
"self",
".",
"hostname",
",",
"username",
"=",
"self",
".",
"username",
",",
"password",
"=",
"self",
".",
"password",
",",
"timeout"... | Implementation of NAPALM method open. | [
"Implementation",
"of",
"NAPALM",
"method",
"open",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/eos/eos.py#L126-L147 | train | Implementation of NAPALM method open. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/eos/eos.py | EOSDriver._multiline_convert | def _multiline_convert(config, start="banner login", end="EOF", depth=1):
"""Converts running-config HEREDOC into EAPI JSON dict"""
ret = list(config) # Don't modify list in-place
try:
s = ret.index(start)
e = s
while depth:
e = ret.index(end,... | python | def _multiline_convert(config, start="banner login", end="EOF", depth=1):
"""Converts running-config HEREDOC into EAPI JSON dict"""
ret = list(config) # Don't modify list in-place
try:
s = ret.index(start)
e = s
while depth:
e = ret.index(end,... | [
"def",
"_multiline_convert",
"(",
"config",
",",
"start",
"=",
"\"banner login\"",
",",
"end",
"=",
"\"EOF\"",
",",
"depth",
"=",
"1",
")",
":",
"ret",
"=",
"list",
"(",
"config",
")",
"# Don't modify list in-place",
"try",
":",
"s",
"=",
"ret",
".",
"in... | Converts running-config HEREDOC into EAPI JSON dict | [
"Converts",
"running",
"-",
"config",
"HEREDOC",
"into",
"EAPI",
"JSON",
"dict"
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/eos/eos.py#L168-L182 | train | Converts running - config HEREDOC into EAPI JSON dict | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/eos/eos.py | EOSDriver._mode_comment_convert | def _mode_comment_convert(commands):
"""
EOS has the concept of multi-line mode comments, shown in the running-config
as being inside a config stanza (router bgp, ACL definition, etc) and beginning
with the normal level of spaces and '!!', followed by comments.
Unfortunately, py... | python | def _mode_comment_convert(commands):
"""
EOS has the concept of multi-line mode comments, shown in the running-config
as being inside a config stanza (router bgp, ACL definition, etc) and beginning
with the normal level of spaces and '!!', followed by comments.
Unfortunately, py... | [
"def",
"_mode_comment_convert",
"(",
"commands",
")",
":",
"ret",
"=",
"[",
"]",
"comment_count",
"=",
"0",
"for",
"idx",
",",
"element",
"in",
"enumerate",
"(",
"commands",
")",
":",
"# Check first for stringiness, as we may have dicts in the command list already",
"... | EOS has the concept of multi-line mode comments, shown in the running-config
as being inside a config stanza (router bgp, ACL definition, etc) and beginning
with the normal level of spaces and '!!', followed by comments.
Unfortunately, pyeapi does not accept mode comments in this format, and ha... | [
"EOS",
"has",
"the",
"concept",
"of",
"multi",
"-",
"line",
"mode",
"comments",
"shown",
"in",
"the",
"running",
"-",
"config",
"as",
"being",
"inside",
"a",
"config",
"stanza",
"(",
"router",
"bgp",
"ACL",
"definition",
"etc",
")",
"and",
"beginning",
"... | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/eos/eos.py#L185-L227 | train | Convert multi - line mode comments into a list of commands. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/eos/eos.py | EOSDriver.commit_config | def commit_config(self, message=""):
"""Implementation of NAPALM method commit_config."""
if message:
raise NotImplementedError(
"Commit message not implemented for this platform"
)
commands = [
"copy startup-config flash:rollback-0",
... | python | def commit_config(self, message=""):
"""Implementation of NAPALM method commit_config."""
if message:
raise NotImplementedError(
"Commit message not implemented for this platform"
)
commands = [
"copy startup-config flash:rollback-0",
... | [
"def",
"commit_config",
"(",
"self",
",",
"message",
"=",
"\"\"",
")",
":",
"if",
"message",
":",
"raise",
"NotImplementedError",
"(",
"\"Commit message not implemented for this platform\"",
")",
"commands",
"=",
"[",
"\"copy startup-config flash:rollback-0\"",
",",
"\"... | Implementation of NAPALM method commit_config. | [
"Implementation",
"of",
"NAPALM",
"method",
"commit_config",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/eos/eos.py#L294-L308 | train | Implementation of NAPALM method commit_config. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/eos/eos.py | EOSDriver.get_bgp_config | def get_bgp_config(self, group="", neighbor=""):
"""Implementation of NAPALM method get_bgp_config."""
_GROUP_FIELD_MAP_ = {
"type": "type",
"multipath": "multipath",
"apply-groups": "apply_groups",
"remove-private-as": "remove_private_as",
"eb... | python | def get_bgp_config(self, group="", neighbor=""):
"""Implementation of NAPALM method get_bgp_config."""
_GROUP_FIELD_MAP_ = {
"type": "type",
"multipath": "multipath",
"apply-groups": "apply_groups",
"remove-private-as": "remove_private_as",
"eb... | [
"def",
"get_bgp_config",
"(",
"self",
",",
"group",
"=",
"\"\"",
",",
"neighbor",
"=",
"\"\"",
")",
":",
"_GROUP_FIELD_MAP_",
"=",
"{",
"\"type\"",
":",
"\"type\"",
",",
"\"multipath\"",
":",
"\"multipath\"",
",",
"\"apply-groups\"",
":",
"\"apply_groups\"",
"... | Implementation of NAPALM method get_bgp_config. | [
"Implementation",
"of",
"NAPALM",
"method",
"get_bgp_config",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/eos/eos.py#L705-L912 | train | Implementation of NAPALM method get_bgp_config. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/eos/eos.py | EOSDriver.get_network_instances | def get_network_instances(self, name=""):
"""get_network_instances implementation for EOS."""
output = self._show_vrf()
vrfs = {}
all_vrf_interfaces = {}
for vrf in output:
if (
vrf.get("route_distinguisher", "") == "<not set>"
or vrf.... | python | def get_network_instances(self, name=""):
"""get_network_instances implementation for EOS."""
output = self._show_vrf()
vrfs = {}
all_vrf_interfaces = {}
for vrf in output:
if (
vrf.get("route_distinguisher", "") == "<not set>"
or vrf.... | [
"def",
"get_network_instances",
"(",
"self",
",",
"name",
"=",
"\"\"",
")",
":",
"output",
"=",
"self",
".",
"_show_vrf",
"(",
")",
"vrfs",
"=",
"{",
"}",
"all_vrf_interfaces",
"=",
"{",
"}",
"for",
"vrf",
"in",
"output",
":",
"if",
"(",
"vrf",
".",
... | get_network_instances implementation for EOS. | [
"get_network_instances",
"implementation",
"for",
"EOS",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/eos/eos.py#L1770-L1817 | train | get_network_instances implementation for EOS. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/eos/eos.py | EOSDriver.ping | def ping(
self,
destination,
source=c.PING_SOURCE,
ttl=c.PING_TTL,
timeout=c.PING_TIMEOUT,
size=c.PING_SIZE,
count=c.PING_COUNT,
vrf=c.PING_VRF,
):
"""
Execute ping on the device and returns a dictionary with the result.
Output ... | python | def ping(
self,
destination,
source=c.PING_SOURCE,
ttl=c.PING_TTL,
timeout=c.PING_TIMEOUT,
size=c.PING_SIZE,
count=c.PING_COUNT,
vrf=c.PING_VRF,
):
"""
Execute ping on the device and returns a dictionary with the result.
Output ... | [
"def",
"ping",
"(",
"self",
",",
"destination",
",",
"source",
"=",
"c",
".",
"PING_SOURCE",
",",
"ttl",
"=",
"c",
".",
"PING_TTL",
",",
"timeout",
"=",
"c",
".",
"PING_TIMEOUT",
",",
"size",
"=",
"c",
".",
"PING_SIZE",
",",
"count",
"=",
"c",
".",... | Execute ping on the device and returns a dictionary with the result.
Output dictionary has one of following keys:
* success
* error
In case of success, inner dictionary will have the followin keys:
* probes_sent (int)
* packet_loss (int)
* rtt_... | [
"Execute",
"ping",
"on",
"the",
"device",
"and",
"returns",
"a",
"dictionary",
"with",
"the",
"result",
".",
"Output",
"dictionary",
"has",
"one",
"of",
"following",
"keys",
":",
"*",
"success",
"*",
"error",
"In",
"case",
"of",
"success",
"inner",
"dictio... | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/eos/eos.py#L1819-L1936 | train | Execute ping on the device and return a dictionary with the result. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/validate.py | empty_tree | def empty_tree(input_list):
"""Recursively iterate through values in nested lists."""
for item in input_list:
if not isinstance(item, list) or not empty_tree(item):
return False
return True | python | def empty_tree(input_list):
"""Recursively iterate through values in nested lists."""
for item in input_list:
if not isinstance(item, list) or not empty_tree(item):
return False
return True | [
"def",
"empty_tree",
"(",
"input_list",
")",
":",
"for",
"item",
"in",
"input_list",
":",
"if",
"not",
"isinstance",
"(",
"item",
",",
"list",
")",
"or",
"not",
"empty_tree",
"(",
"item",
")",
":",
"return",
"False",
"return",
"True"
] | Recursively iterate through values in nested lists. | [
"Recursively",
"iterate",
"through",
"values",
"in",
"nested",
"lists",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/validate.py#L178-L183 | train | Recursively iterate through values in nested lists. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | docs/conf.py | build_napalm_ansible_module_docs | def build_napalm_ansible_module_docs(app):
"""Create documentation for Ansible modules."""
# Add script to clone napalm-ansible repo
status = subprocess.call(
"./build-ansible-module-docs.sh", stdout=sys.stdout, stderr=sys.stderr
)
if status != 0:
print("Something bad happened when... | python | def build_napalm_ansible_module_docs(app):
"""Create documentation for Ansible modules."""
# Add script to clone napalm-ansible repo
status = subprocess.call(
"./build-ansible-module-docs.sh", stdout=sys.stdout, stderr=sys.stderr
)
if status != 0:
print("Something bad happened when... | [
"def",
"build_napalm_ansible_module_docs",
"(",
"app",
")",
":",
"# Add script to clone napalm-ansible repo",
"status",
"=",
"subprocess",
".",
"call",
"(",
"\"./build-ansible-module-docs.sh\"",
",",
"stdout",
"=",
"sys",
".",
"stdout",
",",
"stderr",
"=",
"sys",
".",... | Create documentation for Ansible modules. | [
"Create",
"documentation",
"for",
"Ansible",
"modules",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/docs/conf.py#L319-L352 | train | Build the Ansible modules documentation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | docs/conf.py | build_getters_support_matrix | def build_getters_support_matrix(app):
"""Build the getters support matrix."""
status = subprocess.call("./test.sh", stdout=sys.stdout, stderr=sys.stderr)
if status != 0:
print("Something bad happened when processing the test reports.")
sys.exit(-1)
drivers = set()
matrix = {
... | python | def build_getters_support_matrix(app):
"""Build the getters support matrix."""
status = subprocess.call("./test.sh", stdout=sys.stdout, stderr=sys.stderr)
if status != 0:
print("Something bad happened when processing the test reports.")
sys.exit(-1)
drivers = set()
matrix = {
... | [
"def",
"build_getters_support_matrix",
"(",
"app",
")",
":",
"status",
"=",
"subprocess",
".",
"call",
"(",
"\"./test.sh\"",
",",
"stdout",
"=",
"sys",
".",
"stdout",
",",
"stderr",
"=",
"sys",
".",
"stderr",
")",
"if",
"status",
"!=",
"0",
":",
"print",... | Build the getters support matrix. | [
"Build",
"the",
"getters",
"support",
"matrix",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/docs/conf.py#L355-L402 | train | Build the getters support matrix. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/iosxr/iosxr.py | IOSXRDriver.get_bgp_neighbors | def get_bgp_neighbors(self):
def generate_vrf_query(vrf_name):
"""
Helper to provide XML-query for the VRF-type we're interested in.
"""
if vrf_name == "global":
rpc_command = "<Get><Operational><BGP><InstanceTable><Instance><Naming>\
... | python | def get_bgp_neighbors(self):
def generate_vrf_query(vrf_name):
"""
Helper to provide XML-query for the VRF-type we're interested in.
"""
if vrf_name == "global":
rpc_command = "<Get><Operational><BGP><InstanceTable><Instance><Naming>\
... | [
"def",
"get_bgp_neighbors",
"(",
"self",
")",
":",
"def",
"generate_vrf_query",
"(",
"vrf_name",
")",
":",
"\"\"\"\n Helper to provide XML-query for the VRF-type we're interested in.\n \"\"\"",
"if",
"vrf_name",
"==",
"\"global\"",
":",
"rpc_command",
"=",... | Initial run to figure out what VRF's are available
Decided to get this one from Configured-section
because bulk-getting all instance-data to do the same could get ridiculously heavy
Assuming we're always interested in the DefaultVRF | [
"Initial",
"run",
"to",
"figure",
"out",
"what",
"VRF",
"s",
"are",
"available",
"Decided",
"to",
"get",
"this",
"one",
"from",
"Configured",
"-",
"section",
"because",
"bulk",
"-",
"getting",
"all",
"instance",
"-",
"data",
"to",
"do",
"the",
"same",
"c... | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/iosxr/iosxr.py#L362-L562 | train | This method returns a list of BGP neighbors for the current system. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/base/netmiko_helpers.py | netmiko_args | def netmiko_args(optional_args):
"""Check for Netmiko arguments that were passed in as NAPALM optional arguments.
Return a dictionary of these optional args that will be passed into the Netmiko
ConnectHandler call.
"""
fields = py23_compat.argspec(BaseConnection.__init__)
args = fields[0]
... | python | def netmiko_args(optional_args):
"""Check for Netmiko arguments that were passed in as NAPALM optional arguments.
Return a dictionary of these optional args that will be passed into the Netmiko
ConnectHandler call.
"""
fields = py23_compat.argspec(BaseConnection.__init__)
args = fields[0]
... | [
"def",
"netmiko_args",
"(",
"optional_args",
")",
":",
"fields",
"=",
"py23_compat",
".",
"argspec",
"(",
"BaseConnection",
".",
"__init__",
")",
"args",
"=",
"fields",
"[",
"0",
"]",
"defaults",
"=",
"fields",
"[",
"3",
"]",
"check_self",
"=",
"args",
"... | Check for Netmiko arguments that were passed in as NAPALM optional arguments.
Return a dictionary of these optional args that will be passed into the Netmiko
ConnectHandler call. | [
"Check",
"for",
"Netmiko",
"arguments",
"that",
"were",
"passed",
"in",
"as",
"NAPALM",
"optional",
"arguments",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/base/netmiko_helpers.py#L17-L49 | train | Check for Netmiko arguments that were passed in as NAPALM optional arguments. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos/nxos.py | ensure_netmiko_conn | def ensure_netmiko_conn(func):
"""Decorator that ensures Netmiko connection exists."""
def wrap_function(self, filename=None, config=None):
try:
netmiko_object = self._netmiko_device
if netmiko_object is None:
raise AttributeError()
except AttributeError:... | python | def ensure_netmiko_conn(func):
"""Decorator that ensures Netmiko connection exists."""
def wrap_function(self, filename=None, config=None):
try:
netmiko_object = self._netmiko_device
if netmiko_object is None:
raise AttributeError()
except AttributeError:... | [
"def",
"ensure_netmiko_conn",
"(",
"func",
")",
":",
"def",
"wrap_function",
"(",
"self",
",",
"filename",
"=",
"None",
",",
"config",
"=",
"None",
")",
":",
"try",
":",
"netmiko_object",
"=",
"self",
".",
"_netmiko_device",
"if",
"netmiko_object",
"is",
"... | Decorator that ensures Netmiko connection exists. | [
"Decorator",
"that",
"ensures",
"Netmiko",
"connection",
"exists",
"."
] | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos/nxos.py#L47-L65 | train | Decorator that ensures Netmiko connection exists. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
napalm-automation/napalm | napalm/nxos/nxos.py | NXOSDriverBase._get_merge_diff | def _get_merge_diff(self):
"""
The merge diff is not necessarily what needs to be loaded
for example under NTP, even though the 'ntp commit' command might be
alread configured, it is mandatory to be sent
otherwise it won't take the new configuration - see:
https://github.... | python | def _get_merge_diff(self):
"""
The merge diff is not necessarily what needs to be loaded
for example under NTP, even though the 'ntp commit' command might be
alread configured, it is mandatory to be sent
otherwise it won't take the new configuration - see:
https://github.... | [
"def",
"_get_merge_diff",
"(",
"self",
")",
":",
"diff",
"=",
"[",
"]",
"running_config",
"=",
"self",
".",
"get_config",
"(",
"retrieve",
"=",
"\"running\"",
")",
"[",
"\"running\"",
"]",
"running_lines",
"=",
"running_config",
".",
"splitlines",
"(",
")",
... | The merge diff is not necessarily what needs to be loaded
for example under NTP, even though the 'ntp commit' command might be
alread configured, it is mandatory to be sent
otherwise it won't take the new configuration - see:
https://github.com/napalm-automation/napalm-nxos/issues/59
... | [
"The",
"merge",
"diff",
"is",
"not",
"necessarily",
"what",
"needs",
"to",
"be",
"loaded",
"for",
"example",
"under",
"NTP",
"even",
"though",
"the",
"ntp",
"commit",
"command",
"might",
"be",
"alread",
"configured",
"it",
"is",
"mandatory",
"to",
"be",
"s... | c11ae8bb5ce395698704a0051cdf8d144fbb150d | https://github.com/napalm-automation/napalm/blob/c11ae8bb5ce395698704a0051cdf8d144fbb150d/napalm/nxos/nxos.py#L157-L174 | train | Return the merge diff of the current configuration and the merge candidate. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.