getbuckets

package
v8.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 12 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(anomalyscore types.Float64) *GetBuckets

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

func (*GetBuckets) Desc

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

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

func (GetBuckets) Do

func (r GetBuckets) Do(ctx 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.DateTime) *GetBuckets

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

func (*GetBuckets) ExcludeInterim

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

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

func (*GetBuckets) Expand

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

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

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) JobId

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

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

func (*GetBuckets) Page added in v8.9.0

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

API name: page

func (GetBuckets) Perform added in v8.7.0

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

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

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

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

func (*GetBuckets) Start

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

Start 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/656080dee792f93a849cd7fbf566f528f858a5ea/specification/ml/get_buckets/MlGetBucketsRequest.ts#L26-L133

func NewRequest added in v8.5.0

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON added in v8.5.0

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

FromJSON allows to load an arbitrary json into the request structure

type Response added in v8.7.0

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

func NewResponse added in v8.7.0

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