pyaoscx.ospf module

pyaoscx.ospf.create_ospf_area(vrf, ospf_id, area_id, area_type='default', **kwargs)

Perform a POST call to create an OSPF Area for the specified OSPF ID

Parameters:
  • vrf – Alphanumeric name of the VRF the OSPF ID belongs to
  • ospf_id – OSPF process ID between numbers 1-63
  • area_id – Unique identifier as a string in the form of x.x.x.x
  • area_type – Alphanumeric defining how the external routing and summary LSAs for this area will be handled. Options are “default”,”nssa”,”nssa_no_summary”,”stub”,”stub_no_summary”
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.ospf.create_ospf_id(vrf, ospf_id, redistribute=['connected', 'static'], **kwargs)

Perform a POST call to create an OSPF ID

Parameters:
  • vrf – Alphanumeric name of the VRF the OSPF ID belongs to
  • ospf_id – OSPF process ID between numbers 1-63
  • redistribute – List of types of redistribution methods for the OSPF Process, with the options being “bgp”, “connected”, and “static”
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.ospf.create_ospf_interface(vrf, ospf_id, area_id, interface_name, **kwargs)

Perform POST calls to attach an interface to an OSPF area.

Parameters:
  • vrf – Alphanumeric name of the VRF the OSPF ID belongs to
  • ospf_id – OSPF process ID between numbers 1-63
  • area_id – Unique identifier as a string in the form of x.x.x.x
  • interface_name – Alphanumeric name of the interface that will be attached to the OSPF area
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.ospf.create_ospfv3_area(vrf, ospf_id, area_id, area_type='default', **kwargs)

Perform a POST call to create an OSPFv3 Area for the specified OSPF ID

Parameters:
  • vrf – Alphanumeric name of the VRF the OSPFv3 ID belongs to
  • ospf_id – OSPFv3 process ID between numbers 1-63
  • area_id – Unique identifier as a string in the form of x.x.x.x
  • area_type – Alphanumeric defining how the external routing and summary LSAs for this area will be handled. Options are “default”,”nssa”,”nssa_no_summary”,”stub”,”stub_no_summary”
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.ospf.create_ospfv3_id(vrf, ospf_id, **kwargs)

Perform a POST call to create an OSPFv3 ID

Parameters:
  • vrf – Alphanumeric name of the VRF the OSPFv3 ID belongs to
  • ospf_id – OSPF process ID between numbers 1-63
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.ospf.create_ospfv3_interface(vrf, ospf_id, area_id, interface_name, **kwargs)

Perform POST calls to attach an interface to an OSPFv3 area.

Parameters:
  • vrf – Alphanumeric name of the VRF the OSPFv3 ID belongs to
  • ospf_id – OSPFv3 process ID between numbers 1-63
  • area_id – Unique identifier as a string in the form of x.x.x.x
  • interface_name – Alphanumeric name of the interface that will be attached to the OSPFv3 area
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.ospf.delete_ospf_area(vrf, ospf_id, area_id, **kwargs)

Perform a DETELE call to remove an OSPF Area for the specified OSPF ID

Parameters:
  • vrf – Alphanumeric name of the VRF the OSPF ID belongs to
  • ospf_id – OSPF process ID between numbers 1-63
  • area_id – Unique identifier as a string in the form of x.x.x.x
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.ospf.delete_ospf_id(vrf, ospf_id, **kwargs)

Perform a DELETE call to delete an OSPF Router ID

Parameters:
  • vrf – Alphanumeric name of the VRF the OSPF ID belongs to
  • ospf_id – OSPF process ID between numbers 1-63
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.ospf.delete_ospfv3_area(vrf, ospf_id, area_id, **kwargs)

Perform a DELETE call to remove an OSPFv3 Area for the specified OSPFv3 ID

Parameters:
  • vrf – Alphanumeric name of the VRF the OSPFv3 ID belongs to
  • ospf_id – OSPFv3 process ID between numbers 1-63
  • area_id – Unique identifier as a string in the form of x.x.x.x
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.ospf.delete_ospfv3_id(vrf, ospf_id, **kwargs)

Perform a DELETE call to delete an OSPFv3 Router ID

Parameters:
  • vrf – Alphanumeric name of the VRF the OSPFv3 ID belongs to
  • ospf_id – OSPFv3 process ID between numbers 1-63
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.ospf.get_ospf_routers(vrf, **kwargs)

Perform a GET call to get a list of all OSPF Router IDs

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

List of all OSPF Router IDs in the table

pyaoscx.ospf.get_ospfv3_routers(vrf, **kwargs)

Perform a GET call to get a list of all OSPFv3 Router IDs

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

List of all OSPFv3 Router IDs in the table

pyaoscx.ospf.update_ospf_interface_authentication(vrf, ospf_id, interface_name, auth_type, digest_key, auth_pass, **kwargs)

Perform PUT calls to update an Interface with OSPF to have authentication

Parameters:
  • vrf – Alphanumeric name of the VRF the OSPF ID belongs to
  • ospf_id – OSPF process ID between numbers 1-63
  • interface_name – Alphanumeric name of the interface that will be attached to the OSPF area
  • auth_type – Alphanumeric type of authentication, chosen between ‘md5’, ‘null’, and ‘text’
  • digest_key – Integer between 1-255 that functions as the digest key for the authentication method
  • auth_pass – Alphanumeric text for the authentication password. Note that this will be translated to a base64 String in the configuration and json.
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.ospf.update_ospf_interface_type(vrf, ospf_id, interface_name, interface_type='pointtopoint', **kwargs)

Perform PUT calls to update the type of OSPFv2 Interface given, as well as enable routing on the interface

Parameters:
  • vrf – Alphanumeric name of the VRF the OSPF ID belongs to
  • ospf_id – OSPF process ID between numbers 1-63
  • interface_name – Alphanumeric name of the interface that will be attached to the OSPF area
  • interface_type – Alphanumeric type of OSPF interface. The options are ‘broadcast’, ‘loopback’, ‘nbma’, ‘none’, ‘pointomultipoint’, ‘pointopoint’, and ‘virtuallink’
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.ospf.update_ospfv3_interface_authentication(vrf, ospf_id, interface_name, auth_type, digest_key, auth_pass, **kwargs)

Perform PUT calls to update an Interface with OSPFv3 to have authentication

Parameters:
  • vrf – Alphanumeric name of the VRF the OSPFv3 ID belongs to
  • ospf_id – OSPFv3 process ID between numbers 1-63
  • interface_name – Alphanumeric name of the interface that will be attached to the OSPFv3 area
  • auth_type – Alphanumeric type of authentication, chosen between ‘md5’, ‘null’, and ‘text’
  • digest_key – Integer between 1-255 that functions as the digest key for the authentication method
  • auth_pass – Alphanumeric text for the authentication password. Note that this will be translated to a base64 String in the configuration and json.
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise