'Get binaries and services referred by given log set/get request.'

def _log_params_binaries_services(self, context, body):

    query_filters = {'is_up': True}
    binary = body.get('binary')
    if (binary in ('*', None, '')):
        binaries = self.LOG_BINARIES
    elif (binary == constants.API_BINARY):
        return ([binary], [])
    elif (binary in self.LOG_BINARIES):
        binaries = [binary]
        query_filters['binary'] = binary
    else:
        raise exception.InvalidInput(reason=(_('%s    is    not    a    valid    binary.') % binary))
    server = body.get('server')
    if server:
        query_filters['host_or_cluster'] = server
    services = objects.ServiceList.get_all(context, filters=query_filters)
    return (binaries, services)
