getrecords

package
v8.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Overview

Retrieves anomaly records for an anomaly detection job.

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 GetRecords

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

func New

Retrieves anomaly records for an anomaly detection job.

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

func (*GetRecords) Desc

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

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

func (GetRecords) Do

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

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

func (*GetRecords) End

func (r *GetRecords) End(datetime types.DateTime) *GetRecords

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

func (*GetRecords) ExcludeInterim

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

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

func (*GetRecords) From

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

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

func (*GetRecords) Header

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

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

func (*GetRecords) HttpRequest

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

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

func (*GetRecords) Page added in v8.9.0

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

API name: page

func (GetRecords) Perform added in v8.7.0

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

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

func (*GetRecords) Raw

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

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

func (*GetRecords) RecordScore

func (r *GetRecords) RecordScore(recordscore types.Float64) *GetRecords

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

func (*GetRecords) Request

func (r *GetRecords) Request(req *Request) *GetRecords

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

func (*GetRecords) Size

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

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

func (*GetRecords) Sort

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

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

func (*GetRecords) Start

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

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

type NewGetRecords

type NewGetRecords func(jobid string) *GetRecords

NewGetRecords type alias for index.

func NewGetRecordsFunc

func NewGetRecordsFunc(tp elastictransport.Interface) NewGetRecords

NewGetRecordsFunc returns a new instance of GetRecords 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 {

	// 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"`
	Page           *types.Page `json:"page,omitempty"`
	// RecordScore Refer to the description for the `record_score` query parameter.
	RecordScore *types.Float64 `json:"record_score,omitempty"`
	// Sort Refer to the description 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 getrecords

https://github.com/elastic/elasticsearch-specification/blob/5bf86339cd4bda77d07f6eaa6789b72f9c0279b1/specification/ml/get_records/MlGetAnomalyRecordsRequest.ts#L26-L127

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

func (*Request) UnmarshalJSON added in v8.12.1

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

type Response added in v8.7.0

type Response struct {
	Count   int64           `json:"count"`
	Records []types.Anomaly `json:"records"`
}

Response holds the response body struct for the package getrecords

https://github.com/elastic/elasticsearch-specification/blob/5bf86339cd4bda77d07f6eaa6789b72f9c0279b1/specification/ml/get_records/MlGetAnomalyRecordsResponse.ts#L23-L28

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