Acl

Module for working with EOS access control list resources

This module provides an implementation for configuring and managing access access control lists on Arista EOS nodes. Access control lists can be specified as either ‘standard’ or ‘extended’ ACLs. This module provides the following class implementations:

  • Acls – The top-level class used to manage both standard and extended
    access control lists in EOS
  • StandardAcls – Class that manages the set of standard ACLs
  • ExtendedAcls – Class that manages the set of extended ACLs
class pyeapi.api.acl.Acls(node, *args, **kwargs)

Bases: pyeapi.api.abstract.EntityCollection

create(name, type='standard')
create_instance(name, acl_type)
get(name)
get_instance(name)
getall()

Returns all ACLs in a dict object.

Returns:A Python dictionary object containing all ACL configuration indexed by ACL name:
{
    "<ACL1 name>": {...},
    "<ACL2 name>": {...}
}
marshall(name, *args, **kwargs)
class pyeapi.api.acl.ExtendedAcls(node)

Bases: pyeapi.api.abstract.EntityCollection

add_entry(name, action, protocol, srcaddr, srcprefixlen, dstaddr, dstprefixlen, log=False, seqno=None)
create(name)
default(name)
delete(name)
entry_re = <_sre.SRE_Pattern object at 0x22bd410>
get(name)
remove_entry(name, seqno)
update_entry(name, seqno, action, protocol, srcaddr, srcprefixlen, dstaddr, dstprefixlen, log=False)
class pyeapi.api.acl.StandardAcls(node)

Bases: pyeapi.api.abstract.EntityCollection

add_entry(name, action, addr, prefixlen, log=False, seqno=None)
create(name)
default(name)
delete(name)
entry_re = <_sre.SRE_Pattern object at 0x22c8720>
get(name)
remove_entry(name, seqno)
update_entry(name, seqno, action, addr, prefixlen, log=False)
pyeapi.api.acl.instance(node)
pyeapi.api.acl.mask_to_prefixlen(mask)

Converts a subnet mask from dotted decimal to bit length

Parameters:mask (str) – The dotted decimal subnet mask to convert
Returns:The subnet mask as a valid prefix length
Return type:str
pyeapi.api.acl.prefixlen_to_mask(prefixlen)

Converts a prefix length to a dotted decimal subnet mask

Parameters:prefixlen (str) – The prefix length value to convert
Returns:The subt mask as a dotted decimal string
Return type:str