implement DeleteRole()
[plcapi.git] / PLC / Methods / GetRoles.py
1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.Roles import Role, Roles 
5 from PLC.NovaObject import NovaObject
6 from PLC.Auth import Auth
7
8 class GetRoles(Method):
9     """
10     Get an array of structs containing details about all roles.
11     """
12
13     roles = ['admin', 'pi', 'user', 'tech']
14
15     accepts = [
16         Auth()
17         ]
18
19     returns = [Role.fields]
20
21     def call(self, auth):
22         roles = Roles(self.api) 
23         return roles.dicts()