Closed
Description
Hi,
I noticed that alerta doesn't return all alert with function get_alerts
I think that the problem is the pagination
I changed the code of api.py to get function working
def get_alerts(self, query=None, page=1, page_size=None):
r = self.http.get('/alerts', query, page=page, page_size=page_size)
data = [Alert.parse(a) for a in r['alerts']]
while r['pages'] > r['page']:
r = self.http.get('/alerts', query, page=r['page']+1, page_size=page_size)
data.extend([Alert.parse(a) for a in r['alerts']])
return data
I hope it can help someone else with the same problem
Metadata
Metadata
Assignees
Labels
No labels