-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelasticsearchMlDatafeed.ts
More file actions
363 lines (355 loc) · 20.5 KB
/
elasticsearchMlDatafeed.ts
File metadata and controls
363 lines (355 loc) · 20.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
import * as utilities from "./utilities";
export class ElasticsearchMlDatafeed extends pulumi.CustomResource {
/**
* Get an existing ElasticsearchMlDatafeed resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ElasticsearchMlDatafeedState, opts?: pulumi.CustomResourceOptions): ElasticsearchMlDatafeed {
return new ElasticsearchMlDatafeed(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'elasticstack:index/elasticsearchMlDatafeed:ElasticsearchMlDatafeed';
/**
* Returns true if the given object is an instance of ElasticsearchMlDatafeed. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is ElasticsearchMlDatafeed {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === ElasticsearchMlDatafeed.__pulumiType;
}
/**
* If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low
* cardinality data. This should be a JSON object representing the aggregations to be performed.
*/
declare public readonly aggregations: pulumi.Output<string | undefined>;
/**
* Datafeeds might 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.
*/
declare public readonly chunkingConfig: pulumi.Output<outputs.ElasticsearchMlDatafeedChunkingConfig>;
/**
* 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.
*/
declare public readonly datafeedId: pulumi.Output<string>;
/**
* 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.
*/
declare public readonly delayedDataCheckConfig: pulumi.Output<outputs.ElasticsearchMlDatafeedDelayedDataCheckConfig>;
/**
* Elasticsearch connection configuration block.
*
* @deprecated Deprecated
*/
declare public readonly elasticsearchConnections: pulumi.Output<outputs.ElasticsearchMlDatafeedElasticsearchConnection[] | undefined>;
/**
* 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.
*/
declare public readonly frequency: pulumi.Output<string>;
/**
* 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.
*/
declare public readonly indices: pulumi.Output<string[]>;
/**
* Specifies index expansion options that are used during search.
*/
declare public readonly indicesOptions: pulumi.Output<outputs.ElasticsearchMlDatafeedIndicesOptions>;
/**
* Identifier for the anomaly detection job. The job must exist before creating the datafeed.
*/
declare public readonly jobId: pulumi.Output<string>;
/**
* 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.
*/
declare public readonly maxEmptySearches: pulumi.Output<number | undefined>;
/**
* 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. By default uses `{"match_all": {"boost": 1}}`.
*/
declare public readonly query: pulumi.Output<string>;
/**
* 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.
*/
declare public readonly queryDelay: pulumi.Output<string>;
/**
* Specifies runtime fields for the datafeed search. This should be a JSON object representing the runtime field mappings.
*/
declare public readonly runtimeMappings: pulumi.Output<string | undefined>;
/**
* 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. This should be a JSON object representing the
* script fields.
*/
declare public readonly scriptFields: pulumi.Output<string | undefined>;
/**
* 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.
*/
declare public readonly scrollSize: pulumi.Output<number>;
/**
* Create a ElasticsearchMlDatafeed resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ElasticsearchMlDatafeedArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: ElasticsearchMlDatafeedArgs | ElasticsearchMlDatafeedState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as ElasticsearchMlDatafeedState | undefined;
resourceInputs["aggregations"] = state?.aggregations;
resourceInputs["chunkingConfig"] = state?.chunkingConfig;
resourceInputs["datafeedId"] = state?.datafeedId;
resourceInputs["delayedDataCheckConfig"] = state?.delayedDataCheckConfig;
resourceInputs["elasticsearchConnections"] = state?.elasticsearchConnections;
resourceInputs["frequency"] = state?.frequency;
resourceInputs["indices"] = state?.indices;
resourceInputs["indicesOptions"] = state?.indicesOptions;
resourceInputs["jobId"] = state?.jobId;
resourceInputs["maxEmptySearches"] = state?.maxEmptySearches;
resourceInputs["query"] = state?.query;
resourceInputs["queryDelay"] = state?.queryDelay;
resourceInputs["runtimeMappings"] = state?.runtimeMappings;
resourceInputs["scriptFields"] = state?.scriptFields;
resourceInputs["scrollSize"] = state?.scrollSize;
} else {
const args = argsOrState as ElasticsearchMlDatafeedArgs | undefined;
if (args?.datafeedId === undefined && !opts.urn) {
throw new Error("Missing required property 'datafeedId'");
}
if (args?.indices === undefined && !opts.urn) {
throw new Error("Missing required property 'indices'");
}
if (args?.jobId === undefined && !opts.urn) {
throw new Error("Missing required property 'jobId'");
}
resourceInputs["aggregations"] = args?.aggregations;
resourceInputs["chunkingConfig"] = args?.chunkingConfig;
resourceInputs["datafeedId"] = args?.datafeedId;
resourceInputs["delayedDataCheckConfig"] = args?.delayedDataCheckConfig;
resourceInputs["elasticsearchConnections"] = args?.elasticsearchConnections;
resourceInputs["frequency"] = args?.frequency;
resourceInputs["indices"] = args?.indices;
resourceInputs["indicesOptions"] = args?.indicesOptions;
resourceInputs["jobId"] = args?.jobId;
resourceInputs["maxEmptySearches"] = args?.maxEmptySearches;
resourceInputs["query"] = args?.query;
resourceInputs["queryDelay"] = args?.queryDelay;
resourceInputs["runtimeMappings"] = args?.runtimeMappings;
resourceInputs["scriptFields"] = args?.scriptFields;
resourceInputs["scrollSize"] = args?.scrollSize;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ElasticsearchMlDatafeed.__pulumiType, name, resourceInputs, opts, false /*dependency*/, utilities.getPackage());
}
}
/**
* Input properties used for looking up and filtering ElasticsearchMlDatafeed resources.
*/
export interface ElasticsearchMlDatafeedState {
/**
* If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low
* cardinality data. This should be a JSON object representing the aggregations to be performed.
*/
aggregations?: pulumi.Input<string>;
/**
* Datafeeds might 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?: pulumi.Input<inputs.ElasticsearchMlDatafeedChunkingConfig>;
/**
* 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.
*/
datafeedId?: pulumi.Input<string>;
/**
* 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?: pulumi.Input<inputs.ElasticsearchMlDatafeedDelayedDataCheckConfig>;
/**
* Elasticsearch connection configuration block.
*
* @deprecated Deprecated
*/
elasticsearchConnections?: pulumi.Input<pulumi.Input<inputs.ElasticsearchMlDatafeedElasticsearchConnection>[]>;
/**
* 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?: pulumi.Input<string>;
/**
* 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?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies index expansion options that are used during search.
*/
indicesOptions?: pulumi.Input<inputs.ElasticsearchMlDatafeedIndicesOptions>;
/**
* Identifier for the anomaly detection job. The job must exist before creating the datafeed.
*/
jobId?: pulumi.Input<string>;
/**
* 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.
*/
maxEmptySearches?: pulumi.Input<number>;
/**
* 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. By default uses `{"match_all": {"boost": 1}}`.
*/
query?: pulumi.Input<string>;
/**
* 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?: pulumi.Input<string>;
/**
* Specifies runtime fields for the datafeed search. This should be a JSON object representing the runtime field mappings.
*/
runtimeMappings?: pulumi.Input<string>;
/**
* 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. This should be a JSON object representing the
* script fields.
*/
scriptFields?: pulumi.Input<string>;
/**
* 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?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a ElasticsearchMlDatafeed resource.
*/
export interface ElasticsearchMlDatafeedArgs {
/**
* If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low
* cardinality data. This should be a JSON object representing the aggregations to be performed.
*/
aggregations?: pulumi.Input<string>;
/**
* Datafeeds might 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?: pulumi.Input<inputs.ElasticsearchMlDatafeedChunkingConfig>;
/**
* 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.
*/
datafeedId: pulumi.Input<string>;
/**
* 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?: pulumi.Input<inputs.ElasticsearchMlDatafeedDelayedDataCheckConfig>;
/**
* Elasticsearch connection configuration block.
*
* @deprecated Deprecated
*/
elasticsearchConnections?: pulumi.Input<pulumi.Input<inputs.ElasticsearchMlDatafeedElasticsearchConnection>[]>;
/**
* 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?: pulumi.Input<string>;
/**
* 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: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies index expansion options that are used during search.
*/
indicesOptions?: pulumi.Input<inputs.ElasticsearchMlDatafeedIndicesOptions>;
/**
* Identifier for the anomaly detection job. The job must exist before creating the datafeed.
*/
jobId: pulumi.Input<string>;
/**
* 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.
*/
maxEmptySearches?: pulumi.Input<number>;
/**
* 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. By default uses `{"match_all": {"boost": 1}}`.
*/
query?: pulumi.Input<string>;
/**
* 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?: pulumi.Input<string>;
/**
* Specifies runtime fields for the datafeed search. This should be a JSON object representing the runtime field mappings.
*/
runtimeMappings?: pulumi.Input<string>;
/**
* 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. This should be a JSON object representing the
* script fields.
*/
scriptFields?: pulumi.Input<string>;
/**
* 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?: pulumi.Input<number>;
}