pyaoscx.aggregate_address module

class pyaoscx.aggregate_address.AggregateAddress(session, address_family, ip_prefix, parent_bgp_router, uri=None, **kwargs)

Bases: pyaoscx.pyaoscx_module.PyaoscxModule

Provide configuration management for Aggregate Address on AOS-CX devices.

apply()
Main method to either create or update an existing Aggregate Address.
Checks whether the Aggregate Addresses exists in the switch. Calls self.update() if Aggregate Address is being updated. Calls self.create() if a new Aggregate Address is being created.
Returns:Boolean, True if object was created or modified.
create()
Perform a POST call to create a new Aggregate Address table entry. Only
returns if no exception is raised.
Returns:True if entry was created.
delete()

Perform DELETE call to delete Aggregate Address.

classmethod from_response(session, parent_bgp_router, response_data)
Create a AggregateAddress object given a response_data related to the
Aggregate Address ID object.
Parameters:
  • cls – Object’s class.
  • session – pyaoscx.Session object used to represent a logical connection to the device.
  • parent_bgp_router – parent BGP Router class where Aggregate Address is stored.
  • response_data – The response must be a dictionary of the form: {id: URL}, with the URL being of the form: “bgp_routers/<asn>/aggregate_addresses/<id>” under the path: “/rest/v10.04/system/vrfs/<vrf_name>/”
Returns:

AggregateAddress object.

classmethod from_uri(session, parent_bgp_router, uri)

Create a AggregateAddress object.

Parameters:
  • session – pyaoscx.Session object used to represent a logical connection to the device.
  • parent_bgp_router – parent BGP Router class where Aggregate Address is stored.
  • uri – a String with a URI.
Returns:

tuple containing both the Aggregate Address object and the Aggregate Address’ ID.

get(depth=None, selector=None)
Perform a GET call to retrieve data for a Aggregate Address 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 there is not an exception raised.

classmethod get_all(session, parent_bgp_router)
Perform a GET call to retrieve all system Aggregate Addresses inside a
BGP Router, 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_bgp_router – parent bgp_router object where Aggregate Address is stored.
Returns:

Dictionary containing Aggregate Addresses IDs as keys and a AggregateAddress 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 Aggregate Address URI.

Returns:Object’s URI.
indices = ['address-family', 'ip_prefix']
modified

Return boolean with whether this object has been modified.

resource_uri_name = 'aggregate_addresses'
update()

Perform a PUT call to apply changes to an existing Aggregate Address.

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.