startdatafeed

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Starts one or more datafeeds.

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/1ad7fe36297b3a8e187b2259dedaf68a47bc236e/specification/ml/start_datafeed/MlStartDatafeedRequest.ts#L24-L91

func NewRequest

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON

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

FromJSON allows to load an arbitrary json into the request structure

type Response

type Response struct {

	// Node The ID of the node that the datafeed was started on. If the datafeed 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"`
}

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

type StartDatafeed

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

func (*StartDatafeed) DatafeedId

func (r *StartDatafeed) DatafeedId(v string) *StartDatafeed

DatafeedId A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. API Name: datafeedid

func (StartDatafeed) Do

func (r StartDatafeed) Do(ctx 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(v string) *StartDatafeed

End The time that the datafeed should end, which can be specified by using one of the following formats:

* ISO 8601 format with milliseconds, for example `2017-01-22T06:00:00.000Z` * ISO 8601 format without milliseconds, for example `2017-01-22T06:00:00+00:00` * Milliseconds since the epoch, for example `1485061200000`

Date-time arguments using either of the ISO 8601 formats must have a time zone designator, where `Z` is accepted as an abbreviation for UTC time. When a URL is expected (for example, in browsers), the `+` used in time zone designators must be encoded as `%2B`. The end time value is exclusive. If you do not specify an end time, the datafeed runs continuously. API name: end

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

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

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

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(v string) *StartDatafeed

Start The time that the datafeed should begin, which can be specified by using the same formats as the `end` parameter. This value is inclusive. If you do not specify a start time and the datafeed is associated with a new anomaly detection job, the analysis starts from the earliest time for which data is available. If you restart a stopped datafeed and specify a start value that is earlier than the timestamp of the latest processed record, the datafeed continues from 1 millisecond after the timestamp of the latest processed record. API name: start

func (*StartDatafeed) Timeout

func (r *StartDatafeed) Timeout(v string) *StartDatafeed

Timeout Specifies the amount of time to wait until a datafeed starts. API name: timeout

Jump to

Keyboard shortcuts

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