'Deletes the specified service.'

@wsgi.response(204)
@extensions.expected_errors((400, 404))
def delete(self, req, id):

    context = req.environ['nova.context']
    context.can(services_policies.BASE_POLICY_NAME)
    if api_version_request.is_supported(req, min_version=UUID_FOR_ID_MIN_VERSION):
        if (not uuidutils.is_uuid_like(id)):
            msg = (_('Invalid    uuid    %s') % id)
            raise webob.exc.HTTPBadRequest(explanation=msg)
    else:
        try:
            utils.validate_integer(id, 'id')
        except exception.InvalidInput as exc:
            raise webob.exc.HTTPBadRequest(explanation=exc.format_message())
    try:
        service = self.host_api.service_get_by_id(context, id)
        if (service.binary == 'nova-compute'):
            aggrs = self.aggregate_api.get_aggregates_by_host(context, service.host)
            for ag in aggrs:
                self.aggregate_api.remove_host_from_aggregate(context, ag.id, service.host)
        self.host_api.service_delete(context, id)
    except exception.ServiceNotFound:
        explanation = (_('Service    %s    not    found.') % id)
        raise webob.exc.HTTPNotFound(explanation=explanation)
    except exception.ServiceNotUnique:
        explanation = (_('Service    id    %s    refers    to    multiple    services.') % id)
        raise webob.exc.HTTPBadRequest(explanation=explanation)
