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

Expose a version method to the HTTP Rest API. #505

Closed
wants to merge 2 commits into from

Conversation

majst01
Copy link
Contributor

@majst01 majst01 commented May 6, 2014

Add a handy http rest api call to make it possible that clients can query the installed influxdb version.

Example usage:

curl http://localhost:8086/version
{"version":"dev","gitSha":"b12783456a0c6bfcdf4da5e71a431de35e6ad56b"}

@jvshahid
Copy link
Contributor

jvshahid commented May 6, 2014

@majst01 can you please sign the CLA. The CLA can be found here

@freeformz
Copy link

Should this not be in a response header?

@jvshahid
Copy link
Contributor

jvshahid commented May 6, 2014

@freeformz what do you have in mind ? Return the version as a header with every response or just when the endpoint is hit

@damm
Copy link

damm commented May 7, 2014

I think having the version exposed in the header of every response would be fantastic. Unfortunately this pull request is not about that.

X-INFLUXDB-VERSION: 0.61.1

@majst01
Copy link
Contributor Author

majst01 commented May 7, 2014

My use case was more a simple way (without then need for calling a authenticated method) to get the version of the influxdb instance. For example a client application create a new connection and prints information about the new established connection.

If the version information is only available for regular method, i need to make a call like describeDatabases just to get the version info.

Maybe we can do both:
ad a /version call, and add the X-INFLUXDB-VERSION Header to every response.

@jvshahid
Copy link
Contributor

jvshahid commented May 7, 2014

I think we should add the header for now. I don't like adding a new endpoint, since we're planning on exposing a stats endpoint. The stats endpoint will replace the ping and version endpoints, so in my opinion we shouldn't be introducing new endpoints until the stats one gets done. Thoughts ?

@jvshahid jvshahid added this to the 0.6.2 milestone May 7, 2014
@majst01
Copy link
Contributor Author

majst01 commented May 7, 2014

Ok, sounds like a plan. But actually there is no single place to add/set response headers in http/api.go.

@jvshahid
Copy link
Contributor

jvshahid commented May 7, 2014

See CorsHeaderHandler for an example

@majst01
Copy link
Contributor Author

majst01 commented May 7, 2014

Ok, i removed the /version call and put the version info into the Header.

@jvshahid jvshahid modified the milestones: Next release, 0.6.2 May 12, 2014
@jvshahid jvshahid closed this in 51306db May 13, 2014
@jvshahid jvshahid modified the milestones: 0.6.3, Next release May 13, 2014
@torkelo
Copy link

torkelo commented May 31, 2014

This will be great for Grafana :)

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

Successfully merging this pull request may close these issues.

None yet

5 participants