{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [],
"source": [
"import pandas as pd\n",
"from pybatfish.client.session import Session\n",
"from pybatfish.datamodel import *\n",
"\n",
"pd.set_option(\"display.width\", 300) \n",
"pd.set_option(\"display.max_columns\", 30) \n",
"pd.set_option(\"display.max_rows\", 1000) \n",
"pd.set_option(\"display.max_colwidth\", None)\n",
"\n",
"# Configure all pybatfish loggers to use WARN level\n",
"import logging\n",
"logging.getLogger('pybatfish').setLevel(logging.WARN)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [],
"source": [
"bf = Session(host=\"localhost\")\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "f4ad438a",
"metadata": {},
"source": [
"#### Configuration Properties"
]
},
{
"cell_type": "markdown",
"id": "764a462a",
"metadata": {},
"source": [
"This category of questions enables you to retrieve and process the\n",
"contents of device configurations in a vendor-agnostic manner\n",
"(except where the question itself is vendor-specific). Batfish organizes\n",
"configuration content into several sub-categories.\n"
]
},
{
"cell_type": "markdown",
"id": "4ab518aa",
"metadata": {},
"source": [
"* [Node Properties](#Node-Properties)\n",
"* [Interface Properties](#Interface-Properties)\n",
"* [BGP Process Configuration](#BGP-Process-Configuration)\n",
"* [BGP Peer Configuration](#BGP-Peer-Configuration)\n",
"* [HSRP Properties](#HSRP-Properties)\n",
"* [OSPF Process Configuration](#OSPF-Process-Configuration)\n",
"* [OSPF Interface Configuration](#OSPF-Interface-Configuration)\n",
"* [OSPF Area Configuration](#OSPF-Area-Configuration)\n",
"* [Multi-chassis LAG](#Multi-chassis-LAG)\n",
"* [IP Owners](#IP-Owners)\n",
"* [Named Structures](#Named-Structures)\n",
"* [Defined Structures](#Defined-Structures)\n",
"* [Referenced Structures](#Referenced-Structures)\n",
"* [Undefined References](#Undefined-References)\n",
"* [Unused Structures](#Unused-Structures)\n",
"* [VLAN Properties](#VLAN-Properties)\n",
"* [VRRP Properties](#VRRP-Properties)\n",
"* [A10 Virtual Server Configuration](#A10-Virtual-Server-Configuration)\n",
"* [F5 BIG-IP VIP Configuration](#F5-BIG-IP-VIP-Configuration)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "671e2afe",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "2ab6d87d",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('generate_questions')"
]
},
{
"cell_type": "markdown",
"id": "a538e708",
"metadata": {},
"source": [
"##### Node Properties"
]
},
{
"cell_type": "markdown",
"id": "4042a4e0",
"metadata": {},
"source": [
"Returns configuration settings of nodes."
]
},
{
"cell_type": "markdown",
"id": "0f64a9f4",
"metadata": {},
"source": [
"Lists global settings of devices in the network. Settings that are specific to interfaces, routing protocols, etc. are available via other questions."
]
},
{
"cell_type": "markdown",
"id": "7c89f0b5",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "c7f560cc",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this name or regex. | [NodeSpec](../specifiers.md#node-specifier) | True | \n",
"properties | Include properties matching this regex. | [NodePropertySpec](../specifiers.md#node-property-specifier) | True | "
]
},
{
"cell_type": "markdown",
"id": "ba36f345",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "70925605",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.nodeProperties().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "76691424",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "71fd2dec",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Node | Node | str\n",
"AS_Path_Access_Lists | Names of AS path access lists | Set of str\n",
"Authentication_Key_Chains | Names of authentication keychains | Set of str\n",
"Community_Match_Exprs | Names of expressions for matching a community | Set of str\n",
"Community_Set_Exprs | Names of expressions representing a community-set | Set of str\n",
"Community_Set_Match_Exprs | Names of expressions for matching a ommunity-set | Set of str\n",
"Community_Sets | Names of community-sets | Set of str\n",
"Configuration_Format | Configuration format of the node | str\n",
"DNS_Servers | Configured DNS servers | Set of str\n",
"DNS_Source_Interface | Source interface to use for communicating with DNS servers | str\n",
"Default_Cross_Zone_Action | Default action (PERMIT, DENY) for traffic that traverses firewall zones (null for non-firewall nodes) | str\n",
"Default_Inbound_Action | Default action (PERMIT, DENY) for traffic destined for this node | str\n",
"Domain_Name | Domain name of the node | str\n",
"Hostname | Hostname of the node | str\n",
"IKE_Phase1_Keys | Names of IKE Phase 1 keys | Set of str\n",
"IKE_Phase1_Policies | Names of IKE Phase 1 policies | Set of str\n",
"IKE_Phase1_Proposals | Names of IKE Phase 1 proposals | Set of str\n",
"IP6_Access_Lists | (Deprecated) Names of IPv6 filters (ACLs, firewall rule sets) | Set of str\n",
"IP_Access_Lists | Names of IPv4 filters (ACLs, firewall rule sets) | Set of str\n",
"IPsec_Peer_Configs | Names of IPSec peers | Set of str\n",
"IPsec_Phase2_Policies | Names of IPSec Phase 2 policies | Set of str\n",
"IPsec_Phase2_Proposals | Names of IPSec Phase 2 proposals | Set of str\n",
"Interfaces | Names of interfaces | Set of str\n",
"Logging_Servers | Configured logging servers | Set of str\n",
"Logging_Source_Interface | Source interface for communicating with logging servers | str\n",
"NTP_Servers | Configured NTP servers | Set of str\n",
"NTP_Source_Interface | Source interface for communicating with NTP servers | str\n",
"PBR_Policies | Names of policy-based routing (PBR) policies | Set of str\n",
"Route6_Filter_Lists | (Deprecated) Names of structures that filter IPv6 routes (e.g., prefix lists) | Set of str\n",
"Route_Filter_Lists | Names of structures that filter IPv4 routes (e.g., prefix lists) | Set of str\n",
"Routing_Policies | Names of policies that manipulate routes (e.g., route maps) | Set of str\n",
"SNMP_Source_Interface | Source interface to use for communicating with SNMP servers | str\n",
"SNMP_Trap_Servers | Configured SNMP trap servers | Set of str\n",
"TACACS_Servers | Configured TACACS servers | Set of str\n",
"TACACS_Source_Interface | Source interface to use for communicating with TACACS servers | str\n",
"VRFs | Names of VRFs present on the node | Set of str\n",
"Zones | Names of firewall zones on the node | Set of str"
]
},
{
"cell_type": "markdown",
"id": "75ece274",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "ba06922c",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Node | \n",
" AS_Path_Access_Lists | \n",
" Authentication_Key_Chains | \n",
" Community_Match_Exprs | \n",
" Community_Set_Exprs | \n",
" Community_Set_Match_Exprs | \n",
" Community_Sets | \n",
" Configuration_Format | \n",
" DNS_Servers | \n",
" DNS_Source_Interface | \n",
" Default_Cross_Zone_Action | \n",
" Default_Inbound_Action | \n",
" Domain_Name | \n",
" Hostname | \n",
" IKE_Phase1_Keys | \n",
" ... | \n",
" Interfaces | \n",
" Logging_Servers | \n",
" Logging_Source_Interface | \n",
" NTP_Servers | \n",
" NTP_Source_Interface | \n",
" PBR_Policies | \n",
" Route6_Filter_Lists | \n",
" Route_Filter_Lists | \n",
" Routing_Policies | \n",
" SNMP_Source_Interface | \n",
" SNMP_Trap_Servers | \n",
" TACACS_Servers | \n",
" TACACS_Source_Interface | \n",
" VRFs | \n",
" Zones | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" as2border2 | \n",
" [] | \n",
" [] | \n",
" ['as1_community', 'as2_community', 'as3_community'] | \n",
" [] | \n",
" ['as1_community', 'as2_community', 'as3_community'] | \n",
" [] | \n",
" CISCO_IOS | \n",
" [] | \n",
" None | \n",
" PERMIT | \n",
" PERMIT | \n",
" lab.local | \n",
" as2border2 | \n",
" [] | \n",
" ... | \n",
" ['Ethernet0/0', 'GigabitEthernet0/0', 'GigabitEthernet1/0', 'GigabitEthernet2/0', 'Loopback0'] | \n",
" [] | \n",
" None | \n",
" ['18.18.18.18'] | \n",
" None | \n",
" [] | \n",
" [] | \n",
" ['101', '103', 'inbound_route_filter', 'outbound_routes', '~MATCH_SUPPRESSED_SUMMARY_ONLY:default~'] | \n",
" ['as1_to_as2', 'as2_to_as1', 'as2_to_as3', 'as3_to_as2', '~BGP_COMMON_EXPORT_POLICY:default~', '~BGP_PEER_EXPORT_POLICY:default:10.23.21.3~', '~BGP_PEER_EXPORT_POLICY:default:2.1.2.1~', '~BGP_PEER_EXPORT_POLICY:default:2.1.2.2~', '~BGP_REDISTRIBUTION_POLICY:default~', '~OSPF_EXPORT_POLICY:default:1~', '~RESOLUTION_POLICY~', '~suppress~rp~summary-only~'] | \n",
" None | \n",
" [] | \n",
" [] | \n",
" None | \n",
" ['default'] | \n",
" [] | \n",
"
\n",
" \n",
" | 1 | \n",
" as1border1 | \n",
" [] | \n",
" [] | \n",
" ['as1_community', 'as2_community', 'as3_community'] | \n",
" [] | \n",
" ['as1_community', 'as2_community', 'as3_community'] | \n",
" [] | \n",
" CISCO_IOS | \n",
" [] | \n",
" None | \n",
" PERMIT | \n",
" PERMIT | \n",
" lab.local | \n",
" as1border1 | \n",
" [] | \n",
" ... | \n",
" ['Ethernet0/0', 'GigabitEthernet0/0', 'GigabitEthernet1/0', 'Loopback0'] | \n",
" [] | \n",
" None | \n",
" [] | \n",
" None | \n",
" [] | \n",
" [] | \n",
" ['101', '102', '103', 'default_list', 'inbound_route_filter'] | \n",
" ['as1_to_as2', 'as1_to_as3', 'as2_to_as1', 'as3_to_as1', '~BGP_COMMON_EXPORT_POLICY:default~', '~BGP_PEER_EXPORT_POLICY:default:1.10.1.1~', '~BGP_PEER_EXPORT_POLICY:default:10.12.11.2~', '~BGP_PEER_EXPORT_POLICY:default:3.2.2.2~', '~BGP_PEER_EXPORT_POLICY:default:5.6.7.8~', '~BGP_REDISTRIBUTION_POLICY:default~', '~OSPF_EXPORT_POLICY:default:1~', '~RESOLUTION_POLICY~'] | \n",
" None | \n",
" [] | \n",
" [] | \n",
" None | \n",
" ['default'] | \n",
" [] | \n",
"
\n",
" \n",
" | 2 | \n",
" as3border2 | \n",
" [] | \n",
" [] | \n",
" ['as1_community', 'as2_community', 'as3_community'] | \n",
" [] | \n",
" ['as1_community', 'as2_community', 'as3_community'] | \n",
" [] | \n",
" CISCO_IOS | \n",
" [] | \n",
" None | \n",
" PERMIT | \n",
" PERMIT | \n",
" lab.local | \n",
" as3border2 | \n",
" [] | \n",
" ... | \n",
" ['Ethernet0/0', 'GigabitEthernet0/0', 'GigabitEthernet1/0', 'Loopback0'] | \n",
" [] | \n",
" None | \n",
" ['18.18.18.18', '23.23.23.23'] | \n",
" None | \n",
" [] | \n",
" [] | \n",
" ['101', '102', '103', 'inbound_route_filter'] | \n",
" ['as1_to_as3', 'as2_to_as3', 'as3_to_as1', 'as3_to_as2', '~BGP_COMMON_EXPORT_POLICY:default~', '~BGP_PEER_EXPORT_POLICY:default:10.13.22.1~', '~BGP_PEER_EXPORT_POLICY:default:3.10.1.1~', '~BGP_REDISTRIBUTION_POLICY:default~', '~OSPF_EXPORT_POLICY:default:1~', '~RESOLUTION_POLICY~'] | \n",
" None | \n",
" [] | \n",
" [] | \n",
" None | \n",
" ['default'] | \n",
" [] | \n",
"
\n",
" \n",
" | 3 | \n",
" as1border2 | \n",
" [] | \n",
" [] | \n",
" ['as1_community', 'as2_community', 'as3_community', 'as4_community'] | \n",
" [] | \n",
" ['as1_community', 'as2_community', 'as3_community', 'as4_community'] | \n",
" [] | \n",
" CISCO_IOS | \n",
" [] | \n",
" None | \n",
" PERMIT | \n",
" PERMIT | \n",
" lab.local | \n",
" as1border2 | \n",
" [] | \n",
" ... | \n",
" ['Ethernet0/0', 'GigabitEthernet0/0', 'GigabitEthernet1/0', 'GigabitEthernet2/0', 'Loopback0'] | \n",
" [] | \n",
" None | \n",
" ['18.18.18.18', '23.23.23.23'] | \n",
" None | \n",
" [] | \n",
" [] | \n",
" ['101', '102', '103', 'as4-prefixes', 'inbound_route_filter'] | \n",
" ['as1_to_as2', 'as1_to_as3', 'as1_to_as4', 'as2_to_as1', 'as3_to_as1', 'as4_to_as1', '~BGP_COMMON_EXPORT_POLICY:default~', '~BGP_PEER_EXPORT_POLICY:default:1.10.1.1~', '~BGP_PEER_EXPORT_POLICY:default:10.13.22.3~', '~BGP_PEER_EXPORT_POLICY:default:10.14.22.4~', '~BGP_REDISTRIBUTION_POLICY:default~', '~OSPF_EXPORT_POLICY:default:1~', '~RESOLUTION_POLICY~'] | \n",
" None | \n",
" [] | \n",
" [] | \n",
" None | \n",
" ['default'] | \n",
" [] | \n",
"
\n",
" \n",
" | 4 | \n",
" as2dept1 | \n",
" [] | \n",
" [] | \n",
" ['as2_community'] | \n",
" [] | \n",
" ['as2_community'] | \n",
" [] | \n",
" CISCO_IOS | \n",
" [] | \n",
" None | \n",
" PERMIT | \n",
" PERMIT | \n",
" lab.local | \n",
" as2dept1 | \n",
" [] | \n",
" ... | \n",
" ['Ethernet0/0', 'GigabitEthernet0/0', 'GigabitEthernet1/0', 'GigabitEthernet2/0', 'GigabitEthernet3/0', 'Loopback0'] | \n",
" [] | \n",
" None | \n",
" [] | \n",
" None | \n",
" [] | \n",
" [] | \n",
" ['102'] | \n",
" ['as2_to_dept', 'dept_to_as2', '~BGP_COMMON_EXPORT_POLICY:default~', '~BGP_PEER_EXPORT_POLICY:default:2.34.101.3~', '~BGP_PEER_EXPORT_POLICY:default:2.34.201.3~', '~BGP_REDISTRIBUTION_POLICY:default~', '~RESOLUTION_POLICY~'] | \n",
" None | \n",
" [] | \n",
" [] | \n",
" None | \n",
" ['default'] | \n",
" [] | \n",
"
\n",
" \n",
"
\n",
"
5 rows × 37 columns
\n",
"
"
],
"text/plain": [
" Node AS_Path_Access_Lists Authentication_Key_Chains Community_Match_Exprs Community_Set_Exprs Community_Set_Match_Exprs Community_Sets Configuration_Format DNS_Servers DNS_Source_Interface \\\n",
"0 as2border2 [] [] ['as1_community', 'as2_community', 'as3_community'] [] ['as1_community', 'as2_community', 'as3_community'] [] CISCO_IOS [] None \n",
"1 as1border1 [] [] ['as1_community', 'as2_community', 'as3_community'] [] ['as1_community', 'as2_community', 'as3_community'] [] CISCO_IOS [] None \n",
"2 as3border2 [] [] ['as1_community', 'as2_community', 'as3_community'] [] ['as1_community', 'as2_community', 'as3_community'] [] CISCO_IOS [] None \n",
"3 as1border2 [] [] ['as1_community', 'as2_community', 'as3_community', 'as4_community'] [] ['as1_community', 'as2_community', 'as3_community', 'as4_community'] [] CISCO_IOS [] None \n",
"4 as2dept1 [] [] ['as2_community'] [] ['as2_community'] [] CISCO_IOS [] None \n",
"\n",
" Default_Cross_Zone_Action Default_Inbound_Action Domain_Name Hostname IKE_Phase1_Keys ... Interfaces Logging_Servers Logging_Source_Interface NTP_Servers \\\n",
"0 PERMIT PERMIT lab.local as2border2 [] ... ['Ethernet0/0', 'GigabitEthernet0/0', 'GigabitEthernet1/0', 'GigabitEthernet2/0', 'Loopback0'] [] None ['18.18.18.18'] \n",
"1 PERMIT PERMIT lab.local as1border1 [] ... ['Ethernet0/0', 'GigabitEthernet0/0', 'GigabitEthernet1/0', 'Loopback0'] [] None [] \n",
"2 PERMIT PERMIT lab.local as3border2 [] ... ['Ethernet0/0', 'GigabitEthernet0/0', 'GigabitEthernet1/0', 'Loopback0'] [] None ['18.18.18.18', '23.23.23.23'] \n",
"3 PERMIT PERMIT lab.local as1border2 [] ... ['Ethernet0/0', 'GigabitEthernet0/0', 'GigabitEthernet1/0', 'GigabitEthernet2/0', 'Loopback0'] [] None ['18.18.18.18', '23.23.23.23'] \n",
"4 PERMIT PERMIT lab.local as2dept1 [] ... ['Ethernet0/0', 'GigabitEthernet0/0', 'GigabitEthernet1/0', 'GigabitEthernet2/0', 'GigabitEthernet3/0', 'Loopback0'] [] None [] \n",
"\n",
" NTP_Source_Interface PBR_Policies Route6_Filter_Lists Route_Filter_Lists \\\n",
"0 None [] [] ['101', '103', 'inbound_route_filter', 'outbound_routes', '~MATCH_SUPPRESSED_SUMMARY_ONLY:default~'] \n",
"1 None [] [] ['101', '102', '103', 'default_list', 'inbound_route_filter'] \n",
"2 None [] [] ['101', '102', '103', 'inbound_route_filter'] \n",
"3 None [] [] ['101', '102', '103', 'as4-prefixes', 'inbound_route_filter'] \n",
"4 None [] [] ['102'] \n",
"\n",
" Routing_Policies \\\n",
"0 ['as1_to_as2', 'as2_to_as1', 'as2_to_as3', 'as3_to_as2', '~BGP_COMMON_EXPORT_POLICY:default~', '~BGP_PEER_EXPORT_POLICY:default:10.23.21.3~', '~BGP_PEER_EXPORT_POLICY:default:2.1.2.1~', '~BGP_PEER_EXPORT_POLICY:default:2.1.2.2~', '~BGP_REDISTRIBUTION_POLICY:default~', '~OSPF_EXPORT_POLICY:default:1~', '~RESOLUTION_POLICY~', '~suppress~rp~summary-only~'] \n",
"1 ['as1_to_as2', 'as1_to_as3', 'as2_to_as1', 'as3_to_as1', '~BGP_COMMON_EXPORT_POLICY:default~', '~BGP_PEER_EXPORT_POLICY:default:1.10.1.1~', '~BGP_PEER_EXPORT_POLICY:default:10.12.11.2~', '~BGP_PEER_EXPORT_POLICY:default:3.2.2.2~', '~BGP_PEER_EXPORT_POLICY:default:5.6.7.8~', '~BGP_REDISTRIBUTION_POLICY:default~', '~OSPF_EXPORT_POLICY:default:1~', '~RESOLUTION_POLICY~'] \n",
"2 ['as1_to_as3', 'as2_to_as3', 'as3_to_as1', 'as3_to_as2', '~BGP_COMMON_EXPORT_POLICY:default~', '~BGP_PEER_EXPORT_POLICY:default:10.13.22.1~', '~BGP_PEER_EXPORT_POLICY:default:3.10.1.1~', '~BGP_REDISTRIBUTION_POLICY:default~', '~OSPF_EXPORT_POLICY:default:1~', '~RESOLUTION_POLICY~'] \n",
"3 ['as1_to_as2', 'as1_to_as3', 'as1_to_as4', 'as2_to_as1', 'as3_to_as1', 'as4_to_as1', '~BGP_COMMON_EXPORT_POLICY:default~', '~BGP_PEER_EXPORT_POLICY:default:1.10.1.1~', '~BGP_PEER_EXPORT_POLICY:default:10.13.22.3~', '~BGP_PEER_EXPORT_POLICY:default:10.14.22.4~', '~BGP_REDISTRIBUTION_POLICY:default~', '~OSPF_EXPORT_POLICY:default:1~', '~RESOLUTION_POLICY~'] \n",
"4 ['as2_to_dept', 'dept_to_as2', '~BGP_COMMON_EXPORT_POLICY:default~', '~BGP_PEER_EXPORT_POLICY:default:2.34.101.3~', '~BGP_PEER_EXPORT_POLICY:default:2.34.201.3~', '~BGP_REDISTRIBUTION_POLICY:default~', '~RESOLUTION_POLICY~'] \n",
"\n",
" SNMP_Source_Interface SNMP_Trap_Servers TACACS_Servers TACACS_Source_Interface VRFs Zones \n",
"0 None [] [] None ['default'] [] \n",
"1 None [] [] None ['default'] [] \n",
"2 None [] [] None ['default'] [] \n",
"3 None [] [] None ['default'] [] \n",
"4 None [] [] None ['default'] [] \n",
"\n",
"[5 rows x 37 columns]"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "9d2ac457",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "1ead2299",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Node as2border2\n",
"AS_Path_Access_Lists []\n",
"Authentication_Key_Chains []\n",
"Community_Match_Exprs ['as1_community', 'as2_community', 'as3_community']\n",
"Community_Set_Exprs []\n",
"Community_Set_Match_Exprs ['as1_community', 'as2_community', 'as3_community']\n",
"Community_Sets []\n",
"Configuration_Format CISCO_IOS\n",
"DNS_Servers []\n",
"DNS_Source_Interface None\n",
"Default_Cross_Zone_Action PERMIT\n",
"Default_Inbound_Action PERMIT\n",
"Domain_Name lab.local\n",
"Hostname as2border2\n",
"IKE_Phase1_Keys []\n",
"IKE_Phase1_Policies []\n",
"IKE_Phase1_Proposals []\n",
"IP6_Access_Lists []\n",
"IP_Access_Lists ['101', '103', 'INSIDE_TO_AS3', 'OUTSIDE_TO_INSIDE']\n",
"IPsec_Peer_Configs []\n",
"IPsec_Phase2_Policies []\n",
"IPsec_Phase2_Proposals []\n",
"Interfaces ['Ethernet0/0', 'GigabitEthernet0/0', 'GigabitEthernet1/0', 'GigabitEthernet2/0', 'Loopback0']\n",
"Logging_Servers []\n",
"Logging_Source_Interface None\n",
"NTP_Servers ['18.18.18.18']\n",
"NTP_Source_Interface None\n",
"PBR_Policies []\n",
"Route6_Filter_Lists []\n",
"Route_Filter_Lists ['101', '103', 'inbound_route_filter', 'outbound_routes', '~MATCH_SUPPRESSED_SUMMARY_ONLY:default~']\n",
"Routing_Policies ['as1_to_as2', 'as2_to_as1', 'as2_to_as3', 'as3_to_as2', '~BGP_COMMON_EXPORT_POLICY:default~', '~BGP_PEER_EXPORT_POLICY:default:10.23.21.3~', '~BGP_PEER_EXPORT_POLICY:default:2.1.2.1~', '~BGP_PEER_EXPORT_POLICY:default:2.1.2.2~', '~BGP_REDISTRIBUTION_POLICY:default~', '~OSPF_EXPORT_POLICY:default:1~', '~RESOLUTION_POLICY~', '~suppress~rp~summary-only~']\n",
"SNMP_Source_Interface None\n",
"SNMP_Trap_Servers []\n",
"TACACS_Servers []\n",
"TACACS_Source_Interface None\n",
"VRFs ['default']\n",
"Zones []\n",
"Name: 0, dtype: object"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "a4d57dcb",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "4e47f1b8",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('generate_questions')"
]
},
{
"cell_type": "markdown",
"id": "7972739e",
"metadata": {},
"source": [
"##### Interface Properties"
]
},
{
"cell_type": "markdown",
"id": "98899db5",
"metadata": {},
"source": [
"Returns configuration settings of interfaces."
]
},
{
"cell_type": "markdown",
"id": "4371031a",
"metadata": {},
"source": [
"Lists interface-level settings of interfaces. Settings for routing protocols, VRFs, and zones etc. that are attached to interfaces are available via other questions."
]
},
{
"cell_type": "markdown",
"id": "4aefb68e",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "bc8c5251",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this specifier. | [NodeSpec](../specifiers.md#node-specifier) | True | \n",
"interfaces | Include interfaces matching this specifier. | [InterfaceSpec](../specifiers.md#interface-specifier) | True | \n",
"properties | Include properties matching this specifier. | [InterfacePropertySpec](../specifiers.md#interface-property-specifier) | True | \n",
"excludeShutInterfaces | Exclude interfaces that are shutdown. | bool | True | "
]
},
{
"cell_type": "markdown",
"id": "240401cd",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "714c1db0",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.interfaceProperties().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "5de08c93",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "a2d44b61",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Interface | Interface | [Interface](../datamodel.rst#pybatfish.datamodel.primitives.Interface)\n",
"Access_VLAN | VLAN number when the switchport mode is access (null otherwise) | int\n",
"Active | Whether the interface is active | bool\n",
"Admin_Up | Whether the interface is administratively enabled | bool\n",
"All_Prefixes | All IPv4 addresses assigned to the interface | List of str\n",
"Allowed_VLANs | Allowed VLAN numbers when the switchport mode is trunk | str\n",
"Auto_State_VLAN | For VLAN interfaces, whether the operational status depends on member switchports | bool\n",
"Bandwidth | Nominal bandwidth in bits/sec, used for protocol cost calculations | float\n",
"Blacklisted | Whether the interface is considered down for maintenance | bool\n",
"Channel_Group | Name of the aggregated interface (e.g., a port channel) to which this interface belongs | str\n",
"Channel_Group_Members | For aggregated interfaces (e.g., a port channel), names of constituent interfaces | List of str\n",
"DHCP_Relay_Addresses | IPv4 addresses to which incoming DHCP requests are relayed | List of str\n",
"Declared_Names | Any aliases explicitly defined for this interface | List of str\n",
"Description | Configured interface description | str\n",
"Encapsulation_VLAN | Number for VLAN encapsulation | int\n",
"HSRP_Groups | HSRP group identifiers | Set of str\n",
"HSRP_Version | HSRP version that will be used | str\n",
"Inactive_Reason | Reason why interface is inactive | str\n",
"Incoming_Filter_Name | Name of the input IPv4 filter | str\n",
"MLAG_ID | MLAG identifier of the interface | int\n",
"MTU | Layer3 MTU of the interface | int\n",
"Native_VLAN | Native VLAN when switchport mode is trunk | int\n",
"Outgoing_Filter_Name | Name of the output IPv4 filter | str\n",
"PBR_Policy_Name | Name of policy-based routing (PBR) policy | str\n",
"Primary_Address | Primary IPv4 address along with the prefix length | str\n",
"Primary_Network | Primary IPv4 subnet, in canonical form | str\n",
"Proxy_ARP | Whether proxy ARP is enabled | bool\n",
"Rip_Enabled | Whether RIP is enabled | bool\n",
"Rip_Passive | Whether interface is in RIP passive mode | bool\n",
"Spanning_Tree_Portfast | Whether spanning-tree portfast feature is enabled | bool\n",
"Speed | Link speed in bits/sec | float\n",
"Switchport | Whether the interface is configured as switchport | bool\n",
"Switchport_Mode | Switchport mode (ACCESS, DOT1Q_TUNNEL, DYNAMIC_AUTO, DYNAMIC_DESIRABLE, FEX_FABRIC, MONITOR, NONE, TAP, TOOL, TRUNK) for switchport interfaces | str\n",
"Switchport_Trunk_Encapsulation | Encapsulation type (DOT1Q, ISL, NEGOTIATE) for switchport trunk interfaces | str\n",
"VRF | Name of the VRF to which the interface belongs | str\n",
"VRRP_Groups | All VRRP groups to which the interface belongs | List of int\n",
"Zone_Name | Name of the firewall zone to which the interface belongs | str"
]
},
{
"cell_type": "markdown",
"id": "a67a37ae",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "40958f4b",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Interface | \n",
" Access_VLAN | \n",
" Active | \n",
" Admin_Up | \n",
" All_Prefixes | \n",
" Allowed_VLANs | \n",
" Auto_State_VLAN | \n",
" Bandwidth | \n",
" Blacklisted | \n",
" Channel_Group | \n",
" Channel_Group_Members | \n",
" DHCP_Relay_Addresses | \n",
" Declared_Names | \n",
" Description | \n",
" Encapsulation_VLAN | \n",
" ... | \n",
" Outgoing_Filter_Name | \n",
" PBR_Policy_Name | \n",
" Primary_Address | \n",
" Primary_Network | \n",
" Proxy_ARP | \n",
" Rip_Enabled | \n",
" Rip_Passive | \n",
" Spanning_Tree_Portfast | \n",
" Speed | \n",
" Switchport | \n",
" Switchport_Mode | \n",
" Switchport_Trunk_Encapsulation | \n",
" VRF | \n",
" VRRP_Groups | \n",
" Zone_Name | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" as1border1[Ethernet0/0] | \n",
" None | \n",
" False | \n",
" False | \n",
" [] | \n",
" | \n",
" True | \n",
" 10000000.0 | \n",
" False | \n",
" None | \n",
" [] | \n",
" [] | \n",
" ['Ethernet0/0'] | \n",
" None | \n",
" None | \n",
" ... | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" True | \n",
" False | \n",
" False | \n",
" False | \n",
" 10000000.0 | \n",
" False | \n",
" NONE | \n",
" DOT1Q | \n",
" default | \n",
" [] | \n",
" None | \n",
"
\n",
" \n",
" | 1 | \n",
" as1border1[GigabitEthernet0/0] | \n",
" None | \n",
" True | \n",
" True | \n",
" ['1.0.1.1/24'] | \n",
" | \n",
" True | \n",
" 1000000000.0 | \n",
" False | \n",
" None | \n",
" [] | \n",
" [] | \n",
" ['GigabitEthernet0/0'] | \n",
" None | \n",
" None | \n",
" ... | \n",
" None | \n",
" None | \n",
" 1.0.1.1/24 | \n",
" 1.0.1.0/24 | \n",
" True | \n",
" False | \n",
" False | \n",
" False | \n",
" 1000000000.0 | \n",
" False | \n",
" NONE | \n",
" DOT1Q | \n",
" default | \n",
" [123] | \n",
" None | \n",
"
\n",
" \n",
" | 2 | \n",
" as1border1[GigabitEthernet1/0] | \n",
" None | \n",
" True | \n",
" True | \n",
" ['10.12.11.1/24'] | \n",
" | \n",
" True | \n",
" 1000000000.0 | \n",
" False | \n",
" None | \n",
" [] | \n",
" [] | \n",
" ['GigabitEthernet1/0'] | \n",
" None | \n",
" None | \n",
" ... | \n",
" None | \n",
" None | \n",
" 10.12.11.1/24 | \n",
" 10.12.11.0/24 | \n",
" True | \n",
" False | \n",
" False | \n",
" False | \n",
" 1000000000.0 | \n",
" False | \n",
" NONE | \n",
" DOT1Q | \n",
" default | \n",
" [] | \n",
" None | \n",
"
\n",
" \n",
" | 3 | \n",
" as1border1[Loopback0] | \n",
" None | \n",
" True | \n",
" True | \n",
" ['1.1.1.1/32'] | \n",
" | \n",
" True | \n",
" 8000000000.0 | \n",
" None | \n",
" None | \n",
" [] | \n",
" [] | \n",
" ['Loopback0'] | \n",
" None | \n",
" None | \n",
" ... | \n",
" None | \n",
" None | \n",
" 1.1.1.1/32 | \n",
" 1.1.1.1/32 | \n",
" True | \n",
" False | \n",
" False | \n",
" False | \n",
" None | \n",
" False | \n",
" NONE | \n",
" DOT1Q | \n",
" default | \n",
" [] | \n",
" None | \n",
"
\n",
" \n",
" | 4 | \n",
" as1border2[Ethernet0/0] | \n",
" None | \n",
" False | \n",
" False | \n",
" [] | \n",
" | \n",
" True | \n",
" 10000000.0 | \n",
" False | \n",
" None | \n",
" [] | \n",
" [] | \n",
" ['Ethernet0/0'] | \n",
" None | \n",
" None | \n",
" ... | \n",
" None | \n",
" None | \n",
" None | \n",
" None | \n",
" True | \n",
" False | \n",
" False | \n",
" False | \n",
" 10000000.0 | \n",
" False | \n",
" NONE | \n",
" DOT1Q | \n",
" default | \n",
" [] | \n",
" None | \n",
"
\n",
" \n",
"
\n",
"
5 rows × 37 columns
\n",
"
"
],
"text/plain": [
" Interface Access_VLAN Active Admin_Up All_Prefixes Allowed_VLANs Auto_State_VLAN Bandwidth Blacklisted Channel_Group Channel_Group_Members DHCP_Relay_Addresses Declared_Names Description Encapsulation_VLAN ... Outgoing_Filter_Name PBR_Policy_Name \\\n",
"0 as1border1[Ethernet0/0] None False False [] True 10000000.0 False None [] [] ['Ethernet0/0'] None None ... None None \n",
"1 as1border1[GigabitEthernet0/0] None True True ['1.0.1.1/24'] True 1000000000.0 False None [] [] ['GigabitEthernet0/0'] None None ... None None \n",
"2 as1border1[GigabitEthernet1/0] None True True ['10.12.11.1/24'] True 1000000000.0 False None [] [] ['GigabitEthernet1/0'] None None ... None None \n",
"3 as1border1[Loopback0] None True True ['1.1.1.1/32'] True 8000000000.0 None None [] [] ['Loopback0'] None None ... None None \n",
"4 as1border2[Ethernet0/0] None False False [] True 10000000.0 False None [] [] ['Ethernet0/0'] None None ... None None \n",
"\n",
" Primary_Address Primary_Network Proxy_ARP Rip_Enabled Rip_Passive Spanning_Tree_Portfast Speed Switchport Switchport_Mode Switchport_Trunk_Encapsulation VRF VRRP_Groups Zone_Name \n",
"0 None None True False False False 10000000.0 False NONE DOT1Q default [] None \n",
"1 1.0.1.1/24 1.0.1.0/24 True False False False 1000000000.0 False NONE DOT1Q default [123] None \n",
"2 10.12.11.1/24 10.12.11.0/24 True False False False 1000000000.0 False NONE DOT1Q default [] None \n",
"3 1.1.1.1/32 1.1.1.1/32 True False False False None False NONE DOT1Q default [] None \n",
"4 None None True False False False 10000000.0 False NONE DOT1Q default [] None \n",
"\n",
"[5 rows x 37 columns]"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "60edd978",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "99f48b5f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Interface as1border1[Ethernet0/0]\n",
"Access_VLAN None\n",
"Active False\n",
"Admin_Up False\n",
"All_Prefixes []\n",
"Allowed_VLANs \n",
"Auto_State_VLAN True\n",
"Bandwidth 10000000.0\n",
"Blacklisted False\n",
"Channel_Group None\n",
"Channel_Group_Members []\n",
"DHCP_Relay_Addresses []\n",
"Declared_Names ['Ethernet0/0']\n",
"Description None\n",
"Encapsulation_VLAN None\n",
"HSRP_Groups []\n",
"HSRP_Version None\n",
"Inactive_Reason Administratively down\n",
"Incoming_Filter_Name None\n",
"MLAG_ID None\n",
"MTU 1500\n",
"Native_VLAN None\n",
"Outgoing_Filter_Name None\n",
"PBR_Policy_Name None\n",
"Primary_Address None\n",
"Primary_Network None\n",
"Proxy_ARP True\n",
"Rip_Enabled False\n",
"Rip_Passive False\n",
"Spanning_Tree_Portfast False\n",
"Speed 10000000.0\n",
"Switchport False\n",
"Switchport_Mode NONE\n",
"Switchport_Trunk_Encapsulation DOT1Q\n",
"VRF default\n",
"VRRP_Groups []\n",
"Zone_Name None\n",
"Name: 0, dtype: object"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "675e75bf",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "fa933412",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('generate_questions')"
]
},
{
"cell_type": "markdown",
"id": "a753331c",
"metadata": {},
"source": [
"##### BGP Process Configuration"
]
},
{
"cell_type": "markdown",
"id": "ff4c3417",
"metadata": {},
"source": [
"Returns configuration settings of BGP processes."
]
},
{
"cell_type": "markdown",
"id": "593d8535",
"metadata": {},
"source": [
"Reports configuration settings for each BGP process on each node and VRF in the network. This question reports only process-wide settings. Peer-specific settings are reported by the bgpPeerConfiguration question."
]
},
{
"cell_type": "markdown",
"id": "5c092255",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "080b5229",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this name or regex. | [NodeSpec](../specifiers.md#node-specifier) | True | \n",
"properties | Include properties matching this regex. | [BgpProcessPropertySpec](../specifiers.md#bgp-process-property-specifier) | True | "
]
},
{
"cell_type": "markdown",
"id": "ebff7ea2",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "735a2445",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.bgpProcessConfiguration().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "3ff50ba6",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "dcca684f",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Node | Node | str\n",
"VRF | VRF | str\n",
"Router_ID | Router ID | str\n",
"Confederation_ID | Externally visible autonomous system number for the confederation | int\n",
"Confederation_Members | Set of autonomous system numbers visible only within this BGP confederation | str\n",
"Multipath_EBGP | Whether multipath routing is enabled for EBGP | bool\n",
"Multipath_IBGP | Whether multipath routing is enabled for IBGP | bool\n",
"Multipath_Match_Mode | Which AS paths are considered equivalent (EXACT_PATH, FIRST_AS, PATH_LENGTH) when multipath BGP is enabled | str\n",
"Neighbors | All peers configured on this process, identified by peer address (for active and dynamic peers) or peer interface (for BGP unnumbered peers) | Set of str\n",
"Route_Reflector | Whether any BGP peer in this process is configured as a route reflector client, for ipv4 unicast address family | bool\n",
"Tie_Breaker | Tie breaking mode (ARRIVAL_ORDER, CLUSTER_LIST_LENGTH, ROUTER_ID) | str"
]
},
{
"cell_type": "markdown",
"id": "2d7c3f9a",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "5ca1796e",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Node | \n",
" VRF | \n",
" Router_ID | \n",
" Confederation_ID | \n",
" Confederation_Members | \n",
" Multipath_EBGP | \n",
" Multipath_IBGP | \n",
" Multipath_Match_Mode | \n",
" Neighbors | \n",
" Route_Reflector | \n",
" Tie_Breaker | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" as1border1 | \n",
" default | \n",
" 1.1.1.1 | \n",
" None | \n",
" None | \n",
" True | \n",
" True | \n",
" EXACT_PATH | \n",
" ['3.2.2.2', '1.10.1.1', '5.6.7.8', '10.12.11.2'] | \n",
" False | \n",
" ARRIVAL_ORDER | \n",
"
\n",
" \n",
" | 1 | \n",
" as1border2 | \n",
" default | \n",
" 1.2.2.2 | \n",
" None | \n",
" None | \n",
" True | \n",
" True | \n",
" EXACT_PATH | \n",
" ['10.14.22.4', '1.10.1.1', '10.13.22.3'] | \n",
" False | \n",
" ARRIVAL_ORDER | \n",
"
\n",
" \n",
" | 2 | \n",
" as1core1 | \n",
" default | \n",
" 1.10.1.1 | \n",
" None | \n",
" None | \n",
" True | \n",
" True | \n",
" EXACT_PATH | \n",
" ['1.1.1.1', '1.2.2.2'] | \n",
" True | \n",
" ARRIVAL_ORDER | \n",
"
\n",
" \n",
" | 3 | \n",
" as2border1 | \n",
" default | \n",
" 2.1.1.1 | \n",
" None | \n",
" None | \n",
" True | \n",
" True | \n",
" EXACT_PATH | \n",
" ['2.1.2.1', '2.1.2.2', '10.12.11.1'] | \n",
" False | \n",
" ARRIVAL_ORDER | \n",
"
\n",
" \n",
" | 4 | \n",
" as2border2 | \n",
" default | \n",
" 2.1.1.2 | \n",
" None | \n",
" None | \n",
" True | \n",
" True | \n",
" EXACT_PATH | \n",
" ['2.1.2.1', '2.1.2.2', '10.23.21.3'] | \n",
" False | \n",
" ARRIVAL_ORDER | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Node VRF Router_ID Confederation_ID Confederation_Members Multipath_EBGP Multipath_IBGP Multipath_Match_Mode Neighbors Route_Reflector Tie_Breaker\n",
"0 as1border1 default 1.1.1.1 None None True True EXACT_PATH ['3.2.2.2', '1.10.1.1', '5.6.7.8', '10.12.11.2'] False ARRIVAL_ORDER\n",
"1 as1border2 default 1.2.2.2 None None True True EXACT_PATH ['10.14.22.4', '1.10.1.1', '10.13.22.3'] False ARRIVAL_ORDER\n",
"2 as1core1 default 1.10.1.1 None None True True EXACT_PATH ['1.1.1.1', '1.2.2.2'] True ARRIVAL_ORDER\n",
"3 as2border1 default 2.1.1.1 None None True True EXACT_PATH ['2.1.2.1', '2.1.2.2', '10.12.11.1'] False ARRIVAL_ORDER\n",
"4 as2border2 default 2.1.1.2 None None True True EXACT_PATH ['2.1.2.1', '2.1.2.2', '10.23.21.3'] False ARRIVAL_ORDER"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "d53b620e",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "7d0c6400",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Node as1border1\n",
"VRF default\n",
"Router_ID 1.1.1.1\n",
"Confederation_ID None\n",
"Confederation_Members None\n",
"Multipath_EBGP True\n",
"Multipath_IBGP True\n",
"Multipath_Match_Mode EXACT_PATH\n",
"Neighbors ['3.2.2.2', '1.10.1.1', '5.6.7.8', '10.12.11.2']\n",
"Route_Reflector False\n",
"Tie_Breaker ARRIVAL_ORDER\n",
"Name: 0, dtype: object"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "a0182d7f",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "7afc21bd",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('generate_questions')"
]
},
{
"cell_type": "markdown",
"id": "29ac72c2",
"metadata": {},
"source": [
"##### BGP Peer Configuration"
]
},
{
"cell_type": "markdown",
"id": "1c00b3a2",
"metadata": {},
"source": [
"Returns configuration settings for BGP peerings."
]
},
{
"cell_type": "markdown",
"id": "7834ef5d",
"metadata": {},
"source": [
"Reports configuration settings for each configured BGP peering on each node in the network. This question reports peer-specific settings. Settings that are process-wide are reported by the bgpProcessConfiguration question."
]
},
{
"cell_type": "markdown",
"id": "2bff6a41",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "9a55abd0",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this name or regex. | [NodeSpec](../specifiers.md#node-specifier) | True | \n",
"properties | Include properties matching this regex. | [BgpPeerPropertySpec](../specifiers.md#bgp-peer-property-specifier) | True | "
]
},
{
"cell_type": "markdown",
"id": "822042e6",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "1155055e",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.bgpPeerConfiguration().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "d0285547",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "9ca3a16f",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Node | Node | str\n",
"VRF | VRF | str\n",
"Local_AS | Local AS number | int\n",
"Local_IP | Local IPv4 address (null for BGP unnumbered peers) | str\n",
"Local_Interface | Local Interface | str\n",
"Confederation | Confederation AS number | int\n",
"Remote_AS | Remote AS numbers with which this peer may establish a session | str\n",
"Remote_IP | Remote IP | str\n",
"Description | Configured peer description | str\n",
"Route_Reflector_Client | Whether this peer is a route reflector client | bool\n",
"Cluster_ID | Cluster ID of this peer (null for peers that are not route reflector clients) | str\n",
"Peer_Group | Name of the BGP peer group to which this peer belongs | str\n",
"Import_Policy | Names of import policies to be applied to routes received by this peer | Set of str\n",
"Export_Policy | Names of export policies to be applied to routes exported by this peer | Set of str\n",
"Send_Community | Whether this peer propagates communities | bool\n",
"Is_Passive | Whether this peer is passive | bool"
]
},
{
"cell_type": "markdown",
"id": "e21da8d4",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "21acf18e",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Node | \n",
" VRF | \n",
" Local_AS | \n",
" Local_IP | \n",
" Local_Interface | \n",
" Confederation | \n",
" Remote_AS | \n",
" Remote_IP | \n",
" Description | \n",
" Route_Reflector_Client | \n",
" Cluster_ID | \n",
" Peer_Group | \n",
" Import_Policy | \n",
" Export_Policy | \n",
" Send_Community | \n",
" Is_Passive | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" as1border1 | \n",
" default | \n",
" 1 | \n",
" None | \n",
" None | \n",
" None | \n",
" 666 | \n",
" 3.2.2.2 | \n",
" None | \n",
" False | \n",
" None | \n",
" bad-ebgp | \n",
" [] | \n",
" [] | \n",
" False | \n",
" False | \n",
"
\n",
" \n",
" | 1 | \n",
" as1border1 | \n",
" default | \n",
" 1 | \n",
" 1.1.1.1 | \n",
" None | \n",
" None | \n",
" 1 | \n",
" 1.10.1.1 | \n",
" None | \n",
" False | \n",
" None | \n",
" as1 | \n",
" [] | \n",
" [] | \n",
" True | \n",
" False | \n",
"
\n",
" \n",
" | 2 | \n",
" as1border1 | \n",
" default | \n",
" 1 | \n",
" None | \n",
" None | \n",
" None | \n",
" 555 | \n",
" 5.6.7.8 | \n",
" None | \n",
" False | \n",
" None | \n",
" xanadu | \n",
" [] | \n",
" [] | \n",
" False | \n",
" False | \n",
"
\n",
" \n",
" | 3 | \n",
" as1border1 | \n",
" default | \n",
" 1 | \n",
" 10.12.11.1 | \n",
" None | \n",
" None | \n",
" 2 | \n",
" 10.12.11.2 | \n",
" None | \n",
" False | \n",
" None | \n",
" as2 | \n",
" ['as2_to_as1'] | \n",
" ['as1_to_as2'] | \n",
" True | \n",
" False | \n",
"
\n",
" \n",
" | 4 | \n",
" as1border2 | \n",
" default | \n",
" 1 | \n",
" 10.14.22.1 | \n",
" None | \n",
" None | \n",
" 4 | \n",
" 10.14.22.4 | \n",
" None | \n",
" False | \n",
" None | \n",
" as4 | \n",
" ['as4_to_as1'] | \n",
" ['as1_to_as4'] | \n",
" False | \n",
" False | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Node VRF Local_AS Local_IP Local_Interface Confederation Remote_AS Remote_IP Description Route_Reflector_Client Cluster_ID Peer_Group Import_Policy Export_Policy Send_Community Is_Passive\n",
"0 as1border1 default 1 None None None 666 3.2.2.2 None False None bad-ebgp [] [] False False\n",
"1 as1border1 default 1 1.1.1.1 None None 1 1.10.1.1 None False None as1 [] [] True False\n",
"2 as1border1 default 1 None None None 555 5.6.7.8 None False None xanadu [] [] False False\n",
"3 as1border1 default 1 10.12.11.1 None None 2 10.12.11.2 None False None as2 ['as2_to_as1'] ['as1_to_as2'] True False\n",
"4 as1border2 default 1 10.14.22.1 None None 4 10.14.22.4 None False None as4 ['as4_to_as1'] ['as1_to_as4'] False False"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "26aaf2bb",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "700ffeef",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Node as1border1\n",
"VRF default\n",
"Local_AS 1\n",
"Local_IP None\n",
"Local_Interface None\n",
"Confederation None\n",
"Remote_AS 666\n",
"Remote_IP 3.2.2.2\n",
"Description None\n",
"Route_Reflector_Client False\n",
"Cluster_ID None\n",
"Peer_Group bad-ebgp\n",
"Import_Policy []\n",
"Export_Policy []\n",
"Send_Community False\n",
"Is_Passive False\n",
"Name: 0, dtype: object"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "a1515a37",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "6ce338d8",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'ios_basic_hsrp'"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('ios_basic_hsrp')"
]
},
{
"cell_type": "markdown",
"id": "d7c8261d",
"metadata": {},
"source": [
"##### HSRP Properties"
]
},
{
"cell_type": "markdown",
"id": "a1a13aef",
"metadata": {},
"source": [
"Returns configuration settings of HSRP groups."
]
},
{
"cell_type": "markdown",
"id": "a2c53fd1",
"metadata": {},
"source": [
"Lists information about HSRP groups on interfaces."
]
},
{
"cell_type": "markdown",
"id": "f4fdce71",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "7db7e6cf",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this specifier. | [NodeSpec](../specifiers.md#node-specifier) | True | \n",
"interfaces | Include interfaces matching this specifier. | [InterfaceSpec](../specifiers.md#interface-specifier) | True | \n",
"virtualAddresses | Include only groups with at least one virtual address matching this specifier. | [IpSpec](../specifiers.md#ip-specifier) | True | \n",
"excludeShutInterfaces | Exclude interfaces that are shutdown. | bool | True | "
]
},
{
"cell_type": "markdown",
"id": "1e9a86b5",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "3c310f6e",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.hsrpProperties().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "53814f6b",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "6be14887",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Interface | Interface | [Interface](../datamodel.rst#pybatfish.datamodel.primitives.Interface)\n",
"Group_Id | HSRP Group ID | int\n",
"Virtual_Addresses | Virtual Addresses | Set of str\n",
"Source_Address | Source Address used for HSRP messages | str\n",
"Priority | HSRP router priority | int\n",
"Preempt | Whether preemption is allowed | bool\n",
"Active | Whether the interface is active | bool"
]
},
{
"cell_type": "markdown",
"id": "54f4a0d0",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "64d92886",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Interface | \n",
" Group_Id | \n",
" Virtual_Addresses | \n",
" Source_Address | \n",
" Priority | \n",
" Preempt | \n",
" Active | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" br2[GigabitEthernet0/2] | \n",
" 12 | \n",
" ['192.168.1.254'] | \n",
" 192.168.1.2/24 | \n",
" 100 | \n",
" False | \n",
" True | \n",
"
\n",
" \n",
" | 1 | \n",
" br1[GigabitEthernet0/2] | \n",
" 12 | \n",
" ['192.168.1.254'] | \n",
" 192.168.1.1/24 | \n",
" 110 | \n",
" False | \n",
" True | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Interface Group_Id Virtual_Addresses Source_Address Priority Preempt Active\n",
"0 br2[GigabitEthernet0/2] 12 ['192.168.1.254'] 192.168.1.2/24 100 False True\n",
"1 br1[GigabitEthernet0/2] 12 ['192.168.1.254'] 192.168.1.1/24 110 False True"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "5e146e19",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "07ce9f98",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Interface br2[GigabitEthernet0/2]\n",
"Group_Id 12\n",
"Virtual_Addresses ['192.168.1.254']\n",
"Source_Address 192.168.1.2/24\n",
"Priority 100\n",
"Preempt False\n",
"Active True\n",
"Name: 0, dtype: object"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "18a05f07",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "70f3b7ea",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('generate_questions')"
]
},
{
"cell_type": "markdown",
"id": "7213cebb",
"metadata": {},
"source": [
"##### OSPF Process Configuration"
]
},
{
"cell_type": "markdown",
"id": "27774e32",
"metadata": {},
"source": [
"Returns configuration parameters for OSPF routing processes."
]
},
{
"cell_type": "markdown",
"id": "8aa4bd8a",
"metadata": {},
"source": [
"Returns the values of important properties for all OSPF processes running across the network."
]
},
{
"cell_type": "markdown",
"id": "3a7109ae",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "ae04ae4c",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this name or regex. | [NodeSpec](../specifiers.md#node-specifier) | True | \n",
"properties | Include properties matching this specifier. | [OspfProcessPropertySpec](../specifiers.md#ospf-process-property-specifier) | True | "
]
},
{
"cell_type": "markdown",
"id": "6e694693",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "f843a24d",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.ospfProcessConfiguration().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "7ccb1e7d",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "5d823d4d",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Node | Node | str\n",
"VRF | VRF name | str\n",
"Process_ID | Process ID | str\n",
"Areas | All OSPF areas for this process | Set of str\n",
"Reference_Bandwidth | Reference bandwidth in bits/sec used to calculate interface OSPF cost | float\n",
"Router_ID | Router ID of the process | str\n",
"Export_Policy_Sources | Names of policies that determine which routes are exported into OSPF | Set of str\n",
"Area_Border_Router | Whether this process is at the area border (with at least one interface in Area 0 and one in another area) | bool"
]
},
{
"cell_type": "markdown",
"id": "48d25167",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "9600f1a0",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Node | \n",
" VRF | \n",
" Process_ID | \n",
" Areas | \n",
" Reference_Bandwidth | \n",
" Router_ID | \n",
" Export_Policy_Sources | \n",
" Area_Border_Router | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" as2border1 | \n",
" default | \n",
" 1 | \n",
" ['1'] | \n",
" 100000000.0 | \n",
" 2.1.1.1 | \n",
" [] | \n",
" False | \n",
"
\n",
" \n",
" | 1 | \n",
" as2core1 | \n",
" default | \n",
" 1 | \n",
" ['1'] | \n",
" 100000000.0 | \n",
" 2.1.2.1 | \n",
" [] | \n",
" False | \n",
"
\n",
" \n",
" | 2 | \n",
" as2dist1 | \n",
" default | \n",
" 1 | \n",
" ['1'] | \n",
" 100000000.0 | \n",
" 2.1.3.1 | \n",
" [] | \n",
" False | \n",
"
\n",
" \n",
" | 3 | \n",
" as2dist2 | \n",
" default | \n",
" 1 | \n",
" ['1'] | \n",
" 100000000.0 | \n",
" 2.1.3.2 | \n",
" [] | \n",
" False | \n",
"
\n",
" \n",
" | 4 | \n",
" as1border2 | \n",
" default | \n",
" 1 | \n",
" ['1'] | \n",
" 100000000.0 | \n",
" 1.2.2.2 | \n",
" [] | \n",
" False | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Node VRF Process_ID Areas Reference_Bandwidth Router_ID Export_Policy_Sources Area_Border_Router\n",
"0 as2border1 default 1 ['1'] 100000000.0 2.1.1.1 [] False\n",
"1 as2core1 default 1 ['1'] 100000000.0 2.1.2.1 [] False\n",
"2 as2dist1 default 1 ['1'] 100000000.0 2.1.3.1 [] False\n",
"3 as2dist2 default 1 ['1'] 100000000.0 2.1.3.2 [] False\n",
"4 as1border2 default 1 ['1'] 100000000.0 1.2.2.2 [] False"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "9c514bcd",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "f4900e27",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Node as2border1\n",
"VRF default\n",
"Process_ID 1\n",
"Areas ['1']\n",
"Reference_Bandwidth 100000000.0\n",
"Router_ID 2.1.1.1\n",
"Export_Policy_Sources []\n",
"Area_Border_Router False\n",
"Name: 0, dtype: object"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "3c09fc4a",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "ad832427",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('generate_questions')"
]
},
{
"cell_type": "markdown",
"id": "8f6bd680",
"metadata": {},
"source": [
"##### OSPF Interface Configuration"
]
},
{
"cell_type": "markdown",
"id": "3af1e988",
"metadata": {},
"source": [
"Returns OSPF configuration of interfaces."
]
},
{
"cell_type": "markdown",
"id": "db9d0a55",
"metadata": {},
"source": [
"Returns the interface level OSPF configuration details for the interfaces in the network which run OSPF."
]
},
{
"cell_type": "markdown",
"id": "efc1ba4f",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "1afdc7d1",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this specifier. | [NodeSpec](../specifiers.md#node-specifier) | True | \n",
"properties | Include properties matching this specifier. | [OspfInterfacePropertySpec](../specifiers.md#ospf-interface-property-specifier) | True | "
]
},
{
"cell_type": "markdown",
"id": "c20197c4",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "8e1e1fae",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.ospfInterfaceConfiguration().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "031dab12",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "04586eeb",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Interface | Interface | [Interface](../datamodel.rst#pybatfish.datamodel.primitives.Interface)\n",
"VRF | VRF name | str\n",
"Process_ID | Process ID | str\n",
"OSPF_Area_Name | OSPF area to which the interface belongs | int\n",
"OSPF_Enabled | Whether OSPF is enabled | bool\n",
"OSPF_Passive | Whether interface is in OSPF passive mode | bool\n",
"OSPF_Cost | OSPF cost if explicitly configured | int\n",
"OSPF_Network_Type | Type of OSPF network associated with the interface | str\n",
"OSPF_Hello_Interval | Interval in seconds between sending OSPF hello messages | int\n",
"OSPF_Dead_Interval | Interval in seconds before a silent OSPF neighbor is declared dead | int"
]
},
{
"cell_type": "markdown",
"id": "a14a3734",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 36,
"id": "a7b0b012",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Interface | \n",
" VRF | \n",
" Process_ID | \n",
" OSPF_Area_Name | \n",
" OSPF_Enabled | \n",
" OSPF_Passive | \n",
" OSPF_Cost | \n",
" OSPF_Network_Type | \n",
" OSPF_Hello_Interval | \n",
" OSPF_Dead_Interval | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" as1core1[GigabitEthernet1/0] | \n",
" default | \n",
" 1 | \n",
" 1 | \n",
" True | \n",
" False | \n",
" 1 | \n",
" BROADCAST | \n",
" 10 | \n",
" 40 | \n",
"
\n",
" \n",
" | 1 | \n",
" as1core1[GigabitEthernet0/0] | \n",
" default | \n",
" 1 | \n",
" 1 | \n",
" True | \n",
" False | \n",
" 1 | \n",
" BROADCAST | \n",
" 10 | \n",
" 40 | \n",
"
\n",
" \n",
" | 2 | \n",
" as2dist1[Loopback0] | \n",
" default | \n",
" 1 | \n",
" 1 | \n",
" True | \n",
" False | \n",
" 1 | \n",
" BROADCAST | \n",
" 10 | \n",
" 40 | \n",
"
\n",
" \n",
" | 3 | \n",
" as3core1[GigabitEthernet0/0] | \n",
" default | \n",
" 1 | \n",
" 1 | \n",
" True | \n",
" False | \n",
" 1 | \n",
" BROADCAST | \n",
" 10 | \n",
" 40 | \n",
"
\n",
" \n",
" | 4 | \n",
" as3core1[GigabitEthernet1/0] | \n",
" default | \n",
" 1 | \n",
" 1 | \n",
" True | \n",
" False | \n",
" 1 | \n",
" BROADCAST | \n",
" 10 | \n",
" 40 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Interface VRF Process_ID OSPF_Area_Name OSPF_Enabled OSPF_Passive OSPF_Cost OSPF_Network_Type OSPF_Hello_Interval OSPF_Dead_Interval\n",
"0 as1core1[GigabitEthernet1/0] default 1 1 True False 1 BROADCAST 10 40\n",
"1 as1core1[GigabitEthernet0/0] default 1 1 True False 1 BROADCAST 10 40\n",
"2 as2dist1[Loopback0] default 1 1 True False 1 BROADCAST 10 40\n",
"3 as3core1[GigabitEthernet0/0] default 1 1 True False 1 BROADCAST 10 40\n",
"4 as3core1[GigabitEthernet1/0] default 1 1 True False 1 BROADCAST 10 40"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "82a3b683",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 37,
"id": "a6040ec2",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Interface as1core1[GigabitEthernet1/0]\n",
"VRF default\n",
"Process_ID 1\n",
"OSPF_Area_Name 1\n",
"OSPF_Enabled True\n",
"OSPF_Passive False\n",
"OSPF_Cost 1\n",
"OSPF_Network_Type BROADCAST\n",
"OSPF_Hello_Interval 10\n",
"OSPF_Dead_Interval 40\n",
"Name: 0, dtype: object"
]
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 38,
"id": "a4c836d2",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 39,
"id": "9945f459",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 39,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('generate_questions')"
]
},
{
"cell_type": "markdown",
"id": "2317c605",
"metadata": {},
"source": [
"##### OSPF Area Configuration"
]
},
{
"cell_type": "markdown",
"id": "709e3014",
"metadata": {},
"source": [
"Returns configuration parameters of OSPF areas."
]
},
{
"cell_type": "markdown",
"id": "930baa50",
"metadata": {},
"source": [
"Returns information about all OSPF areas defined across the network."
]
},
{
"cell_type": "markdown",
"id": "8d01a5d9",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "827858d1",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this name or regex. | [NodeSpec](../specifiers.md#node-specifier) | True | "
]
},
{
"cell_type": "markdown",
"id": "bec350d9",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 40,
"id": "c82727be",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.ospfAreaConfiguration().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "afe5b857",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "3b016582",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Node | Node | str\n",
"VRF | VRF | str\n",
"Process_ID | Process ID | str\n",
"Area | Area number | str\n",
"Area_Type | Area type | str\n",
"Active_Interfaces | Names of active interfaces | Set of str\n",
"Passive_Interfaces | Names of passive interfaces | Set of str"
]
},
{
"cell_type": "markdown",
"id": "5f9a0608",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 41,
"id": "d5caa320",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Node | \n",
" VRF | \n",
" Process_ID | \n",
" Area | \n",
" Area_Type | \n",
" Active_Interfaces | \n",
" Passive_Interfaces | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" as2dist2 | \n",
" default | \n",
" 1 | \n",
" 1 | \n",
" NONE | \n",
" ['GigabitEthernet0/0', 'GigabitEthernet1/0', 'Loopback0'] | \n",
" [] | \n",
"
\n",
" \n",
" | 1 | \n",
" as2border2 | \n",
" default | \n",
" 1 | \n",
" 1 | \n",
" NONE | \n",
" ['GigabitEthernet1/0', 'GigabitEthernet2/0', 'Loopback0'] | \n",
" [] | \n",
"
\n",
" \n",
" | 2 | \n",
" as3core1 | \n",
" default | \n",
" 1 | \n",
" 1 | \n",
" NONE | \n",
" ['GigabitEthernet0/0', 'GigabitEthernet1/0', 'Loopback0'] | \n",
" [] | \n",
"
\n",
" \n",
" | 3 | \n",
" as2core1 | \n",
" default | \n",
" 1 | \n",
" 1 | \n",
" NONE | \n",
" ['GigabitEthernet0/0', 'GigabitEthernet1/0', 'GigabitEthernet2/0', 'GigabitEthernet3/0', 'Loopback0'] | \n",
" [] | \n",
"
\n",
" \n",
" | 4 | \n",
" as1border2 | \n",
" default | \n",
" 1 | \n",
" 1 | \n",
" NONE | \n",
" ['GigabitEthernet1/0', 'Loopback0'] | \n",
" [] | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Node VRF Process_ID Area Area_Type Active_Interfaces Passive_Interfaces\n",
"0 as2dist2 default 1 1 NONE ['GigabitEthernet0/0', 'GigabitEthernet1/0', 'Loopback0'] []\n",
"1 as2border2 default 1 1 NONE ['GigabitEthernet1/0', 'GigabitEthernet2/0', 'Loopback0'] []\n",
"2 as3core1 default 1 1 NONE ['GigabitEthernet0/0', 'GigabitEthernet1/0', 'Loopback0'] []\n",
"3 as2core1 default 1 1 NONE ['GigabitEthernet0/0', 'GigabitEthernet1/0', 'GigabitEthernet2/0', 'GigabitEthernet3/0', 'Loopback0'] []\n",
"4 as1border2 default 1 1 NONE ['GigabitEthernet1/0', 'Loopback0'] []"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "d11abbc8",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 42,
"id": "dec95e31",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Node as2dist2\n",
"VRF default\n",
"Process_ID 1\n",
"Area 1\n",
"Area_Type NONE\n",
"Active_Interfaces ['GigabitEthernet0/0', 'GigabitEthernet1/0', 'Loopback0']\n",
"Passive_Interfaces []\n",
"Name: 0, dtype: object"
]
},
"execution_count": 42,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "eba76973",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 44,
"id": "8ea2dead",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'aristaevpn'"
]
},
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('aristaevpn')"
]
},
{
"cell_type": "markdown",
"id": "42ab7d9d",
"metadata": {},
"source": [
"##### Multi-chassis LAG"
]
},
{
"cell_type": "markdown",
"id": "e581ce72",
"metadata": {},
"source": [
"Returns MLAG configuration."
]
},
{
"cell_type": "markdown",
"id": "5d61cd78",
"metadata": {},
"source": [
"Lists the configuration settings for each MLAG domain in the network."
]
},
{
"cell_type": "markdown",
"id": "71f0ab0f",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "c73dabec",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this specifier. | [NodeSpec](../specifiers.md#node-specifier) | True | \n",
"mlagIds | Include MLAG IDs matching this specifier. | [MlagIdSpec](../specifiers.md#mlag-id-specifier) | True | "
]
},
{
"cell_type": "markdown",
"id": "266e1968",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 45,
"id": "cf7918d8",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.mlagProperties().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "0f320545",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "3eb37af1",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Node | Node name | str\n",
"MLAG_ID | MLAG domain ID | str\n",
"Peer_Address | Peer's IP address | str\n",
"Local_Interface | Local interface used for MLAG peering | [Interface](../datamodel.rst#pybatfish.datamodel.primitives.Interface)\n",
"Source_Interface | Local interface used as source-interface for MLAG peering | [Interface](../datamodel.rst#pybatfish.datamodel.primitives.Interface)"
]
},
{
"cell_type": "markdown",
"id": "3d9ae076",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 46,
"id": "2ac4d877",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Node | \n",
" MLAG_ID | \n",
" Peer_Address | \n",
" Local_Interface | \n",
" Source_Interface | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" dc1-bl1a | \n",
" DC1_BL1 | \n",
" 10.255.252.11 | \n",
" dc1-bl1a[Port-Channel3] | \n",
" dc1-bl1a[Vlan4094] | \n",
"
\n",
" \n",
" | 1 | \n",
" dc1-bl1b | \n",
" DC1_BL1 | \n",
" 10.255.252.10 | \n",
" dc1-bl1b[Port-Channel3] | \n",
" dc1-bl1b[Vlan4094] | \n",
"
\n",
" \n",
" | 2 | \n",
" dc1-l2leaf5a | \n",
" DC1_L2LEAF5 | \n",
" 10.255.252.19 | \n",
" dc1-l2leaf5a[Port-Channel3] | \n",
" dc1-l2leaf5a[Vlan4094] | \n",
"
\n",
" \n",
" | 3 | \n",
" dc1-l2leaf5b | \n",
" DC1_L2LEAF5 | \n",
" 10.255.252.18 | \n",
" dc1-l2leaf5b[Port-Channel3] | \n",
" dc1-l2leaf5b[Vlan4094] | \n",
"
\n",
" \n",
" | 4 | \n",
" dc1-l2leaf6a | \n",
" DC1_L2LEAF6 | \n",
" 10.255.252.23 | \n",
" dc1-l2leaf6a[Port-Channel3] | \n",
" dc1-l2leaf6a[Vlan4094] | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Node MLAG_ID Peer_Address Local_Interface Source_Interface\n",
"0 dc1-bl1a DC1_BL1 10.255.252.11 dc1-bl1a[Port-Channel3] dc1-bl1a[Vlan4094]\n",
"1 dc1-bl1b DC1_BL1 10.255.252.10 dc1-bl1b[Port-Channel3] dc1-bl1b[Vlan4094]\n",
"2 dc1-l2leaf5a DC1_L2LEAF5 10.255.252.19 dc1-l2leaf5a[Port-Channel3] dc1-l2leaf5a[Vlan4094]\n",
"3 dc1-l2leaf5b DC1_L2LEAF5 10.255.252.18 dc1-l2leaf5b[Port-Channel3] dc1-l2leaf5b[Vlan4094]\n",
"4 dc1-l2leaf6a DC1_L2LEAF6 10.255.252.23 dc1-l2leaf6a[Port-Channel3] dc1-l2leaf6a[Vlan4094]"
]
},
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "22a4cdc2",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 47,
"id": "e9538e95",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Node dc1-bl1a\n",
"MLAG_ID DC1_BL1\n",
"Peer_Address 10.255.252.11\n",
"Local_Interface dc1-bl1a[Port-Channel3]\n",
"Source_Interface dc1-bl1a[Vlan4094]\n",
"Name: 0, dtype: object"
]
},
"execution_count": 47,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 48,
"id": "8ce45fda",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 48,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 49,
"id": "35b1e753",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('generate_questions')"
]
},
{
"cell_type": "markdown",
"id": "c00ec5aa",
"metadata": {},
"source": [
"##### IP Owners"
]
},
{
"cell_type": "markdown",
"id": "b1d7a853",
"metadata": {},
"source": [
"Returns where IP addresses are attached in the network."
]
},
{
"cell_type": "markdown",
"id": "9591de1b",
"metadata": {},
"source": [
"For each device, lists the mapping from IPs to corresponding interface(s) and VRF(s)."
]
},
{
"cell_type": "markdown",
"id": "c3eb60ae",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "3eeb4f14",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"ips | Restrict output to only specified IP addresses. | [IpSpec](../specifiers.md#ip-specifier) | True | \n",
"duplicatesOnly | Restrict output to only IP addresses that are duplicated (configured on a different node or VRF) in the snapshot. | bool | False | False"
]
},
{
"cell_type": "markdown",
"id": "e91b9fdd",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 50,
"id": "7df44a92",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.ipOwners().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "81bf71f5",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "edc62bc1",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Node | Node hostname | str\n",
"VRF | VRF name | str\n",
"Interface | Interface name | str\n",
"IP | IP address | str\n",
"Mask | Network mask length | int\n",
"Active | Whether the interface is active | bool"
]
},
{
"cell_type": "markdown",
"id": "bef9e90e",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 51,
"id": "103383a1",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Node | \n",
" VRF | \n",
" Interface | \n",
" IP | \n",
" Mask | \n",
" Active | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" as2dist2 | \n",
" default | \n",
" Loopback0 | \n",
" 2.1.3.2 | \n",
" 32 | \n",
" True | \n",
"
\n",
" \n",
" | 1 | \n",
" as2dist1 | \n",
" default | \n",
" Loopback0 | \n",
" 2.1.3.1 | \n",
" 32 | \n",
" True | \n",
"
\n",
" \n",
" | 2 | \n",
" as2dept1 | \n",
" default | \n",
" GigabitEthernet1/0 | \n",
" 2.34.201.4 | \n",
" 24 | \n",
" True | \n",
"
\n",
" \n",
" | 3 | \n",
" as2dept1 | \n",
" default | \n",
" Loopback0 | \n",
" 2.1.1.2 | \n",
" 32 | \n",
" True | \n",
"
\n",
" \n",
" | 4 | \n",
" as3border2 | \n",
" default | \n",
" GigabitEthernet1/0 | \n",
" 3.0.2.1 | \n",
" 24 | \n",
" True | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Node VRF Interface IP Mask Active\n",
"0 as2dist2 default Loopback0 2.1.3.2 32 True\n",
"1 as2dist1 default Loopback0 2.1.3.1 32 True\n",
"2 as2dept1 default GigabitEthernet1/0 2.34.201.4 24 True\n",
"3 as2dept1 default Loopback0 2.1.1.2 32 True\n",
"4 as3border2 default GigabitEthernet1/0 3.0.2.1 24 True"
]
},
"execution_count": 51,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "f9bf0d36",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 52,
"id": "15c5db2d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Node as2dist2\n",
"VRF default\n",
"Interface Loopback0\n",
"IP 2.1.3.2\n",
"Mask 32\n",
"Active True\n",
"Name: 0, dtype: object"
]
},
"execution_count": 52,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 53,
"id": "fbef0611",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 53,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 54,
"id": "3528f90a",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 54,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('generate_questions')"
]
},
{
"cell_type": "markdown",
"id": "531c1d1a",
"metadata": {},
"source": [
"##### Named Structures"
]
},
{
"cell_type": "markdown",
"id": "8d245346",
"metadata": {},
"source": [
"Returns named structure definitions."
]
},
{
"cell_type": "markdown",
"id": "e7c3139b",
"metadata": {},
"source": [
"Return structures defined in the configurations, represented in a vendor-independent JSON format."
]
},
{
"cell_type": "markdown",
"id": "55070c60",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "b0167f22",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this specifier. | [NodeSpec](../specifiers.md#node-specifier) | True | \n",
"structureTypes | Include structures of this type. | [NamedStructureSpec](../specifiers.md#named-structure-specifier) | True | \n",
"structureNames | Include structures matching this name or regex. | str | True | \n",
"ignoreGenerated | Whether to ignore auto-generated structures. | bool | True | True\n",
"indicatePresence | Output if the structure is present or absent. | bool | True | "
]
},
{
"cell_type": "markdown",
"id": "7989b412",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 55,
"id": "5bbff00c",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.namedStructures().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "73c98c3e",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "06006b99",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Node | Node | str\n",
"Structure_Type | Structure type | str\n",
"Structure_Name | Structure name | str\n",
"Structure_Definition | Structure definition | dict"
]
},
{
"cell_type": "markdown",
"id": "134a10d3",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 56,
"id": "3c112732",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Node | \n",
" Structure_Type | \n",
" Structure_Name | \n",
" Structure_Definition | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" as1border1 | \n",
" Community_Set_Match_Expr | \n",
" as1_community | \n",
" {'expr': {'class': 'org.batfish.datamodel.routing_policy.communities.CommunityMatchRegex', 'communityRendering': {'class': 'org.batfish.datamodel.routing_policy.communities.ColonSeparatedRendering'}, 'regex': '(,|\\{|\\}|^|$| )1:'}} | \n",
"
\n",
" \n",
" | 1 | \n",
" as1border2 | \n",
" Community_Set_Match_Expr | \n",
" as1_community | \n",
" {'expr': {'class': 'org.batfish.datamodel.routing_policy.communities.CommunityMatchRegex', 'communityRendering': {'class': 'org.batfish.datamodel.routing_policy.communities.ColonSeparatedRendering'}, 'regex': '(,|\\{|\\}|^|$| )1:'}} | \n",
"
\n",
" \n",
" | 2 | \n",
" as2border1 | \n",
" Community_Set_Match_Expr | \n",
" as1_community | \n",
" {'expr': {'class': 'org.batfish.datamodel.routing_policy.communities.CommunityMatchRegex', 'communityRendering': {'class': 'org.batfish.datamodel.routing_policy.communities.ColonSeparatedRendering'}, 'regex': '(,|\\{|\\}|^|$| )1:'}} | \n",
"
\n",
" \n",
" | 3 | \n",
" as2border2 | \n",
" Community_Set_Match_Expr | \n",
" as1_community | \n",
" {'expr': {'class': 'org.batfish.datamodel.routing_policy.communities.CommunityMatchRegex', 'communityRendering': {'class': 'org.batfish.datamodel.routing_policy.communities.ColonSeparatedRendering'}, 'regex': '(,|\\{|\\}|^|$| )1:'}} | \n",
"
\n",
" \n",
" | 4 | \n",
" as3border1 | \n",
" Community_Set_Match_Expr | \n",
" as1_community | \n",
" {'expr': {'class': 'org.batfish.datamodel.routing_policy.communities.CommunityMatchRegex', 'communityRendering': {'class': 'org.batfish.datamodel.routing_policy.communities.ColonSeparatedRendering'}, 'regex': '(,|\\{|\\}|^|$| )1:'}} | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Node Structure_Type Structure_Name Structure_Definition\n",
"0 as1border1 Community_Set_Match_Expr as1_community {'expr': {'class': 'org.batfish.datamodel.routing_policy.communities.CommunityMatchRegex', 'communityRendering': {'class': 'org.batfish.datamodel.routing_policy.communities.ColonSeparatedRendering'}, 'regex': '(,|\\{|\\}|^|$| )1:'}}\n",
"1 as1border2 Community_Set_Match_Expr as1_community {'expr': {'class': 'org.batfish.datamodel.routing_policy.communities.CommunityMatchRegex', 'communityRendering': {'class': 'org.batfish.datamodel.routing_policy.communities.ColonSeparatedRendering'}, 'regex': '(,|\\{|\\}|^|$| )1:'}}\n",
"2 as2border1 Community_Set_Match_Expr as1_community {'expr': {'class': 'org.batfish.datamodel.routing_policy.communities.CommunityMatchRegex', 'communityRendering': {'class': 'org.batfish.datamodel.routing_policy.communities.ColonSeparatedRendering'}, 'regex': '(,|\\{|\\}|^|$| )1:'}}\n",
"3 as2border2 Community_Set_Match_Expr as1_community {'expr': {'class': 'org.batfish.datamodel.routing_policy.communities.CommunityMatchRegex', 'communityRendering': {'class': 'org.batfish.datamodel.routing_policy.communities.ColonSeparatedRendering'}, 'regex': '(,|\\{|\\}|^|$| )1:'}}\n",
"4 as3border1 Community_Set_Match_Expr as1_community {'expr': {'class': 'org.batfish.datamodel.routing_policy.communities.CommunityMatchRegex', 'communityRendering': {'class': 'org.batfish.datamodel.routing_policy.communities.ColonSeparatedRendering'}, 'regex': '(,|\\{|\\}|^|$| )1:'}}"
]
},
"execution_count": 56,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "4c483b06",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 57,
"id": "ea8b9c3a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Node as1border1\n",
"Structure_Type Community_Set_Match_Expr\n",
"Structure_Name as1_community\n",
"Structure_Definition {'expr': {'class': 'org.batfish.datamodel.routing_policy.communities.CommunityMatchRegex', 'communityRendering': {'class': 'org.batfish.datamodel.routing_policy.communities.ColonSeparatedRendering'}, 'regex': '(,|\\{|\\}|^|$| )1:'}}\n",
"Name: 0, dtype: object"
]
},
"execution_count": 57,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 58,
"id": "26d87bdb",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 58,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 59,
"id": "66472645",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 59,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('generate_questions')"
]
},
{
"cell_type": "markdown",
"id": "fec2ca70",
"metadata": {},
"source": [
"##### Defined Structures"
]
},
{
"cell_type": "markdown",
"id": "101b4afe",
"metadata": {},
"source": [
"Lists the structures defined in the network."
]
},
{
"cell_type": "markdown",
"id": "34f0ebcb",
"metadata": {},
"source": [
"Lists the structures defined in the network, along with the files and line numbers in which they are defined."
]
},
{
"cell_type": "markdown",
"id": "4cd1d77f",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "913ca8f3",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"filename | Include structures defined in the given file. | str | True | \n",
"nodes | Include files used to generate nodes whose name matches this specifier. | [NodeSpec](../specifiers.md#node-specifier) | True | .*\n",
"names | Include structures whose name matches this string or regex. | str | True | .*\n",
"types | Include structures whose vendor-specific type matches this string or regex. | str | True | .*"
]
},
{
"cell_type": "markdown",
"id": "eab89bd5",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 60,
"id": "a40311c7",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.definedStructures().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "c88f5ee3",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "4b08a0e1",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Structure_Type | Vendor-specific type of the structure | str\n",
"Structure_Name | Name of the structure | str\n",
"Source_Lines | File and line numbers where the structure is defined | [FileLines](../datamodel.rst#pybatfish.datamodel.primitives.FileLines)"
]
},
{
"cell_type": "markdown",
"id": "90324cdc",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 61,
"id": "5401a46b",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Structure_Type | \n",
" Structure_Name | \n",
" Source_Lines | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" extended ipv4 access-list line | \n",
" OUTSIDE_TO_INSIDE: permit ip any any | \n",
" configs/as2border1.cfg:[137] | \n",
"
\n",
" \n",
" | 1 | \n",
" extended ipv4 access-list line | \n",
" blocktelnet: deny tcp any any eq telnet | \n",
" configs/as2core1.cfg:[122] | \n",
"
\n",
" \n",
" | 2 | \n",
" interface | \n",
" GigabitEthernet1/0 | \n",
" configs/as1core1.cfg:[69, 70, 71] | \n",
"
\n",
" \n",
" | 3 | \n",
" route-map-clause | \n",
" as3_to_as2 1 | \n",
" configs/as3border1.cfg:[146, 147, 148, 149] | \n",
"
\n",
" \n",
" | 4 | \n",
" extended ipv4 access-list | \n",
" 101 | \n",
" configs/as2border2.cfg:[140, 141] | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Structure_Type Structure_Name Source_Lines\n",
"0 extended ipv4 access-list line OUTSIDE_TO_INSIDE: permit ip any any configs/as2border1.cfg:[137]\n",
"1 extended ipv4 access-list line blocktelnet: deny tcp any any eq telnet configs/as2core1.cfg:[122]\n",
"2 interface GigabitEthernet1/0 configs/as1core1.cfg:[69, 70, 71]\n",
"3 route-map-clause as3_to_as2 1 configs/as3border1.cfg:[146, 147, 148, 149]\n",
"4 extended ipv4 access-list 101 configs/as2border2.cfg:[140, 141]"
]
},
"execution_count": 61,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "e2493791",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 62,
"id": "8bbffa76",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Structure_Type extended ipv4 access-list line\n",
"Structure_Name OUTSIDE_TO_INSIDE: permit ip any any\n",
"Source_Lines configs/as2border1.cfg:[137]\n",
"Name: 0, dtype: object"
]
},
"execution_count": 62,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 63,
"id": "43a31557",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 63,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 64,
"id": "6465222a",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 64,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('generate_questions')"
]
},
{
"cell_type": "markdown",
"id": "0c6f5690",
"metadata": {},
"source": [
"##### Referenced Structures"
]
},
{
"cell_type": "markdown",
"id": "378468a2",
"metadata": {},
"source": [
"Lists the references in configuration files to vendor-specific structures."
]
},
{
"cell_type": "markdown",
"id": "77b897f3",
"metadata": {},
"source": [
"Lists the references in configuration files to vendor-specific structures, along with the line number, the name and the type of the structure referenced, and configuration context in which each reference occurs."
]
},
{
"cell_type": "markdown",
"id": "427808ea",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "0945aad4",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include files used to generate nodes whose name matches this specifier. | [NodeSpec](../specifiers.md#node-specifier) | True | \n",
"names | Include structures whose name matches this string or regex. | str | True | \n",
"types | Include structures whose vendor-specific type matches this string or regex. | str | True | "
]
},
{
"cell_type": "markdown",
"id": "179900c3",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 65,
"id": "ce19e620",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.referencedStructures().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "74825bf0",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "91c00864",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Structure_Type | Type of structure referenced | str\n",
"Structure_Name | The referenced structure | str\n",
"Context | Configuration context in which the reference appears | str\n",
"Source_Lines | Lines where reference appears | [FileLines](../datamodel.rst#pybatfish.datamodel.primitives.FileLines)"
]
},
{
"cell_type": "markdown",
"id": "dfb35c19",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 66,
"id": "b8f09d2e",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Structure_Type | \n",
" Structure_Name | \n",
" Context | \n",
" Source_Lines | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" bgp neighbor | \n",
" 1.10.1.1 (VRF default) | \n",
" bgp neighbor self ref | \n",
" configs/as1border1.cfg:[92, 111] | \n",
"
\n",
" \n",
" | 1 | \n",
" bgp neighbor | \n",
" 10.12.11.2 (VRF default) | \n",
" bgp neighbor self ref | \n",
" configs/as1border1.cfg:[114] | \n",
"
\n",
" \n",
" | 2 | \n",
" bgp neighbor | \n",
" 3.2.2.2 (VRF default) | \n",
" bgp neighbor self ref | \n",
" configs/as1border1.cfg:[112] | \n",
"
\n",
" \n",
" | 3 | \n",
" bgp neighbor | \n",
" 5.6.7.8 (VRF default) | \n",
" bgp neighbor self ref | \n",
" configs/as1border1.cfg:[113] | \n",
"
\n",
" \n",
" | 4 | \n",
" bgp peer-group | \n",
" as1 | \n",
" bgp neighbor peer-group | \n",
" configs/as1border1.cfg:[91] | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Structure_Type Structure_Name Context Source_Lines\n",
"0 bgp neighbor 1.10.1.1 (VRF default) bgp neighbor self ref configs/as1border1.cfg:[92, 111]\n",
"1 bgp neighbor 10.12.11.2 (VRF default) bgp neighbor self ref configs/as1border1.cfg:[114]\n",
"2 bgp neighbor 3.2.2.2 (VRF default) bgp neighbor self ref configs/as1border1.cfg:[112]\n",
"3 bgp neighbor 5.6.7.8 (VRF default) bgp neighbor self ref configs/as1border1.cfg:[113]\n",
"4 bgp peer-group as1 bgp neighbor peer-group configs/as1border1.cfg:[91]"
]
},
"execution_count": 66,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "9e91bfcb",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 67,
"id": "bc0f3e6a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Structure_Type bgp neighbor\n",
"Structure_Name 1.10.1.1 (VRF default)\n",
"Context bgp neighbor self ref\n",
"Source_Lines configs/as1border1.cfg:[92, 111]\n",
"Name: 0, dtype: object"
]
},
"execution_count": 67,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 68,
"id": "bc229f9f",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 68,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 69,
"id": "67c9d3c8",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 69,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('generate_questions')"
]
},
{
"cell_type": "markdown",
"id": "09cd5509",
"metadata": {},
"source": [
"##### Undefined References"
]
},
{
"cell_type": "markdown",
"id": "903c5748",
"metadata": {},
"source": [
"Identifies undefined references in configuration."
]
},
{
"cell_type": "markdown",
"id": "d52e9119",
"metadata": {},
"source": [
"Finds configurations that have references to named structures (e.g., ACLs) that are not defined. Such occurrences indicate errors and can have serious consequences in some cases."
]
},
{
"cell_type": "markdown",
"id": "1abe2a2b",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "d923d5b5",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Look for undefined references on nodes matching this name or regex. | [NodeSpec](../specifiers.md#node-specifier) | True | .*"
]
},
{
"cell_type": "markdown",
"id": "ee13b4ac",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 70,
"id": "7d4d1fbd",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.undefinedReferences().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "2616a369",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "2d7da226",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"File_Name | File containing reference | str\n",
"Struct_Type | Type of struct reference is supposed to be | str\n",
"Ref_Name | The undefined reference | str\n",
"Context | Context of undefined reference | str\n",
"Lines | Lines where reference appears | [FileLines](../datamodel.rst#pybatfish.datamodel.primitives.FileLines)"
]
},
{
"cell_type": "markdown",
"id": "055faed6",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 71,
"id": "084e0d6b",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" File_Name | \n",
" Struct_Type | \n",
" Ref_Name | \n",
" Context | \n",
" Lines | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" configs/as2core2.cfg | \n",
" route-map | \n",
" filter-bogons | \n",
" bgp inbound route-map | \n",
" configs/as2core2.cfg:[110] | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" File_Name Struct_Type Ref_Name Context Lines\n",
"0 configs/as2core2.cfg route-map filter-bogons bgp inbound route-map configs/as2core2.cfg:[110]"
]
},
"execution_count": 71,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "e3bf3ce4",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 72,
"id": "784e6161",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"File_Name configs/as2core2.cfg\n",
"Struct_Type route-map\n",
"Ref_Name filter-bogons\n",
"Context bgp inbound route-map\n",
"Lines configs/as2core2.cfg:[110]\n",
"Name: 0, dtype: object"
]
},
"execution_count": 72,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 73,
"id": "209043b0",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 73,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 74,
"id": "96a1dc98",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 74,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('generate_questions')"
]
},
{
"cell_type": "markdown",
"id": "bf4edeb6",
"metadata": {},
"source": [
"##### Unused Structures"
]
},
{
"cell_type": "markdown",
"id": "58f98525",
"metadata": {},
"source": [
"Returns nodes with structures such as ACLs, routemaps, etc. that are defined but not used."
]
},
{
"cell_type": "markdown",
"id": "e8d94175",
"metadata": {},
"source": [
"Return nodes with structures such as ACLs, routes, etc. that are defined but not used. This may represent a bug in the configuration, which may have occurred because a final step in a template or MOP was not completed. Or it could be harmless extra configuration generated from a master template that is not meant to be used on those nodes."
]
},
{
"cell_type": "markdown",
"id": "a0e81d5d",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "88ac0b84",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Look for unused structures on nodes matching this name or regex. | [NodeSpec](../specifiers.md#node-specifier) | True | .*"
]
},
{
"cell_type": "markdown",
"id": "c1b0682f",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 75,
"id": "54de469e",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.unusedStructures().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "ef6ea9e7",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "9e8b96cf",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Structure_Type | Vendor-specific type of the structure | str\n",
"Structure_Name | Name of the structure | str\n",
"Source_Lines | File and line numbers where the structure is defined | [FileLines](../datamodel.rst#pybatfish.datamodel.primitives.FileLines)"
]
},
{
"cell_type": "markdown",
"id": "d7c02723",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 76,
"id": "af054697",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Structure_Type | \n",
" Structure_Name | \n",
" Source_Lines | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" bgp peer-group | \n",
" as3 | \n",
" configs/as1border1.cfg:[85] | \n",
"
\n",
" \n",
" | 1 | \n",
" expanded community-list | \n",
" as1_community | \n",
" configs/as1border1.cfg:[121] | \n",
"
\n",
" \n",
" | 2 | \n",
" ipv4 prefix-list | \n",
" inbound_route_filter | \n",
" configs/as1border1.cfg:[131, 132] | \n",
"
\n",
" \n",
" | 3 | \n",
" bgp peer-group | \n",
" as2 | \n",
" configs/as1border2.cfg:[87] | \n",
"
\n",
" \n",
" | 4 | \n",
" expanded community-list | \n",
" as1_community | \n",
" configs/as1border2.cfg:[123] | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Structure_Type Structure_Name Source_Lines\n",
"0 bgp peer-group as3 configs/as1border1.cfg:[85]\n",
"1 expanded community-list as1_community configs/as1border1.cfg:[121]\n",
"2 ipv4 prefix-list inbound_route_filter configs/as1border1.cfg:[131, 132]\n",
"3 bgp peer-group as2 configs/as1border2.cfg:[87]\n",
"4 expanded community-list as1_community configs/as1border2.cfg:[123]"
]
},
"execution_count": 76,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "b9d04a67",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 77,
"id": "33082f7f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Structure_Type bgp peer-group\n",
"Structure_Name as3\n",
"Source_Lines configs/as1border1.cfg:[85]\n",
"Name: 0, dtype: object"
]
},
"execution_count": 77,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 78,
"id": "9e305d95",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 78,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 79,
"id": "3354dbf7",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'aristaevpn'"
]
},
"execution_count": 79,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('aristaevpn')"
]
},
{
"cell_type": "markdown",
"id": "d8c40aaf",
"metadata": {},
"source": [
"##### VLAN Properties"
]
},
{
"cell_type": "markdown",
"id": "80d3e151",
"metadata": {},
"source": [
"Returns configuration settings of switched VLANs."
]
},
{
"cell_type": "markdown",
"id": "32d4e62d",
"metadata": {},
"source": [
"Lists information about implicitly and explicitly configured switched VLANs."
]
},
{
"cell_type": "markdown",
"id": "b30fc0f5",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "bd72575f",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this specifier. | [NodeSpec](../specifiers.md#node-specifier) | True | \n",
"interfaces | Include interfaces matching this specifier. | [InterfaceSpec](../specifiers.md#interface-specifier) | True | \n",
"vlans | Include VLANs in this space. | str | True | \n",
"excludeShutInterfaces | Exclude interfaces that are shutdown. | bool | True | "
]
},
{
"cell_type": "markdown",
"id": "a518cc7f",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 80,
"id": "8346f11a",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.switchedVlanProperties().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "0ea41414",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "427d51cf",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Node | Node | str\n",
"VLAN_ID | VLAN_ID | int\n",
"Interfaces | Switched interfaces carrying traffic for this VLAN | Set of [Interface](../datamodel.rst#pybatfish.datamodel.primitives.Interface)\n",
"VXLAN_VNI | VXLAN VNI with which this VLAN is associated | int"
]
},
{
"cell_type": "markdown",
"id": "3830aa5a",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 81,
"id": "a2d5a0b3",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Node | \n",
" VLAN_ID | \n",
" Interfaces | \n",
" VXLAN_VNI | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" dc1-bl1b | \n",
" 250 | \n",
" [dc1-bl1b[Port-Channel3], dc1-bl1b[Vlan250]] | \n",
" 20250 | \n",
"
\n",
" \n",
" | 1 | \n",
" dc1-leaf1a | \n",
" 210 | \n",
" [dc1-leaf1a[Vlan210]] | \n",
" 20210 | \n",
"
\n",
" \n",
" | 2 | \n",
" dc1-leaf1a | \n",
" 211 | \n",
" [dc1-leaf1a[Vlan211]] | \n",
" 20211 | \n",
"
\n",
" \n",
" | 3 | \n",
" dc1-leaf2a | \n",
" 3764 | \n",
" [dc1-leaf2a[Port-Channel3]] | \n",
" None | \n",
"
\n",
" \n",
" | 4 | \n",
" dc1-leaf2b | \n",
" 3789 | \n",
" [dc1-leaf2b[Port-Channel3]] | \n",
" None | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Node VLAN_ID Interfaces VXLAN_VNI\n",
"0 dc1-bl1b 250 [dc1-bl1b[Port-Channel3], dc1-bl1b[Vlan250]] 20250\n",
"1 dc1-leaf1a 210 [dc1-leaf1a[Vlan210]] 20210\n",
"2 dc1-leaf1a 211 [dc1-leaf1a[Vlan211]] 20211\n",
"3 dc1-leaf2a 3764 [dc1-leaf2a[Port-Channel3]] None\n",
"4 dc1-leaf2b 3789 [dc1-leaf2b[Port-Channel3]] None"
]
},
"execution_count": 81,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "474affc4",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 82,
"id": "bc94319c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Node dc1-bl1b\n",
"VLAN_ID 250\n",
"Interfaces [dc1-bl1b[Port-Channel3], dc1-bl1b[Vlan250]]\n",
"VXLAN_VNI 20250\n",
"Name: 0, dtype: object"
]
},
"execution_count": 82,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 83,
"id": "d91578c0",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 83,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 84,
"id": "3dd3d7fc",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'ios_basic_vrrp'"
]
},
"execution_count": 84,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('ios_basic_vrrp')"
]
},
{
"cell_type": "markdown",
"id": "e550ad24",
"metadata": {},
"source": [
"##### VRRP Properties"
]
},
{
"cell_type": "markdown",
"id": "cf08fd94",
"metadata": {},
"source": [
"Returns configuration settings of VRRP groups."
]
},
{
"cell_type": "markdown",
"id": "06ec827a",
"metadata": {},
"source": [
"Lists information about VRRP groups on interfaces."
]
},
{
"cell_type": "markdown",
"id": "abb08c75",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "0ab4cd1c",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this specifier. | [NodeSpec](../specifiers.md#node-specifier) | True | \n",
"interfaces | Include interfaces matching this specifier. | [InterfaceSpec](../specifiers.md#interface-specifier) | True | \n",
"virtualAddresses | Include only groups with at least one virtual address matching this specifier. | [IpSpec](../specifiers.md#ip-specifier) | True | \n",
"excludeShutInterfaces | Exclude interfaces that are shutdown. | bool | True | "
]
},
{
"cell_type": "markdown",
"id": "059ad46f",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 85,
"id": "d288e8ea",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.vrrpProperties().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "5c0ba28f",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "75736196",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Interface | Interface | [Interface](../datamodel.rst#pybatfish.datamodel.primitives.Interface)\n",
"Group_Id | VRRP Group ID | int\n",
"Virtual_Addresses | Virtual Addresses | Set of str\n",
"Source_Address | Source Address used for VRRP messages | str\n",
"Priority | VRRP router priority | int\n",
"Preempt | Whether preemption is allowed | bool\n",
"Active | Whether the interface is active | bool"
]
},
{
"cell_type": "markdown",
"id": "9a16ecf1",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 86,
"id": "a1974a71",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Interface | \n",
" Group_Id | \n",
" Virtual_Addresses | \n",
" Source_Address | \n",
" Priority | \n",
" Preempt | \n",
" Active | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" br1[GigabitEthernet0/2] | \n",
" 12 | \n",
" ['192.168.1.254'] | \n",
" 192.168.1.1/24 | \n",
" 110 | \n",
" True | \n",
" True | \n",
"
\n",
" \n",
" | 1 | \n",
" br2[GigabitEthernet0/2] | \n",
" 12 | \n",
" ['192.168.1.254'] | \n",
" 192.168.1.2/24 | \n",
" 100 | \n",
" True | \n",
" True | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Interface Group_Id Virtual_Addresses Source_Address Priority Preempt Active\n",
"0 br1[GigabitEthernet0/2] 12 ['192.168.1.254'] 192.168.1.1/24 110 True True\n",
"1 br2[GigabitEthernet0/2] 12 ['192.168.1.254'] 192.168.1.2/24 100 True True"
]
},
"execution_count": 86,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "3234cf3b",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 87,
"id": "fe343d98",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Interface br1[GigabitEthernet0/2]\n",
"Group_Id 12\n",
"Virtual_Addresses ['192.168.1.254']\n",
"Source_Address 192.168.1.1/24\n",
"Priority 110\n",
"Preempt True\n",
"Active True\n",
"Name: 0, dtype: object"
]
},
"execution_count": 87,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 88,
"id": "d59b4bfe",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 88,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 89,
"id": "bed574f4",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'a10'"
]
},
"execution_count": 89,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('a10')"
]
},
{
"cell_type": "markdown",
"id": "c44bf203",
"metadata": {},
"source": [
"##### A10 Virtual Server Configuration"
]
},
{
"cell_type": "markdown",
"id": "80becc80",
"metadata": {},
"source": [
"Returns Virtual Server configuration of A10 devices."
]
},
{
"cell_type": "markdown",
"id": "81b8da42",
"metadata": {},
"source": [
"Lists all the virtual-server to service-group to server mappings in A10 configurations."
]
},
{
"cell_type": "markdown",
"id": "dd9a9cc0",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "70de0c43",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this name or regex. | [NodeSpec](../specifiers.md#node-specifier) | True | \n",
"virtualServerIps | Include virtual servers whose IP match this specifier. | [IpSpec](../specifiers.md#ip-specifier) | True | "
]
},
{
"cell_type": "markdown",
"id": "595422b9",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 90,
"id": "08bae9b3",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.a10VirtualServerConfiguration().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "28508b88",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "2444b3dd",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Node | Node | str\n",
"Virtual_Server_Name | Virtual Server Name | str\n",
"Virtual_Server_Enabled | Virtual Server Enabled | bool\n",
"Virtual_Server_IP | Virtual Server IP | str\n",
"Virtual_Server_Port | Virtual Server Port | int\n",
"Virtual_Server_Port_Enabled | Virtual Server Port Enabled | bool\n",
"Virtual_Server_Type | Virtual Server Type | str\n",
"Virtual_Server_Port_Type_Name | Virtual Server Port Type Name | str\n",
"Service_Group_Name | Service Group Name | str\n",
"Service_Group_Type | Service Group Type | str\n",
"Servers | List of Servers. Each item is a 4-tuple: Server Name, Port, IP Address, and Active Status. | Set of List of str\n",
"Source_NAT_Pool_Name | Source NAT Pool Name | str"
]
},
{
"cell_type": "markdown",
"id": "65e5107b",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 91,
"id": "e7c7306a",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Node | \n",
" Virtual_Server_Name | \n",
" Virtual_Server_Enabled | \n",
" Virtual_Server_IP | \n",
" Virtual_Server_Port | \n",
" Virtual_Server_Port_Enabled | \n",
" Virtual_Server_Type | \n",
" Virtual_Server_Port_Type_Name | \n",
" Service_Group_Name | \n",
" Service_Group_Type | \n",
" Servers | \n",
" Source_NAT_Pool_Name | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" lb42 | \n",
" VS_TCP_80 | \n",
" True | \n",
" 10.0.0.1 | \n",
" 80 | \n",
" True | \n",
" TCP | \n",
" None | \n",
" SG_TCP_80 | \n",
" TCP | \n",
" [['SERVER1', '80', '10.1.10.11', 'active'], ['SERVER2', '80', '10.1.10.12', 'inactive']] | \n",
" None | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Node Virtual_Server_Name Virtual_Server_Enabled Virtual_Server_IP Virtual_Server_Port Virtual_Server_Port_Enabled Virtual_Server_Type Virtual_Server_Port_Type_Name Service_Group_Name Service_Group_Type Servers \\\n",
"0 lb42 VS_TCP_80 True 10.0.0.1 80 True TCP None SG_TCP_80 TCP [['SERVER1', '80', '10.1.10.11', 'active'], ['SERVER2', '80', '10.1.10.12', 'inactive']] \n",
"\n",
" Source_NAT_Pool_Name \n",
"0 None "
]
},
"execution_count": 91,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "32ea3e0b",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 92,
"id": "5eb09e3c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Node lb42\n",
"Virtual_Server_Name VS_TCP_80\n",
"Virtual_Server_Enabled True\n",
"Virtual_Server_IP 10.0.0.1\n",
"Virtual_Server_Port 80\n",
"Virtual_Server_Port_Enabled True\n",
"Virtual_Server_Type TCP\n",
"Virtual_Server_Port_Type_Name None\n",
"Service_Group_Name SG_TCP_80\n",
"Service_Group_Type TCP\n",
"Servers [['SERVER1', '80', '10.1.10.11', 'active'], ['SERVER2', '80', '10.1.10.12', 'inactive']]\n",
"Source_NAT_Pool_Name None\n",
"Name: 0, dtype: object"
]
},
"execution_count": 92,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
},
{
"cell_type": "code",
"execution_count": 93,
"id": "92cf03d0",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'generate_questions'"
]
},
"execution_count": 93,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_network('generate_questions')"
]
},
{
"cell_type": "code",
"execution_count": 94,
"id": "caf820ad",
"metadata": {
"nbsphinx": "hidden"
},
"outputs": [
{
"data": {
"text/plain": [
"'f5'"
]
},
"execution_count": 94,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bf.set_snapshot('f5')"
]
},
{
"cell_type": "markdown",
"id": "aeb1348b",
"metadata": {},
"source": [
"##### F5 BIG-IP VIP Configuration"
]
},
{
"cell_type": "markdown",
"id": "46a15b0b",
"metadata": {},
"source": [
"Returns VIP configuration of F5 BIG-IP devices."
]
},
{
"cell_type": "markdown",
"id": "a7cf770d",
"metadata": {},
"source": [
"Lists all the VIP to server IP mappings contained in F5 BIP-IP configurations."
]
},
{
"cell_type": "markdown",
"id": "3da41756",
"metadata": {},
"source": [
"###### **Inputs**"
]
},
{
"cell_type": "markdown",
"id": "ca3b90be",
"metadata": {},
"source": [
"Name | Description | Type | Optional | Default Value\n",
"--- | --- | --- | --- | --- \n",
"nodes | Include nodes matching this name or regex. | [NodeSpec](../specifiers.md#node-specifier) | True | "
]
},
{
"cell_type": "markdown",
"id": "ac1a01cb",
"metadata": {},
"source": [
"###### **Invocation**"
]
},
{
"cell_type": "code",
"execution_count": 95,
"id": "cca270ec",
"metadata": {},
"outputs": [],
"source": [
"result = bf.q.f5BigipVipConfiguration().answer().frame()"
]
},
{
"cell_type": "markdown",
"id": "56e6b1fd",
"metadata": {},
"source": [
"###### **Return Value**"
]
},
{
"cell_type": "markdown",
"id": "22ded5c7",
"metadata": {},
"source": [
"Name | Description | Type\n",
"--- | --- | ---\n",
"Node | Node | str\n",
"VIP_Name | Virtual Service Name | str\n",
"VIP_Endpoint | Virtual Service Endpoint | str\n",
"Servers | Servers | Set of str\n",
"Description | Description | str"
]
},
{
"cell_type": "markdown",
"id": "e8411247",
"metadata": {},
"source": [
"Print the first 5 rows of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 96,
"id": "8ca320e0",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Node | \n",
" VIP_Name | \n",
" VIP_Endpoint | \n",
" Servers | \n",
" Description | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" f5bigip | \n",
" /Common/virtual1 | \n",
" 192.0.2.1:80 TCP | \n",
" ['10.0.0.1:80'] | \n",
" virtual1 is cool | \n",
"
\n",
" \n",
" | 1 | \n",
" f5bigip | \n",
" /Common/virtual2 | \n",
" 192.0.2.2:80 TCP | \n",
" ['10.0.0.2:80'] | \n",
" pool2 is lame | \n",
"
\n",
" \n",
" | 2 | \n",
" f5bigip | \n",
" /Common/virtual3 | \n",
" 192.0.2.3:80 TCP | \n",
" ['10.0.0.4:80', '10.0.0.3:80'] | \n",
" | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Node VIP_Name VIP_Endpoint Servers Description\n",
"0 f5bigip /Common/virtual1 192.0.2.1:80 TCP ['10.0.0.1:80'] virtual1 is cool\n",
"1 f5bigip /Common/virtual2 192.0.2.2:80 TCP ['10.0.0.2:80'] pool2 is lame\n",
"2 f5bigip /Common/virtual3 192.0.2.3:80 TCP ['10.0.0.4:80', '10.0.0.3:80'] "
]
},
"execution_count": 96,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.head(5)"
]
},
{
"cell_type": "markdown",
"id": "51218216",
"metadata": {},
"source": [
"Print the first row of the returned Dataframe"
]
},
{
"cell_type": "code",
"execution_count": 97,
"id": "18fba8c4",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Node f5bigip\n",
"VIP_Name /Common/virtual1\n",
"VIP_Endpoint 192.0.2.1:80 TCP\n",
"Servers ['10.0.0.1:80']\n",
"Description virtual1 is cool\n",
"Name: 0, dtype: object"
]
},
"execution_count": 97,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.iloc[0]"
]
}
],
"metadata": {
"celltoolbar": "Edit Metadata",
"hide_input": false,
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.17"
}
},
"nbformat": 4,
"nbformat_minor": 2
}