mlimporter

package
v6.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mlimporter contains code for loading Elastic X-Pack Machine Learning job configurations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HaveXpackML

func HaveXpackML(esClient MLLoader) (bool, error)

HaveXpackML checks whether X-pack is installed and has Machine Learning enabled.

func ImportMachineLearningJob

func ImportMachineLearningJob(esClient MLLoader, cfg *MLConfig) error

ImportMachineLearningJob uploads the job and datafeed configuration to ES/xpack.

Types

type MLConfig

type MLConfig struct {
	ID           string `config:"id"`
	JobPath      string `config:"job"`
	DatafeedPath string `config:"datafeed"`
	MinVersion   string `config:"min_version"`
}

MLConfig contains the required configuration for loading one job and the associated datafeed.

type MLLoader

type MLLoader interface {
	Request(method, path string, pipeline string, params map[string]string, body interface{}) (int, []byte, error)
	LoadJSON(path string, json map[string]interface{}) ([]byte, error)
	GetVersion() string
}

MLLoader is a subset of the Elasticsearch client API capable of loading the ML configs.

Jump to

Keyboard shortcuts

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