postdata

package
v8.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Overview

Send data to an anomaly detection job for analysis.

IMPORTANT: For each job, data can be accepted from only a single connection at a time. It is not currently possible to post data to multiple jobs using wildcards or a comma-separated list.

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 NewPostData

type NewPostData func(jobid string) *PostData

NewPostData type alias for index.

func NewPostDataFunc

func NewPostDataFunc(tp elastictransport.Interface) NewPostData

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

type PostData

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

func New

Send data to an anomaly detection job for analysis.

IMPORTANT: For each job, data can be accepted from only a single connection at a time. It is not currently possible to post data to multiple jobs using wildcards or a comma-separated list.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html

func (PostData) Do

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

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

func (*PostData) ErrorTrace added in v8.14.0

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

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

func (*PostData) FilterPath added in v8.14.0

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

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

func (*PostData) Header

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

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

func (*PostData) HttpRequest

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

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

func (*PostData) Human added in v8.14.0

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

Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_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 (PostData) Perform

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

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

func (*PostData) Pretty added in v8.14.0

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

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

func (*PostData) Raw

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

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

func (*PostData) Request

func (r *PostData) Request(req *Request) *PostData

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

func (*PostData) ResetEnd

func (r *PostData) ResetEnd(datetime string) *PostData

ResetEnd Specifies the end of the bucket resetting range. API name: reset_end

func (*PostData) ResetStart

func (r *PostData) ResetStart(datetime string) *PostData

ResetStart Specifies the start of the bucket resetting range. API name: reset_start

type Request added in v8.11.0

type Request = []json.RawMessage

Request holds the request body struct for the package postdata

https://github.com/elastic/elasticsearch-specification/blob/f6a370d0fba975752c644fc730f7c45610e28f36/specification/ml/post_data/MlPostJobDataRequest.ts#L24-L76

func NewRequest added in v8.13.1

func NewRequest() *Request

NewRequest returns a Request

type Response

type Response struct {
	BucketCount                 int64  `json:"bucket_count"`
	EarliestRecordTimestamp     *int64 `json:"earliest_record_timestamp,omitempty"`
	EmptyBucketCount            int64  `json:"empty_bucket_count"`
	InputBytes                  int64  `json:"input_bytes"`
	InputFieldCount             int64  `json:"input_field_count"`
	InputRecordCount            int64  `json:"input_record_count"`
	InvalidDateCount            int64  `json:"invalid_date_count"`
	JobId                       string `json:"job_id"`
	LastDataTime                *int64 `json:"last_data_time,omitempty"`
	LatestEmptyBucketTimestamp  *int64 `json:"latest_empty_bucket_timestamp,omitempty"`
	LatestRecordTimestamp       *int64 `json:"latest_record_timestamp,omitempty"`
	LatestSparseBucketTimestamp *int64 `json:"latest_sparse_bucket_timestamp,omitempty"`
	LogTime                     *int64 `json:"log_time,omitempty"`
	MissingFieldCount           int64  `json:"missing_field_count"`
	OutOfOrderTimestampCount    int64  `json:"out_of_order_timestamp_count"`
	ProcessedFieldCount         int64  `json:"processed_field_count"`
	ProcessedRecordCount        int64  `json:"processed_record_count"`
	SparseBucketCount           int64  `json:"sparse_bucket_count"`
}

Response holds the response body struct for the package postdata

https://github.com/elastic/elasticsearch-specification/blob/f6a370d0fba975752c644fc730f7c45610e28f36/specification/ml/post_data/MlPostJobDataResponse.ts#L24-L45

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