3 from PLC.Faults import *
4 from PLC.Method import Method
5 from PLC.Parameter import Parameter, Mixed
6 from PLC.Roles import Role, Roles
7 from PLC.Auth import Auth
9 class DeleteRole(Method):
13 WARNING: This will remove the specified role from all accounts
14 that possess it, and from all node and slice attributes that refer
17 Returns 1 if successful, faults otherwise.
24 Mixed(Role.fields['role_id'],
28 returns = Parameter(int, '1 if successful')
31 def call(self, auth, role_id_or_name):
32 roles = Roles(self.api, [role_id_or_name])
34 raise PLCInvalidArgument, "No such role"
38 self.event_objects = {'Role': [role['role_id']]}