snapshots_status.asciidoc 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. [[java-rest-high-snapshot-snapshots-status]]
  2. === Snapshots Status API
  3. The Snapshots Status API allows to retrieve detailed information about snapshots in progress.
  4. [[java-rest-high-snapshot-snapshots-status-request]]
  5. ==== Snapshots Status Request
  6. A `SnapshotsStatusRequest`:
  7. ["source","java",subs="attributes,callouts,macros"]
  8. --------------------------------------------------
  9. include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[snapshots-status-request]
  10. --------------------------------------------------
  11. ==== Required Arguments
  12. The following arguments must be provided:
  13. ["source","java",subs="attributes,callouts,macros"]
  14. --------------------------------------------------
  15. include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[snapshots-status-request-repository]
  16. --------------------------------------------------
  17. <1> Sets the repository to check for snapshot statuses
  18. ["source","java",subs="attributes,callouts,macros"]
  19. --------------------------------------------------
  20. include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[snapshots-status-request-snapshots]
  21. --------------------------------------------------
  22. <1> The list of snapshot names to check the status of
  23. ==== Optional Arguments
  24. The following arguments can optionally be provided:
  25. ["source","java",subs="attributes,callouts,macros"]
  26. --------------------------------------------------
  27. include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[snapshots-status-request-ignoreUnavailable]
  28. --------------------------------------------------
  29. <1> The command will fail if some of the snapshots are unavailable. The `ignore_unavailable` flag
  30. set to true will return all snapshots that are currently available.
  31. ["source","java",subs="attributes,callouts,macros"]
  32. --------------------------------------------------
  33. include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[snapshots-status-request-masterTimeout]
  34. --------------------------------------------------
  35. <1> Timeout to connect to the master node as a `TimeValue`
  36. <2> Timeout to connect to the master node as a `String`
  37. [[java-rest-high-snapshot-snapshots-status-sync]]
  38. ==== Synchronous Execution
  39. ["source","java",subs="attributes,callouts,macros"]
  40. --------------------------------------------------
  41. include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[snapshots-status-execute]
  42. --------------------------------------------------
  43. [[java-rest-high-snapshot-snapshots-status-async]]
  44. ==== Asynchronous Execution
  45. The asynchronous execution of retrieving snapshot statuses requires both the
  46. `SnapshotsStatusRequest` instance and an `ActionListener` instance to be
  47. passed to the asynchronous method:
  48. ["source","java",subs="attributes,callouts,macros"]
  49. --------------------------------------------------
  50. include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[snapshots-status-execute-async]
  51. --------------------------------------------------
  52. <1> The `SnapshotsStatusRequest` to execute and the `ActionListener`
  53. to use when the execution completes
  54. The asynchronous method does not block and returns immediately. Once it is
  55. completed the `ActionListener` is called back using the `onResponse` method
  56. if the execution successfully completed or using the `onFailure` method if
  57. it failed.
  58. A typical listener for `SnapshotsStatusResponse` looks like:
  59. ["source","java",subs="attributes,callouts,macros"]
  60. --------------------------------------------------
  61. include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[snapshots-status-execute-listener]
  62. --------------------------------------------------
  63. <1> Called when the execution is successfully completed. The response is
  64. provided as an argument
  65. <2> Called in case of a failure. The raised exception is provided as an argument
  66. [[java-rest-high-snapshot-snapshots-status-response]]
  67. ==== Snapshots Status Response
  68. The returned `SnapshotsStatusResponse` allows to retrieve information about the
  69. executed operation as follows:
  70. ["source","java",subs="attributes,callouts,macros"]
  71. --------------------------------------------------
  72. include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[snapshots-status-response]
  73. --------------------------------------------------
  74. <1> Request contains a list of snapshot statuses
  75. <2> Each status contains information about the snapshot
  76. <3> Example of reading snapshot statistics about a specific index and shard