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.Auth import Auth
7 class DeleteRole(Method):
11 WARNING: This will remove the specified role from all accounts
12 that possess it, and from all node and slice attributes that refer
15 Returns 1 if successful, faults otherwise.
22 Mixed(Role.fields['role_id'],
26 returns = Parameter(int, '1 if successful')
29 def call(self, auth, role_id_or_name):
30 roles = Roles(self.api, [role_id_or_name])
32 raise PLCInvalidArgument, "No such role"
36 self.object_ids = [role['role_id']]