Skip to content

Commit 844160d

Browse files
committed
fix telemetry query params
1 parent c45031f commit 844160d

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

provider/README.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,6 @@ Trips that start or end at a [Stop][stops] must include a `stop_id` property in
249249

250250
The `/events/recent` and `/events/historical/` endpoints return a list of Event objects, describing the activity of the Provider's vehicles. Recent events are at most two weeks old and can be queried with start/stop time, and historical events are packaged in hour-sized chunks for ease of implementation.
251251

252-
(?) This distinction is a holdover from MDS 1.x. Dramatic simplification of the query is meant to make cold storage by hourly chunks trivial without a database. We should ask Providers if that has been a concern in practice. Alternatively they could be the same endpoint with different parameters.
253-
254252
Unless stated otherwise by the municipality, this endpoint must return only those status changes with a `event_location` that [intersects](#intersection-operation) with the [municipality boundary](#municipality-boundary).
255253

256254
> Note: As a result of this definition, consumers should query the [trips endpoint][trips] to infer when vehicles enter or leave the municipality boundary.
@@ -267,8 +265,8 @@ Unless stated otherwise by the municipality, this endpoint must return only thos
267265

268266
The `/events/historical` API uses the following query parameter:
269267

270-
| Parameter | Format | Expected Output |
271-
| --------------- | ------ | --------------- |
268+
| Parameter | Format | Expected Output |
269+
| --------- | ------ | --------------- |
272270
| `event_time` | `YYYY-MM-DDTHH`, an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) extended datetime representing an UTC hour between 00 and 23. | All status changes with an event time occurring within the hour. For example, requesting `event_time=2019-10-01T07` returns all status changes where `2019-10-01T07:00:00 <= status_change.event_time < 2019-10-01T08:00:00` UTC. |
273271

274272
Without an `event_time` query parameter, `/events` shall return a `400 Bad Request` error.
@@ -514,17 +512,11 @@ Unless stated otherwise by the municipality, this endpoint must return only thos
514512

515513
#### Telemetry - Query Parameters
516514

517-
The telemetry API should allow querying with a combination of query parameters:
518-
519-
| Parameter | Type | Expected Output |
520-
| ----- | ---- | -------- |
521-
| `start_time` | [timestamp][ts] | telemetry where `start_time <= telemetry.timestamp` |
522-
| `end_time` | [timestamp][ts] | telemetry where `telemetry.timestamp < end_time` |
523-
| `trip_id` | UUID | telemetry where `telemetry.trip_id == trip_id`
515+
| Parameter | Format | Expected Output |
516+
| --------- | ------ | --------------- |
517+
| `telemetry_time` | `YYYY-MM-DDTHH`, an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) extended datetime representing an UTC hour between 00 and 23. | All telemetry with timestamp occurring within the hour. For example, requesting `telemetry_time=2019-10-01T07` returns all telemetry where `2019-10-01T07:00:00 <= telemetry.timestamp < 2019-10-01T08:00:00` UTC. |
524518

525-
Should either side of the requested time range be missing, or a `trip_id` is not present, `/events` shall return a `400 Bad Request` error.
526-
527-
Should the requested time range exceed 2 weeks, `/telemetry` shall return a `400 Bad Request` error.
519+
Without a `telemetry_time` query parameter, `/telemetry` shall return a `400 Bad Request` error.
528520

529521
[Top][toc]
530522

@@ -555,8 +547,6 @@ In addition to the standard [Provider payload wrapper](#response-format), respon
555547
**Schema:** [`vehicles` schema][vehicles-schema]
556548
**`data` Payload:** `{ "vehicles": [] }`, an array of [Vehicle](vehicle) objects
557549

558-
(?) Open question: should we standardize on telemetry over GeoJSON Point? E.g. replace last_event_location with last_event_telemetry.
559-
560550
[Top][toc]
561551

562552
[agps]: https://en.wikipedia.org/wiki/Assisted_GPS

0 commit comments

Comments
 (0)