forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ResponseOps][Rules] Moved params of anomaly detection rules to a sep…
…arate package (elastic#205497) Connected with elastic#195189 ## Summary - Moved params of anomaly detection rule type to `/response-ops/rule_params/anomaly_detection/` - Moved params of anomaly detection jobs health rule type to `/response-ops/rule_params/anomaly_detection_jobs_health/` --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
Showing
12 changed files
with
154 additions
and
87 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/platform/packages/shared/response-ops/rule_params/anomaly_detection/index.ts
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,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
export { mlAnomalyDetectionAlertParamsSchema } from './latest'; | ||
export { mlAnomalyDetectionAlertParamsSchema as mlAnomalyDetectionAlertParamsSchemaV1 } from './v1'; |
10 changes: 10 additions & 0 deletions
10
src/platform/packages/shared/response-ops/rule_params/anomaly_detection/latest.ts
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,10 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
export * from './v1'; |
30 changes: 30 additions & 0 deletions
30
src/platform/packages/shared/response-ops/rule_params/anomaly_detection/v1.ts
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,30 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import { schema } from '@kbn/config-schema'; | ||
import { ML_ANOMALY_RESULT_TYPE } from '@kbn/ml-anomaly-utils'; | ||
|
||
import { jobsSelectionSchema } from '../common/utils'; | ||
|
||
export const mlAnomalyDetectionAlertParamsSchema = schema.object({ | ||
jobSelection: jobsSelectionSchema, | ||
/** Anomaly score threshold */ | ||
severity: schema.number({ min: 0, max: 100 }), | ||
/** Result type to alert upon */ | ||
resultType: schema.oneOf([ | ||
schema.literal(ML_ANOMALY_RESULT_TYPE.RECORD), | ||
schema.literal(ML_ANOMALY_RESULT_TYPE.BUCKET), | ||
schema.literal(ML_ANOMALY_RESULT_TYPE.INFLUENCER), | ||
]), | ||
includeInterim: schema.boolean({ defaultValue: true }), | ||
/** User's override for the lookback interval */ | ||
lookbackInterval: schema.nullable(schema.string()), | ||
/** User's override for the top N buckets */ | ||
topNBuckets: schema.nullable(schema.number({ min: 1 })), | ||
}); |
11 changes: 11 additions & 0 deletions
11
src/platform/packages/shared/response-ops/rule_params/anomaly_detection_jobs_health/index.ts
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,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
export { anomalyDetectionJobsHealthRuleParamsSchema } from './latest'; | ||
export { anomalyDetectionJobsHealthRuleParamsSchema as anomalyDetectionJobsHealthRuleParamsSchemaV1 } from './v1'; |
10 changes: 10 additions & 0 deletions
10
...platform/packages/shared/response-ops/rule_params/anomaly_detection_jobs_health/latest.ts
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,10 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
export * from './v1'; |
48 changes: 48 additions & 0 deletions
48
src/platform/packages/shared/response-ops/rule_params/anomaly_detection_jobs_health/v1.ts
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,48 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import { schema } from '@kbn/config-schema'; | ||
import { jobsSelectionSchema } from '../common/utils'; | ||
|
||
export const anomalyDetectionJobsHealthRuleParamsSchema = schema.object({ | ||
includeJobs: jobsSelectionSchema, | ||
excludeJobs: schema.nullable(jobsSelectionSchema), | ||
testsConfig: schema.nullable( | ||
schema.object({ | ||
datafeed: schema.nullable( | ||
schema.object({ | ||
enabled: schema.boolean({ defaultValue: true }), | ||
}) | ||
), | ||
mml: schema.nullable( | ||
schema.object({ | ||
enabled: schema.boolean({ defaultValue: true }), | ||
}) | ||
), | ||
delayedData: schema.nullable( | ||
schema.object({ | ||
enabled: schema.boolean({ defaultValue: true }), | ||
docsCount: schema.nullable(schema.number({ min: 1 })), | ||
timeInterval: schema.nullable(schema.string()), | ||
}) | ||
), | ||
behindRealtime: schema.nullable( | ||
schema.object({ | ||
enabled: schema.boolean({ defaultValue: true }), | ||
timeInterval: schema.nullable(schema.string()), | ||
}) | ||
), | ||
errorMessages: schema.nullable( | ||
schema.object({ | ||
enabled: schema.boolean({ defaultValue: true }), | ||
}) | ||
), | ||
}) | ||
), | ||
}); |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
"kbn_references": [ | ||
"@kbn/config-schema", | ||
"@kbn/ml-anomaly-utils", | ||
"@kbn/i18n", | ||
"@kbn/alerting-comparators", | ||
] | ||
} |
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