3 from PLC.Faults import *
4 from PLC.Method import Method
5 from PLC.Parameter import Parameter, Mixed
6 from PLC.InitScripts import InitScript, InitScripts
7 from PLC.Auth import Auth
9 class DeleteInitScript(Method):
11 Deletes an existing initscript.
13 Returns 1 if successful, faults otherwise.
20 Mixed(InitScript.fields['initscript_id'],
21 InitScript.fields['name']),
24 returns = Parameter(int, '1 if successful')
27 def call(self, auth, initscript_id_or_name):
28 initscripts = InitScripts(self.api, [initscript_id_or_name])
30 raise PLCInvalidArgument, "No such initscript"
32 initscript = initscripts[0]
34 self.event_objects = {'InitScript': [initscript['initscript_id']]}