def _set_enabled_status(self, req, host, enabled):
        context = req.environ['nova.context']
        state = "enabled" if enabled else "disabled"
        LOG.audit(_("Setting host %(host)s to %(state)s.") % locals())
        result = self.compute_api.set_host_enabled(context, host=host,
                enabled=enabled)
        if result not in ("enabled", "disabled"):
            # An error message was returned
            raise webob.exc.HTTPBadRequest(explanation=result)
        return {"host": host, "status": result}
Process request to labels endpoint.
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/api/openstack/contrib/hosts.py/HostController._set_enabled_status--crossover with--dataset/ETHPy150Open kobotoolbox/kobocat/onadata/libs/mixins/labels_mixin.py/process_label_request