Documentation ¶
Overview ¶
Instantiates a datafeed.
Index ¶
- Variables
- type NewPutDatafeed
- type PutDatafeed
- func (r *PutDatafeed) AllowNoIndices(b bool) *PutDatafeed
- func (r *PutDatafeed) DatafeedId(v string) *PutDatafeed
- func (r PutDatafeed) Do(ctx context.Context) (*http.Response, error)
- func (r *PutDatafeed) ExpandWildcards(value string) *PutDatafeed
- func (r *PutDatafeed) Header(key, value string) *PutDatafeed
- func (r *PutDatafeed) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *PutDatafeed) IgnoreThrottled(b bool) *PutDatafeed
- func (r *PutDatafeed) IgnoreUnavailable(b bool) *PutDatafeed
- func (r *PutDatafeed) Raw(raw json.RawMessage) *PutDatafeed
- func (r *PutDatafeed) Request(req *Request) *PutDatafeed
- type Request
- type RequestBuilder
- func (rb *RequestBuilder) Aggregations(values map[string]*types.AggregationContainerBuilder) *RequestBuilder
- func (rb *RequestBuilder) Build() *Request
- func (rb *RequestBuilder) ChunkingConfig(chunkingconfig *types.ChunkingConfigBuilder) *RequestBuilder
- func (rb *RequestBuilder) DelayedDataCheckConfig(delayeddatacheckconfig *types.DelayedDataCheckConfigBuilder) *RequestBuilder
- func (rb *RequestBuilder) Frequency(frequency *types.DurationBuilder) *RequestBuilder
- func (rb *RequestBuilder) FromJSON(data string) (*Request, error)
- func (rb *RequestBuilder) Headers(headers *types.HttpHeadersBuilder) *RequestBuilder
- func (rb *RequestBuilder) Indices(indices *types.IndicesBuilder) *RequestBuilder
- func (rb *RequestBuilder) IndicesOptions(indicesoptions *types.IndicesOptionsBuilder) *RequestBuilder
- func (rb *RequestBuilder) JobId(jobid types.Id) *RequestBuilder
- func (rb *RequestBuilder) MaxEmptySearches(maxemptysearches int) *RequestBuilder
- func (rb *RequestBuilder) Query(query *types.QueryContainerBuilder) *RequestBuilder
- func (rb *RequestBuilder) QueryDelay(querydelay *types.DurationBuilder) *RequestBuilder
- func (rb *RequestBuilder) RuntimeMappings(runtimemappings *types.RuntimeFieldsBuilder) *RequestBuilder
- func (rb *RequestBuilder) ScriptFields(values map[string]*types.ScriptFieldBuilder) *RequestBuilder
- func (rb *RequestBuilder) ScrollSize(scrollsize int) *RequestBuilder
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 NewPutDatafeed ¶
type NewPutDatafeed func(datafeedid string) *PutDatafeed
NewPutDatafeed type alias for index.
func NewPutDatafeedFunc ¶
func NewPutDatafeedFunc(tp elastictransport.Interface) NewPutDatafeed
NewPutDatafeedFunc returns a new instance of PutDatafeed with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type PutDatafeed ¶
type PutDatafeed struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *PutDatafeed
Instantiates a datafeed.
https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html
func (*PutDatafeed) AllowNoIndices ¶
func (r *PutDatafeed) AllowNoIndices(b bool) *PutDatafeed
AllowNoIndices If true, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the `_all` string or when no indices are specified. API name: allow_no_indices
func (*PutDatafeed) DatafeedId ¶
func (r *PutDatafeed) DatafeedId(v string) *PutDatafeed
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 (*PutDatafeed) ExpandWildcards ¶
func (r *PutDatafeed) ExpandWildcards(value string) *PutDatafeed
ExpandWildcards Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values. API name: expand_wildcards
func (*PutDatafeed) Header ¶
func (r *PutDatafeed) Header(key, value string) *PutDatafeed
Header set a key, value pair in the PutDatafeed headers map.
func (*PutDatafeed) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*PutDatafeed) IgnoreThrottled ¶
func (r *PutDatafeed) IgnoreThrottled(b bool) *PutDatafeed
IgnoreThrottled If true, concrete, expanded, or aliased indices are ignored when frozen. API name: ignore_throttled
func (*PutDatafeed) IgnoreUnavailable ¶
func (r *PutDatafeed) IgnoreUnavailable(b bool) *PutDatafeed
IgnoreUnavailable If true, unavailable indices (missing or closed) are ignored. API name: ignore_unavailable
func (*PutDatafeed) Raw ¶
func (r *PutDatafeed) Raw(raw json.RawMessage) *PutDatafeed
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*PutDatafeed) Request ¶
func (r *PutDatafeed) Request(req *Request) *PutDatafeed
Request allows to set the request property with the appropriate payload.
type Request ¶
type Request struct { // Aggregations If set, the datafeed performs aggregation searches. // Support for aggregations is limited and should be used only with low // cardinality data. Aggregations map[string]types.AggregationContainer `json:"aggregations,omitempty"` // ChunkingConfig Datafeeds might be required to search over long time periods, for several // months or years. // This search is split into time chunks in order to ensure the load on // Elasticsearch is managed. // Chunking configuration controls how the size of these time chunks are // calculated; // it is an advanced configuration option. ChunkingConfig *types.ChunkingConfig `json:"chunking_config,omitempty"` // DelayedDataCheckConfig Specifies whether the datafeed checks for missing data and the size of the // window. // The datafeed can optionally search over indices that have already been read // in an effort to determine whether // any data has subsequently been added to the index. If missing data is found, // it is a good indication that the // `query_delay` is set too low and the data is being indexed after the datafeed // has passed that moment in time. // This check runs only on real-time datafeeds. DelayedDataCheckConfig *types.DelayedDataCheckConfig `json:"delayed_data_check_config,omitempty"` // Frequency The interval at which scheduled queries are made while the datafeed runs in // real time. // The default value is either the bucket span for short bucket spans, or, for // longer bucket spans, a sensible // fraction of the bucket span. When `frequency` is shorter than the bucket // span, interim results for the last // (partial) bucket are written then eventually overwritten by the full bucket // results. If the datafeed uses // aggregations, this value must be divisible by the interval of the date // histogram aggregation. Frequency *types.Duration `json:"frequency,omitempty"` Headers *types.HttpHeaders `json:"headers,omitempty"` // Indices An array of index names. Wildcards are supported. If any of the indices are // in remote clusters, the machine // learning nodes must have the `remote_cluster_client` role. Indices *types.Indices `json:"indices,omitempty"` // IndicesOptions Specifies index expansion options that are used during search IndicesOptions *types.IndicesOptions `json:"indices_options,omitempty"` // JobId Identifier for the anomaly detection job. JobId *types.Id `json:"job_id,omitempty"` // MaxEmptySearches If a real-time datafeed has never seen any data (including during any initial // training period), it automatically // stops and closes the associated job after this many real-time searches return // no documents. In other words, // it stops after `frequency` times `max_empty_searches` of real-time operation. // If not set, a datafeed with no // end time that sees no data remains started until it is explicitly stopped. By // default, it is not set. MaxEmptySearches *int `json:"max_empty_searches,omitempty"` // Query The Elasticsearch query domain-specific language (DSL). This value // corresponds to the query object in an // Elasticsearch search POST body. All the options that are supported by // Elasticsearch can be used, as this // object is passed verbatim to Elasticsearch. Query *types.QueryContainer `json:"query,omitempty"` // QueryDelay The number of seconds behind real time that data is queried. For example, if // data from 10:04 a.m. might // not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 // seconds. The default // value is randomly selected between `60s` and `120s`. This randomness improves // the query performance // when there are multiple jobs running on the same node. QueryDelay *types.Duration `json:"query_delay,omitempty"` // RuntimeMappings Specifies runtime fields for the datafeed search. RuntimeMappings *types.RuntimeFields `json:"runtime_mappings,omitempty"` // ScriptFields Specifies scripts that evaluate custom expressions and returns script fields // to the datafeed. // The detector configuration objects in a job can contain functions that use // these script fields. ScriptFields map[string]types.ScriptField `json:"script_fields,omitempty"` // ScrollSize The size parameter that is used in Elasticsearch searches when the datafeed // does not use aggregations. // The maximum value is the value of `index.max_result_window`, which is 10,000 // by default. ScrollSize *int `json:"scroll_size,omitempty"` }
Request holds the request body struct for the package putdatafeed
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
RequestBuilder is the builder API for the putdatafeed.Request
func NewRequestBuilder ¶
func NewRequestBuilder() *RequestBuilder
NewRequest returns a RequestBuilder which can be chained and built to retrieve a RequestBuilder
func (*RequestBuilder) Aggregations ¶
func (rb *RequestBuilder) Aggregations(values map[string]*types.AggregationContainerBuilder) *RequestBuilder
func (*RequestBuilder) Build ¶
func (rb *RequestBuilder) Build() *Request
Build finalize the chain and returns the Request struct.
func (*RequestBuilder) ChunkingConfig ¶
func (rb *RequestBuilder) ChunkingConfig(chunkingconfig *types.ChunkingConfigBuilder) *RequestBuilder
func (*RequestBuilder) DelayedDataCheckConfig ¶
func (rb *RequestBuilder) DelayedDataCheckConfig(delayeddatacheckconfig *types.DelayedDataCheckConfigBuilder) *RequestBuilder
func (*RequestBuilder) Frequency ¶
func (rb *RequestBuilder) Frequency(frequency *types.DurationBuilder) *RequestBuilder
func (*RequestBuilder) FromJSON ¶
func (rb *RequestBuilder) FromJSON(data string) (*Request, error)
FromJSON allows to load an arbitrary json into the request structure
func (*RequestBuilder) Headers ¶
func (rb *RequestBuilder) Headers(headers *types.HttpHeadersBuilder) *RequestBuilder
func (*RequestBuilder) Indices ¶
func (rb *RequestBuilder) Indices(indices *types.IndicesBuilder) *RequestBuilder
func (*RequestBuilder) IndicesOptions ¶
func (rb *RequestBuilder) IndicesOptions(indicesoptions *types.IndicesOptionsBuilder) *RequestBuilder
func (*RequestBuilder) JobId ¶
func (rb *RequestBuilder) JobId(jobid types.Id) *RequestBuilder
func (*RequestBuilder) MaxEmptySearches ¶
func (rb *RequestBuilder) MaxEmptySearches(maxemptysearches int) *RequestBuilder
func (*RequestBuilder) Query ¶
func (rb *RequestBuilder) Query(query *types.QueryContainerBuilder) *RequestBuilder
func (*RequestBuilder) QueryDelay ¶
func (rb *RequestBuilder) QueryDelay(querydelay *types.DurationBuilder) *RequestBuilder
func (*RequestBuilder) RuntimeMappings ¶
func (rb *RequestBuilder) RuntimeMappings(runtimemappings *types.RuntimeFieldsBuilder) *RequestBuilder
func (*RequestBuilder) ScriptFields ¶
func (rb *RequestBuilder) ScriptFields(values map[string]*types.ScriptFieldBuilder) *RequestBuilder
func (*RequestBuilder) ScrollSize ¶
func (rb *RequestBuilder) ScrollSize(scrollsize int) *RequestBuilder