Skip to content

Commit 3344768

Browse files
committed
Merge branch '6.x' into retention-leases-recovery-6.x
* 6.x: (25 commits) Backport of types removal for Put/Get index templates (elastic#38465) Add support for API keys to access Elasticsearch (elastic#38291) (elastic#38399) Deprecate support for internal versioning for concurrency control (elastic#38451) Deprecate types in rollover index API (elastic#38389) (elastic#38458) Add typless client side GetIndexRequest calls and response class (elastic#38422) [ML] Report index unavailable instead of waiting for lazy node (elastic#38444) await fix CurtIT#testIndex until elastic#38451 is merged (elastic#38466) Update ilm-api.asciidoc, point to REMOVE policy (elastic#38235) (elastic#38464) SQL: Fix esType for DATETIME/DATE and INTERVALS (elastic#38179) Clean up duplicate follow config parameter code (elastic#37688) (elastic#38443) Deprecation check for No Master Block setting (elastic#38383) Bubble-up exceptions from scheduler (elastic#38441) Lift retention lease expiration to index shard (elastic#38391) Deprecate maxRetryTimeout in RestClient and increase default value (elastic#38425) Update Rollup Caps to allow unknown fields (elastic#38446) Backport of elastic#38411: `if_seq_no` and `if_primary_term` parameters aren't wired correctly in REST Client's CRUD API Support unknown fields in ingest pipeline map configuration (elastic#38429) SQL: Implement CURRENT_DATE (elastic#38175) Backport changes to the release notes script. (elastic#38346) Fix ILM explain response to allow unknown fields (elastic#38363) ...
2 parents e3a38c8 + 9f3b3b4 commit 3344768

File tree

310 files changed

+15288
-3375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

310 files changed

+15288
-3375
lines changed

client/rest-high-level/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ integTestCluster {
104104
setting 'xpack.license.self_generated.type', 'trial'
105105
setting 'xpack.security.enabled', 'true'
106106
setting 'xpack.security.authc.token.enabled', 'true'
107+
setting 'xpack.security.authc.api_key.enabled', 'true'
107108
// Truststore settings are not used since TLS is not enabled. Included for testing the get certificates API
108109
setting 'xpack.security.http.ssl.certificate_authorities', 'testnode.crt'
109110
setting 'xpack.security.http.ssl.supported_protocols', 'TLSv1.2,TLSv1.1,TLSv1'

client/rest-high-level/src/main/java/org/elasticsearch/client/IndicesClient.java

Lines changed: 148 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,10 @@
3434
import org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest;
3535
import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest;
3636
import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeResponse;
37-
import org.elasticsearch.action.admin.indices.get.GetIndexRequest;
38-
import org.elasticsearch.action.admin.indices.get.GetIndexResponse;
39-
import org.elasticsearch.client.indices.GetFieldMappingsRequest;
40-
import org.elasticsearch.client.indices.GetFieldMappingsResponse;
4137
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest;
4238
import org.elasticsearch.action.admin.indices.open.OpenIndexResponse;
4339
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
4440
import org.elasticsearch.action.admin.indices.refresh.RefreshResponse;
45-
import org.elasticsearch.action.admin.indices.rollover.RolloverRequest;
46-
import org.elasticsearch.action.admin.indices.rollover.RolloverResponse;
4741
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest;
4842
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse;
4943
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest;
@@ -57,6 +51,10 @@
5751
import org.elasticsearch.client.indices.CreateIndexRequest;
5852
import org.elasticsearch.client.indices.CreateIndexResponse;
5953
import org.elasticsearch.client.indices.FreezeIndexRequest;
54+
import org.elasticsearch.client.indices.GetFieldMappingsRequest;
55+
import org.elasticsearch.client.indices.GetFieldMappingsResponse;
56+
import org.elasticsearch.client.indices.GetIndexRequest;
57+
import org.elasticsearch.client.indices.GetIndexResponse;
6058
import org.elasticsearch.client.indices.GetIndexTemplatesRequest;
6159
import org.elasticsearch.client.indices.GetMappingsRequest;
6260
import org.elasticsearch.client.indices.GetMappingsResponse;
@@ -65,6 +63,8 @@
6563
import org.elasticsearch.client.indices.PutIndexTemplateRequest;
6664
import org.elasticsearch.client.indices.PutMappingRequest;
6765
import org.elasticsearch.client.indices.UnfreezeIndexRequest;
66+
import org.elasticsearch.client.indices.rollover.RolloverRequest;
67+
import org.elasticsearch.client.indices.rollover.RolloverResponse;
6868
import org.elasticsearch.rest.RestStatus;
6969

7070
import java.io.IOException;
@@ -901,6 +901,41 @@ public void getAsync(GetIndexRequest getIndexRequest, RequestOptions options,
901901
GetIndexResponse::fromXContent, listener, emptySet());
902902
}
903903

904+
/**
905+
* Retrieve information about one or more indexes
906+
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html">
907+
* Indices Get Index API on elastic.co</a>
908+
* @param getIndexRequest the request
909+
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
910+
* @return the response
911+
* @throws IOException in case there is a problem sending the request or parsing back the response
912+
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
913+
* {@link #get(GetIndexRequest, RequestOptions)} should be used instead, which accepts a new request object.
914+
*/
915+
@Deprecated
916+
public org.elasticsearch.action.admin.indices.get.GetIndexResponse get(
917+
org.elasticsearch.action.admin.indices.get.GetIndexRequest getIndexRequest, RequestOptions options) throws IOException {
918+
return restHighLevelClient.performRequestAndParseEntity(getIndexRequest, IndicesRequestConverters::getIndex, options,
919+
org.elasticsearch.action.admin.indices.get.GetIndexResponse::fromXContent, emptySet());
920+
}
921+
922+
/**
923+
* Retrieve information about one or more indexes
924+
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html">
925+
* Indices Get Index API on elastic.co</a>
926+
* @param getIndexRequest the request
927+
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
928+
* @param listener the listener to be notified upon request completion
929+
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
930+
* {@link #getAsync(GetIndexRequest, RequestOptions, ActionListener)} should be used instead, which accepts a new request object.
931+
*/
932+
@Deprecated
933+
public void getAsync(org.elasticsearch.action.admin.indices.get.GetIndexRequest getIndexRequest, RequestOptions options,
934+
ActionListener<org.elasticsearch.action.admin.indices.get.GetIndexResponse> listener) {
935+
restHighLevelClient.performRequestAsyncAndParseEntity(getIndexRequest, IndicesRequestConverters::getIndex, options,
936+
org.elasticsearch.action.admin.indices.get.GetIndexResponse::fromXContent, listener, emptySet());
937+
}
938+
904939
/**
905940
* Force merge one or more indices using the Force Merge API.
906941
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html">
@@ -1058,15 +1093,38 @@ public boolean exists(GetIndexRequest request, RequestOptions options) throws IO
10581093
);
10591094
}
10601095

1096+
/**
1097+
* Checks if the index (indices) exists or not.
1098+
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html">
1099+
* Indices Exists API on elastic.co</a>
1100+
* @param request the request
1101+
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
1102+
* @return the response
1103+
* @throws IOException in case there is a problem sending the request
1104+
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
1105+
* {@link #exists(GetIndexRequest, RequestOptions)} should be used instead, which accepts a new request object.
1106+
*/
1107+
@Deprecated
1108+
public boolean exists(org.elasticsearch.action.admin.indices.get.GetIndexRequest request, RequestOptions options) throws IOException {
1109+
return restHighLevelClient.performRequest(
1110+
request,
1111+
IndicesRequestConverters::indicesExist,
1112+
options,
1113+
RestHighLevelClient::convertExistsResponse,
1114+
Collections.emptySet()
1115+
);
1116+
}
1117+
10611118
/**
10621119
* Checks if the index (indices) exists or not.
10631120
* <p>
10641121
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html">
10651122
* Indices Exists API on elastic.co</a>
1066-
* @deprecated Prefer {@link #exists(GetIndexRequest, RequestOptions)}
1123+
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
1124+
* {@link #exists(GetIndexRequest, RequestOptions)} should be used instead, which accepts a new request object.
10671125
*/
10681126
@Deprecated
1069-
public boolean exists(GetIndexRequest request, Header... headers) throws IOException {
1127+
public boolean exists(org.elasticsearch.action.admin.indices.get.GetIndexRequest request, Header... headers) throws IOException {
10701128
return restHighLevelClient.performRequest(
10711129
request,
10721130
IndicesRequestConverters::indicesExist,
@@ -1095,15 +1153,40 @@ public void existsAsync(GetIndexRequest request, RequestOptions options, ActionL
10951153
);
10961154
}
10971155

1156+
/**
1157+
* Asynchronously checks if the index (indices) exists or not.
1158+
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html">
1159+
* Indices Exists API on elastic.co</a>
1160+
* @param request the request
1161+
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
1162+
* @param listener the listener to be notified upon request completion
1163+
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
1164+
* {@link #existsAsync(GetIndexRequest, RequestOptions, ActionListener)} should be used instead, which accepts a new request object.
1165+
*/
1166+
@Deprecated
1167+
public void existsAsync(org.elasticsearch.action.admin.indices.get.GetIndexRequest request, RequestOptions options,
1168+
ActionListener<Boolean> listener) {
1169+
restHighLevelClient.performRequestAsync(
1170+
request,
1171+
IndicesRequestConverters::indicesExist,
1172+
options,
1173+
RestHighLevelClient::convertExistsResponse,
1174+
listener,
1175+
Collections.emptySet()
1176+
);
1177+
}
1178+
10981179
/**
10991180
* Asynchronously checks if the index (indices) exists or not.
11001181
* <p>
11011182
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html">
11021183
* Indices Exists API on elastic.co</a>
1103-
* @deprecated Prefer {@link #existsAsync(GetIndexRequest, RequestOptions, ActionListener)}
1184+
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
1185+
* {@link #existsAsync(GetIndexRequest, RequestOptions, ActionListener)} should be used instead, which accepts a new request object.
11041186
*/
11051187
@Deprecated
1106-
public void existsAsync(GetIndexRequest request, ActionListener<Boolean> listener, Header... headers) {
1188+
public void existsAsync(org.elasticsearch.action.admin.indices.get.GetIndexRequest request, ActionListener<Boolean> listener,
1189+
Header... headers) {
11071190
restHighLevelClient.performRequestAsync(
11081191
request,
11091192
IndicesRequestConverters::indicesExist,
@@ -1234,17 +1317,54 @@ public RolloverResponse rollover(RolloverRequest rolloverRequest, RequestOptions
12341317
RolloverResponse::fromXContent, emptySet());
12351318
}
12361319

1320+
/**
1321+
* Asynchronously rolls over an index using the Rollover Index API.
1322+
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html">
1323+
* Rollover Index API on elastic.co</a>
1324+
* @param rolloverRequest the request
1325+
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
1326+
* @param listener the listener to be notified upon request completion
1327+
*/
1328+
public void rolloverAsync(RolloverRequest rolloverRequest, RequestOptions options, ActionListener<RolloverResponse> listener) {
1329+
restHighLevelClient.performRequestAsyncAndParseEntity(rolloverRequest, IndicesRequestConverters::rollover, options,
1330+
RolloverResponse::fromXContent, listener, emptySet());
1331+
}
1332+
1333+
/**
1334+
* Rolls over an index using the Rollover Index API.
1335+
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html">
1336+
* Rollover Index API on elastic.co</a>
1337+
* @param rolloverRequest the request
1338+
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
1339+
* @return the response
1340+
* @throws IOException in case there is a problem sending the request or parsing back the response
1341+
*
1342+
* @deprecated This method uses deprecated request and response objects.
1343+
* The method {@link #rollover(RolloverRequest, RequestOptions)} should be used instead, which accepts a new request object.
1344+
*/
1345+
@Deprecated
1346+
public org.elasticsearch.action.admin.indices.rollover.RolloverResponse rollover(
1347+
org.elasticsearch.action.admin.indices.rollover.RolloverRequest rolloverRequest,
1348+
RequestOptions options) throws IOException {
1349+
return restHighLevelClient.performRequestAndParseEntity(rolloverRequest, IndicesRequestConverters::rollover, options,
1350+
org.elasticsearch.action.admin.indices.rollover.RolloverResponse::fromXContent, emptySet());
1351+
}
1352+
12371353
/**
12381354
* Rolls over an index using the Rollover Index API.
12391355
* <p>
12401356
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html">
12411357
* Rollover Index API on elastic.co</a>
1242-
* @deprecated Prefer {@link #rollover(RolloverRequest, RequestOptions)}
1358+
*
1359+
* @deprecated This method uses deprecated request and response objects.
1360+
* The method {@link #rollover(RolloverRequest, RequestOptions)} should be used instead, which accepts a new request object.
12431361
*/
12441362
@Deprecated
1245-
public RolloverResponse rollover(RolloverRequest rolloverRequest, Header... headers) throws IOException {
1363+
public org.elasticsearch.action.admin.indices.rollover.RolloverResponse rollover(
1364+
org.elasticsearch.action.admin.indices.rollover.RolloverRequest rolloverRequest,
1365+
Header... headers) throws IOException {
12461366
return restHighLevelClient.performRequestAndParseEntity(rolloverRequest, IndicesRequestConverters::rollover,
1247-
RolloverResponse::fromXContent, emptySet(), headers);
1367+
org.elasticsearch.action.admin.indices.rollover.RolloverResponse::fromXContent, emptySet(), headers);
12481368
}
12491369

12501370
/**
@@ -1254,23 +1374,33 @@ public RolloverResponse rollover(RolloverRequest rolloverRequest, Header... head
12541374
* @param rolloverRequest the request
12551375
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
12561376
* @param listener the listener to be notified upon request completion
1377+
*
1378+
* @deprecated This method uses deprecated request and response objects.
1379+
* The method {@link #rolloverAsync(RolloverRequest, RequestOptions, ActionListener)} should be used instead, which
1380+
* accepts a new request object.
12571381
*/
1258-
public void rolloverAsync(RolloverRequest rolloverRequest, RequestOptions options, ActionListener<RolloverResponse> listener) {
1382+
@Deprecated
1383+
public void rolloverAsync(org.elasticsearch.action.admin.indices.rollover.RolloverRequest rolloverRequest,
1384+
RequestOptions options, ActionListener<org.elasticsearch.action.admin.indices.rollover.RolloverResponse> listener) {
12591385
restHighLevelClient.performRequestAsyncAndParseEntity(rolloverRequest, IndicesRequestConverters::rollover, options,
1260-
RolloverResponse::fromXContent, listener, emptySet());
1386+
org.elasticsearch.action.admin.indices.rollover.RolloverResponse::fromXContent, listener, emptySet());
12611387
}
12621388

12631389
/**
12641390
* Asynchronously rolls over an index using the Rollover Index API.
12651391
* <p>
12661392
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html">
12671393
* Rollover Index API on elastic.co</a>
1268-
* @deprecated Prefer {@link #rolloverAsync(RolloverRequest, RequestOptions, ActionListener)}
1394+
*
1395+
* @deprecated This method uses deprecated request and response objects.
1396+
* The method {@link #rolloverAsync(RolloverRequest, RequestOptions, ActionListener)} should be used instead, which
1397+
* accepts a new request object.
12691398
*/
12701399
@Deprecated
1271-
public void rolloverAsync(RolloverRequest rolloverRequest, ActionListener<RolloverResponse> listener, Header... headers) {
1400+
public void rolloverAsync(org.elasticsearch.action.admin.indices.rollover.RolloverRequest rolloverRequest,
1401+
ActionListener<org.elasticsearch.action.admin.indices.rollover.RolloverResponse> listener, Header... headers) {
12721402
restHighLevelClient.performRequestAsyncAndParseEntity(rolloverRequest, IndicesRequestConverters::rollover,
1273-
RolloverResponse::fromXContent, listener, emptySet(), headers);
1403+
org.elasticsearch.action.admin.indices.rollover.RolloverResponse::fromXContent, listener, emptySet(), headers);
12741404
}
12751405

12761406
/**

0 commit comments

Comments
 (0)