ks888 / LambStatus

[Maintenance mode] Serverless Status Page System
https://lambstatus.github.io
Apache License 2.0
1.3k stars 119 forks source link

/incidents API improvements #99

Open marcinc opened 6 years ago

marcinc commented 6 years ago

I'd like to propose a few improvements to the /incidents API:

marcinc commented 6 years ago

Also, option to order incidents by createdAt / updatedAt would be very useful.

ks888 commented 6 years ago

So far the associations between components and incidents are not stored in the DB and so we need to reconsider the structure of the stored data.

To support the query parameters to filter incidents will be pretty simple (except componentID filtering) since the dynamo DB already supports a query operation. It's great if you have a chance to contribute the code.

Just curious, what is your use case of this feature?

marcinc commented 6 years ago

Will take a stab at adding the filtering in for existing data.

As for the componentID adding that in the Incident model would be pretty handy. Basic use case here would be that in some cases you might want to only quickly check whether there is a Resolved incident (or any other status for that matter) for a given component. So instead of fetching the entire list of incidents and iterating through (given the componentID is already known) you may simply fetch relevant entries only and optionally limit them further with extra limit, since and status (if needed).