Add new "start_node" and "stop_node" to the base NodeDriver class.
Those methods are promoted to be part of the Libcloud standard compute
API because they are currently implemented as extension methods by a lot
of the existing compute drivers.
@@ -259,6 +259,24 @@ class Node(UuidMixin):
"""
return self.driver.reboot_node(self)
+ def start(self):
+ # type: () -> bool
+ """
+ Start this node.
+
+ :return: ``bool``
+ """
+ return self.driver.start_node(self)
+
+ def stop_node(self):
+ # type: () -> bool
+ """
+ Start this node.
+
+ :return: ``bool``
+ """
+ return self.driver.stop_node(self)
+
def destroy(self):
"""
Destroy this node
@@ -1082,6 +1100,34 @@ class NodeDriver(BaseDriver):
raise NotImplementedError(
'reboot_node not implemented for this driver')
+ def start_node(self, node):
+ # type: (Node) -> bool
+ """
+ Start a node.
+
+ :param node: The node to be started
+ :type node: :class:`.Node`
+
+ :return: True if the start was successful, otherwise False
+ :rtype: ``bool``
+ """
+ raise NotImplementedError(
+ 'start_node not implemented for this driver')
+
+ def stop_node(self, node):
+ # type: (Node) -> bool
+ """
+ Stop a node
+
+ :param node: The node to be stopped.
+ :type node: :class:`.Node`
+
+ :return: True if the stop was successful, otherwise False
+ :rtype: ``bool``
+ """
+ raise NotImplementedError(
+ 'stop_node not implemented for this driver')
+
def destroy_node(self, node):
# type: (Node) -> bool
"""
