consul.api.acl.policy module

class consul.api.acl.policy.Policy(agent)[source]

Bases: object

list(token=None)[source]

Lists all the active ACL policies. This is a privileged endpoint, and requires a management token. token will override this client’s default token. Requires a token with acl:read capability. ACLPermissionDenied raised otherwise

Parameters:

token (str | None)

read(uuid, token=None)[source]

Returns the policy information for id. Requires a token with acl:read capability. :param uuid: Specifies the UUID of the policy you look up. :param token: token with acl:read capability :return: selected Polic information

Parameters:

token (str | None)

create(name, token=None, description=None, rules=None)[source]

Create a policy This is a privileged endpoint, and requires a token with acl:write. :param name: Specifies a name for the ACL policy. :param token: token with acl:write capability :param description: Free form human-readable description of the policy. :param rules: Specifies rules for the ACL policy. :return: The cloned token information

Parameters:
  • name (str)

  • token (str | None)

  • description (str | None)