'Do the cleanup on resources from a specific service/host/node.'

@wsgi.Controller.api_version('3.24')
@wsgi.response(202)
def cleanup(self, req, body=None):

    ctxt = self.policy_checker(req, 'cleanup')
    body = (body or {})
    params = self._prepare_params(ctxt, body, self.allowed_clean_keys)
    params['until'] = timeutils.utcnow()
    cleanup_request = objects.CleanupRequest(**params)
    (cleaning, unavailable) = self.sch_api.work_cleanup(ctxt, cleanup_request)
    return {'cleaning': workers_view.ViewBuilder.service_list(cleaning), 'unavailable': workers_view.ViewBuilder.service_list(unavailable)}
