Exemple #1
0
    def get_all(self, q=None, limit=None, sort=None, marker=None):
        """Return all events matching the query filters.

        :param q: Filter arguments for which Events to return
        :param limit: Maximum number of samples to be returned.
        :param sort: A pair of sort key and sort direction combined with ":"
        :param marker: The pagination query marker, message id of the last
                       item viewed
        """
        rbac.enforce("events:index", pecan.request)
        q = q or []
        event_filter = _event_query_to_event_filter(q)
        pagination = v2_utils.set_pagination_options(
            sort, limit, marker, event_models.Event)
        return [Event(message_id=event.message_id,
                      event_type=event.event_type,
                      generated=event.generated,
                      traits=event.traits,
                      raw=event.raw)
                for event in
                pecan.request.conn.get_events(event_filter, pagination)]
Exemple #2
0
    def get_all(self, q=None, limit=None, sort=None, marker=None):
        """Return all events matching the query filters.

        :param q: Filter arguments for which Events to return
        :param limit: Maximum number of samples to be returned.
        :param sort: A pair of sort key and sort direction combined with ":"
        :param marker: The pagination query marker, message id of the last
                       item viewed
        """
        rbac.enforce("events:index", pecan.request)
        q = q or []
        event_filter = _event_query_to_event_filter(q)
        pagination = v2_utils.set_pagination_options(
            sort, limit, marker, event_models.Event)
        return [Event(message_id=event.message_id,
                      event_type=event.event_type,
                      generated=event.generated,
                      traits=event.traits,
                      raw=event.raw)
                for event in
                pecan.request.conn.get_events(event_filter, pagination)]