-
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.
- Loading branch information
Showing
16 changed files
with
112 additions
and
74 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
packages/response-ops/rule_params/synthetics_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'; |
74 changes: 74 additions & 0 deletions
74
packages/response-ops/rule_params/synthetics_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,74 @@ | ||
/* | ||
* 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 TimeWindowSchema = schema.object({ | ||
unit: schema.oneOf( | ||
[schema.literal('s'), schema.literal('m'), schema.literal('h'), schema.literal('d')], | ||
{ | ||
defaultValue: 'm', | ||
} | ||
), | ||
size: schema.number({ | ||
defaultValue: 5, | ||
}), | ||
}); | ||
|
||
export const NumberOfChecksSchema = schema.object({ | ||
numberOfChecks: schema.number({ | ||
defaultValue: 5, | ||
min: 1, | ||
max: 100, | ||
}), | ||
}); | ||
|
||
export const StatusRuleConditionSchema = schema.object({ | ||
groupBy: schema.maybe( | ||
schema.string({ | ||
defaultValue: 'locationId', | ||
}) | ||
), | ||
downThreshold: schema.maybe( | ||
schema.number({ | ||
defaultValue: 3, | ||
}) | ||
), | ||
locationsThreshold: schema.maybe( | ||
schema.number({ | ||
defaultValue: 1, | ||
}) | ||
), | ||
window: schema.oneOf([ | ||
schema.object({ | ||
time: TimeWindowSchema, | ||
}), | ||
NumberOfChecksSchema, | ||
]), | ||
includeRetests: schema.maybe(schema.boolean()), | ||
}); | ||
|
||
export const StatusRuleParamsSchema = schema.object( | ||
{ | ||
condition: schema.maybe(StatusRuleConditionSchema), | ||
monitorIds: schema.maybe(schema.arrayOf(schema.string())), | ||
locations: schema.maybe(schema.arrayOf(schema.string())), | ||
tags: schema.maybe(schema.arrayOf(schema.string())), | ||
monitorTypes: schema.maybe(schema.arrayOf(schema.string())), | ||
projects: schema.maybe(schema.arrayOf(schema.string())), | ||
kqlQuery: schema.maybe(schema.string()), | ||
}, | ||
{ | ||
meta: { description: 'The parameters for the rule.' }, | ||
} | ||
); | ||
|
||
export type StatusRuleParams = TypeOf<typeof StatusRuleParamsSchema>; | ||
export type TimeWindow = TypeOf<typeof TimeWindowSchema>; | ||
export type StatusRuleCondition = TypeOf<typeof StatusRuleConditionSchema>; |
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
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
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
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