Skip to content

Commit

Permalink
Create index files and update imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
adcoelho committed Jan 3, 2025
1 parent f80d522 commit c9f6057
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 12 deletions.
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';
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

import { TypeOf, schema } from '@kbn/config-schema';

export const UptimeDurationAnomalyRuleParamsSchema = schema.object({
export const uptimeDurationAnomalyRuleParamsSchema = schema.object({
stackVersion: schema.maybe(schema.string()),
monitorId: schema.string(),
severity: schema.number(),
});

export type UptimeDurationAnomalyRuleParams = TypeOf<typeof UptimeDurationAnomalyRuleParamsSchema>;
export type UptimeDurationAnomalyRuleParams = TypeOf<typeof uptimeDurationAnomalyRuleParamsSchema>;
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';
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { TypeOf, schema } from '@kbn/config-schema';

export const UptimeMonitorStatusRuleParamsSchema = schema.object({
export const uptimeMonitorStatusRuleParamsSchema = schema.object({
stackVersion: schema.maybe(schema.string()),
availability: schema.maybe(
schema.object({
Expand Down Expand Up @@ -49,4 +49,4 @@ export const UptimeMonitorStatusRuleParamsSchema = schema.object({
isAutoGenerated: schema.maybe(schema.boolean()),
});

export type UptimeMonitorStatusParams = TypeOf<typeof UptimeMonitorStatusRuleParamsSchema>;
export type UptimeMonitorStatusParams = TypeOf<typeof uptimeMonitorStatusRuleParamsSchema>;
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';
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

import { TypeOf, schema } from '@kbn/config-schema';

export const UptimeTLSRuleParamsSchema = schema.object({
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>;
export type UptimeTLSRuleParams = TypeOf<typeof uptimeTLSRuleParamsSchema>;
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
import { ActionGroupIdsOf } from '@kbn/alerting-plugin/common';
import type { MlAnomaliesTableRecord } from '@kbn/ml-anomaly-utils';
import { getSeverityType } from '@kbn/ml-anomaly-utils';
import { UptimeDurationAnomalyRuleParamsSchema } from '@kbn/response-ops-rule-params/uptime_duration_anomaly/latest';
import { uptimeDurationAnomalyRuleParamsSchema } from '@kbn/response-ops-rule-params/uptime_duration_anomaly';
import {
alertsLocatorID,
AlertsLocatorParams,
Expand Down Expand Up @@ -109,7 +109,7 @@ export const durationAnomalyAlertFactory: UptimeAlertTypeFactory<ActionGroupIds>
producer: 'uptime',
name: durationAnomalyTranslations.alertFactoryName,
validate: {
params: UptimeDurationAnomalyRuleParamsSchema,
params: uptimeDurationAnomalyRuleParamsSchema,
},
defaultActionGroupId: DURATION_ANOMALY.id,
actionGroups: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { JsonObject } from '@kbn/utility-types';
import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query';
import { ALERT_REASON } from '@kbn/rule-data-utils';
import { ActionGroupIdsOf } from '@kbn/alerting-plugin/common';
import { UptimeMonitorStatusRuleParamsSchema } from '@kbn/response-ops-rule-params/uptime_monitor_status/latest';
import { uptimeMonitorStatusRuleParamsSchema } from '@kbn/response-ops-rule-params/uptime_monitor_status';
import {
alertsLocatorID,
AlertsLocatorParams,
Expand Down Expand Up @@ -294,7 +294,7 @@ export const statusCheckAlertFactory: UptimeAlertTypeFactory<ActionGroupIds> = (
defaultMessage: 'Uptime monitor status',
}),
validate: {
params: UptimeMonitorStatusRuleParamsSchema,
params: uptimeMonitorStatusRuleParamsSchema,
},
defaultActionGroupId: MONITOR_STATUS.id,
actionGroups: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { LocatorPublic } from '@kbn/share-plugin/common';
import { ALERT_REASON, ALERT_UUID } from '@kbn/rule-data-utils';
import { asyncForEach } from '@kbn/std';
import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
import { UptimeTLSRuleParamsSchema } from '@kbn/response-ops-rule-params/uptime_tls/latest';
import { uptimeTLSRuleParamsSchema } from '@kbn/response-ops-rule-params/uptime_tls';

import { uptimeRuleFieldMap } from '../../../../common/rules/uptime_rule_field_map';
import { formatFilterString } from './status_check';
Expand Down Expand Up @@ -124,7 +124,7 @@ export const tlsAlertFactory: UptimeAlertTypeFactory<ActionGroupIds> = (
producer: 'uptime',
name: tlsTranslations.alertFactoryName,
validate: {
params: UptimeTLSRuleParamsSchema,
params: uptimeTLSRuleParamsSchema,
},
defaultActionGroupId: TLS.id,
actionGroups: [
Expand Down

0 comments on commit c9f6057

Please sign in to comment.