Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure api and add event-status model #194

Merged
merged 3 commits into from
Dec 20, 2018

Conversation

toddapetersen
Copy link
Contributor

This is a baseline restructure of the Agency api to address a number of endpoint changes and incorporate feedback received in previous issue and PRs (#161 , #116 and #63 ).

Major changes:

  • provider_id is passed as part of an authorization bearer token.
  • Looking up and registering vehicles use standard GET and POST operations on /vehicles endpoint.
  • The /vehicles/{vehicle_id}/event allows Providers to POST events to affect vehicle status. The vehicle status is modeled around a state flow that is modeled in Vehicle Events table.
  • Deregister vehicle, trip start and end are now events.
  • Events for trip_enter and trip_leave were added to address trips that do not start or end in the Agency jurisdiction.

This is a baseline restructure of the Agency api to address a number of endpoint changes and incorporate feedback received in previous issue and PRs (#161, #116 and #63).

Major changes:
* `provider_id` is passed as part of an authorization bearer token.
* Looking up and registering vehicles use standard `GET` and `POST` operations on `/vehicles` endpoint.
* The `/vehicles/{vehicle_id}/event` allows Providers to `POST` events to affect vehicle status.  The vehicle status is modeled around a state flow that is modeled in Vehicle Events table.
* Deregister vehicle, trip start and end are now events.
* Events for `trip_enter` and `trip_leave` were added to address trips that do not start or end in the Agency jurisdiction.
@hunterowens hunterowens added the Agency Specific to the Agency API label Dec 12, 2018
@HenriJ
Copy link

HenriJ commented Dec 17, 2018

Hi @toddapetersen , love the more restful approach !

  • Why send telemetry data in the {vehicle}/event endpoint instead of the /update_trip_telemetry (that could become a {vehicle}/telemetry) ? It might be interesting to be updated on the telemetry every 5 seconds (to keep up-to-date data on the battery level, ...).
  • The Telemetry is referenced in the document, but I can't find the definition ?

@HenriJ
Copy link

HenriJ commented Dec 17, 2018

Oops, just saw your PR #196 , it answers my questions :)

For the events, what should happen if the Agency server goes down ? Could we add a timestamp field the event so that if we receive it later, we can know the real time when it occurred ?

@hunterowens
Copy link
Collaborator

@toddapetersen

Couple things.

This PR needs to target the dev branch, not 0.2.x as it is breaking changes.

I noticed that #195 #196 #197 all target this branch rather than dev or 0.2.x and that is PR contains commits that should be in that are also in #195/#196/#197? Or do you have a different strategy to merge these commits? I think it is currently very unclear how changes are being made.

agency/README.md Show resolved Hide resolved
agency/README.md Show resolved Hide resolved
agency/README.md Show resolved Hide resolved
agency/README.md Show resolved Hide resolved
agency/README.md Show resolved Hide resolved
agency/README.md Outdated Show resolved Hide resolved
agency/README.md Show resolved Hide resolved
@hunterowens
Copy link
Collaborator

Need to additionally integrate rebase and integrate #172 before merging this.

@toddapetersen toddapetersen changed the base branch from 0.2.x to dev December 19, 2018 21:04
@toddapetersen
Copy link
Contributor Author

Discussed changes are committed and rebased against dev. Should be good to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agency Specific to the Agency API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants