Resolving Specifiers

Resolve Location Specifier

Returns the set of locations corresponding to a locationSpec value.

Helper question that shows how specified locationSpec values resolve to the locations in the network.

Inputs

Name

Description

Type

Optional

Default Value

locations

Input to the LocationSpecifier.

LocationSpec

False

grammarVersion

Version of grammar to use for resolution.

str

True

Invocation

[6]:
result = bfq.resolveLocationSpecifier(locations='@enter(as2border1[GigabitEthernet2/0])').answer().frame()

Return Value

Name

Description

Type

Location

Location

str

Print the first 5 rows of the returned Dataframe

[7]:
result.head(5)
[7]:
Location
0 InterfaceLinkLocation{nodeName=as2border1, interfaceName=GigabitEthernet2/0}

Print the first row of the returned Dataframe

[8]:
result.iloc[0]
[8]:
Location    InterfaceLinkLocation{nodeName=as2border1, interfaceName=GigabitEthernet2/0}
Name: 0, dtype: object

Resolve Filter Specifier

Returns the set of filters corresponding to a filterSpec value.

Helper question that shows how specified filterSpec values resolve to the filters in the network.

Inputs

Name

Description

Type

Optional

Default Value

filters

Input to the FilterSpecifier.

FilterSpec

False

grammarVersion

Version of grammar to use for resolution.

str

True

nodes

Input to the NodeSpecifier that specifies the set of nodes that should be considered.

NodeSpec

True

/.*/

Invocation

[11]:
result = bfq.resolveFilterSpecifier(filters='@in(as2border1[GigabitEthernet0/0])').answer().frame()

Return Value

Name

Description

Type

Node

Node

str

Filter_Name

Filter name

str

Print the first 5 rows of the returned Dataframe

[12]:
result.head(5)
[12]:
Node Filter_Name
0 as2border1 OUTSIDE_TO_INSIDE

Print the first row of the returned Dataframe

[13]:
result.iloc[0]
[13]:
Node           as2border1
Filter_Name    OUTSIDE_TO_INSIDE
Name: 0, dtype: object

Resolve Node Specifier

Returns the set of nodes corresponding to a nodeSpec value.

Helper question that shows how specified nodeSpec values resolve to the nodes in the network.

Inputs

Name

Description

Type

Optional

Default Value

nodes

Input to the NodeSpecifier.

NodeSpec

False

grammarVersion

Version of grammar to use for resolution.

str

True

Invocation

[16]:
result = bfq.resolveNodeSpecifier(nodes='/border/').answer().frame()

Return Value

Name

Description

Type

Node

Node

str

Print the first 5 rows of the returned Dataframe

[17]:
result.head(5)
[17]:
Node
0 as1border1
1 as1border2
2 as2border1
3 as2border2
4 as3border1

Print the first row of the returned Dataframe

[18]:
result.iloc[0]
[18]:
Node    as1border1
Name: 0, dtype: object

Resolve Interface Specifier

Returns the set of interfaces corresponding to an interfaceSpec value.

Helper question that shows how specified interfaceSpec values resolve to the interfaces in the network.

Inputs

Name

Description

Type

Optional

Default Value

interfaces

Input to the interfaceSpecifier.

InterfaceSpec

False

grammarVersion

Version of grammar to use for resolution.

str

True

nodes

Input to the NodeSpecifier that specifies the set of nodes that should be considered.

NodeSpec

True

/.*/

Invocation

[21]:
result = bfq.resolveInterfaceSpecifier(interfaces='/border/[.*Ethernet]').answer().frame()

Return Value

Name

Description

Type

Interface

Interface

Interface

Print the first 5 rows of the returned Dataframe

[22]:
result.head(5)
[22]:
Interface
0 as1border1[Ethernet0/0]
1 as1border1[GigabitEthernet0/0]
2 as1border1[GigabitEthernet1/0]
3 as1border2[Ethernet0/0]
4 as1border2[GigabitEthernet0/0]

Print the first row of the returned Dataframe

[23]:
result.iloc[0]
[23]:
Interface    as1border1[Ethernet0/0]
Name: 0, dtype: object

Resolve IPs from Location Specifier

Returns IPs that are auto-assigned to locations.

Helper question that shows IPs that will be assigned to specified locationSpec values by questions are automatically pick IPs based on locations.

Inputs

Name

Description

Type

Optional

Default Value

locations

Input to the LocationSpecifier.

LocationSpec

False

grammarVersion

Version of grammar to use for resolution.

str

True

Invocation

[26]:
result = bfq.resolveIpsOfLocationSpecifier(locations='@enter(as2border1[GigabitEthernet2/0])').answer().frame()

Return Value

Name

Description

Type

Locations

Resolution

str

IP_Space

IP space

str

Print the first 5 rows of the returned Dataframe

[27]:
result.head(5)
[27]:
Locations IP_Space
0 [InterfaceLinkLocation{nodeName=as2border1, interfaceName=GigabitEthernet2/0}] AclIpSpace{lines=[AclIpSpaceLine{action=DENY, ipSpace=AclIpSpace{lines=[AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.2.2.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.1.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.1.3.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.1.2.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.1.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.2.2.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.1.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.0.2.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.0.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.128.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.128.0.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.0.2.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.0.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.0.1.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.0.2.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.0.1.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.0.2.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.1.3.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.1.2.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.1.1.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.10.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.10.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.13.22.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.21.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.22.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.12.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.11.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.12.11.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.13.22.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.12.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.22.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.21.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.11.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.12.11.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.14.22.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.23.21.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.12.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.22.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.21.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.11.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.21.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.22.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.12.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.11.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.23.21.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.34.201.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.34.101.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.34.201.4}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.34.101.4}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=90.90.90.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=90.90.90.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.128.1.101}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.128.0.101}}]}}, AclIpSpaceLine{ipSpace=AclIpSpace{lines=[AclIpSpaceLine{action=DENY, ipSpace=IpIpSpace{ip=2.12.12.0}}, AclIpSpaceLine{action=DENY, ipSpace=IpIpSpace{ip=2.12.12.255}}, AclIpSpaceLine{ipSpace=PrefixIpSpace{prefix=2.12.12.0/24}}]}}]}

Print the first row of the returned Dataframe

[28]:
result.iloc[0]
[28]:
Locations    [InterfaceLinkLocation{nodeName=as2border1, interfaceName=GigabitEthernet2/0}]
IP_Space     AclIpSpace{lines=[AclIpSpaceLine{action=DENY, ipSpace=AclIpSpace{lines=[AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.2.2.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.1.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.1.3.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.1.2.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.1.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.2.2.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.1.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.0.2.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.0.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.128.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.128.0.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.0.2.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.0.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.0.1.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.0.2.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.0.1.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.0.2.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.1.3.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.1.2.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.1.1.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.10.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.10.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.13.22.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.21.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.22.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.12.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.11.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.12.11.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.13.22.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.12.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.22.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.21.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.11.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.12.11.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.14.22.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.23.21.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.12.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.22.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.21.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.11.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.21.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.22.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.12.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.23.11.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.23.21.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.34.201.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.34.101.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.34.201.4}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.34.101.4}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=90.90.90.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=90.90.90.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.128.1.101}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.128.0.101}}]}}, AclIpSpaceLine{ipSpace=AclIpSpace{lines=[AclIpSpaceLine{action=DENY, ipSpace=IpIpSpace{ip=2.12.12.0}}, AclIpSpaceLine{action=DENY, ipSpace=IpIpSpace{ip=2.12.12.255}}, AclIpSpaceLine{ipSpace=PrefixIpSpace{prefix=2.12.12.0/24}}]}}]}
Name: 0, dtype: object

Resolve IP Specifier

Returns the IP address space corresponding to an ipSpec value.

Helper question that shows how specified ipSpec values resolve to IPs.

Inputs

Name

Description

Type

Optional

Default Value

ips

Input to the IP space specifier.

IpSpec

False

grammarVersion

Version of grammar to use for resolution.

str

True

Invocation

[31]:
result = bfq.resolveIpSpecifier(ips='/border/[.*Ethernet]').answer().frame()

Return Value

Name

Description

Type

IP_Space

IP space

str

Print the first 5 rows of the returned Dataframe

[32]:
result.head(5)
[32]:
IP_Space
0 AclIpSpace{lines=[AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.0.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.12.11.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.13.22.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.0.2.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.14.22.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.12.11.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.11.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.12.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.23.21.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.22.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.21.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.0.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.23.21.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.13.22.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.0.2.1}}]}

Print the first row of the returned Dataframe

[33]:
result.iloc[0]
[33]:
IP_Space    AclIpSpace{lines=[AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.0.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.12.11.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.13.22.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=1.0.2.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.14.22.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.12.11.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.11.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.12.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.23.21.2}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.22.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=2.12.21.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.0.1.1}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.23.21.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=10.13.22.3}}, AclIpSpaceLine{ipSpace=IpIpSpace{ip=3.0.2.1}}]}
Name: 0, dtype: object