|
30 | 30 | import org.elasticsearch.client.ccr.ForgetFollowerRequest;
|
31 | 31 | import org.elasticsearch.client.ccr.GetAutoFollowPatternRequest;
|
32 | 32 | import org.elasticsearch.client.ccr.GetAutoFollowPatternResponse;
|
| 33 | +import org.elasticsearch.client.ccr.PauseAutoFollowPatternRequest; |
33 | 34 | import org.elasticsearch.client.ccr.PauseFollowRequest;
|
34 | 35 | import org.elasticsearch.client.ccr.PutAutoFollowPatternRequest;
|
35 | 36 | import org.elasticsearch.client.ccr.PutFollowRequest;
|
36 | 37 | import org.elasticsearch.client.ccr.PutFollowResponse;
|
| 38 | +import org.elasticsearch.client.ccr.ResumeAutoFollowPatternRequest; |
37 | 39 | import org.elasticsearch.client.ccr.ResumeFollowRequest;
|
38 | 40 | import org.elasticsearch.client.ccr.UnfollowRequest;
|
39 | 41 | import org.elasticsearch.client.core.AcknowledgedResponse;
|
@@ -410,6 +412,92 @@ public Cancellable getAutoFollowPatternAsync(GetAutoFollowPatternRequest request
|
410 | 412 | );
|
411 | 413 | }
|
412 | 414 |
|
| 415 | + /** |
| 416 | + * Pauses an auto follow pattern. |
| 417 | + * |
| 418 | + * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html"> |
| 419 | + * the docs</a> for more. |
| 420 | + * |
| 421 | + * @param request the request |
| 422 | + * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 423 | + * @return the response |
| 424 | + * @throws IOException in case there is a problem sending the request or parsing back the response |
| 425 | + */ |
| 426 | + public AcknowledgedResponse pauseAutoFollowPattern(PauseAutoFollowPatternRequest request, RequestOptions options) throws IOException { |
| 427 | + return restHighLevelClient.performRequestAndParseEntity( |
| 428 | + request, |
| 429 | + CcrRequestConverters::pauseAutoFollowPattern, |
| 430 | + options, |
| 431 | + AcknowledgedResponse::fromXContent, |
| 432 | + Collections.emptySet() |
| 433 | + ); |
| 434 | + } |
| 435 | + |
| 436 | + /** |
| 437 | + * Asynchronously pauses an auto follow pattern. |
| 438 | + * |
| 439 | + * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html"> |
| 440 | + * the docs</a> for more. |
| 441 | + * @param request the request |
| 442 | + * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 443 | + * @param listener the listener to be notified upon request completion |
| 444 | + * @return cancellable that may be used to cancel the request |
| 445 | + */ |
| 446 | + public Cancellable pauseAutoFollowPatternAsync(PauseAutoFollowPatternRequest request, |
| 447 | + RequestOptions options, |
| 448 | + ActionListener<AcknowledgedResponse> listener) { |
| 449 | + return restHighLevelClient.performRequestAsyncAndParseEntity( |
| 450 | + request, |
| 451 | + CcrRequestConverters::pauseAutoFollowPattern, |
| 452 | + options, |
| 453 | + AcknowledgedResponse::fromXContent, |
| 454 | + listener, |
| 455 | + Collections.emptySet()); |
| 456 | + } |
| 457 | + |
| 458 | + /** |
| 459 | + * Resumes an auto follow pattern. |
| 460 | + * |
| 461 | + * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html"> |
| 462 | + * the docs</a> for more. |
| 463 | + * |
| 464 | + * @param request the request |
| 465 | + * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 466 | + * @return the response |
| 467 | + * @throws IOException in case there is a problem sending the request or parsing back the response |
| 468 | + */ |
| 469 | + public AcknowledgedResponse resumeAutoFollowPattern(ResumeAutoFollowPatternRequest request, RequestOptions options) throws IOException { |
| 470 | + return restHighLevelClient.performRequestAndParseEntity( |
| 471 | + request, |
| 472 | + CcrRequestConverters::resumeAutoFollowPattern, |
| 473 | + options, |
| 474 | + AcknowledgedResponse::fromXContent, |
| 475 | + Collections.emptySet() |
| 476 | + ); |
| 477 | + } |
| 478 | + |
| 479 | + /** |
| 480 | + * Asynchronously resumes an auto follow pattern. |
| 481 | + * |
| 482 | + * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html"> |
| 483 | + * the docs</a> for more. |
| 484 | + * @param request the request |
| 485 | + * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 486 | + * @param listener the listener to be notified upon request completion |
| 487 | + * @return cancellable that may be used to cancel the request |
| 488 | + */ |
| 489 | + public Cancellable resumeAutoFollowPatternAsync(ResumeAutoFollowPatternRequest request, |
| 490 | + RequestOptions options, |
| 491 | + ActionListener<AcknowledgedResponse> listener) { |
| 492 | + return restHighLevelClient.performRequestAsyncAndParseEntity( |
| 493 | + request, |
| 494 | + CcrRequestConverters::resumeAutoFollowPattern, |
| 495 | + options, |
| 496 | + AcknowledgedResponse::fromXContent, |
| 497 | + listener, |
| 498 | + Collections.emptySet()); |
| 499 | + } |
| 500 | + |
413 | 501 | /**
|
414 | 502 | * Gets all CCR stats.
|
415 | 503 | *
|
|
0 commit comments