Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 010d3c2

Browse files
authored
Update base.py
#18 was repaired
1 parent 1254b09 commit 010d3c2

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

consul/base.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,13 +1065,25 @@ def delete(self, role_id, token=None):
10651065

10661066
def list(
10671067
self, policy=None, token=None):
1068+
"""
1069+
This endpoint lists all the ACL roles.
1070+
:param *policy*: (string: "") - Filters the
1071+
role list to those roles that are linked with
1072+
the specific policy ID.
1073+
:header X-Consul-Token:
1074+
:return:
1075+
"""
1076+
path = '/v1/acl/roles?policy=%s' % policy
10681077
headers = {}
10691078
token = token or self.agent.token
10701079
if token:
10711080
headers['X-Consul-Token'] = token
1081+
1082+
if policy:
1083+
headers['X-Consul-Token'] = policy
10721084

10731085
return self.agent.http.get(CB.json(),
1074-
path='/v1/acl/roles',
1086+
path=path,
10751087
headers=headers)
10761088

10771089
class AuthMethod(object):

0 commit comments

Comments
 (0)