-
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 annotation routes to use new pl…
…atform router (#57067) (#57361) * update annotation routes to use NP router * create ts file for feature check * update schema to allow null value for earliest/latestMs * update annotations model test * use NP security plugin to access user info
- Loading branch information
1 parent
f5251bb
commit 6797a0d
Showing
11 changed files
with
254 additions
and
114 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
11 changes: 11 additions & 0 deletions
11
x-pack/legacy/plugins/ml/server/lib/check_annotations/index.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,11 @@ | ||
/* | ||
* 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 { IScopedClusterClient } from 'src/core/server'; | ||
|
||
export function isAnnotationsFeatureAvailable( | ||
callAsCurrentUser: IScopedClusterClient['callAsCurrentUser'] | ||
): boolean; |
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
30 changes: 30 additions & 0 deletions
30
x-pack/legacy/plugins/ml/server/new_platform/annotations_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,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 { schema } from '@kbn/config-schema'; | ||
|
||
export const indexAnnotationSchema = { | ||
timestamp: schema.number(), | ||
end_timestamp: schema.number(), | ||
annotation: schema.string(), | ||
job_id: schema.string(), | ||
type: schema.string(), | ||
create_time: schema.maybe(schema.number()), | ||
create_username: schema.maybe(schema.string()), | ||
modified_time: schema.maybe(schema.number()), | ||
modified_username: schema.maybe(schema.string()), | ||
_id: schema.maybe(schema.string()), | ||
key: schema.maybe(schema.string()), | ||
}; | ||
|
||
export const getAnnotationsSchema = { | ||
jobIds: schema.arrayOf(schema.string()), | ||
earliestMs: schema.oneOf([schema.nullable(schema.number()), schema.maybe(schema.number())]), | ||
latestMs: schema.oneOf([schema.nullable(schema.number()), schema.maybe(schema.number())]), | ||
maxAnnotations: schema.number(), | ||
}; | ||
|
||
export const deleteAnnotationSchema = { annotationId: 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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.