summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorEd Leafe <ed@leafe.com>2011-08-08 15:34:04 +0000
committerEd Leafe <ed@leafe.com>2011-08-08 15:34:04 +0000
commit6dcea0da62e881eaeb02027ea868d49c2402209d (patch)
treed7195fb631676bc6b880a46cc85b2af6d4289543 /nova/compute
parent966b7218a0fc96222e0ef0a22526f1bf3e7f2a9c (diff)
parenteb66810f6034a29724630e89739217a83b858d86 (diff)
Merged trunk
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/api.py5
-rw-r--r--nova/compute/manager.py6
2 files changed, 11 insertions, 0 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 752f29384..e5e5f7f57 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -999,6 +999,11 @@ class API(base.Base):
return self._call_compute_message("set_host_enabled", context,
instance_id=None, host=host, params={"enabled": enabled})
+ def host_power_action(self, context, host, action):
+ """Reboots or shuts down the host."""
+ return self._call_compute_message("host_power_action", context,
+ instance_id=None, host=host, params={"action": action})
+
@scheduler_api.reroute_compute("diagnostics")
def get_diagnostics(self, context, instance_id):
"""Retrieve diagnostics for the given instance."""
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 69acf6e95..fb135e1f2 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -958,6 +958,12 @@ class ComputeManager(manager.SchedulerDependentManager):
result))
@exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
+ def host_power_action(self, context, instance_id=None, host=None,
+ action=None):
+ """Reboots or shuts down the host."""
+ return self.driver.host_power_action(host, action)
+
+ @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def set_host_enabled(self, context, instance_id=None, host=None,
enabled=None):
"""Sets the specified host's ability to accept new instances."""