-
Notifications
You must be signed in to change notification settings - Fork 17
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
Added healthcheck endpoint #173
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tzumainn I worry that we are conflating two things here:
- Health check
- Version discovery
If we're going to report a versions
string, then either (a) there should be code to dynamically discover what API versions are supported by the code or (b) there should be a way to register version information.
What do you think?
To be honest I don't see a huge practical difference between the two (although I could be missing something)! I do agree with your comment about versions though. |
The difference is that the health check endpoint doesn't really require any additional logic, so it can be implemented immediately, while setting up version discovery seems like a bigger project. I defer to your judgement on this; if you're happy with the current implementation, I'm not going to object. |
@sheldor1510 I would make that a separate PR. |
from oslo_serialization import jsonutils | ||
|
||
|
||
def root(host_url): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may as well create a unit test for this, just for completeness!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
created and tested!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! One last request - can you squash your commits into a single commit? That helps maintain a clean commit history.
added unit tests pre-commit fix
48a6c55
to
24d2b83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good - thanks!
@larsks For #160 , I discussed with @tzumainn and decided to do the healthcheck at the root endpoint (
<host_url>/
) similar to how the Ironic API does.So, the API returns this at
<host_url>/
:The rest of the requests return this if accessed unauthenticated: