previewdatafeed

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Overview

Previews a datafeed.

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 NewPreviewDatafeed

type NewPreviewDatafeed func() *PreviewDatafeed

NewPreviewDatafeed type alias for index.

func NewPreviewDatafeedFunc

func NewPreviewDatafeedFunc(tp elastictransport.Interface) NewPreviewDatafeed

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

type PreviewDatafeed

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

func (*PreviewDatafeed) DatafeedId

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

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. NOTE: If you use this path parameter, you cannot provide datafeed or anomaly detection job configuration details in the request body. API Name: datafeedid

func (PreviewDatafeed) Do

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

func (*PreviewDatafeed) End

End The end time when the datafeed preview should stop API name: end

func (*PreviewDatafeed) Header

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

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

func (*PreviewDatafeed) HttpRequest

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

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

func (PreviewDatafeed) Perform

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

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

func (*PreviewDatafeed) Raw

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

func (*PreviewDatafeed) Request

func (r *PreviewDatafeed) Request(req *Request) *PreviewDatafeed

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

func (*PreviewDatafeed) Start

func (r *PreviewDatafeed) Start(v string) *PreviewDatafeed

Start The start time from where the datafeed preview should begin API name: start

type Request

type Request struct {

	// DatafeedConfig The datafeed definition to preview.
	DatafeedConfig *types.DatafeedConfig `json:"datafeed_config,omitempty"`
	// JobConfig The configuration details for the anomaly detection job that is associated
	// with the datafeed. If the
	// `datafeed_config` object does not include a `job_id` that references an
	// existing anomaly detection job, you must
	// supply this `job_config` object. If you include both a `job_id` and a
	// `job_config`, the latter information is
	// used. You cannot specify a `job_config` object unless you also supply a
	// `datafeed_config` object.
	JobConfig *types.JobConfig `json:"job_config,omitempty"`
}

Request holds the request body struct for the package previewdatafeed

https://github.com/elastic/elasticsearch-specification/blob/1ad7fe36297b3a8e187b2259dedaf68a47bc236e/specification/ml/preview_datafeed/MlPreviewDatafeedRequest.ts#L26-L69

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 {
	Data []json.RawMessage `json:"data"`
}

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