diff --git a/core/src/main/java/org/elasticsearch/action/ActionModule.java b/core/src/main/java/org/elasticsearch/action/ActionModule.java index 618b97fbac2d9..89994dc30f3d1 100644 --- a/core/src/main/java/org/elasticsearch/action/ActionModule.java +++ b/core/src/main/java/org/elasticsearch/action/ActionModule.java @@ -253,6 +253,9 @@ import org.elasticsearch.rest.action.admin.indices.RestFlushAction; import org.elasticsearch.rest.action.admin.indices.RestForceMergeAction; import org.elasticsearch.rest.action.admin.indices.RestGetAliasesAction; +import org.elasticsearch.rest.action.admin.indices.RestGetAllAliasesAction; +import org.elasticsearch.rest.action.admin.indices.RestGetAllMappingsAction; +import org.elasticsearch.rest.action.admin.indices.RestGetAllSettingsAction; import org.elasticsearch.rest.action.admin.indices.RestGetFieldMappingAction; import org.elasticsearch.rest.action.admin.indices.RestGetIndexTemplateAction; import org.elasticsearch.rest.action.admin.indices.RestGetIndicesAction; @@ -541,6 +544,9 @@ public void initRestHandlers(Supplier nodesInCluster) { registerHandler.accept(new RestDeleteSnapshotAction(settings, restController)); registerHandler.accept(new RestSnapshotsStatusAction(settings, restController)); + registerHandler.accept(new RestGetAllAliasesAction(settings, restController)); + registerHandler.accept(new RestGetAllMappingsAction(settings, restController)); + registerHandler.accept(new RestGetAllSettingsAction(settings, restController, indexScopedSettings, settingsFilter)); registerHandler.accept(new RestTypesExistsAction(settings, restController)); registerHandler.accept(new RestGetIndicesAction(settings, restController, indexScopedSettings, settingsFilter)); registerHandler.accept(new RestIndicesStatsAction(settings, restController)); diff --git a/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesAction.java b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesAction.java index 41408fdcf6c61..5a211d63d3a5e 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesAction.java @@ -57,6 +57,8 @@ public RestGetAliasesAction(final Settings settings, final RestController contro super(settings); controller.registerHandler(GET, "/_alias/{name}", this); controller.registerHandler(HEAD, "/_alias/{name}", this); + controller.registerHandler(GET, "/{index}/_alias", this); + controller.registerHandler(HEAD, "/{index}/_alias", this); controller.registerHandler(GET, "/{index}/_alias/{name}", this); controller.registerHandler(HEAD, "/{index}/_alias/{name}", this); } diff --git a/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAllAliasesAction.java b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAllAliasesAction.java new file mode 100644 index 0000000000000..0d10ac5800e76 --- /dev/null +++ b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAllAliasesAction.java @@ -0,0 +1,107 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.action.admin.indices; + +import org.elasticsearch.action.admin.indices.get.GetIndexRequest; +import org.elasticsearch.action.admin.indices.get.GetIndexRequest.Feature; +import org.elasticsearch.action.admin.indices.get.GetIndexResponse; +import org.elasticsearch.action.support.IndicesOptions; +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.cluster.metadata.AliasMetaData; +import org.elasticsearch.common.Strings; +import org.elasticsearch.common.settings.IndexScopedSettings; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.settings.SettingsFilter; +import org.elasticsearch.common.xcontent.ToXContent.Params; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.rest.BaseRestHandler; +import org.elasticsearch.rest.BytesRestResponse; +import org.elasticsearch.rest.RestController; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.RestResponse; +import org.elasticsearch.rest.action.RestBuilderListener; + +import java.io.IOException; +import java.util.List; +import java.util.Set; + +import static org.elasticsearch.rest.RestRequest.Method.GET; +import static org.elasticsearch.rest.RestRequest.Method.HEAD; +import static org.elasticsearch.rest.RestStatus.OK; + +/** + * The REST handler for retrieving all aliases + */ +public class RestGetAllAliasesAction extends BaseRestHandler { + + public RestGetAllAliasesAction(final Settings settings, final RestController controller) { + super(settings); + controller.registerHandler(GET, "/_alias", this); + controller.registerHandler(GET, "/_aliases", this); + } + + @Override + public String getName() { + return "get_all_aliases_action"; + } + + @Override + public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { + final GetIndexRequest getIndexRequest = new GetIndexRequest(); + getIndexRequest.indices(Strings.EMPTY_ARRAY); + getIndexRequest.features(Feature.ALIASES); + getIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, getIndexRequest.indicesOptions())); + getIndexRequest.local(request.paramAsBoolean("local", getIndexRequest.local())); + getIndexRequest.humanReadable(request.paramAsBoolean("human", false)); + return channel -> client.admin().indices().getIndex(getIndexRequest, new RestBuilderListener(channel) { + + @Override + public RestResponse buildResponse(final GetIndexResponse response, final XContentBuilder builder) throws Exception { + builder.startObject(); + { + for (final String index : response.indices()) { + builder.startObject(index); + { + writeAliases(response.aliases().get(index), builder, request); + } + builder.endObject(); + } + } + builder.endObject(); + + return new BytesRestResponse(OK, builder); + } + + private void writeAliases(final List aliases, final XContentBuilder builder, + final Params params) throws IOException { + builder.startObject("aliases"); + { + if (aliases != null) { + for (final AliasMetaData alias : aliases) { + AliasMetaData.Builder.toXContent(alias, builder, params); + } + } + } + builder.endObject(); + } + }); + } + +} diff --git a/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAllMappingsAction.java b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAllMappingsAction.java new file mode 100644 index 0000000000000..9892717cd779b --- /dev/null +++ b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAllMappingsAction.java @@ -0,0 +1,109 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.action.admin.indices; + +import com.carrotsearch.hppc.cursors.ObjectObjectCursor; +import org.elasticsearch.action.admin.indices.get.GetIndexRequest; +import org.elasticsearch.action.admin.indices.get.GetIndexRequest.Feature; +import org.elasticsearch.action.admin.indices.get.GetIndexResponse; +import org.elasticsearch.action.support.IndicesOptions; +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.cluster.metadata.AliasMetaData; +import org.elasticsearch.cluster.metadata.MappingMetaData; +import org.elasticsearch.common.Strings; +import org.elasticsearch.common.collect.ImmutableOpenMap; +import org.elasticsearch.common.settings.IndexScopedSettings; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.settings.SettingsFilter; +import org.elasticsearch.common.xcontent.ToXContent.Params; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.rest.BaseRestHandler; +import org.elasticsearch.rest.BytesRestResponse; +import org.elasticsearch.rest.RestController; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.RestResponse; +import org.elasticsearch.rest.action.RestBuilderListener; + +import java.io.IOException; +import java.util.List; +import java.util.Set; + +import static org.elasticsearch.rest.RestRequest.Method.GET; +import static org.elasticsearch.rest.RestRequest.Method.HEAD; +import static org.elasticsearch.rest.RestStatus.OK; + +/** + * The REST handler for retrieving all mappings + */ +public class RestGetAllMappingsAction extends BaseRestHandler { + + public RestGetAllMappingsAction(final Settings settings, final RestController controller) { + super(settings); + controller.registerHandler(GET, "/_mapping", this); + controller.registerHandler(GET, "/_mappings", this); + } + + @Override + public String getName() { + return "get_all_mappings_action"; + } + + @Override + public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { + final GetIndexRequest getIndexRequest = new GetIndexRequest(); + getIndexRequest.indices(Strings.EMPTY_ARRAY); + getIndexRequest.features(Feature.MAPPINGS); + getIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, getIndexRequest.indicesOptions())); + getIndexRequest.local(request.paramAsBoolean("local", getIndexRequest.local())); + getIndexRequest.humanReadable(request.paramAsBoolean("human", false)); + return channel -> client.admin().indices().getIndex(getIndexRequest, new RestBuilderListener(channel) { + + @Override + public RestResponse buildResponse(final GetIndexResponse response, final XContentBuilder builder) throws Exception { + builder.startObject(); + { + for (final String index : response.indices()) { + builder.startObject(index); + { + writeMappings(response.mappings().get(index), builder); + } + builder.endObject(); + } + } + builder.endObject(); + + return new BytesRestResponse(OK, builder); + } + + private void writeMappings(final ImmutableOpenMap mappings, + final XContentBuilder builder) throws IOException { + builder.startObject("mappings"); + { + for (final ObjectObjectCursor typeEntry : mappings) { + builder.field(typeEntry.key); + builder.map(typeEntry.value.sourceAsMap()); + } + } + builder.endObject(); + } + }); + } + +} diff --git a/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAllSettingsAction.java b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAllSettingsAction.java new file mode 100644 index 0000000000000..f51cee37ad3f0 --- /dev/null +++ b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAllSettingsAction.java @@ -0,0 +1,121 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.rest.action.admin.indices; + +import org.elasticsearch.action.admin.indices.get.GetIndexRequest; +import org.elasticsearch.action.admin.indices.get.GetIndexRequest.Feature; +import org.elasticsearch.action.admin.indices.get.GetIndexResponse; +import org.elasticsearch.action.support.IndicesOptions; +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.cluster.metadata.AliasMetaData; +import org.elasticsearch.common.Strings; +import org.elasticsearch.common.settings.IndexScopedSettings; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.settings.SettingsFilter; +import org.elasticsearch.common.xcontent.ToXContent.Params; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.rest.BaseRestHandler; +import org.elasticsearch.rest.BytesRestResponse; +import org.elasticsearch.rest.RestController; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.RestResponse; +import org.elasticsearch.rest.action.RestBuilderListener; + +import java.io.IOException; +import java.util.List; +import java.util.Set; + +import static org.elasticsearch.rest.RestRequest.Method.GET; +import static org.elasticsearch.rest.RestRequest.Method.HEAD; +import static org.elasticsearch.rest.RestStatus.OK; + +/** + * The REST handler for retrieving all settings + */ +public class RestGetAllSettingsAction extends BaseRestHandler { + + private final IndexScopedSettings indexScopedSettings; + private final SettingsFilter settingsFilter; + + public RestGetAllSettingsAction(final Settings settings, final RestController controller, + final IndexScopedSettings indexScopedSettings, final SettingsFilter settingsFilter) { + super(settings); + this.indexScopedSettings = indexScopedSettings; + controller.registerHandler(GET, "/_settings", this); + this.settingsFilter = settingsFilter; + } + + @Override + public String getName() { + return "get_all_settings_action"; + } + + @Override + public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { + final GetIndexRequest getIndexRequest = new GetIndexRequest(); + getIndexRequest.indices(Strings.EMPTY_ARRAY); + getIndexRequest.features(Feature.SETTINGS); + getIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, getIndexRequest.indicesOptions())); + getIndexRequest.local(request.paramAsBoolean("local", getIndexRequest.local())); + getIndexRequest.humanReadable(request.paramAsBoolean("human", false)); + // This is required so the "flat_settings" parameter counts as consumed + request.paramAsBoolean("flat_settings", false); + final boolean defaults = request.paramAsBoolean("include_defaults", false); + return channel -> client.admin().indices().getIndex(getIndexRequest, new RestBuilderListener(channel) { + + @Override + public RestResponse buildResponse(final GetIndexResponse response, final XContentBuilder builder) throws Exception { + builder.startObject(); + { + for (final String index : response.indices()) { + builder.startObject(index); + { + writeSettings(response.settings().get(index), builder, request, defaults); + } + builder.endObject(); + } + } + builder.endObject(); + + return new BytesRestResponse(OK, builder); + } + + + private void writeSettings(final Settings settings, final XContentBuilder builder, + final Params params, final boolean defaults) throws IOException { + builder.startObject("settings"); + { + settings.toXContent(builder, params); + } + builder.endObject(); + if (defaults) { + builder.startObject("defaults"); + { + settingsFilter + .filter(indexScopedSettings.diff(settings, RestGetAllSettingsAction.this.settings)) + .toXContent(builder, request); + } + builder.endObject(); + } + } + }); + } + +} diff --git a/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesAction.java b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesAction.java index 3a9ba2a20ed22..e9552d4752685 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesAction.java @@ -67,7 +67,6 @@ public RestGetIndicesAction( this.indexScopedSettings = indexScopedSettings; controller.registerHandler(GET, "/{index}", this); controller.registerHandler(HEAD, "/{index}", this); - controller.registerHandler(GET, "/{index}/{type}", this); this.settingsFilter = settingsFilter; } @@ -79,18 +78,8 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { String[] indices = Strings.splitStringByCommaToArray(request.param("index")); - String[] featureParams = request.paramAsStringArray("type", null); - // Work out if the indices is a list of features - if (featureParams == null && indices.length > 0 && indices[0] != null && indices[0].startsWith("_") && !"_all".equals(indices[0])) { - featureParams = indices; - indices = new String[]{"_all"}; - } final GetIndexRequest getIndexRequest = new GetIndexRequest(); getIndexRequest.indices(indices); - if (featureParams != null) { - Feature[] features = Feature.convertToFeatures(featureParams); - getIndexRequest.features(features); - } getIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, getIndexRequest.indicesOptions())); getIndexRequest.local(request.paramAsBoolean("local", getIndexRequest.local())); getIndexRequest.humanReadable(request.paramAsBoolean("human", false)); diff --git a/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java index 47a6cdfc8cd1b..d596ab238cdb5 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java @@ -48,6 +48,8 @@ public class RestGetMappingAction extends BaseRestHandler { public RestGetMappingAction(Settings settings, RestController controller) { super(settings); controller.registerHandler(GET, "/{index}/{type}/_mapping", this); + controller.registerHandler(GET, "/{index}/_mappings", this); + controller.registerHandler(GET, "/{index}/_mapping", this); controller.registerHandler(GET, "/{index}/_mappings/{type}", this); controller.registerHandler(GET, "/{index}/_mapping/{type}", this); controller.registerHandler(GET, "/_mapping/{type}", this); diff --git a/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetSettingsAction.java b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetSettingsAction.java index 7e988c49428ba..8ac7f12312a45 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetSettingsAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetSettingsAction.java @@ -51,8 +51,9 @@ public RestGetSettingsAction(Settings settings, RestController controller, Index final SettingsFilter settingsFilter) { super(settings); this.indexScopedSettings = indexScopedSettings; - controller.registerHandler(GET, "/{index}/_settings/{name}", this); controller.registerHandler(GET, "/_settings/{name}", this); + controller.registerHandler(GET, "/{index}/_settings", this); + controller.registerHandler(GET, "/{index}/_settings/{name}", this); controller.registerHandler(GET, "/{index}/_setting/{name}", this); this.settingsFilter = settingsFilter; } @@ -66,6 +67,8 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { final String[] names = request.paramAsStringArrayOrEmptyIfAll("name"); final boolean renderDefaults = request.paramAsBoolean("include_defaults", false); + // This is required so the "flat_settings" parameter counts as consumed + request.paramAsBoolean("flat_settings", false); GetSettingsRequest getSettingsRequest = new GetSettingsRequest() .indices(Strings.splitStringByCommaToArray(request.param("index"))) .indicesOptions(IndicesOptions.fromRequest(request, IndicesOptions.strictExpandOpen())) diff --git a/docs/reference/indices/get-index.asciidoc b/docs/reference/indices/get-index.asciidoc index 772318c71d87a..ffa512dca6363 100644 --- a/docs/reference/indices/get-index.asciidoc +++ b/docs/reference/indices/get-index.asciidoc @@ -15,20 +15,3 @@ alias or wildcard expression is required. The get index API can also be applied to more than one index, or on all indices by using `_all` or `*` as index. - -[float] -=== Filtering index information - -The information returned by the get API can be filtered to include only specific features -by specifying a comma delimited list of features in the URL: - -[source,js] --------------------------------------------------- -GET twitter/_settings,_mappings --------------------------------------------------- -// CONSOLE -// TEST[setup:twitter] - -The above command will only return the settings and mappings for the index called `twitter`. - -The available features are `_settings`, `_mappings` and `_aliases`. diff --git a/docs/reference/migration/migrate_6_0/rest.asciidoc b/docs/reference/migration/migrate_6_0/rest.asciidoc index d7e55f0942fe9..5f0c88f13cfee 100644 --- a/docs/reference/migration/migrate_6_0/rest.asciidoc +++ b/docs/reference/migration/migrate_6_0/rest.asciidoc @@ -58,3 +58,13 @@ as a result. From version 6.0.0, delete by query requests require an explicit qu Running `DELETE index/type/id` now implicitly creates `type` with a default mapping if it did not exist yet. + +==== Indices information APIs + +Previously it was possible to execute `GET /_aliases,_mappings` or `GET +/myindex/_settings,_alias` by separating mulitple types of requests with commas +in order to retrieve multiple types of information about one or more indices. +This comma-separation for retrieving multiple pieces of information has been +removed.. `GET /_all` can be used to retrieve all aliases, settings, and +mappings for all indices. In order to retrieve only the mappings for an index, +`GET /myindex/_mappings` (or `_aliases`, or `_settings`). diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get.json index e58af6d50b2a7..f615718c7d4e2 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get.json @@ -4,17 +4,12 @@ "methods":[ "GET" ], "url":{ "path":"/{index}", - "paths":[ "/{index}", "/{index}/{feature}" ], + "paths":[ "/{index}" ], "parts":{ "index":{ "type":"list", "required" : true, "description":"A comma-separated list of index names" - }, - "feature":{ - "type":"list", - "description":"A comma-separated list of features", - "options": ["_settings", "_mappings", "_aliases"] } }, "params":{ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get/10_basic.yml index 54728644f72d2..b6ac97eb91bfd 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get/10_basic.yml @@ -52,42 +52,19 @@ setup: - is_true: test_index.settings - is_true: test_index.mappings ---- -"Get index infos for mappings only": - - - do: - indices.get: - index: test_index - feature: _mapping - - - is_true: test_index.mappings - - is_false: test_index.aliases - - is_false: test_index.settings - ---- -"Get index infos should work on aliases": - - - do: - indices.get: - index: test_blias - feature: _mapping - - - is_true: test_index.mappings - - is_false: test_index.aliases - - is_false: test_index.settings - --- "Get index infos should work for wildcards": - do: indices.get: index: test_* - feature: _mapping,_settings - is_true: test_index.mappings + - is_true: test_index.aliases - is_true: test_index.settings - is_true: test_index_2.settings - - is_false: test_index.aliases + - is_true: test_index_2.mappings + - is_true: test_index_2.aliases --- "Get index infos with human settings should return index creation date and version in readable format": @@ -95,7 +72,6 @@ setup: - do: indices.get: index: test_index - feature: _settings human: true - is_true: test_index.settings.index.creation_date_string @@ -107,7 +83,6 @@ setup: - do: indices.get: index: test_index - feature: _settings - is_false: test_index.settings.index.creation_date_string - is_false: test_index.settings.index.version.created_string @@ -169,7 +144,6 @@ setup: - do: indices.get: index: test_index_* - feature: _settings expand_wildcards: closed - is_false: test_index_2.settings @@ -181,7 +155,6 @@ setup: - do: indices.get: index: test_index_* - feature: _settings expand_wildcards: open,closed - is_true: test_index_2.settings diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yml index d930b4a3fb963..e812856a3d832 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yml @@ -96,12 +96,11 @@ setup: "Get test-* with wildcard_expansion=none": - do: + catch: missing indices.get_mapping: index: test-x* expand_wildcards: none - - match: { $body: {} } - --- "Get test-* with wildcard_expansion=open,closed": diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.update_aliases/30_remove_index_and_replace_with_alias.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.update_aliases/30_remove_index_and_replace_with_alias.yml index ff1c77a87db8b..ebf923e259997 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.update_aliases/30_remove_index_and_replace_with_alias.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.update_aliases/30_remove_index_and_replace_with_alias.yml @@ -29,7 +29,7 @@ - is_true: '' - do: - indices.get_mapping: + indices.get: index: test # the name of the index that the alias points to, would be `test` if the index were still there - is_true: test_2