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

PreparedQuery Delete API is a "Query" rather than a "Write" #1591

Closed
highlyunavailable opened this issue Jan 13, 2016 · 3 comments
Closed

PreparedQuery Delete API is a "Query" rather than a "Write" #1591

highlyunavailable opened this issue Jan 13, 2016 · 3 comments
Labels
type/bug Feature does not function as expected

Comments

@highlyunavailable
Copy link
Contributor

Is there any specific reason the PreparedQuery create API is a POST when every other API in Consul uses PUT for create/update (including the prepared query update API)?

Just something I discovered when adding this for the C# API and wondered about.

@highlyunavailable
Copy link
Contributor Author

Also, the PreparedQuery Delete API is a "Query" rather than a "Write": https://github.com/hashicorp/consul/blob/master/api/prepared_query.go#L149 (compared to KV: https://github.com/hashicorp/consul/blob/master/api/kv.go#L199)

@slackpad slackpad added the type/bug Feature does not function as expected label Jan 13, 2016
@slackpad
Copy link
Contributor

Hi @highlyunavailable since this was a totally new API we wanted to be more REST-y, similar to the KV store, but we decided to separate out the create from the update operation since the ID is always generated by the Consul and never passed in when the query is created. It definitely could have been a PUT, but was sort of a style choice.

The API options thing is a bug, thanks for finding that!

@slackpad slackpad added the easy label Jan 13, 2016
@highlyunavailable
Copy link
Contributor Author

Okay, fair enough. It wasn't a big deal, I just wondered because it was different. Thanks!

I edited the title of the issue to be the actual bug.

@highlyunavailable highlyunavailable changed the title PreparedQuery create POST vs PUT for all other APIs PreparedQuery Delete API is a "Query" rather than a "Write" Jan 13, 2016
@kyhavlov kyhavlov closed this as completed Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Feature does not function as expected
Projects
None yet
Development

No branches or pull requests

3 participants