datastax / cstar_perf

Apache Cassandra performance testing platform
Apache License 2.0
72 stars 34 forks source link

Add /api/tests endpoint #116

Closed aboudreault closed 8 years ago

aboudreault commented 8 years ago

@mambocab This is for #106.

The filtering is quite precise. I'll let you decide if it is OK or not.

aboudreault commented 8 years ago

ah, and query/respons example:

http://127.0.0.1:8000/api/tests?date_from=1445458013
[
  {
    "href": "/api/tests/id/458ad396-782f-11e5-bf8f-0242ac11002a",
    "test_id": "458ad396-782f-11e5-bf8f-0242ac11002a"
  }
]
mambocab commented 8 years ago

The code looks good. So, if there are multiple tests, you get a list of objects, like

[
  {
    "href": "/api/tests/id/458ad396-782f-11e5-bf8f-0242ac11002a",
    "test_id": "458ad396-782f-11e5-bf8f-0242ac11002a"
  },
  {
    "href": "/api/tests/id/...",
    "test_id": "...",
  }
]

If so, that looks good to me. I'm not sure what the value of the href is when it's trivial to construct it given the test_id, but if you can think of any use case, then I have no problem with it.

aboudreault commented 8 years ago

I agree there are not much value here. Usually, it's a good practice in APIs to provide the urls of the resources they return. It allows the client to really only consume the data and not parse/guess/fetch. Sometime, the href is more complex.

aboudreault commented 8 years ago

If in any case it becomes a problem, we can remove it sure.

aboudreault commented 8 years ago

Should we add 'scheduled_date' in those summary objects? if its useful for you.