verify_repository.asciidoc 3.5 KB

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