-
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.
[ML] New Platform server shim: update job service routes to use new p…
…latform router (#57403) * wip: convert jobService route file to TS and use NP router * add schema definitions for route params * add api docs description for routes * update schema and rename client * update calendarManager * fix typo in schema * use NP context savedObjectsClient for rollup true * request no longer passed to JobServiceProvider * update anomalyDetectors schema for job update * add missing key to anomalydetectors schema
- Loading branch information
1 parent
204767e
commit cc21b64
Showing
15 changed files
with
781 additions
and
384 deletions.
There are no files selected for viewing
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
75 changes: 75 additions & 0 deletions
75
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,75 @@ | ||
/* | ||
* 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 categorizationFieldExamplesSchema = { | ||
indexPatternTitle: schema.string(), | ||
query: schema.any(), | ||
size: schema.number(), | ||
field: schema.string(), | ||
timeField: schema.maybe(schema.string()), | ||
start: schema.number(), | ||
end: schema.number(), | ||
analyzer: schema.object(analyzerSchema), | ||
}; | ||
|
||
export const chartSchema = { | ||
indexPatternTitle: schema.string(), | ||
timeField: schema.maybe(schema.string()), | ||
start: schema.maybe(schema.number()), | ||
end: schema.maybe(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.maybe( | ||
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 = { | ||
jobs: schema.maybe( | ||
schema.arrayOf( | ||
schema.object({ | ||
job_id: schema.maybe(schema.string()), | ||
groups: schema.arrayOf(schema.maybe(schema.string())), | ||
}) | ||
) | ||
), | ||
}; |
Oops, something went wrong.