Beispiel #1
0
 def convert_with_links(cls,
                        rpc_event_suppression,
                        limit,
                        url=None,
                        expand=False,
                        **kwargs):
     collection = EventSuppressionCollection()
     collection.event_suppression = [
         EventSuppression.convert_with_links(p, expand)
         for p in rpc_event_suppression
     ]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
Beispiel #2
0
    def convert_with_links(cls, ilog, limit=None, url=None,
                           expand=False, **kwargs):

        ilogs = []
        for a in ilog:
            ilogs.append(a)

        collection = EventLogCollection()
        collection.event_log = [EventLog.convert_with_links(ch, expand)
                                for ch in ilogs]

        collection.next = collection.get_next(limit, url=url, **kwargs)
        return collection
Beispiel #3
0
    def convert_with_links(cls, ialm, limit, url=None, expand=False, **kwargs):
        # filter masked alarms
        ialms = []
        for a in ialm:
            if isinstance(a, tuple):
                ialm_instance = a[0]
            else:
                ialm_instance = a
            if str(ialm_instance['masked']) != 'True':
                ialms.append(a)

        collection = AlarmCollection()
        collection.alarms = [
            Alarm.convert_with_links(ch, expand) for ch in ialms
        ]
        # url = url or None
        collection.next = collection.get_next(limit, url=url, **kwargs)
        return collection