Skip to content

Commit 5a656d0

Browse files
authored
Fix Action definitions for watcher.put_watcher API (elastic#1272)
1 parent d29bdf8 commit 5a656d0

File tree

8 files changed

+871
-219
lines changed

8 files changed

+871
-219
lines changed

output/schema/schema.json

+644-158
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/validation-errors.json

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

+76-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_types/Transform.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class Transform {}
2828
* @variants container
2929
*/
3030
export class TransformContainer {
31-
chain?: ChainTransform
31+
chain?: ChainTransform | TransformContainer[]
3232
script?: ScriptTransform
3333
search?: SearchTransform
3434
}
@@ -38,8 +38,13 @@ export class ChainTransform {
3838
}
3939

4040
export class ScriptTransform {
41-
lang: string
42-
params: Dictionary<string, UserDefinedValue>
41+
/**
42+
* @server_default painless
43+
*/
44+
lang?: string
45+
params?: Dictionary<string, UserDefinedValue>
46+
source?: string
47+
id?: string
4348
}
4449

4550
export class SearchTransform {

specification/watcher/_types/Action.ts

+14-10
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@
1919

2020
import { Dictionary } from '@spec_utils/Dictionary'
2121
import { IndexName, Name } from '@_types/common'
22-
import { Host } from '@_types/Networking'
2322
import { integer } from '@_types/Numeric'
2423
import { DateString, EpochMillis, Time } from '@_types/Time'
2524
import { TransformContainer } from '@_types/Transform'
26-
import { Index, Logging } from './Actions'
25+
import {
26+
IndexAction,
27+
LoggingAction,
28+
WebhookAction,
29+
EmailAction,
30+
PagerDutyAction,
31+
SlackAction
32+
} from './Actions'
2733
import { ConditionContainer } from './Conditions'
2834

2935
export class Action {
@@ -35,15 +41,13 @@ export class Action {
3541
throttle_period?: Time
3642
throttle_period_in_millis?: EpochMillis
3743
transform?: TransformContainer
38-
index?: Index
39-
logging?: Logging
44+
index?: IndexAction
45+
logging?: LoggingAction
46+
email?: EmailAction
47+
pagerduty?: PagerDutyAction
48+
slack?: SlackAction
4049
/** @since 7.14.0 */
41-
webhook?: ActionWebhook
42-
}
43-
44-
export class ActionWebhook {
45-
host: Host
46-
port: integer
50+
webhook?: WebhookAction
4751
}
4852

4953
export type Actions = Dictionary<IndexName, ActionStatus>

0 commit comments

Comments
 (0)