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 anomaly detectors routes to use…
… new platform router (elastic#56717) * update job routes to NP * call notify.error properly on mlMessageBarService * add route documentation annotation to job routes * update schema and route doc * update apidoc file with routes
- Loading branch information
1 parent
981f53c
commit 70ec649
Showing
5 changed files
with
574 additions
and
210 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
93 changes: 93 additions & 0 deletions
93
x-pack/legacy/plugins/ml/server/new_platform/anomaly_detectors_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,93 @@ | ||
/* | ||
* 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 detectorSchema = schema.object({ | ||
identifier: schema.maybe(schema.string()), | ||
function: schema.string(), | ||
field_name: schema.maybe(schema.string()), | ||
by_field_name: schema.maybe(schema.string()), | ||
over_field_name: schema.maybe(schema.string()), | ||
partition_field_name: schema.maybe(schema.string()), | ||
detector_description: schema.maybe(schema.string()), | ||
}); | ||
|
||
const customUrlSchema = { | ||
url_name: schema.string(), | ||
url_value: schema.string(), | ||
time_range: schema.maybe(schema.any()), | ||
}; | ||
|
||
const customSettingsSchema = schema.object({ | ||
created_by: schema.maybe(schema.string()), | ||
custom_urls: schema.maybe(schema.arrayOf(schema.maybe(schema.object({ ...customUrlSchema })))), | ||
}); | ||
|
||
export const anomalyDetectionUpdateJobSchema = { | ||
description: schema.maybe(schema.string()), | ||
detectors: schema.maybe( | ||
schema.arrayOf( | ||
schema.maybe( | ||
schema.object({ | ||
detector_index: schema.number(), | ||
custom_rules: schema.arrayOf( | ||
schema.maybe( | ||
schema.object({ | ||
actions: schema.arrayOf(schema.string()), | ||
conditions: schema.arrayOf(schema.any()), | ||
scope: schema.maybe(schema.any()), | ||
}) | ||
) | ||
), | ||
}) | ||
) | ||
) | ||
), | ||
custom_settings: schema.maybe(customSettingsSchema), | ||
analysis_limits: schema.object({ | ||
categorization_examples_limit: schema.maybe(schema.number()), | ||
model_memory_limit: schema.maybe(schema.string()), | ||
}), | ||
groups: schema.maybe(schema.arrayOf(schema.maybe(schema.string()))), | ||
}; | ||
|
||
export const anomalyDetectionJobSchema = { | ||
analysis_config: schema.object({ | ||
bucket_span: schema.maybe(schema.string()), | ||
summary_count_field_name: schema.maybe(schema.string()), | ||
detectors: schema.arrayOf(detectorSchema), | ||
influencers: schema.arrayOf(schema.maybe(schema.string())), | ||
categorization_field_name: schema.maybe(schema.string()), | ||
}), | ||
analysis_limits: schema.object({ | ||
categorization_examples_limit: schema.maybe(schema.number()), | ||
model_memory_limit: schema.maybe(schema.string()), | ||
}), | ||
create_time: schema.maybe(schema.number()), | ||
custom_settings: schema.maybe(customSettingsSchema), | ||
allow_lazy_open: schema.maybe(schema.any()), | ||
data_counts: schema.maybe(schema.any()), | ||
data_description: schema.object({ | ||
time_field: schema.string(), | ||
time_format: schema.maybe(schema.string()), | ||
}), | ||
datafeed_config: schema.maybe(schema.any()), | ||
description: schema.maybe(schema.string()), | ||
established_model_memory: schema.maybe(schema.number()), | ||
finished_time: schema.maybe(schema.number()), | ||
job_id: schema.string(), | ||
job_type: schema.maybe(schema.string()), | ||
job_version: schema.maybe(schema.string()), | ||
groups: schema.arrayOf(schema.maybe(schema.string())), | ||
model_plot_config: schema.maybe(schema.any()), | ||
model_size_stats: schema.maybe(schema.any()), | ||
model_snapshot_id: schema.maybe(schema.string()), | ||
model_snapshot_min_version: schema.maybe(schema.string()), | ||
model_snapshot_retention_days: schema.maybe(schema.number()), | ||
results_index_name: schema.maybe(schema.string()), | ||
state: schema.maybe(schema.string()), | ||
}; |
202 changes: 0 additions & 202 deletions
202
x-pack/legacy/plugins/ml/server/routes/anomaly_detectors.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.