startdatafeed

package
v8.17.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Overview

Start datafeeds.

A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped multiple times throughout its lifecycle.

Before you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs.

If you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped. If new data was indexed for that exact millisecond between stopping and starting, it will be ignored.

When Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or update it had at the time of creation or update and runs the query using those same roles. If you provided secondary authorization headers when you created or updated the datafeed, those credentials are used instead.

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 NewStartDatafeed

type NewStartDatafeed func(datafeedid string) *StartDatafeed

NewStartDatafeed type alias for index.

func NewStartDatafeedFunc

func NewStartDatafeedFunc(tp elastictransport.Interface) NewStartDatafeed

NewStartDatafeedFunc returns a new instance of StartDatafeed 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 {

	// End Refer to the description for the `end` query parameter.
	End types.DateTime `json:"end,omitempty"`
	// Start Refer to the description for the `start` query parameter.
	Start types.DateTime `json:"start,omitempty"`
	// Timeout Refer to the description for the `timeout` query parameter.
	Timeout types.Duration `json:"timeout,omitempty"`
}

Request holds the request body struct for the package startdatafeed

https://github.com/elastic/elasticsearch-specification/blob/2f823ff6fcaa7f3f0f9b990dc90512d8901e5d64/specification/ml/start_datafeed/MlStartDatafeedRequest.ts#L24-L92

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 {

	// Node The ID of the node that the job was started on. In serverless this will be
	// the "serverless".
	// If the job is allowed to open lazily and has not yet been assigned to a node,
	// this value is an empty string.
	Node []string `json:"node"`
	// Started For a successful response, this value is always `true`. On failure, an
	// exception is returned instead.
	Started bool `json:"started"`
}

Response holds the response body struct for the package startdatafeed

https://github.com/elastic/elasticsearch-specification/blob/2f823ff6fcaa7f3f0f9b990dc90512d8901e5d64/specification/ml/start_datafeed/MlStartDatafeedResponse.ts#L22-L34

func NewResponse added in v8.7.0

func NewResponse() *Response

NewResponse returns a Response

func (*Response) UnmarshalJSON added in v8.7.1

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

type StartDatafeed

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

func New

Start datafeeds.

A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped multiple times throughout its lifecycle.

Before you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs.

If you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped. If new data was indexed for that exact millisecond between stopping and starting, it will be ignored.

When Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or update it had at the time of creation or update and runs the query using those same roles. If you provided secondary authorization headers when you created or updated the datafeed, those credentials are used instead.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html

func (StartDatafeed) Do

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

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

func (*StartDatafeed) End

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

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

func (*StartDatafeed) ErrorTrace added in v8.14.0

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

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

func (*StartDatafeed) FilterPath added in v8.14.0

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

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

func (*StartDatafeed) Header

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

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

func (*StartDatafeed) HttpRequest

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

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

func (*StartDatafeed) Human added in v8.14.0

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

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 (StartDatafeed) Perform added in v8.7.0

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

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

func (*StartDatafeed) Pretty added in v8.14.0

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

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

func (*StartDatafeed) Raw

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

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

func (*StartDatafeed) Request

func (r *StartDatafeed) Request(req *Request) *StartDatafeed

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

func (*StartDatafeed) Start

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

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

func (*StartDatafeed) Timeout

func (r *StartDatafeed) Timeout(duration types.Duration) *StartDatafeed

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

Jump to

Keyboard shortcuts

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