|
| 1 | +[[java-rest-high-snapshot-verify-repository]] |
| 2 | +=== Snapshot Verify Repository API |
| 3 | + |
| 4 | +The Snapshot Verify Repository API allows to verify a registered repository. |
| 5 | + |
| 6 | +[[java-rest-high-snapshot-verify-repository-request]] |
| 7 | +==== Snapshot Verify Repository Request |
| 8 | + |
| 9 | +A `VerifyRepositoryRequest`: |
| 10 | + |
| 11 | +["source","java",subs="attributes,callouts,macros"] |
| 12 | +-------------------------------------------------- |
| 13 | +include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[verify-repository-request] |
| 14 | +-------------------------------------------------- |
| 15 | + |
| 16 | +==== Optional Arguments |
| 17 | +The following arguments can optionally be provided: |
| 18 | + |
| 19 | +["source","java",subs="attributes,callouts,macros"] |
| 20 | +-------------------------------------------------- |
| 21 | +include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[create-repository-request-timeout] |
| 22 | +-------------------------------------------------- |
| 23 | +<1> Timeout to wait for the all the nodes to acknowledge the settings were applied |
| 24 | +as a `TimeValue` |
| 25 | +<2> Timeout to wait for the all the nodes to acknowledge the settings were applied |
| 26 | +as a `String` |
| 27 | + |
| 28 | +["source","java",subs="attributes,callouts,macros"] |
| 29 | +-------------------------------------------------- |
| 30 | +include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[verify-repository-request-masterTimeout] |
| 31 | +-------------------------------------------------- |
| 32 | +<1> Timeout to connect to the master node as a `TimeValue` |
| 33 | +<2> Timeout to connect to the master node as a `String` |
| 34 | + |
| 35 | +[[java-rest-high-snapshot-verify-repository-sync]] |
| 36 | +==== Synchronous Execution |
| 37 | + |
| 38 | +["source","java",subs="attributes,callouts,macros"] |
| 39 | +-------------------------------------------------- |
| 40 | +include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[verify-repository-execute] |
| 41 | +-------------------------------------------------- |
| 42 | + |
| 43 | +[[java-rest-high-snapshot-verify-repository-async]] |
| 44 | +==== Asynchronous Execution |
| 45 | + |
| 46 | +The asynchronous execution of a snapshot verify repository requires both the |
| 47 | +`VerifyRepositoryRequest` instance and an `ActionListener` instance to be |
| 48 | +passed to the asynchronous method: |
| 49 | + |
| 50 | +["source","java",subs="attributes,callouts,macros"] |
| 51 | +-------------------------------------------------- |
| 52 | +include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[verify-repository-execute-async] |
| 53 | +-------------------------------------------------- |
| 54 | +<1> The `VerifyRepositoryRequest` to execute and the `ActionListener` |
| 55 | +to use when the execution completes |
| 56 | + |
| 57 | +The asynchronous method does not block and returns immediately. Once it is |
| 58 | +completed the `ActionListener` is called back using the `onResponse` method |
| 59 | +if the execution successfully completed or using the `onFailure` method if |
| 60 | +it failed. |
| 61 | + |
| 62 | +A typical listener for `VerifyRepositoryResponse` looks like: |
| 63 | + |
| 64 | +["source","java",subs="attributes,callouts,macros"] |
| 65 | +-------------------------------------------------- |
| 66 | +include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[verify-repository-execute-listener] |
| 67 | +-------------------------------------------------- |
| 68 | +<1> Called when the execution is successfully completed. The response is |
| 69 | +provided as an argument |
| 70 | +<2> Called in case of a failure. The raised exception is provided as an argument |
| 71 | + |
| 72 | +[[java-rest-high-cluster-verify-repository-response]] |
| 73 | +==== Snapshot Verify Repository Response |
| 74 | + |
| 75 | +The returned `VerifyRepositoryResponse` allows to retrieve information about the |
| 76 | +executed operation as follows: |
| 77 | + |
| 78 | +["source","java",subs="attributes,callouts,macros"] |
| 79 | +-------------------------------------------------- |
| 80 | +include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[verify-repository-response] |
| 81 | +-------------------------------------------------- |
0 commit comments