8.4. Common Function/Class filters for Jinja tables Processing
- class nettoolkit.j2config.func.Aggregated(table)[source]
Bases:
Commondevice Aggregated/instances
- Parameters:
table (dict) – dataframe dictionary
- Returns:
Instance of Aggregated
- Return type:
- Yields:
Aggregated – Instance of Aggregated
- class nettoolkit.j2config.func.Bgp(table)[source]
Bases:
Commondevice Bgp/instances
- Parameters:
table (dict) – dataframe dictionary
- Returns:
Instance of Bgp
- Return type:
- Yields:
Bgp – Instance of Bgp
- class nettoolkit.j2config.func.Common(table)[source]
Bases:
objectCOMMON FUNCTIONALITY CLASS TO INHERIT
- class nettoolkit.j2config.func.Loopback(table)[source]
Bases:
Commondevice Loopback/instances
- Parameters:
table (dict) – dataframe dictionary
- Returns:
Instance of Loopback
- Return type:
- Yields:
Loopback – Instance of Loopback
- class nettoolkit.j2config.func.Ospf(table)[source]
Bases:
Commondevice Ospf
- Parameters:
table (dict) – dataframe dictionary
- Returns:
Instance of Ospf
- Return type:
- Yields:
Ospf – Instance of Ospf
- class nettoolkit.j2config.func.Physical(table)[source]
Bases:
Commondevice Physical/instances
- Parameters:
table (dict) – dataframe dictionary
- Returns:
Instance of Physical
- Return type:
- Yields:
Physical – Instance of Physical
- interface(n)[source]
yields data slice(s) for the sorted physical interfaces informations
- Parameters:
n (int) – interface number
- Yields:
data_slice – of matched interface
- interface_type(intf_type)[source]
condition: is provided dataslice is of given interface type
- Parameters:
data (data_slice) – Pandas DataFrame slice
intf_type (str) – interface type to be verify
- Returns:
result of condition
- Return type:
bool
- interface_type_ends(x)[source]
condition: is provided dataslice ends with given argument x
- Parameters:
data (data_slice) – Pandas DataFrame slice
x (str) – interface type ending identifier to be verify with
- Returns:
result of condition
- Return type:
bool
- sorted()[source]
provides list of sorted interface numbers
- Returns:
of interface numbers sorted
- Return type:
list
- class nettoolkit.j2config.func.Static(table)[source]
Bases:
Commondevice static
- Parameters:
table (dict) – dataframe dictionary
- Returns:
Instance of Static
- Return type:
- Yields:
Static – Instance of Static
- class nettoolkit.j2config.func.Vlan(table)[source]
Bases:
Commondevice Vlan/instances
- Parameters:
table (dict) – dataframe dictionary
- Returns:
Instance of Vlan
- Return type:
- Yields:
Vlan – Instance of Vlan
- of_instance(vrf)[source]
yields data slice(s) for the vrf matching with intvrf column
- Parameters:
vrf (str) – vrf name
- Yields:
data_slice – of matching vrf with intvrf
- class nettoolkit.j2config.func.Vrf(table)[source]
Bases:
Commondevice vrf/instances
- Parameters:
table (dict) – dataframe dictionary
- Returns:
Instance of VRF
- Return type:
- Yields:
Vrf – Instance of VRF
- sorted()[source]
list of available vrfs sorted by vrf field.
- Returns:
sorted vrfs
- Return type:
list
- sorted_vrf_data()[source]
vrf data generator, sorted by vrf names
- Yields:
data_slice – data for all vrf rows except vrf is none, sorted by vrf names
- sorted_vrf_data_by_vpnid()[source]
vrf data generator, sorted by vpnids
- Yields:
data_slice – data for all vrf rows except vrf is none, sorted by vpnids