pyaoscx.vrf module¶
-
pyaoscx.vrf.
add_vrf
(vrf_name, route_distinguisher=None, vrf_type='user', **kwargs)¶ Perform a POST call to create a new VRF, and add a route distinguisher if desired.
Parameters: - vrf_name – Alphanumeric name of VRF
- route_distinguisher – Optional route distinguisher to add. Defaults to nothing if not specified.
- vrf_type – Optional VRF type. Defaults to “user” if not specified.
- kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns: True if successful, False otherwise
-
pyaoscx.vrf.
add_vrf_address_family
(vrf_name, family_type='ipv4_unicast', export_target=[], import_targets=[], **kwargs)¶ Perform a POST call to create a new VRF, and add a route distinguisher if desired. Note that this functions has logic that works for both v1 and v10.04
Parameters: - vrf_name – Alphanumeric name of VRF
- family_type – Alphanumeric type of the Address Family. The options are ‘ipv4_unicast’ and ‘ipv6_unicast’. The default value is set to ‘ipv4_unicast’.
- export_target – Optional list of export route targets.
- import_targets – Optional list of import route targets
- kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns: True if successful, False otherwise
-
pyaoscx.vrf.
add_vrf_v1
(vrf_name, route_distinguisher=None, vrf_type='user', **kwargs)¶ Perform a POST call to create a new VRF, and add a route distinguisher if desired.
Parameters: - vrf_name – name of VRF
- route_distinguisher – Optional route distinguisher to add. Defaults to nothing if not specified.
- vrf_type – Optional VRF type. Defaults to “user” if not specified.
- kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns: True if successful, False otherwise
-
pyaoscx.vrf.
delete_vrf
(vrf_name, **kwargs)¶ Perform a DELETE call to delete a VRF. Note that this functions has logic that works for both v1 and v10.04
Parameters: - vrf_name – Alphanumeric name of VRF
- kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns: True if successful, False otherwise
-
pyaoscx.vrf.
delete_vrf_address_family
(vrf_name, family_type='ipv4_unicast', **kwargs)¶ Perform a DELETE call to remove a VRF address family. Note that this functions has logic that works for both v1 and v10.04
Parameters: - vrf_name – Alphanumeric name of VRF
- family_type – Alphanumeric type of the Address Family. The options are ‘ipv4_unicast’ and ‘ipv6_unicast’. The default value is set to ‘ipv4_unicast’.
- kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns: True if successful, False otherwise
-
pyaoscx.vrf.
get_all_vrfs
(**kwargs)¶ Perform a GET call to get a list (or dictionary) of all entries in VRF table
Parameters: kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function Returns: List/dict of all VRFs in the table
-
pyaoscx.vrf.
get_vrf
(vrf_name, depth=0, selector=None, **kwargs)¶ Perform a GET call to get data for a VRF table entry
Parameters: - vrf_name – Alphanumeric name of the VRF
- depth – Integer deciding how many levels into the API JSON that references will be returned.
- selector – Alphanumeric option to select specific information to return. The options are ‘configuration’, ‘status’, ‘statistics’ or ‘writable’.
- kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns: Dictionary containing the VRF data