-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Watcher] Support for adding actions to threshold watch #35175
Merged
alisonelizabeth
merged 19 commits into
elastic:watcher-port
from
alisonelizabeth:threshold-watch-actions
May 3, 2019
Merged
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b107924
initial support for adding actions via threshold watch
alisonelizabeth 38e3d55
added validation; support for email and slack action types
alisonelizabeth ab7f44e
added support for index action
alisonelizabeth ac0b569
added support for webhook action
alisonelizabeth f3ce9ca
added support for pagerduty action
alisonelizabeth 419c349
Merge remote-tracking branch 'upstream/watcher-port' into threshold-w…
alisonelizabeth b25f6ee
added support for jira action
alisonelizabeth 7d85488
cleanup
alisonelizabeth 7c4d032
Merge remote-tracking branch 'upstream/watcher-port' into threshold-w…
alisonelizabeth e858f66
remove extra spacers
alisonelizabeth 4ad38cb
Add SCSS file and tweak actions dropdown position.
cjcenizal 721b20a
Merge pull request #1 from cjcenizal/watcher/actions-dropdown-tweaks
alisonelizabeth 03b58c0
address review comments
alisonelizabeth 85fc8df
adjust logic that determines if actions are enabled/disabled
alisonelizabeth 762eb44
Merge remote-tracking branch 'upstream/watcher-port' into threshold-w…
alisonelizabeth 884335c
addressing pr feedback
alisonelizabeth 514149b
Merge remote-tracking branch 'upstream/watcher-port' into threshold-w…
alisonelizabeth 3aca320
fix linting error
alisonelizabeth 3896071
Merge remote-tracking branch 'upstream/watcher-port' into threshold-w…
alisonelizabeth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
type EmailActionType = 'email'; | ||
type LoggingActionType = 'logging'; | ||
type WebhookActionType = 'webhook'; | ||
type IndexActionType = 'index'; | ||
type SlackActionType = 'slack'; | ||
type JiraActionType = 'jira'; | ||
type PagerDutyActionType = 'pagerduty'; | ||
|
||
export interface BaseAction { | ||
id: string; | ||
typeName: string; | ||
simulateMessage: string; | ||
simulateFailMessage: string; | ||
simulatePrompt: string; | ||
selectMessage: string; | ||
validate: () => { [key: string]: string[] }; | ||
isEnabled: boolean; | ||
} | ||
|
||
export interface EmailAction extends BaseAction { | ||
type: EmailActionType; | ||
iconClass: 'email'; | ||
to: []; | ||
subject?: string; | ||
body: string; | ||
} | ||
|
||
export interface LoggingAction extends BaseAction { | ||
type: LoggingActionType; | ||
iconClass: 'loggingApp'; | ||
text: string; | ||
} | ||
|
||
export interface IndexAction extends BaseAction { | ||
type: IndexActionType; | ||
iconClass: 'indexOpen'; | ||
index: string; | ||
} | ||
|
||
export interface PagerDutyAction extends BaseAction { | ||
type: PagerDutyActionType; | ||
iconClass: 'apps'; | ||
description: string; | ||
} | ||
|
||
export interface WebhookAction extends BaseAction { | ||
type: WebhookActionType; | ||
iconClass: 'logoWebhook'; | ||
method?: 'head' | 'get' | 'post' | 'put' | 'delete'; | ||
host: string; | ||
port: number; | ||
path?: string; | ||
body: string; | ||
} | ||
|
||
export interface SlackAction extends BaseAction { | ||
type: SlackActionType; | ||
iconClass: 'logoSlack'; | ||
text: string; | ||
to: string[]; | ||
} | ||
|
||
export interface JiraAction extends BaseAction { | ||
type: JiraActionType; | ||
iconClass: 'apps'; | ||
account?: string; | ||
projectKey: string; | ||
issueType: string; | ||
summary: string; | ||
} | ||
|
||
export type ActionType = | ||
| EmailAction | ||
| LoggingAction | ||
| IndexAction | ||
| SlackAction | ||
| JiraAction | ||
| PagerDutyAction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Import the EUI global scope so we can use EUI constants | ||
@import 'src/legacy/ui/public/styles/_styling_constants'; | ||
|
||
// Watcher plugin styles | ||
|
||
// Prefix all styles with "watcher" to avoid conflicts. | ||
// Examples | ||
// watcherChart | ||
// watcherChart__legend | ||
// watcherChart__legend--small | ||
// watcherChart__legend-isLoading | ||
|
||
.watcherThresholdWatchActionDropdownContainer { | ||
justify-content: flex-end; | ||
flex-direction: row; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not native speaker, but shouldn't we quote the "to"?
"To" email property is required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Updated, but also plan on doing a copy review with gail.