pyaoscx.tunnel_endpoint module¶
-
class
pyaoscx.tunnel_endpoint.
TunnelEndpoint
(session, interface, network_id, destination, origin='static', vrf=None, **kwargs)¶ Bases:
pyaoscx.pyaoscx_module.PyaoscxModule
Provide configuration for Tunnel Endpoints (TEP) on AOS-CX devices.
-
apply
()¶ - Main method used to either create a TEP, or update an existing one.
- Checks whether the TEP exists in the switch. Calls self.update() if TEP is being updated. Calls self.create() if the TEP doesn’t exist in the switch.
Returns: Boolean, True if object was created or modified.
-
collection_uri
= 'system/interfaces/{intf_name}/tunnel_endpoints'¶
-
create
()¶ - Perform a POST call to create a new TEP using the object’s attributes
- as POST body. Exception is raised if object is unable to be created.
Returns: Boolean, True if TEP was created.
-
delete
()¶ Perform DELETE call to delete <pyaoscx_module_type> table entry.
-
classmethod
from_response
(session, response_data)¶ Create a TEP object given a response_dat
-
classmethod
from_uri
(session, uri)¶ Create a TEP object given a TEP URI.
-
get
(depth=None, selector=None)¶ - Perform a GET call to retrieve data for a TEP 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_interface)¶ - Perform a GET call to retrieve all Tunnel Endpoints and create a
- dictionary containing each respective TEP.
Parameters: - cls – Object’s class.
- session – pyaoscx.Session object used to represent a logical connection to the device.
- parent_interface – Interface attached to this tunnel
Returns: Dictionary containing TEP IDs as keys and a TEP object as value.
-
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 TEP URI.
Returns: Object’s URI.
-
indices
= ['vrf_name', 'origin', 'destination']¶
-
modified
¶ Return boolean with whether this object has been modified.
-
object_uri
= 'system/interfaces/{intf_name}/tunnel_endpoints/{vrf_name},{origin},{destination}'¶
-
resource_uri_name
= 'tunnel_endpoints'¶
-
update
()¶ Perform a PUT call to apply changes to an existing TEP 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.
-