'Reboots, shuts down or powers up the host.'

@wrap_exception()
@target_host_cell
def host_power_action(self, context, host_name, action):

    host_name = self._assert_host_exists(context, host_name)
    payload = {'host_name': host_name, 'action': action}
    compute_utils.notify_about_host_update(context, 'power_action.start', payload)
    result = self.rpcapi.host_power_action(context, action=action, host=host_name)
    compute_utils.notify_about_host_update(context, 'power_action.end', payload)
    return result
