2018-10-05 11:45:46 -04:00
|
|
|
--
|
|
|
|
:api: get-buckets
|
|
|
|
:request: GetBucketsRequest
|
|
|
|
:response: GetBucketsResponse
|
|
|
|
--
|
2019-09-10 11:26:56 -04:00
|
|
|
[role="xpack"]
|
2018-10-05 11:45:46 -04:00
|
|
|
[id="{upid}-{api}"]
|
2019-07-30 13:52:23 -04:00
|
|
|
=== Get buckets API
|
2018-08-23 04:35:06 -04:00
|
|
|
|
2019-07-30 13:52:23 -04:00
|
|
|
Retrieves one or more bucket results.
|
2018-10-05 11:45:46 -04:00
|
|
|
It accepts a +{request}+ object and responds
|
|
|
|
with a +{response}+ object.
|
2018-08-23 04:35:06 -04:00
|
|
|
|
2018-10-05 11:45:46 -04:00
|
|
|
[id="{upid}-{api}-request"]
|
2019-07-30 13:52:23 -04:00
|
|
|
==== Get buckets request
|
2018-08-23 04:35:06 -04:00
|
|
|
|
2018-10-05 11:45:46 -04:00
|
|
|
A +{request}+ object gets created with an existing non-null `jobId`.
|
2018-08-23 04:35:06 -04:00
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request]
|
2018-08-23 04:35:06 -04:00
|
|
|
--------------------------------------------------
|
2019-07-30 13:52:23 -04:00
|
|
|
<1> Constructing a new request referencing an existing `jobId`.
|
2018-08-23 04:35:06 -04:00
|
|
|
|
2019-07-30 13:52:23 -04:00
|
|
|
==== Optional arguments
|
2018-08-23 04:35:06 -04:00
|
|
|
The following arguments are optional:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-timestamp]
|
2018-08-23 04:35:06 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> The timestamp of the bucket to get. Otherwise it will return all buckets.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-anomaly-score]
|
2018-08-23 04:35:06 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Buckets with anomaly scores greater or equal than this value will be returned.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-desc]
|
2018-08-23 04:35:06 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> If `true`, the buckets are sorted in descending order. Defaults to `false`.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-end]
|
2018-08-23 04:35:06 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Buckets with timestamps earlier than this time will be returned.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-exclude-interim]
|
2018-08-23 04:35:06 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> If `true`, interim results will be excluded. Defaults to `false`.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-expand]
|
2018-08-23 04:35:06 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> If `true`, buckets will include their anomaly records. Defaults to `false`.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-page]
|
2018-08-23 04:35:06 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> The page parameters `from` and `size`. `from` specifies the number of buckets to skip.
|
|
|
|
`size` specifies the maximum number of buckets to get. Defaults to `0` and `100` respectively.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-sort]
|
2018-08-23 04:35:06 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> The field to sort buckets on. Defaults to `timestamp`.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-start]
|
2018-08-23 04:35:06 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Buckets with timestamps on or after this time will be returned.
|
|
|
|
|
2018-10-05 11:45:46 -04:00
|
|
|
include::../execution.asciidoc[]
|
2018-08-23 04:35:06 -04:00
|
|
|
|
2018-10-05 11:45:46 -04:00
|
|
|
[id="{upid}-{api}-response"]
|
2019-07-30 13:52:23 -04:00
|
|
|
==== Get buckets response
|
2018-08-23 04:35:06 -04:00
|
|
|
|
2018-10-05 11:45:46 -04:00
|
|
|
The returned +{response}+ contains the requested buckets:
|
2018-08-23 04:35:06 -04:00
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-10-05 11:45:46 -04:00
|
|
|
include-tagged::{doc-tests-file}[{api}-response]
|
2018-08-23 04:35:06 -04:00
|
|
|
--------------------------------------------------
|
2019-07-30 13:52:23 -04:00
|
|
|
<1> The count of buckets that were matched.
|
|
|
|
<2> The buckets retrieved.
|