2 from PLC.Faults import *
3 from PLC.Method import Method
4 from PLC.Parameter import Parameter, Mixed
5 from PLC.Roles import Role, Roles
6 from PLC.Auth import Auth
8 class DeleteRole(Method):
12 WARNING: This will remove the specified role from all accounts
13 that possess it, and from all node and slice attributes that refer
16 Returns 1 if successful, faults otherwise.
23 Mixed(Role.fields['role_id'],
27 returns = Parameter(int, '1 if successful')
30 def call(self, auth, role_id_or_name):
31 roles = Roles(self.api, [role_id_or_name])
33 raise PLCInvalidArgument, "No such role"
37 self.event_objects = {'Role': [role['role_id']]}