pyaoscx.vrf_address_family module

class pyaoscx.vrf_address_family.VrfAddressFamily(session, address_family, parent_vrf, uri=None, **kwargs)

Bases: pyaoscx.pyaoscx_module.PyaoscxModule

Provide configuration management for VRF Address Family settings on AOS-CX
devices.
apply()
Main method used to either create or update an existing
VrfAddressFamily object. Checks whether the VRF Address Family exists in the switch. Calls self.update() if VRF Address Family being updated. Calls self.create() if a new VRF Address Family is being created.
Returns:Boolean, True if object was created or modified.
collection_uri = 'system/vrfs/{name}/vrf_address_families'
create()
Perform a POST call to create a new VRF Address Family table entry.
Only returns if no exception raised.
Returns:True if entry was created
delete()

Perform DELETE call to delete VRF Address Family table entry.

classmethod from_response(session, parent_vrf, response_data)
Create a VrfAddressFamily object given a response_data related to the
VRF Address Family’s address_family.
Parameters:
  • cls – Object’s class.
  • session – pyaoscx.Session object used to represent a logical connection to the device.
  • parent_vrf – parent Vrf object where VrfAddressFamlily object is stored.
  • response_data – The response must be a dictionary of the form: { addr_fam: <URL> } with URL: “/rest/v10.04/system/vrfs/vrf_address_families/addr_fam”
Returns:

VrfAddressFamily object.

classmethod from_uri(session, parent_vrf, uri)

Create a VrfAddressFamily object given a URI and parent VRF.

Parameters:
  • cls – Object’s class.
  • session – pyaoscx.Session object used to represent a logical connection to the device.
  • parent_vrf – parent vrf class where VRF Address Family is stored.
  • uri – a String with a URI.
Returns:

tuple containing both the VRF Address Family object and the VRF Address Family’s address_family.

get(depth=None, selector=None)
Perform a GET call to retrieve data for a VRF Address Family table
entry and fill the object with the incoming attributes.
Parameters:
  • depth – Integer deciding how many levels into the API JSON that references will be returned.
  • selector – Alphanumeric option to select specific information to return.
Returns:

Returns True if no exception is raised.

classmethod get_all(session, parent_vrf)
Perform a GET call to retrieve all system VRF Address Families inside a
VRF, and create a dictionary containing them.
Parameters:
  • cls – Object’s class.
  • session – pyaoscx.Session object used to represent a logical connection to the device.
  • parent_vrf – Vrf object where VRF Address Families are stored.
Returns:

Dictionary containing VRF Address Family IDs as keys and a VrfAddressFamily objects as values.

get_info_format()
Method used to obtain correct object format for referencing inside
other objects.
Returns:Object format depending on the API Version.
get_uri()

Method used to obtain the specific VRF Address Family URI.

Returns:Object’s URI.
indices = ['address_family']
modified

Return boolean with whether this object has been modified.

object_uri = 'system/vrfs/{name}/vrf_address_families/{address_family}'
resource_uri_name = 'vrf_address_families'
update()
Perform a PUT call to apply changes to an existing VRF Address Family
table entry.
Returns:True if Object was modified and a PUT request was made.
was_modified()

Getter method for the __modified attribute.

Returns:Boolean True if the object was recently modified.