def _host_power_action(self, req, host, action):
        """Reboots, shuts down or powers up the host."""
        context = req.environ['nova.context']
        try:
            result = self.compute_api.host_power_action(context, host=host,
                    action=action)
        except __HOLE__ as e:
            raise webob.exc.HTTPBadRequest(explanation=e.msg)
        return {"host": host, "power_action": result}
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/api/openstack/contrib/hosts.py/HostController._host_power_action