getbuckets

package
v8.4.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Overview

Retrieves anomaly detection job results for one or more buckets.

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

Retrieves anomaly detection job results for one or more buckets.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html

func (*GetBuckets) AnomalyScore

func (r *GetBuckets) AnomalyScore(value string) *GetBuckets

AnomalyScore Returns buckets with anomaly scores greater or equal than this value. API name: anomaly_score

func (*GetBuckets) Desc

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

Desc If `true`, the buckets are sorted in descending order. API name: desc

func (GetBuckets) Do

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

Do runs the http.Request through the provided transport.

func (*GetBuckets) End

func (r *GetBuckets) End(value string) *GetBuckets

End Returns buckets with timestamps earlier than this time. `-1` means it is unset and results are not limited to specific timestamps. API name: end

func (*GetBuckets) ExcludeInterim

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

ExcludeInterim If `true`, the output excludes interim results. API name: exclude_interim

func (*GetBuckets) Expand

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

Expand If true, the output includes anomaly records. API name: expand

func (*GetBuckets) From

func (r *GetBuckets) From(i 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) JobId

func (r *GetBuckets) JobId(v string) *GetBuckets

JobId Identifier for the anomaly detection job. API Name: jobid

func (*GetBuckets) Raw

func (r *GetBuckets) Raw(raw json.RawMessage) *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(i int) *GetBuckets

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

func (*GetBuckets) Sort

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

Sort Specifies the sort field for the requested buckets. API name: sort

func (*GetBuckets) Start

func (r *GetBuckets) Start(value string) *GetBuckets

Start Returns buckets with timestamps after this time. `-1` means it is unset and results are not limited to specific timestamps. API name: start

func (*GetBuckets) Timestamp

func (r *GetBuckets) Timestamp(v 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 *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 *types.Field `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/1b56d7e58f5c59f05d1641c6d6a8117c5e01d741/specification/ml/get_buckets/MlGetBucketsRequest.ts#L26-L133

type RequestBuilder

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

RequestBuilder is the builder API for the getbuckets.Request

func NewRequestBuilder

func NewRequestBuilder() *RequestBuilder

NewRequest returns a RequestBuilder which can be chained and built to retrieve a RequestBuilder

func (*RequestBuilder) AnomalyScore

func (rb *RequestBuilder) AnomalyScore(anomalyscore float64) *RequestBuilder

func (*RequestBuilder) Build

func (rb *RequestBuilder) Build() *Request

Build finalize the chain and returns the Request struct.

func (*RequestBuilder) Desc

func (rb *RequestBuilder) Desc(desc bool) *RequestBuilder

func (*RequestBuilder) End

func (*RequestBuilder) ExcludeInterim

func (rb *RequestBuilder) ExcludeInterim(excludeinterim bool) *RequestBuilder

func (*RequestBuilder) Expand

func (rb *RequestBuilder) Expand(expand bool) *RequestBuilder

func (*RequestBuilder) FromJSON

func (rb *RequestBuilder) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

func (*RequestBuilder) Page

func (*RequestBuilder) Sort

func (rb *RequestBuilder) Sort(sort types.Field) *RequestBuilder

func (*RequestBuilder) Start

Jump to

Keyboard shortcuts

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