getbuckets

package
v9.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Get anomaly detection job results for buckets. The API presents a chronological view of the records, grouped by bucket.

Index

Constants

This section is empty.

Variables

View Source
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")

ErrBuildPath is returned in case of missing parameters within the build of the request.

Functions

This section is empty.

Types

type GetBuckets

type GetBuckets struct {
	// contains filtered or unexported fields
}

func New

Get anomaly detection job results for buckets. The API presents a chronological view of the records, grouped by bucket.

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-buckets

func (*GetBuckets) AnomalyScore

func (r *GetBuckets) AnomalyScore(anomalyscore types.Float64) *GetBuckets

Refer to the description for the `anomaly_score` query parameter. API name: anomaly_score

func (*GetBuckets) Desc

func (r *GetBuckets) Desc(desc bool) *GetBuckets

Refer to the description for the `desc` query parameter. API name: desc

func (GetBuckets) Do

func (r GetBuckets) Do(providedCtx context.Context) (*Response, error)

Do runs the request through the transport, handle the response and returns a getbuckets.Response

func (*GetBuckets) End

func (r *GetBuckets) End(datetime types.DateTimeVariant) *GetBuckets

Refer to the description for the `end` query parameter. API name: end

func (*GetBuckets) ErrorTrace

func (r *GetBuckets) ErrorTrace(errortrace bool) *GetBuckets

ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace

func (*GetBuckets) ExcludeInterim

func (r *GetBuckets) ExcludeInterim(excludeinterim bool) *GetBuckets

Refer to the description for the `exclude_interim` query parameter. API name: exclude_interim

func (*GetBuckets) Expand

func (r *GetBuckets) Expand(expand bool) *GetBuckets

Refer to the description for the `expand` query parameter. API name: expand

func (*GetBuckets) FilterPath

func (r *GetBuckets) FilterPath(filterpaths ...string) *GetBuckets

FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path

func (*GetBuckets) From

func (r *GetBuckets) From(from int) *GetBuckets

From Skips the specified number of buckets. API name: from

func (*GetBuckets) Header

func (r *GetBuckets) Header(key, value string) *GetBuckets

Header set a key, value pair in the GetBuckets headers map.

func (*GetBuckets) HttpRequest

func (r *GetBuckets) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*GetBuckets) Human

func (r *GetBuckets) Human(human bool) *GetBuckets

Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"exists_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human

func (*GetBuckets) Page

func (r *GetBuckets) Page(page types.PageVariant) *GetBuckets

API name: page

func (GetBuckets) Perform

func (r GetBuckets) Perform(providedCtx context.Context) (*http.Response, error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*GetBuckets) Pretty

func (r *GetBuckets) Pretty(pretty bool) *GetBuckets

Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty

func (*GetBuckets) Raw

func (r *GetBuckets) Raw(raw io.Reader) *GetBuckets

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*GetBuckets) Request

func (r *GetBuckets) Request(req *Request) *GetBuckets

Request allows to set the request property with the appropriate payload.

func (*GetBuckets) Size

func (r *GetBuckets) Size(size int) *GetBuckets

Size Specifies the maximum number of buckets to obtain. API name: size

func (*GetBuckets) Sort

func (r *GetBuckets) Sort(field string) *GetBuckets

Refer to the desription for the `sort` query parameter. API name: sort

func (*GetBuckets) Start

func (r *GetBuckets) Start(datetime types.DateTimeVariant) *GetBuckets

Refer to the description for the `start` query parameter. API name: start

func (*GetBuckets) Timestamp

func (r *GetBuckets) Timestamp(timestamp string) *GetBuckets

Timestamp The timestamp of a single bucket result. If you do not specify this parameter, the API returns information about all buckets. API Name: timestamp

type NewGetBuckets

type NewGetBuckets func(jobid string) *GetBuckets

NewGetBuckets type alias for index.

func NewGetBucketsFunc

func NewGetBucketsFunc(tp elastictransport.Interface) NewGetBuckets

NewGetBucketsFunc returns a new instance of GetBuckets with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type Request

type Request struct {

	// AnomalyScore Refer to the description for the `anomaly_score` query parameter.
	AnomalyScore *types.Float64 `json:"anomaly_score,omitempty"`
	// Desc Refer to the description for the `desc` query parameter.
	Desc *bool `json:"desc,omitempty"`
	// End Refer to the description for the `end` query parameter.
	End types.DateTime `json:"end,omitempty"`
	// ExcludeInterim Refer to the description for the `exclude_interim` query parameter.
	ExcludeInterim *bool `json:"exclude_interim,omitempty"`
	// Expand Refer to the description for the `expand` query parameter.
	Expand *bool       `json:"expand,omitempty"`
	Page   *types.Page `json:"page,omitempty"`
	// Sort Refer to the desription for the `sort` query parameter.
	Sort *string `json:"sort,omitempty"`
	// Start Refer to the description for the `start` query parameter.
	Start types.DateTime `json:"start,omitempty"`
}

Request holds the request body struct for the package getbuckets

https://github.com/elastic/elasticsearch-specification/blob/907d11a72a6bfd37b777d526880c56202889609e/specification/ml/get_buckets/MlGetBucketsRequest.ts#L26-L145

func NewRequest

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

func (*Request) UnmarshalJSON

func (s *Request) UnmarshalJSON(data []byte) error

type Response

type Response struct {
	Buckets []types.BucketSummary `json:"buckets"`
	Count   int64                 `json:"count"`
}

Response holds the response body struct for the package getbuckets

https://github.com/elastic/elasticsearch-specification/blob/907d11a72a6bfd37b777d526880c56202889609e/specification/ml/get_buckets/MlGetBucketsResponse.ts#L23-L28

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL