-
Notifications
You must be signed in to change notification settings - Fork 298
Expand file tree
/
Copy pathElasticsearchCcrAsyncClient.java
More file actions
716 lines (626 loc) · 29.8 KB
/
Copy pathElasticsearchCcrAsyncClient.java
File metadata and controls
716 lines (626 loc) · 29.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. 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 co.elastic.clients.elasticsearch.ccr;
import co.elastic.clients.ApiClient;
import co.elastic.clients.elasticsearch._types.ErrorResponse;
import co.elastic.clients.transport.ElasticsearchTransport;
import co.elastic.clients.transport.Endpoint;
import co.elastic.clients.transport.JsonEndpoint;
import co.elastic.clients.transport.Transport;
import co.elastic.clients.transport.TransportOptions;
import co.elastic.clients.util.ObjectBuilder;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import javax.annotation.Nullable;
//----------------------------------------------------------------
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------------------
//
// This code is generated from the Elasticsearch API specification
// at https://github.com/elastic/elasticsearch-specification
//
// Manual updates to this file will be lost when the code is
// re-generated.
//
// If you find a property that is missing or wrongly typed, please
// open an issue or a PR on the API specification repository.
//
//----------------------------------------------------------------
/**
* Client for the ccr namespace.
*/
public class ElasticsearchCcrAsyncClient extends ApiClient<ElasticsearchTransport, ElasticsearchCcrAsyncClient> {
public ElasticsearchCcrAsyncClient(ElasticsearchTransport transport) {
super(transport, null);
}
public ElasticsearchCcrAsyncClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) {
super(transport, transportOptions);
}
@Override
public ElasticsearchCcrAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) {
return new ElasticsearchCcrAsyncClient(this.transport, transportOptions);
}
// ----- Endpoint: ccr.delete_auto_follow_pattern
/**
* Delete auto-follow patterns.
* <p>
* Delete a collection of cross-cluster replication auto-follow patterns.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-delete-auto-follow-pattern">Documentation
* on elastic.co</a>
*/
public CompletableFuture<DeleteAutoFollowPatternResponse> deleteAutoFollowPattern(
DeleteAutoFollowPatternRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<DeleteAutoFollowPatternRequest, DeleteAutoFollowPatternResponse, ErrorResponse> endpoint = (JsonEndpoint<DeleteAutoFollowPatternRequest, DeleteAutoFollowPatternResponse, ErrorResponse>) DeleteAutoFollowPatternRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Delete auto-follow patterns.
* <p>
* Delete a collection of cross-cluster replication auto-follow patterns.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteAutoFollowPatternRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-delete-auto-follow-pattern">Documentation
* on elastic.co</a>
*/
public final CompletableFuture<DeleteAutoFollowPatternResponse> deleteAutoFollowPattern(
Function<DeleteAutoFollowPatternRequest.Builder, ObjectBuilder<DeleteAutoFollowPatternRequest>> fn) {
return deleteAutoFollowPattern(fn.apply(new DeleteAutoFollowPatternRequest.Builder()).build());
}
// ----- Endpoint: ccr.follow
/**
* Create a follower.
* <p>
* Create a cross-cluster replication follower index that follows a specific
* leader index. When the API returns, the follower index exists and
* cross-cluster replication starts replicating operations from the leader index
* to the follower index.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow">Documentation
* on elastic.co</a>
*/
public CompletableFuture<FollowResponse> follow(FollowRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<FollowRequest, FollowResponse, ErrorResponse> endpoint = (JsonEndpoint<FollowRequest, FollowResponse, ErrorResponse>) FollowRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Create a follower.
* <p>
* Create a cross-cluster replication follower index that follows a specific
* leader index. When the API returns, the follower index exists and
* cross-cluster replication starts replicating operations from the leader index
* to the follower index.
*
* @param fn
* a function that initializes a builder to create the
* {@link FollowRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow">Documentation
* on elastic.co</a>
*/
public final CompletableFuture<FollowResponse> follow(
Function<FollowRequest.Builder, ObjectBuilder<FollowRequest>> fn) {
return follow(fn.apply(new FollowRequest.Builder()).build());
}
// ----- Endpoint: ccr.follow_info
/**
* Get follower information.
* <p>
* Get information about all cross-cluster replication follower indices. For
* example, the results include follower index names, leader index names,
* replication options, and whether the follower indices are active or paused.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow-info">Documentation
* on elastic.co</a>
*/
public CompletableFuture<FollowInfoResponse> followInfo(FollowInfoRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<FollowInfoRequest, FollowInfoResponse, ErrorResponse> endpoint = (JsonEndpoint<FollowInfoRequest, FollowInfoResponse, ErrorResponse>) FollowInfoRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get follower information.
* <p>
* Get information about all cross-cluster replication follower indices. For
* example, the results include follower index names, leader index names,
* replication options, and whether the follower indices are active or paused.
*
* @param fn
* a function that initializes a builder to create the
* {@link FollowInfoRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow-info">Documentation
* on elastic.co</a>
*/
public final CompletableFuture<FollowInfoResponse> followInfo(
Function<FollowInfoRequest.Builder, ObjectBuilder<FollowInfoRequest>> fn) {
return followInfo(fn.apply(new FollowInfoRequest.Builder()).build());
}
// ----- Endpoint: ccr.follow_stats
/**
* Get follower stats.
* <p>
* Get cross-cluster replication follower stats. The API returns shard-level
* stats about the "following tasks" associated with each shard for
* the specified indices.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow-stats">Documentation
* on elastic.co</a>
*/
public CompletableFuture<FollowStatsResponse> followStats(FollowStatsRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<FollowStatsRequest, FollowStatsResponse, ErrorResponse> endpoint = (JsonEndpoint<FollowStatsRequest, FollowStatsResponse, ErrorResponse>) FollowStatsRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get follower stats.
* <p>
* Get cross-cluster replication follower stats. The API returns shard-level
* stats about the "following tasks" associated with each shard for
* the specified indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link FollowStatsRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow-stats">Documentation
* on elastic.co</a>
*/
public final CompletableFuture<FollowStatsResponse> followStats(
Function<FollowStatsRequest.Builder, ObjectBuilder<FollowStatsRequest>> fn) {
return followStats(fn.apply(new FollowStatsRequest.Builder()).build());
}
// ----- Endpoint: ccr.forget_follower
/**
* Forget a follower.
* <p>
* Remove the cross-cluster replication follower retention leases from the
* leader.
* <p>
* A following index takes out retention leases on its leader index. These
* leases are used to increase the likelihood that the shards of the leader
* index retain the history of operations that the shards of the following index
* need to run replication. When a follower index is converted to a regular
* index by the unfollow API (either by directly calling the API or by index
* lifecycle management tasks), these leases are removed. However, removal of
* the leases can fail, for example when the remote cluster containing the
* leader index is unavailable. While the leases will eventually expire on their
* own, their extended existence can cause the leader index to hold more history
* than necessary and prevent index lifecycle management from performing some
* operations on the leader index. This API exists to enable manually removing
* the leases when the unfollow API is unable to do so.
* <p>
* NOTE: This API does not stop replication by a following index. If you use
* this API with a follower index that is still actively following, the
* following index will add back retention leases on the leader. The only
* purpose of this API is to handle the case of failure to remove the following
* retention leases after the unfollow API is invoked.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-forget-follower">Documentation
* on elastic.co</a>
*/
public CompletableFuture<ForgetFollowerResponse> forgetFollower(ForgetFollowerRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<ForgetFollowerRequest, ForgetFollowerResponse, ErrorResponse> endpoint = (JsonEndpoint<ForgetFollowerRequest, ForgetFollowerResponse, ErrorResponse>) ForgetFollowerRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Forget a follower.
* <p>
* Remove the cross-cluster replication follower retention leases from the
* leader.
* <p>
* A following index takes out retention leases on its leader index. These
* leases are used to increase the likelihood that the shards of the leader
* index retain the history of operations that the shards of the following index
* need to run replication. When a follower index is converted to a regular
* index by the unfollow API (either by directly calling the API or by index
* lifecycle management tasks), these leases are removed. However, removal of
* the leases can fail, for example when the remote cluster containing the
* leader index is unavailable. While the leases will eventually expire on their
* own, their extended existence can cause the leader index to hold more history
* than necessary and prevent index lifecycle management from performing some
* operations on the leader index. This API exists to enable manually removing
* the leases when the unfollow API is unable to do so.
* <p>
* NOTE: This API does not stop replication by a following index. If you use
* this API with a follower index that is still actively following, the
* following index will add back retention leases on the leader. The only
* purpose of this API is to handle the case of failure to remove the following
* retention leases after the unfollow API is invoked.
*
* @param fn
* a function that initializes a builder to create the
* {@link ForgetFollowerRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-forget-follower">Documentation
* on elastic.co</a>
*/
public final CompletableFuture<ForgetFollowerResponse> forgetFollower(
Function<ForgetFollowerRequest.Builder, ObjectBuilder<ForgetFollowerRequest>> fn) {
return forgetFollower(fn.apply(new ForgetFollowerRequest.Builder()).build());
}
// ----- Endpoint: ccr.get_auto_follow_pattern
/**
* Get auto-follow patterns.
* <p>
* Get cross-cluster replication auto-follow patterns.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-get-auto-follow-pattern-1">Documentation
* on elastic.co</a>
*/
public CompletableFuture<GetAutoFollowPatternResponse> getAutoFollowPattern(GetAutoFollowPatternRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<GetAutoFollowPatternRequest, GetAutoFollowPatternResponse, ErrorResponse> endpoint = (JsonEndpoint<GetAutoFollowPatternRequest, GetAutoFollowPatternResponse, ErrorResponse>) GetAutoFollowPatternRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get auto-follow patterns.
* <p>
* Get cross-cluster replication auto-follow patterns.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetAutoFollowPatternRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-get-auto-follow-pattern-1">Documentation
* on elastic.co</a>
*/
public final CompletableFuture<GetAutoFollowPatternResponse> getAutoFollowPattern(
Function<GetAutoFollowPatternRequest.Builder, ObjectBuilder<GetAutoFollowPatternRequest>> fn) {
return getAutoFollowPattern(fn.apply(new GetAutoFollowPatternRequest.Builder()).build());
}
/**
* Get auto-follow patterns.
* <p>
* Get cross-cluster replication auto-follow patterns.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-get-auto-follow-pattern-1">Documentation
* on elastic.co</a>
*/
public CompletableFuture<GetAutoFollowPatternResponse> getAutoFollowPattern() {
return this.transport.performRequestAsync(new GetAutoFollowPatternRequest.Builder().build(),
GetAutoFollowPatternRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: ccr.pause_auto_follow_pattern
/**
* Pause an auto-follow pattern.
* <p>
* Pause a cross-cluster replication auto-follow pattern. When the API returns,
* the auto-follow pattern is inactive. New indices that are created on the
* remote cluster and match the auto-follow patterns are ignored.
* <p>
* You can resume auto-following with the resume auto-follow pattern API. When
* it resumes, the auto-follow pattern is active again and automatically
* configures follower indices for newly created indices on the remote cluster
* that match its patterns. Remote indices that were created while the pattern
* was paused will also be followed, unless they have been deleted or closed in
* the interim.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-pause-auto-follow-pattern">Documentation
* on elastic.co</a>
*/
public CompletableFuture<PauseAutoFollowPatternResponse> pauseAutoFollowPattern(
PauseAutoFollowPatternRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<PauseAutoFollowPatternRequest, PauseAutoFollowPatternResponse, ErrorResponse> endpoint = (JsonEndpoint<PauseAutoFollowPatternRequest, PauseAutoFollowPatternResponse, ErrorResponse>) PauseAutoFollowPatternRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Pause an auto-follow pattern.
* <p>
* Pause a cross-cluster replication auto-follow pattern. When the API returns,
* the auto-follow pattern is inactive. New indices that are created on the
* remote cluster and match the auto-follow patterns are ignored.
* <p>
* You can resume auto-following with the resume auto-follow pattern API. When
* it resumes, the auto-follow pattern is active again and automatically
* configures follower indices for newly created indices on the remote cluster
* that match its patterns. Remote indices that were created while the pattern
* was paused will also be followed, unless they have been deleted or closed in
* the interim.
*
* @param fn
* a function that initializes a builder to create the
* {@link PauseAutoFollowPatternRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-pause-auto-follow-pattern">Documentation
* on elastic.co</a>
*/
public final CompletableFuture<PauseAutoFollowPatternResponse> pauseAutoFollowPattern(
Function<PauseAutoFollowPatternRequest.Builder, ObjectBuilder<PauseAutoFollowPatternRequest>> fn) {
return pauseAutoFollowPattern(fn.apply(new PauseAutoFollowPatternRequest.Builder()).build());
}
// ----- Endpoint: ccr.pause_follow
/**
* Pause a follower.
* <p>
* Pause a cross-cluster replication follower index. The follower index will not
* fetch any additional operations from the leader index. You can resume
* following with the resume follower API. You can pause and resume a follower
* index to change the configuration of the following task.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-pause-follow">Documentation
* on elastic.co</a>
*/
public CompletableFuture<PauseFollowResponse> pauseFollow(PauseFollowRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<PauseFollowRequest, PauseFollowResponse, ErrorResponse> endpoint = (JsonEndpoint<PauseFollowRequest, PauseFollowResponse, ErrorResponse>) PauseFollowRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Pause a follower.
* <p>
* Pause a cross-cluster replication follower index. The follower index will not
* fetch any additional operations from the leader index. You can resume
* following with the resume follower API. You can pause and resume a follower
* index to change the configuration of the following task.
*
* @param fn
* a function that initializes a builder to create the
* {@link PauseFollowRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-pause-follow">Documentation
* on elastic.co</a>
*/
public final CompletableFuture<PauseFollowResponse> pauseFollow(
Function<PauseFollowRequest.Builder, ObjectBuilder<PauseFollowRequest>> fn) {
return pauseFollow(fn.apply(new PauseFollowRequest.Builder()).build());
}
// ----- Endpoint: ccr.put_auto_follow_pattern
/**
* Create or update auto-follow patterns.
* <p>
* Create a collection of cross-cluster replication auto-follow patterns for a
* remote cluster. Newly created indices on the remote cluster that match any of
* the patterns are automatically configured as follower indices. Indices on the
* remote cluster that were created before the auto-follow pattern was created
* will not be auto-followed even if they match the pattern.
* <p>
* This API can also be used to update auto-follow patterns. NOTE: Follower
* indices that were configured automatically before updating an auto-follow
* pattern will remain unchanged even if they do not match against the new
* patterns.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-put-auto-follow-pattern">Documentation
* on elastic.co</a>
*/
public CompletableFuture<PutAutoFollowPatternResponse> putAutoFollowPattern(PutAutoFollowPatternRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<PutAutoFollowPatternRequest, PutAutoFollowPatternResponse, ErrorResponse> endpoint = (JsonEndpoint<PutAutoFollowPatternRequest, PutAutoFollowPatternResponse, ErrorResponse>) PutAutoFollowPatternRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Create or update auto-follow patterns.
* <p>
* Create a collection of cross-cluster replication auto-follow patterns for a
* remote cluster. Newly created indices on the remote cluster that match any of
* the patterns are automatically configured as follower indices. Indices on the
* remote cluster that were created before the auto-follow pattern was created
* will not be auto-followed even if they match the pattern.
* <p>
* This API can also be used to update auto-follow patterns. NOTE: Follower
* indices that were configured automatically before updating an auto-follow
* pattern will remain unchanged even if they do not match against the new
* patterns.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutAutoFollowPatternRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-put-auto-follow-pattern">Documentation
* on elastic.co</a>
*/
public final CompletableFuture<PutAutoFollowPatternResponse> putAutoFollowPattern(
Function<PutAutoFollowPatternRequest.Builder, ObjectBuilder<PutAutoFollowPatternRequest>> fn) {
return putAutoFollowPattern(fn.apply(new PutAutoFollowPatternRequest.Builder()).build());
}
// ----- Endpoint: ccr.resume_auto_follow_pattern
/**
* Resume an auto-follow pattern.
* <p>
* Resume a cross-cluster replication auto-follow pattern that was paused. The
* auto-follow pattern will resume configuring following indices for newly
* created indices that match its patterns on the remote cluster. Remote indices
* created while the pattern was paused will also be followed unless they have
* been deleted or closed in the interim.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-resume-auto-follow-pattern">Documentation
* on elastic.co</a>
*/
public CompletableFuture<ResumeAutoFollowPatternResponse> resumeAutoFollowPattern(
ResumeAutoFollowPatternRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<ResumeAutoFollowPatternRequest, ResumeAutoFollowPatternResponse, ErrorResponse> endpoint = (JsonEndpoint<ResumeAutoFollowPatternRequest, ResumeAutoFollowPatternResponse, ErrorResponse>) ResumeAutoFollowPatternRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Resume an auto-follow pattern.
* <p>
* Resume a cross-cluster replication auto-follow pattern that was paused. The
* auto-follow pattern will resume configuring following indices for newly
* created indices that match its patterns on the remote cluster. Remote indices
* created while the pattern was paused will also be followed unless they have
* been deleted or closed in the interim.
*
* @param fn
* a function that initializes a builder to create the
* {@link ResumeAutoFollowPatternRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-resume-auto-follow-pattern">Documentation
* on elastic.co</a>
*/
public final CompletableFuture<ResumeAutoFollowPatternResponse> resumeAutoFollowPattern(
Function<ResumeAutoFollowPatternRequest.Builder, ObjectBuilder<ResumeAutoFollowPatternRequest>> fn) {
return resumeAutoFollowPattern(fn.apply(new ResumeAutoFollowPatternRequest.Builder()).build());
}
// ----- Endpoint: ccr.resume_follow
/**
* Resume a follower.
* <p>
* Resume a cross-cluster replication follower index that was paused. The
* follower index could have been paused with the pause follower API.
* Alternatively it could be paused due to replication that cannot be retried
* due to failures during following tasks. When this API returns, the follower
* index will resume fetching operations from the leader index.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-resume-follow">Documentation
* on elastic.co</a>
*/
public CompletableFuture<ResumeFollowResponse> resumeFollow(ResumeFollowRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<ResumeFollowRequest, ResumeFollowResponse, ErrorResponse> endpoint = (JsonEndpoint<ResumeFollowRequest, ResumeFollowResponse, ErrorResponse>) ResumeFollowRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Resume a follower.
* <p>
* Resume a cross-cluster replication follower index that was paused. The
* follower index could have been paused with the pause follower API.
* Alternatively it could be paused due to replication that cannot be retried
* due to failures during following tasks. When this API returns, the follower
* index will resume fetching operations from the leader index.
*
* @param fn
* a function that initializes a builder to create the
* {@link ResumeFollowRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-resume-follow">Documentation
* on elastic.co</a>
*/
public final CompletableFuture<ResumeFollowResponse> resumeFollow(
Function<ResumeFollowRequest.Builder, ObjectBuilder<ResumeFollowRequest>> fn) {
return resumeFollow(fn.apply(new ResumeFollowRequest.Builder()).build());
}
// ----- Endpoint: ccr.stats
/**
* Get cross-cluster replication stats.
* <p>
* This API returns stats about auto-following and the same shard-level stats as
* the get follower stats API.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-stats">Documentation
* on elastic.co</a>
*/
public CompletableFuture<CcrStatsResponse> stats(CcrStatsRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<CcrStatsRequest, CcrStatsResponse, ErrorResponse> endpoint = (JsonEndpoint<CcrStatsRequest, CcrStatsResponse, ErrorResponse>) CcrStatsRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get cross-cluster replication stats.
* <p>
* This API returns stats about auto-following and the same shard-level stats as
* the get follower stats API.
*
* @param fn
* a function that initializes a builder to create the
* {@link CcrStatsRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-stats">Documentation
* on elastic.co</a>
*/
public final CompletableFuture<CcrStatsResponse> stats(
Function<CcrStatsRequest.Builder, ObjectBuilder<CcrStatsRequest>> fn) {
return stats(fn.apply(new CcrStatsRequest.Builder()).build());
}
/**
* Get cross-cluster replication stats.
* <p>
* This API returns stats about auto-following and the same shard-level stats as
* the get follower stats API.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-stats">Documentation
* on elastic.co</a>
*/
public CompletableFuture<CcrStatsResponse> stats() {
return this.transport.performRequestAsync(new CcrStatsRequest.Builder().build(), CcrStatsRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: ccr.unfollow
/**
* Unfollow an index.
* <p>
* Convert a cross-cluster replication follower index to a regular index. The
* API stops the following task associated with a follower index and removes
* index metadata and settings associated with cross-cluster replication. The
* follower index must be paused and closed before you call the unfollow API.
* <blockquote>
* <p>
* info Currently cross-cluster replication does not support converting an
* existing regular index to a follower index. Converting a follower index to a
* regular index is an irreversible operation.
* </p>
* </blockquote>
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-unfollow">Documentation
* on elastic.co</a>
*/
public CompletableFuture<UnfollowResponse> unfollow(UnfollowRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<UnfollowRequest, UnfollowResponse, ErrorResponse> endpoint = (JsonEndpoint<UnfollowRequest, UnfollowResponse, ErrorResponse>) UnfollowRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Unfollow an index.
* <p>
* Convert a cross-cluster replication follower index to a regular index. The
* API stops the following task associated with a follower index and removes
* index metadata and settings associated with cross-cluster replication. The
* follower index must be paused and closed before you call the unfollow API.
* <blockquote>
* <p>
* info Currently cross-cluster replication does not support converting an
* existing regular index to a follower index. Converting a follower index to a
* regular index is an irreversible operation.
* </p>
* </blockquote>
*
* @param fn
* a function that initializes a builder to create the
* {@link UnfollowRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-unfollow">Documentation
* on elastic.co</a>
*/
public final CompletableFuture<UnfollowResponse> unfollow(
Function<UnfollowRequest.Builder, ObjectBuilder<UnfollowRequest>> fn) {
return unfollow(fn.apply(new UnfollowRequest.Builder()).build());
}
}