get_settings.asciidoc 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. --
  2. :api: get-settings
  3. :request: GetSettingsRequest
  4. :response: GetSettingsResponse
  5. --
  6. [id="{upid}-{api}"]
  7. === Get Settings API
  8. [id="{upid}-{api}-request"]
  9. ==== Get Settings Request
  10. A +{request}+ requires one or more `index` arguments:
  11. ["source","java",subs="attributes,callouts,macros"]
  12. --------------------------------------------------
  13. include-tagged::{doc-tests-file}[{api}-request]
  14. --------------------------------------------------
  15. <1> The index whose settings we should retrieve
  16. ==== Optional arguments
  17. The following arguments can optionally be provided:
  18. ["source","java",subs="attributes,callouts,macros"]
  19. --------------------------------------------------
  20. include-tagged::{doc-tests-file}[{api}-request-names]
  21. --------------------------------------------------
  22. <1> One or more settings that be the only settings retrieved. If unset, all settings will be retrieved
  23. ["source","java",subs="attributes,callouts,macros"]
  24. --------------------------------------------------
  25. include-tagged::{doc-tests-file}[{api}-request-include-defaults]
  26. --------------------------------------------------
  27. <1> If true, defaults will be returned for settings not explicitly set on the index
  28. ["source","java",subs="attributes,callouts,macros"]
  29. --------------------------------------------------
  30. include-tagged::{doc-tests-file}[{api}-request-indicesOptions]
  31. --------------------------------------------------
  32. <1> Setting `IndicesOptions` controls how unavailable indices are resolved and
  33. how wildcard expressions are expanded
  34. include::../execution.asciidoc[]
  35. [id="{upid}-{api}-response"]
  36. ==== Get Settings Response
  37. The returned +{response}+ allows to retrieve information about the
  38. executed operation as follows:
  39. ["source","java",subs="attributes,callouts,macros"]
  40. --------------------------------------------------
  41. include-tagged::{doc-tests-file}[{api}-response]
  42. --------------------------------------------------
  43. <1> We can retrieve the setting value for a particular index directly from the response as a string
  44. <2> We can also retrieve the Settings object for a particular index for further examination
  45. <3> The returned Settings object provides convenience methods for non String types
  46. If the `includeDefaults` flag was set to true in the +{request}+ the
  47. behavior of +{response}+ will differ somewhat.
  48. ["source","java",subs="attributes,callouts,macros"]
  49. --------------------------------------------------
  50. include-tagged::{doc-tests-file}[{api}-defaults-response]
  51. --------------------------------------------------
  52. <1> Individual default setting values may be retrieved directly from the +{response}+
  53. <2> We may retrieve a Settings object for an index that contains those settings with default values