get-repo-api.asciidoc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. [[get-snapshot-repo-api]]
  2. === Get snapshot repository API
  3. ++++
  4. <titleabbrev>Get snapshot repository</titleabbrev>
  5. ++++
  6. Gets information about one or more registered
  7. <<snapshots-register-repository,snapshot repositories>>.
  8. ////
  9. [source,console]
  10. ----
  11. PUT /_snapshot/my_repository
  12. {
  13. "type": "fs",
  14. "settings": {
  15. "location": "my_backup_location"
  16. }
  17. }
  18. ----
  19. // TESTSETUP
  20. ////
  21. [source,console]
  22. ----
  23. GET /_snapshot/my_repository
  24. ----
  25. [[get-snapshot-repo-api-request]]
  26. ==== {api-request-title}
  27. `GET /_snapshot/<repository>`
  28. `GET /_snapshot`
  29. [[get-snapshot-repo-api-path-params]]
  30. ==== {api-path-parms-title}
  31. `<repository>`::
  32. (Required, string)
  33. Comma-separated list of snapshot repository names used to limit the request.
  34. Wildcard (`*`) expressions are supported.
  35. +
  36. To get information about all snapshot repositories registered in the
  37. cluster, omit this parameter or use `*` or `_all`.
  38. [[get-snapshot-repo-api-query-params]]
  39. ==== {api-query-parms-title}
  40. `local`::
  41. (Optional, boolean) If `true`, the request gets information from the local node
  42. only. If `false`, the request gets information from the master node. Defaults to
  43. `false`.
  44. `master_timeout`::
  45. (Optional, <<time-units, time units>>) Specifies the period of time to wait for
  46. a connection to the master node. If no response is received before the timeout
  47. expires, the request fails and returns an error. Defaults to `30s`.
  48. [role="child_attributes"]
  49. [[get-snapshot-repo-api-response-body]]
  50. ==== {api-response-body-title}
  51. `<repository>`::
  52. (object)
  53. Contains information about the snapshot repository. Key is the name of the
  54. snapshot repository.
  55. +
  56. .Properties of `<repository>`
  57. [%collapsible%open]
  58. ====
  59. `type`::
  60. +
  61. --
  62. (string)
  63. Repository type.
  64. .Values for `type`
  65. [%collapsible%open]
  66. =====
  67. `fs`::
  68. Shared file system repository. See <<snapshots-filesystem-repository>>.
  69. [xpack]#`source`#::
  70. Source-only repository. See <<snapshots-source-only-repository>>.
  71. `url`::
  72. URL repository. See <<snapshots-read-only-repository>>.
  73. =====
  74. More repository types are available through these official plugins:
  75. * {plugins}/repository-s3.html[repository-s3] for S3 repository support
  76. * {plugins}/repository-hdfs.html[repository-hdfs] for HDFS repository support in
  77. Hadoop environments
  78. * {plugins}/repository-azure.html[repository-azure] for Azure storage
  79. repositories
  80. * {plugins}/repository-gcs.html[repository-gcs] for Google Cloud Storage
  81. repositories
  82. --
  83. `settings`::
  84. (object)
  85. Contains settings for the repository. Valid properties for the `settings` object
  86. depend on the repository type, set using the
  87. <<put-snapshot-repo-api-request-type,`type`>> parameter.
  88. +
  89. For properties, see the <<put-snapshot-repo-api,put snapshot repository API>>'s
  90. <<put-snapshot-repo-api-settings-param,`settings` parameter>>.
  91. ====
  92. [[get-snapshot-repo-api-example]]
  93. ==== {api-examples-title}
  94. [source,console]
  95. ----
  96. GET /_snapshot/my_repository
  97. ----
  98. The API returns the following response:
  99. [source,console-result]
  100. ----
  101. {
  102. "my_repository" : {
  103. "type" : "fs",
  104. "settings" : {
  105. "location" : "my_backup_location"
  106. }
  107. }
  108. }
  109. ----