get rid of svn keywords once and for good
[plcapi.git] / PLC / Methods / BootNotifyOwners.py
1 from PLC.Method import Method
2 from PLC.Parameter import Parameter, Mixed
3 from PLC.Auth import Auth, BootAuth, SessionAuth
4 from PLC.Nodes import Node, Nodes
5 from PLC.Messages import Message, Messages
6
7 from PLC.Boot import notify_owners
8
9 class BootNotifyOwners(Method):
10     """
11     Notify the owners of the node, and/or support about an event that
12     happened on the machine.
13
14     Returns 1 if successful.
15     """
16
17     roles = ['node']
18
19     accepts = [
20         Auth(),
21         Message.fields['message_id'],
22         Parameter(int, "Notify PIs"),
23         Parameter(int, "Notify technical contacts"),
24         Parameter(int, "Notify support")
25         ]
26
27     returns = Parameter(int, '1 if successful')
28
29     def call(self, auth, message_id, include_pis, include_techs, include_support):
30         assert isinstance(self.caller, Node)
31         notify_owners(self, self.caller, message_id, include_pis, include_techs, include_support)
32         return 1