get-buckets.asciidoc 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. --
  2. :api: get-buckets
  3. :request: GetBucketsRequest
  4. :response: GetBucketsResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Get buckets API
  9. Retrieves one or more bucket results.
  10. It accepts a +{request}+ object and responds
  11. with a +{response}+ object.
  12. [id="{upid}-{api}-request"]
  13. ==== Get buckets request
  14. A +{request}+ object gets created with an existing non-null `jobId`.
  15. ["source","java",subs="attributes,callouts,macros"]
  16. --------------------------------------------------
  17. include-tagged::{doc-tests-file}[{api}-request]
  18. --------------------------------------------------
  19. <1> Constructing a new request referencing an existing `jobId`.
  20. ==== Optional arguments
  21. The following arguments are optional:
  22. ["source","java",subs="attributes,callouts,macros"]
  23. --------------------------------------------------
  24. include-tagged::{doc-tests-file}[{api}-timestamp]
  25. --------------------------------------------------
  26. <1> The timestamp of the bucket to get. Otherwise it will return all buckets.
  27. ["source","java",subs="attributes,callouts,macros"]
  28. --------------------------------------------------
  29. include-tagged::{doc-tests-file}[{api}-anomaly-score]
  30. --------------------------------------------------
  31. <1> Buckets with anomaly scores greater or equal than this value will be returned.
  32. ["source","java",subs="attributes,callouts,macros"]
  33. --------------------------------------------------
  34. include-tagged::{doc-tests-file}[{api}-desc]
  35. --------------------------------------------------
  36. <1> If `true`, the buckets are sorted in descending order. Defaults to `false`.
  37. ["source","java",subs="attributes,callouts,macros"]
  38. --------------------------------------------------
  39. include-tagged::{doc-tests-file}[{api}-end]
  40. --------------------------------------------------
  41. <1> Buckets with timestamps earlier than this time will be returned.
  42. ["source","java",subs="attributes,callouts,macros"]
  43. --------------------------------------------------
  44. include-tagged::{doc-tests-file}[{api}-exclude-interim]
  45. --------------------------------------------------
  46. <1> If `true`, interim results will be excluded. Defaults to `false`.
  47. ["source","java",subs="attributes,callouts,macros"]
  48. --------------------------------------------------
  49. include-tagged::{doc-tests-file}[{api}-expand]
  50. --------------------------------------------------
  51. <1> If `true`, buckets will include their anomaly records. Defaults to `false`.
  52. ["source","java",subs="attributes,callouts,macros"]
  53. --------------------------------------------------
  54. include-tagged::{doc-tests-file}[{api}-page]
  55. --------------------------------------------------
  56. <1> The page parameters `from` and `size`. `from` specifies the number of buckets to skip.
  57. `size` specifies the maximum number of buckets to get. Defaults to `0` and `100` respectively.
  58. ["source","java",subs="attributes,callouts,macros"]
  59. --------------------------------------------------
  60. include-tagged::{doc-tests-file}[{api}-sort]
  61. --------------------------------------------------
  62. <1> The field to sort buckets on. Defaults to `timestamp`.
  63. ["source","java",subs="attributes,callouts,macros"]
  64. --------------------------------------------------
  65. include-tagged::{doc-tests-file}[{api}-start]
  66. --------------------------------------------------
  67. <1> Buckets with timestamps on or after this time will be returned.
  68. include::../execution.asciidoc[]
  69. [id="{upid}-{api}-response"]
  70. ==== Get buckets response
  71. The returned +{response}+ contains the requested buckets:
  72. ["source","java",subs="attributes,callouts,macros"]
  73. --------------------------------------------------
  74. include-tagged::{doc-tests-file}[{api}-response]
  75. --------------------------------------------------
  76. <1> The count of buckets that were matched.
  77. <2> The buckets retrieved.