-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Modify /query endpoint to work with POST and limit GET #6290
Comments
The deprecated or warning message that needs to be sent back is related to #5707 which also needs that functionality. It's likely easiest to do that by adding something to the results object. |
@pauldix is something like this what you envisioned?
Of course, we would modify the |
…e operations In order to follow REST a bit more carefully, all write operations should go through a POST in the future. We still allow read operations through either GET or POST (similar to the Graphite /render endpoint), but write operations will trigger a returned warning as part of the JSON response and will eventually return an error. Fixes #6290.
@jsternberg sure that looks good. |
I like the idea of allowing InfluxQL syntax combines a DDL and DML for interacting with the database. In the context of interacting with the database, HTTP currently is a dumb transport for sending InfluxQL queries. Tying InfluxQL syntax with HTTP verbs is redundant to InfluxQL's built-in permissions model and adds an unnecessary relationship to the HTTP protocol. Additionally, disallowing some queries via
To me, there are minimal practical benefits to limiting |
@gunnaraasen I think it's a rather trivial change in most clients to change to send everything through a |
Changing all clients to use |
…e operations In order to follow REST a bit more carefully, all write operations should go through a POST in the future. We still allow read operations through either GET or POST (similar to the Graphite /render endpoint), but write operations will trigger a returned warning as part of the JSON response and will eventually return an error. Also updates the Golang client libraries to always use POST instead of GET. Fixes #6290.
…e operations In order to follow REST a bit more carefully, all write operations should go through a POST in the future. We still allow read operations through either GET or POST (similar to the Graphite /render endpoint), but write operations will trigger a returned warning as part of the JSON response and will eventually return an error. Also updates the Golang client libraries to always use POST instead of GET. Fixes #6290.
…e operations In order to follow REST a bit more carefully, all write operations should go through a POST in the future. We still allow read operations through either GET or POST (similar to the Graphite /render endpoint), but write operations will trigger a returned warning as part of the JSON response and will eventually return an error. Also updates the Golang client libraries to always use POST instead of GET. Fixes #6290.
…e operations In order to follow REST a bit more carefully, all write operations should go through a POST in the future. We still allow read operations through either GET or POST (similar to the Graphite /render endpoint), but write operations will trigger a returned warning as part of the JSON response and will eventually return an error. Also updates the Golang client libraries to always use POST instead of GET. Fixes #6290.
…e operations In order to follow REST a bit more carefully, all write operations should go through a POST in the future. We still allow read operations through either GET or POST (similar to the Graphite /render endpoint), but write operations will trigger a returned warning as part of the JSON response and will eventually return an error. Also updates the Golang client libraries to always use POST instead of GET. Fixes #6290.
Sorry, what was the reason for making golang client/v2 use POST for queries? We use caching nginx in front of influxdb to ease its burgen, but unfortunately it doesn't work with POST requests. |
The intention was to separate queries that modify the database (using POST) and those that just query the database (using GET). Select queries are supposed to use GET, but the current client isn't smart enough to have different functions for those two different queries. While this is something that's easier to fix for someone using the client, I don't know how we would fix it for the |
Thanks for the explanation.
|
When can it be expected for queries that modifies the database to be disallowed when using GET requests rather than just a deprecation warning? I think letting GET be read-only is a great way to create more reliable clients. |
Not sure if this related, but I have a similar problem to what is described here grafana/grafana#5987. Edit: Found out in file handler.go that MultipartForm can be used to post query parameter as well. This solves my question, though it is not mentioned in the documentation as far as I can tell. |
We should modify the
/query
endpoint so that everything works withPOST
requests. We should then limitGET
requests so that onlySELECT
andSHOW
queries work there (except forSELECT INTO
queries, which should only work through aPOST
For the 0.13.0 release we should add the
POST
functionality and put a deprecation warning in theGET
requests for any queries that won't work later.After 0.13.0 is released we should then add the limitations to
GET
requestsThe text was updated successfully, but these errors were encountered: