pyaoscx.acl module

pyaoscx.acl.clear_interface_acl(interface_name, acl_type='aclv4_out', **kwargs)

Perform GET and PUT calls to clear an interface’s ACL

Parameters:
  • interface_name – Alphanumeric name of the interface
  • acl_type – Type of ACL, options are between ‘aclv4_out’, ‘aclv4_in’, and ‘aclv6_in’
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.acl.clear_port_acl_in(port_name, list_type, **kwargs)

Perform GET and PUT calls to clear a Port’s Ingress ACL

Parameters:
  • port_name – Alphanumeric name of the Port
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.acl.create_acl(list_name, list_type, **kwargs)

Perform a POST call to create an ACL with no entries

Parameters:
  • list_name – Alphanumeric name of the ACL
  • list_type – Type should be one of “ipv4,” “ipv6,” or “mac”
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.acl.create_acl_entry(list_name, list_type, sequence_num, action, count=None, ip_protocol=None, src_ip=None, dst_ip=None, dst_l4_port_min=None, dst_l4_port_max=None, src_mac=None, dst_mac=None, ethertype=None, **kwargs)

Perform a POST call to create an ACL entry

Parameters:
  • list_name – Alphanumeric name of the ACL
  • list_type – Type should be one of “ipv4,” “ipv6,” or “mac”
  • sequence_num – Integer number of the sequence
  • action – Action should be either “permit” or “deny”
  • count – Optional boolean flag that when true, will make entry increment hit count for matched packets
  • ip_protocol – Optional integer IP protocol number
  • src_ip – Optional source IP address
  • dst_ip – Optional destination IP address
  • dst_l4_port_min – Optional minimum L4 port number in range; used in conjunction with dst_l4_port_max.
  • dst_l4_port_max – Optional maximum L4 port number in range; used in conjunction with dst_l4_port_min.
  • src_mac – Optional source MAC address
  • dst_mac – Optional destination MAC address
  • ethertype – Optional integer EtherType number
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.acl.delete_acl(list_name, list_type, **kwargs)

Perform a DELETE call to delete an ACL

Parameters:
  • list_name – Alphanumeric name of the ACL
  • list_type – Type should be one of “ipv4,” “ipv6,” or “mac”
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.acl.delete_acl_entry(list_name, list_type, sequence_num, **kwargs)

Perform a DELETE call to delete an ACL entry

Parameters:
  • list_name – Alphanumeric name of the ACL
  • list_type – Type should be one of “ipv4,” “ipv6,” or “mac”
  • sequence_num – Integer ID for the entry.
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.acl.get_acl(list_name, list_type, **kwargs)

Perform a GET call to get details of a particular ACL

Parameters:
  • list_name – Alphanumeric name of the ACL
  • list_type – Type should be one of “ipv4,” “ipv6,” or “mac”
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

Dictionary containing data about a particular ACL

pyaoscx.acl.get_all_acl_entries(list_name, list_type, **kwargs)

Perform a GET call to get all entries of an ACL

Parameters:
  • list_name – Alphanumeric name of the ACL
  • list_type – Type should be one of “ipv4,” “ipv6,” or “mac”
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

Dictionary containing queue profile entry URIs

pyaoscx.acl.get_all_acls(**kwargs)

Perform a GET call to get a list of all ACLs

Parameters:kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:List of all ACLs in the table
pyaoscx.acl.update_acl(list_name, list_type, **kwargs)

Perform a PUT call to version-up an ACL. This is required whenever entries of an ACL are changed in any way.

Parameters:
  • list_name – Alphanumeric name of the ACL
  • list_type – Type should be one of “ipv4,” “ipv6,” or “mac”
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.acl.update_port_acl_in(interface_name, acl_name, list_type, **kwargs)

Perform GET and PUT calls to apply ACL on an interface. This function specifically applies an ACL to Ingress traffic of the interface

Parameters:
  • interface_name – Alphanumeric String that is the name of the interface on which the ACL is applied to
  • acl_name – Alphanumeric String that is the name of the ACL
  • list_type – Alphanumeric String of ipv4 or ipv6 to specify the type of ACL
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise

pyaoscx.acl.update_port_acl_out(interface_name, acl_name, **kwargs)

Perform GET and PUT calls to apply ACL on an L3 interface. This function specifically applies an ACL to Egress traffic of the interface, which must be a routing interface

Parameters:
  • interface_name – Alphanumeric String that is the name of the interface on which the ACL is applied to
  • acl_name – Alphanumeric String that is the name of the ACL
  • kwargs – keyword s: requests.session object with loaded cookie jar keyword url: URL in main() function
Returns:

True if successful, False otherwise