get-repo-api.asciidoc 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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-prereqs]]
  30. ==== {api-prereq-title}
  31. * If the {es} {security-features} are enabled, you must have the
  32. `monitor_snapshot`, `create_snapshot`, or `manage`
  33. <<privileges-list-cluster,cluster privilege>> to use this API.
  34. [[get-snapshot-repo-api-path-params]]
  35. ==== {api-path-parms-title}
  36. `<repository>`::
  37. (Required, string)
  38. Comma-separated list of snapshot repository names used to limit the request.
  39. Wildcard (`*`) expressions are supported.
  40. +
  41. To get information about all snapshot repositories registered in the
  42. cluster, omit this parameter or use `*` or `_all`.
  43. [[get-snapshot-repo-api-query-params]]
  44. ==== {api-query-parms-title}
  45. `local`::
  46. (Optional, Boolean) If `true`, the request gets information from the local node
  47. only. If `false`, the request gets information from the master node. Defaults to
  48. `false`.
  49. `master_timeout`::
  50. (Optional, <<time-units, time units>>) Specifies the period of time to wait for
  51. a connection to the master node. If no response is received before the timeout
  52. expires, the request fails and returns an error. Defaults to `30s`.
  53. [role="child_attributes"]
  54. [[get-snapshot-repo-api-response-body]]
  55. ==== {api-response-body-title}
  56. `<repository>`::
  57. (object)
  58. Contains information about the snapshot repository. Key is the name of the
  59. snapshot repository.
  60. +
  61. .Properties of `<repository>`
  62. [%collapsible%open]
  63. ====
  64. `type`::
  65. +
  66. --
  67. (string)
  68. Repository type.
  69. .Values for `type`
  70. [%collapsible%open]
  71. =====
  72. `fs`::
  73. Shared file system repository. See <<snapshots-filesystem-repository>>.
  74. [xpack]#`source`#::
  75. Source-only repository. See <<snapshots-source-only-repository>>.
  76. `url`::
  77. URL repository. See <<snapshots-read-only-repository>>.
  78. =====
  79. More repository types are available through these official plugins:
  80. * {plugins}/repository-s3.html[repository-s3] for S3 repository support
  81. * {plugins}/repository-hdfs.html[repository-hdfs] for HDFS repository support in
  82. Hadoop environments
  83. * {plugins}/repository-azure.html[repository-azure] for Azure storage
  84. repositories
  85. * {plugins}/repository-gcs.html[repository-gcs] for Google Cloud Storage
  86. repositories
  87. --
  88. `settings`::
  89. (object)
  90. Contains settings for the repository. Valid properties for the `settings` object
  91. depend on the repository type, set using the
  92. <<put-snapshot-repo-api-request-type,`type`>> parameter.
  93. +
  94. For properties, see the <<put-snapshot-repo-api,create or update snapshot
  95. repository API>>'s <<put-snapshot-repo-api-settings-param,`settings`
  96. parameter>>.
  97. ====
  98. [[get-snapshot-repo-api-example]]
  99. ==== {api-examples-title}
  100. [source,console]
  101. ----
  102. GET /_snapshot/my_repository
  103. ----
  104. The API returns the following response:
  105. [source,console-result]
  106. ----
  107. {
  108. "my_repository" : {
  109. "type" : "fs",
  110. "uuid" : "0JLknrXbSUiVPuLakHjBrQ",
  111. "settings" : {
  112. "location" : "my_backup_location"
  113. }
  114. }
  115. }
  116. ----
  117. // TESTRESPONSE[s/"uuid" : "0JLknrXbSUiVPuLakHjBrQ"/"uuid" : $body.my_repository.uuid/]