(self, request, tenant_id, entity_id, alarm_id)
Gets an alarm by ID.
Gets an alarm by ID.
Gets an alarm by ID .
def get_alarm(self, request, tenant_id, entity_id, alarm_id):
        """
        Gets an alarm by ID.
        """
        entities = self._entity_cache_for_tenant(tenant_id).entities

        try:
            alarm = _get_alarm(entities, entity_id, alarm_id)
            return json.dumps(alarm.to_json())
        except (ObjectDoesNotExist, ParentDoesNotExist) as e:
            request.setResponseCode(e.code)
            return json.dumps(e.to_json())
def get_alarm ( self , request , tenant_id , entity_id , alarm_id ) : entities = self . _entity_cache_for_tenant ( tenant_id ) . entities try : alarm = _get_alarm ( entities , entity_id , alarm_id ) return json . dumps ( alarm . to_json ( ) ) except ( ObjectDoesNotExist , ParentDoesNotExist ) as e : request . setResponseCode ( e . code ) return json . dumps ( e . to_json ( ) )