# 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: `EntityCollection`

  create(name, type='standard')
  create_instance(name, acl_type)
  get(k[, d]) → D[k] if k in D, else d. d defaults to None.
  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: `EntityCollection`

  add_entry(name, action, protocol, srcaddr, srcprefixlen, dstaddr, dstprefixlen, log=False, seqno=None)
  create(name)
  default(name)
  delete(name)
  entry_re = re.compile('(\\d+)(?: ([p|d]\\w+))(?: (\\w+|\\d+))(?: ([a|h]\\w+))?(?: ([0-9]+(?:\\.[0-9]+){3}))?(?:/([0-9]{1,2}))?(?: ((?:eq|gt|lt|neq|range) [\\w-]+))?(?: ([a|h]\\w+))?(?: ([0-9]+(?:\\.[0-9]+){3}))?(?:/([0-9]{)
  get(k[, d]) → D[k] if k in D, else d. d defaults to None.
  remove_entry(name, seqno)
  update_entry(name, seqno, action, protocol, srcaddr, srcprefixlen, dstaddr, dstprefixlen, log=False)

class pyeapi.api.acl.StandardAcls(node)

  Bases: `EntityCollection`

  add_entry(name, action, addr, prefixlen, log=False, seqno=None)
  create(name)
  default(name)
  delete(name)
  entry_re = re.compile('(\\d+)(?: ([p|d]\\w+))(?: (any))?(?: (host))?(?: ([0-9]+(?:\\.[0-9]+){3}))?(?:/([0-9]{1,2}))?(?: ([0-9]+(?:\\.[0-9]+){3}))?(?: (log))?')
  get(k[, d]) → D[k] if k in D, else d. d defaults to None.
  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