pyaoscx.bgp module

pyaoscx.bgp.create_bgp_asn(vrf_name, asn, router_id=None, **kwargs)

Perform a POST call to create a BGP Router Autonomous System Number

Parameters:
  • vrf_name – Alphanumeric name of the VRF the BGP ASN belongs to
  • asn – Integer that represents the Autonomous System Number
  • router_id – Optional IPv4 address that functions as the BGP Router ID
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.bgp.create_bgp_neighbors(vrf_name, asn, group_ip, family_type='l2vpn_evpn', reflector=False, send_community=False, local_interface='', **kwargs)

Perform a POST call to create BGP neighbors to the associated BGP ASN. With l2vpn_evpn being True, this will also apply EVPN settings to the BGP neighbor configurations. Note that this functions has logic that works for both v1 and v10.04

Parameters:
  • vrf_name – Alphanumeric name of the VRF the BGP ASN belongs to
  • asn – Integer that represents the Autonomous System Number
  • group_ip – IPv4 address or name of group of the neighbors that functions as the BGP Router link
  • family_type – Alphanumeric to specify what type of neighbor settings to configure. The options are ‘l2vpn-evpn’, ‘ipv4-unicast’, or ‘ipv6-unicast’. When setting to l2vpn-evpn, the neighbor configurations also will add route-reflector-client and send-community settings.
  • reflector – Boolean value to determine whether this neighbor has route reflector enabled. Default is False.
  • send_community – Boolean value to determine whether this neighbor has send-community enabled. Default is False.
  • local_interface – Optional alphanumeric to specify which interface the neighbor will apply to.
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.bgp.create_bgp_vrf(vrf_name, asn, redistribute, **kwargs)

Perform a POST call to create BGP VRF settings for the associated BGP ASN. Note that this functions has logic that works for both v1 and v10.04

Parameters:
  • vrf_name – Alphanumeric name of the VRF the BGP ASN belongs to
  • asn – Integer that represents the Autonomous System Number
  • redistribute – Optional alphanumeric to specify which types of routes that should be redistributed by BGP. The options are “ipv4-unicast” or “ipv6-unicast”.
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.bgp.delete_bgp_asn(vrf_name, asn, **kwargs)

Perform a DELETE call to remove a BGP Router Autonomous System Number

Parameters:
  • vrf_name – Alphanumeric name of the VRF the BGP ASN belongs to
  • asn – Integer that represents the Autonomous System Number
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.bgp.delete_bgp_vrf(vrf_name, asn, **kwargs)

Perform a DELETE call to remove BGP VRF settings for the associated BGP ASN. Note that this functions has logic that works for both v1 and v10.04

Parameters:
  • vrf_name – Alphanumeric name of the VRF the BGP ASN belongs to
  • asn – Integer that represents the Autonomous System Number
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.bgp.get_bgp_neighbors_list(vrf_name, asn, **kwargs)

Perform a GET call to get a list of all BGP neighbors for the supplied Autonomous System Number

Parameters:
  • vrf_name – Alphanumeric name of the VRF that we are retrieving all BGP ASNs from
  • asn – Integer that represents the Autonomous System Number
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

List of all BGP neighbors in the table for the ASN

pyaoscx.bgp.get_bgp_routers(vrf_name, **kwargs)

Perform a GET call to get a list of all BGP Router Autonomous System Number references

Parameters:
  • vrf_name – Alphanumeric name of the VRF that we are retrieving all BGP ASNs from
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

List of all BGP Router ASNs in the table