Documentation
¶
Overview ¶
Previews a datafeed.
Index ¶
- Variables
- type NewPreviewDatafeed
- type PreviewDatafeed
- func (r *PreviewDatafeed) DatafeedConfig(datafeedconfig *types.DatafeedConfig) *PreviewDatafeed
- func (r *PreviewDatafeed) DatafeedId(datafeedid string) *PreviewDatafeed
- func (r PreviewDatafeed) Do(providedCtx context.Context) (Response, error)
- func (r *PreviewDatafeed) End(datetime string) *PreviewDatafeed
- func (r *PreviewDatafeed) ErrorTrace(errortrace bool) *PreviewDatafeed
- func (r *PreviewDatafeed) FilterPath(filterpaths ...string) *PreviewDatafeed
- func (r *PreviewDatafeed) Header(key, value string) *PreviewDatafeed
- func (r *PreviewDatafeed) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *PreviewDatafeed) Human(human bool) *PreviewDatafeed
- func (r *PreviewDatafeed) JobConfig(jobconfig *types.JobConfig) *PreviewDatafeed
- func (r PreviewDatafeed) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *PreviewDatafeed) Pretty(pretty bool) *PreviewDatafeed
- func (r *PreviewDatafeed) Raw(raw io.Reader) *PreviewDatafeed
- func (r *PreviewDatafeed) Request(req *Request) *PreviewDatafeed
- func (r *PreviewDatafeed) Start(datetime string) *PreviewDatafeed
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
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 New ¶
func New(tp elastictransport.Interface) *PreviewDatafeed
Previews a datafeed.
https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html
func (*PreviewDatafeed) DatafeedConfig ¶ added in v8.9.0
func (r *PreviewDatafeed) DatafeedConfig(datafeedconfig *types.DatafeedConfig) *PreviewDatafeed
DatafeedConfig The datafeed definition to preview. API name: datafeed_config
func (*PreviewDatafeed) DatafeedId ¶
func (r *PreviewDatafeed) DatafeedId(datafeedid 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 ¶
func (r PreviewDatafeed) Do(providedCtx context.Context) (Response, error)
Do runs the request through the transport, handle the response and returns a previewdatafeed.Response
func (*PreviewDatafeed) End ¶ added in v8.7.0
func (r *PreviewDatafeed) End(datetime string) *PreviewDatafeed
End The end time when the datafeed preview should stop API name: end
func (*PreviewDatafeed) ErrorTrace ¶ added in v8.14.0
func (r *PreviewDatafeed) ErrorTrace(errortrace bool) *PreviewDatafeed
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*PreviewDatafeed) FilterPath ¶ added in v8.14.0
func (r *PreviewDatafeed) FilterPath(filterpaths ...string) *PreviewDatafeed
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
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 ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*PreviewDatafeed) Human ¶ added in v8.14.0
func (r *PreviewDatafeed) Human(human bool) *PreviewDatafeed
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 (*PreviewDatafeed) JobConfig ¶ added in v8.9.0
func (r *PreviewDatafeed) JobConfig(jobconfig *types.JobConfig) *PreviewDatafeed
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. API name: job_config
func (PreviewDatafeed) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*PreviewDatafeed) Pretty ¶ added in v8.14.0
func (r *PreviewDatafeed) Pretty(pretty bool) *PreviewDatafeed
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*PreviewDatafeed) Raw ¶
func (r *PreviewDatafeed) Raw(raw io.Reader) *PreviewDatafeed
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 ¶ added in v8.7.0
func (r *PreviewDatafeed) Start(datetime 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
type Response ¶ added in v8.7.0
type Response []json.RawMessage