(self, request, tenant_id, np_id)
return json.dumps({'values': values, 'metadata': metadata})
List of alarms pointing to a particular NotificationPlan
List of alarms pointing to a particular NotificationPlan
List of alarms pointing to a particular NotificationPlan
def alarms_by_np(self, request, tenant_id, np_id):
        """
        List of alarms pointing to a particular NotificationPlan
        """
        entities = self._entity_cache_for_tenant(tenant_id).entities
        values = [alarm.to_json()
                  for entity in entities.values()
                  for alarm in entity.alarms.values()
                  if alarm.notification_plan_id == np_id]
        metadata = {'limit': 100,
                    'marker': None,
                    'next_marker': None,
                    'next_href': None,
                    'count': len(values)}
        request.setResponseCode(200)
        return json.dumps({'values': values, 'metadata': metadata})
def alarms_by_np ( self , request , tenant_id , np_id ) : entities = self . _entity_cache_for_tenant ( tenant_id ) . entities values = [ alarm . to_json ( ) for entity in entities . values ( ) for alarm in entity . alarms . values ( ) if alarm . notification_plan_id == np_id ] metadata = { 'limit' : 100 , 'marker' : None , 'next_marker' : None , 'next_href' : None , 'count' : len ( values ) } request . setResponseCode ( 200 ) return json . dumps ( { 'values' : values , 'metadata' : metadata } )