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