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.
[ML] New Platform server shim: update results service routes to use n…
…ew platform router (elastic#56886) * migrate resultsService routes to NP. begin conversion of model file to TS * add schema validation to routes * add types to results service model file * add docs for routes * update route description and add routes to doc json file
- Loading branch information
1 parent
f6913a1
commit ff85c7d
Showing
8 changed files
with
356 additions
and
167 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
x-pack/legacy/plugins/ml/server/models/results_service/build_anomaly_table_items.d.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; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { AnomalyRecordDoc } from '../../../common/types/anomalies'; | ||
|
||
export interface AnomaliesTableRecord { | ||
time: number; | ||
source: AnomalyRecordDoc; | ||
rowId: string; | ||
jobId: string; | ||
detectorIndex: number; | ||
severity: number; | ||
entityName?: string; | ||
entityValue?: any; | ||
influencers?: Array<{ [key: string]: any }>; | ||
actual?: number[]; | ||
actualSort?: any; | ||
typical?: number[]; | ||
typicalSort?: any; | ||
metricDescriptionSort?: number; | ||
} | ||
|
||
export function buildAnomalyTableItems( | ||
anomalyRecords: any, | ||
aggregationInterval: any, | ||
dateFormatTz: string | ||
): AnomaliesTableRecord[]; |
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
File renamed without changes.
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
35 changes: 35 additions & 0 deletions
35
x-pack/legacy/plugins/ml/server/new_platform/results_service_schema.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,35 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { schema } from '@kbn/config-schema'; | ||
|
||
const criteriaFieldSchema = schema.object({ | ||
fieldType: schema.maybe(schema.string()), | ||
fieldName: schema.string(), | ||
fieldValue: schema.any(), | ||
}); | ||
|
||
export const anomaliesTableDataSchema = { | ||
jobIds: schema.arrayOf(schema.string()), | ||
criteriaFields: schema.arrayOf(criteriaFieldSchema), | ||
influencers: schema.arrayOf(schema.maybe(schema.string())), | ||
aggregationInterval: schema.string(), | ||
threshold: schema.number(), | ||
earliestMs: schema.number(), | ||
latestMs: schema.number(), | ||
dateFormatTz: schema.string(), | ||
maxRecords: schema.number(), | ||
maxExamples: schema.maybe(schema.number()), | ||
influencersFilterQuery: schema.maybe(schema.any()), | ||
}; | ||
|
||
export const partitionFieldValuesSchema = { | ||
jobId: schema.string(), | ||
searchTerm: schema.maybe(schema.any()), | ||
criteriaFields: schema.arrayOf(criteriaFieldSchema), | ||
earliestMs: schema.number(), | ||
latestMs: schema.number(), | ||
}; |
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.