Creating ssh api (unfinished)
[nepi.git] / src / neco / resources / linux / node.py
1 from neco.execution.resource import ResourceManager, clsinit
2 from neco.execution.attribute import Attribute, Flags
3
4 @clsinit
5 class LinuxNode(ResourceManager):
6     _rtype = "LinuxNode"
7
8     @classmethod
9     def _register_attributes(cls):
10         hostname = Attribute("hostname", "Hostname of the machine")
11         username = Attribute("username", "Local account username", 
12                 flags = Flags.Credential)
13         password = Attribute("pasword", "Local account password",
14                 flags = Flags.Credential)
15
16         cls._register_attribute(hostname)
17         cls._register_attribute(username)
18         cls._register_attribute(password)
19
20     def __init__(self, ec, guid):
21         super(LinuxNode, self).__init__(ec, guid)
22
23         self._logger = logging.getLogger("neco.linux.Node.%d" % guid)
24         #elf._logger.setLevel(neco.LOGLEVEL)
25
26     def deploy(self):
27         pass
28
29     def discover(self, filters):
30         pass
31
32     def provision(self, filters):
33         pass
34
35     def start(self):
36         pass
37
38     def stop(self):
39         pass
40
41     def deploy(self, group = None):
42         pass
43
44     def release(self):
45         pass
46
47     def _validate_connection(self, guid):
48         # TODO: Validate!
49         return True
50
51