Hygieia: Rest API

Created on 1 Jun 2017  Â·  6Comments  Â·  Source: hygieia/hygieia

Want to take a stab at a V2 of the API. Based on your roadmap, it looks like you wanted to create a more intelligent API, here were some thoughts I had for enhancements.

  • Take advantage of Spring HATEOAS, and make the API self discoverable through use of link and proper rest nouns/verbs. Will be more consistent and easier to navigate.

  • Separate the domain model from the rest api resources. Currently, the client needs to have more knowledge of the domain than it should have to. Since Hygieia has been around a while now, we have a better understanding of the use cases, which should give us a better understanding of what resources we will need to expose.

  • Instead of removing the old API, create a V2 we could slowly migrate to. This would most likely be accomplished through the url. ex. "http:/localhost/api/v2/foo"

Let me know if you guys have any thoughts on this, or would like to see anything else.

enhancement help wanted

Most helpful comment

I'd also like to decouple the collector's from the database by having them use the API instead. This should hopefully make it a bit easier for individuals to build/maintain collectors.

All 6 comments

I'd also like to decouple the collector's from the database by having them use the API instead. This should hopefully make it a bit easier for individuals to build/maintain collectors.

Yeah, was definitely going to keep that in mind as we go.

There is some discussion on gitter regarding some changes needed to receive "Comcast" contributions like Rally collector and some others they built.

@irvingoe I believe that one involves changing Hygieia from a monolithic git project to a submodule git project, which might be a bit beyond the scope of this particular issue.

We could certainly split the API out into it's own project, though - that might make it easier for individuals to set up and make localized contributions to just the API. The same could be said about the UI - if all you want to do is make a few aesthetic improvements, you (theoretically) wouldn't have to set up a ton of stuff to make that contribution. Of course, there might be greater maintainer load associated with this approach. I think #1305 is more appropriate for these discussions :)

@rob-miller-777 totally onboard with all of the above ideas, though.

fyi... we are looking into having Hygieia as an org. It will help breaking things easily. Stay tuned.

Long term goal is to create GraphQL api layer. Closing this.

Was this page helpful?
0 / 5 - 0 ratings