diff options
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 5 | ||||
| -rw-r--r-- | nova/compute/manager.py | 6 |
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.""" |
