-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ResponseOps][Rules]Move uptime rule params to package (#205238)
Connected with #195187 ## Summary - Moved params of duration anomaly rule type to `/response-ops/rule_params/uptime_duration_anomaly/` - Moved params of monitor status rule type to `/response-ops/rule_params/uptime_monitor_status/` - Moved params of TLS rule type to `/response-ops/rule_params/uptime_tls/` - **Did not move anything related to the legacy TLS rule type.** I ran into a similar issue to #205207 for the monitor status rule type. It doesn't block this PR but some follow up work might be needed for `x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/validate_monitor_status.ts`. We will probably decide after the new year. --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
98cc4b1
commit c8d46ee
Showing
13 changed files
with
169 additions
and
53 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/platform/packages/shared/response-ops/rule_params/uptime_duration_anomaly/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,14 @@ | ||
/* | ||
* 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 { uptimeDurationAnomalyRuleParamsSchema } from './latest'; | ||
export { uptimeDurationAnomalyRuleParamsSchema as uptimeDurationAnomalyRuleParamsSchemaV1 } from './v1'; | ||
|
||
export type { UptimeDurationAnomalyRuleParams } from './latest'; | ||
export type { UptimeDurationAnomalyRuleParams as UptimeDurationAnomalyRuleParamsV1 } from './v1'; |
10 changes: 10 additions & 0 deletions
10
src/platform/packages/shared/response-ops/rule_params/uptime_duration_anomaly/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'; |
18 changes: 18 additions & 0 deletions
18
src/platform/packages/shared/response-ops/rule_params/uptime_duration_anomaly/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,18 @@ | ||
/* | ||
* 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 { TypeOf, schema } from '@kbn/config-schema'; | ||
|
||
export const uptimeDurationAnomalyRuleParamsSchema = schema.object({ | ||
stackVersion: schema.maybe(schema.string()), | ||
monitorId: schema.string(), | ||
severity: schema.number(), | ||
}); | ||
|
||
export type UptimeDurationAnomalyRuleParams = TypeOf<typeof uptimeDurationAnomalyRuleParamsSchema>; |
14 changes: 14 additions & 0 deletions
14
src/platform/packages/shared/response-ops/rule_params/uptime_monitor_status/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,14 @@ | ||
/* | ||
* 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 { uptimeMonitorStatusRuleParamsSchema } from './latest'; | ||
export { uptimeMonitorStatusRuleParamsSchema as uptimeMonitorStatusRuleParamsSchemaV1 } from './v1'; | ||
|
||
export type { UptimeMonitorStatusParams } from './latest'; | ||
export type { UptimeMonitorStatusParams as UptimeMonitorStatusParamsV1 } from './v1'; |
10 changes: 10 additions & 0 deletions
10
src/platform/packages/shared/response-ops/rule_params/uptime_monitor_status/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'; |
52 changes: 52 additions & 0 deletions
52
src/platform/packages/shared/response-ops/rule_params/uptime_monitor_status/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,52 @@ | ||
/* | ||
* 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 { TypeOf, schema } from '@kbn/config-schema'; | ||
|
||
export const uptimeMonitorStatusRuleParamsSchema = schema.object({ | ||
stackVersion: schema.maybe(schema.string()), | ||
availability: schema.maybe( | ||
schema.object({ | ||
range: schema.number(), | ||
rangeUnit: schema.string(), | ||
threshold: schema.string(), | ||
}) | ||
), | ||
// deprecated | ||
filters: schema.maybe( | ||
schema.oneOf([ | ||
// deprecated | ||
schema.object({ | ||
'monitor.type': schema.maybe(schema.arrayOf(schema.string())), | ||
'observer.geo.name': schema.maybe(schema.arrayOf(schema.string())), | ||
tags: schema.maybe(schema.arrayOf(schema.string())), | ||
'url.port': schema.maybe(schema.arrayOf(schema.string())), | ||
}), | ||
schema.string(), | ||
]) | ||
), | ||
locations: schema.maybe(schema.arrayOf(schema.string())), | ||
numTimes: schema.number(), | ||
search: schema.maybe(schema.string()), | ||
shouldCheckStatus: schema.boolean(), | ||
shouldCheckAvailability: schema.boolean(), | ||
timerangeCount: schema.maybe(schema.number()), | ||
timerangeUnit: schema.maybe(schema.string()), | ||
// deprecated | ||
timerange: schema.maybe( | ||
schema.object({ | ||
from: schema.string(), | ||
to: schema.string(), | ||
}) | ||
), | ||
version: schema.maybe(schema.number()), | ||
isAutoGenerated: schema.maybe(schema.boolean()), | ||
}); | ||
|
||
export type UptimeMonitorStatusParams = TypeOf<typeof uptimeMonitorStatusRuleParamsSchema>; |
14 changes: 14 additions & 0 deletions
14
src/platform/packages/shared/response-ops/rule_params/uptime_tls/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,14 @@ | ||
/* | ||
* 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 { uptimeTLSRuleParamsSchema } from './latest'; | ||
export { uptimeTLSRuleParamsSchema as uptimeTLSRuleParamsSchemaV1 } from './v1'; | ||
|
||
export type { UptimeTLSRuleParams } from './latest'; | ||
export type { UptimeTLSRuleParams as UptimeTLSRuleParamsV1 } from './v1'; |
10 changes: 10 additions & 0 deletions
10
src/platform/packages/shared/response-ops/rule_params/uptime_tls/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'; |
19 changes: 19 additions & 0 deletions
19
src/platform/packages/shared/response-ops/rule_params/uptime_tls/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,19 @@ | ||
/* | ||
* 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 { TypeOf, schema } from '@kbn/config-schema'; | ||
|
||
export const uptimeTLSRuleParamsSchema = schema.object({ | ||
stackVersion: schema.maybe(schema.string()), | ||
search: schema.maybe(schema.string()), | ||
certExpirationThreshold: schema.maybe(schema.number()), | ||
certAgeThreshold: schema.maybe(schema.number()), | ||
}); | ||
|
||
export type UptimeTLSRuleParams = TypeOf<typeof uptimeTLSRuleParamsSchema>; |
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