Skip to content

Consistent apis: GET part #4710

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

Merged
merged 1 commit into from
Jan 14, 2014

Conversation

spinscale
Copy link
Contributor

In order to make some our APIs consistent, ticket #4071 has been created.

This PR (not yet rebase, will do after review) takes care of streamlining the GET APIs

XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
builder.startObject();
for (ObjectObjectCursor<String, Settings> cursor : getSettingsResponse.getIndexToSettings()) {
// no settings, jump over it to shorten the response data
if (cursor.value.getAsMap().size() == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe getAsMap().isEmtpy() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@s1monw
Copy link
Contributor

s1monw commented Jan 13, 2014

I think this is close - @clintongormley can you look at it please!

return this;
}

@Override
public ActionRequestValidationException validate() {
return null;
ActionRequestValidationException validationException = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool looks good!

@dakrone
Copy link
Member

dakrone commented Jan 14, 2014

This looks good to me, +1

@s1monw
Copy link
Contributor

s1monw commented Jan 14, 2014

left some minor comments

* Made GET mappings consistent, supporting
  * /{index}/_mappings/{type}
  * /{index}/_mapping/{type}
  * /_mapping/{type}
  * Added "mappings" in the JSON response to align it with other responses
* Made GET warmers consistent, support /{index}/_warmers/{type} and /_warmer, /_warner/{name}
  as well as wildcards and _all notation
* Made GET aliases consistent, support /{index}/_aliases/{name} and /_alias, /_aliases/{name}
  as well as wildcards and _all notation
* Made GET settings consistent, added /{index}/_setting/{name}, /_settings/{name}
  as well as supportings wildcards in settings name
* Returning empty JSON instead of a 404, if a specific warmer/
  setting/alias/type is missing
* Added a ton of spec tests for all of the above
* Added a couple of more integration tests for several features

Relates elastic#4071
@spinscale spinscale merged commit 349a8be into elastic:master Jan 14, 2014
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.

4 participants