Create API to list running instances
Summary
As an Insights user, I want to know what instances are running in my account(s) at a given time so I can make some decision about tethering?
Side note: This is being declared a priority recently.
From this line in recent prioritization chat:
API that takes an account and gives a list of instances it thinks are currently running.
Since we already have /api/v1/instances/
that is filtered to anything the current user sees (belonging to their accounts or if superuser all accounts), I would suggest we simply add a filter to that like ?running=True
or perhaps ?running_at=2010-01-02T03:04:05.00+00
Do we ever want to look at a timestamp? Or is it always only checking for things running now?
- Dan wants us to answer: "right now this is what I have running in AWS"
As I also reminded us in the recent prioritization chat:
BUUUUUUT REMEMBER THAT WE ARE NOT REAL-TIME.
Acceptance Criteria
-
Verify an API exists that lists all instances that are currently running - We do not care to look at arbitrary dates. Only now.
-
Verify API only returns instances visible to the authenticated user -
Verify API returns a list like /api/v1/instances/
(but probably on v2) - Maybe we don't paginate this? Or maybe we set the page size freaky huge?
- Why? The intent here is to tell the customer about ALL of their data at once in a view that doesn't necessarily paginate.
-
This operation is only officially supported on v2. - but we don't have to go out of our way to hide it for v1 if it's "change once for everywhere"
Assumptions and Questions
- v1 or v2 API? In other words: local auth or 3scale auth?
if v1 local auth, how is Insights going to use it?- if v2 3scale auth, how is anyone getting data into the system?
- ANSWER: v2 all the way. We trust that "sources" and a future UI are coming soon.™
- QE effort for this story is "almost nothing" - @mpierce