get-repo-api.asciidoc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. (Optional, string)
  38. Comma-separated list of snapshot repository names used to limit the request.
  39. Wildcard (`*`) expressions are supported including combining wildcards with exclude patterns starting with `-`.
  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. include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  50. [role="child_attributes"]
  51. [[get-snapshot-repo-api-response-body]]
  52. ==== {api-response-body-title}
  53. `<repository>`::
  54. (object)
  55. Contains information about the snapshot repository. Key is the name of the
  56. snapshot repository.
  57. +
  58. .Properties of `<repository>`
  59. [%collapsible%open]
  60. ====
  61. `type`::
  62. +
  63. --
  64. (string)
  65. Repository type.
  66. .Values for `type`
  67. [%collapsible%open]
  68. =====
  69. `fs`::
  70. Shared file system repository. See <<snapshots-filesystem-repository>>.
  71. [xpack]#`source`#::
  72. Source-only repository. See <<snapshots-source-only-repository>>.
  73. `url`::
  74. URL repository. See <<snapshots-read-only-repository>>.
  75. =====
  76. More repository types are available through these official plugins:
  77. * <<repository-s3, repository-s3>> for S3 repository support
  78. * {plugins}/repository-hdfs.html[repository-hdfs] for HDFS repository support in
  79. Hadoop environments
  80. * <<repository-azure,repository-azure>> for Azure storage repositories
  81. * <<repository-gcs,repository-gcs>> for Google Cloud Storage 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,create or update snapshot
  90. repository API>>'s <<put-snapshot-repo-api-settings-param,`settings`
  91. parameter>>.
  92. ====
  93. [[get-snapshot-repo-api-example]]
  94. ==== {api-examples-title}
  95. [source,console]
  96. ----
  97. GET /_snapshot/my_repository
  98. ----
  99. The API returns the following response:
  100. [source,console-result]
  101. ----
  102. {
  103. "my_repository" : {
  104. "type" : "fs",
  105. "uuid" : "0JLknrXbSUiVPuLakHjBrQ",
  106. "settings" : {
  107. "location" : "my_backup_location"
  108. }
  109. }
  110. }
  111. ----
  112. // TESTRESPONSE[s/"uuid" : "0JLknrXbSUiVPuLakHjBrQ"/"uuid" : $body.my_repository.uuid/]