-
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.
add schema definitions for route params
- Loading branch information
1 parent
a92fed4
commit a1a88ca
Showing
2 changed files
with
122 additions
and
40 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
x-pack/legacy/plugins/ml/server/new_platform/job_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,66 @@ | ||
/* | ||
* 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 analyzerSchema = { | ||
tokenizer: schema.string(), | ||
filter: schema.arrayOf( | ||
schema.object({ | ||
type: schema.string(), | ||
stopwords: schema.arrayOf(schema.maybe(schema.string())), | ||
}) | ||
), | ||
}; | ||
|
||
export const catFieldExamplesSchema = { | ||
indexPatternTitle: schema.string(), | ||
query: schema.any(), | ||
size: schema.number(), | ||
field: schema.string(), | ||
timeField: schema.string(), | ||
start: schema.number(), | ||
end: schema.number(), | ||
analyzer: schema.object(analyzerSchema), | ||
}; | ||
|
||
export const chartSchema = { | ||
indexPatternTitle: schema.string(), | ||
timefield: schema.string(), | ||
start: schema.number(), | ||
end: schema.number(), | ||
intervalMs: schema.number(), | ||
query: schema.any(), | ||
aggFieldNamePairs: schema.arrayOf(schema.any()), | ||
splitFieldName: schema.maybe(schema.nullable(schema.string())), | ||
splitFieldValue: schema.maybe(schema.nullable(schema.string())), | ||
}; | ||
|
||
export const datafeedIdsSchema = { datafeedIds: schema.arrayOf(schema.maybe(schema.string())) }; | ||
|
||
export const forceStartDatafeedSchema = { | ||
datafeedIds: schema.arrayOf(schema.maybe(schema.string())), | ||
start: schema.maybe(schema.number()), | ||
end: schema.maybe(schema.number()), | ||
}; | ||
|
||
export const jobIdsSchema = { | ||
jobIds: schema.oneOf([schema.string(), schema.arrayOf(schema.maybe(schema.string()))]), | ||
}; | ||
export const jobsWithTimerangeSchema = { dateFormatTz: schema.maybe(schema.string()) }; | ||
|
||
export const lookBackProgressSchema = { | ||
jobId: schema.string(), | ||
start: schema.maybe(schema.number()), | ||
end: schema.maybe(schema.number()), | ||
}; | ||
|
||
export const topCategoriesSchema = { jobId: schema.string(), count: schema.number() }; | ||
|
||
export const updateGroupsSchema = { | ||
job_id: schema.string(), | ||
groups: schema.arrayOf(schema.maybe(schema.string())), | ||
}; |
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