-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[Entity Analytics][API] New API to allow user to configure risk engine SO #201344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
abhishekbhatia1710
wants to merge
5
commits into
elastic:main
from
abhishekbhatia1710:ea-task-api-soConfigure
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0310e97
New API to allow user to configure risk engine so
abhishekbhatia1710 c8eae58
Merge branch 'main' into ea-task-api-soConfigure
CAWilson94 57f5ec3
[CI] Auto-commit changed files from 'yarn openapi:bundle'
kibanamachine 563474b
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine df98eac
Merge branch 'main' into ea-task-api-soConfigure
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
54 changes: 54 additions & 0 deletions
54
...lution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.gen.ts
This file contains hidden or 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,54 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
* | ||
* info: | ||
* title: Risk Scoring API | ||
* version: 2023-10-31 | ||
*/ | ||
|
||
import { z } from '@kbn/zod'; | ||
|
||
export type ConfigureRiskEngineSavedObjectErrorResponse = z.infer< | ||
typeof ConfigureRiskEngineSavedObjectErrorResponse | ||
>; | ||
export const ConfigureRiskEngineSavedObjectErrorResponse = z.object({ | ||
risk_engine_saved_object_configured: z.boolean(), | ||
errors: z.array( | ||
z.object({ | ||
seq: z.number().int(), | ||
error: z.string(), | ||
}) | ||
), | ||
}); | ||
|
||
export type ConfigureRiskEngineSavedObjectRequestBody = z.infer< | ||
typeof ConfigureRiskEngineSavedObjectRequestBody | ||
>; | ||
export const ConfigureRiskEngineSavedObjectRequestBody = z.object({ | ||
exclude_alert_statuses: z.array(z.string()).optional(), | ||
range: z | ||
.object({ | ||
start: z.string().optional(), | ||
end: z.string().optional(), | ||
}) | ||
.optional(), | ||
exclude_alert_tags: z.array(z.string()).optional(), | ||
}); | ||
export type ConfigureRiskEngineSavedObjectRequestBodyInput = z.input< | ||
typeof ConfigureRiskEngineSavedObjectRequestBody | ||
>; | ||
|
||
export type ConfigureRiskEngineSavedObjectResponse = z.infer< | ||
typeof ConfigureRiskEngineSavedObjectResponse | ||
>; | ||
export const ConfigureRiskEngineSavedObjectResponse = z.object({ | ||
risk_engine_saved_object_configured: z.boolean().optional(), | ||
}); |
81 changes: 81 additions & 0 deletions
81
...n/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.schema.yaml
This file contains hidden or 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,81 @@ | ||
openapi: 3.0.0 | ||
info: | ||
version: '2023-10-31' | ||
title: Risk Scoring API | ||
description: These APIs allow the consumer to configure the Risk Engine Saved Object. | ||
paths: | ||
/api/risk_score/engine/saved_object/configure: | ||
patch: | ||
x-labels: [ess, serverless] | ||
x-codegen-enabled: true | ||
operationId: ConfigureRiskEngineSavedObject | ||
summary: Configure the Risk Engine Saved Object | ||
description: Configuring the Risk Engine Saved Object | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
exclude_alert_statuses: | ||
type: array | ||
items: | ||
type: string | ||
range: | ||
type: object | ||
properties: | ||
start: | ||
type: string | ||
end: | ||
type: string | ||
exclude_alert_tags: | ||
type: array | ||
items: | ||
type: string | ||
responses: | ||
'200': | ||
description: Successful response | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
risk_engine_saved_object_configured: | ||
type: boolean | ||
'400': | ||
description: Task manager is unavailable | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../common/common.schema.yaml#/components/schemas/TaskManagerUnavailableResponse' | ||
default: | ||
description: Unexpected error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/ConfigureRiskEngineSavedObjectErrorResponse' | ||
|
||
components: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it worth it to move this component to a common file? I believe we already have one for the risk engine? |
||
schemas: | ||
ConfigureRiskEngineSavedObjectErrorResponse: | ||
type: object | ||
required: | ||
- risk_engine_saved_object_configured | ||
- errors | ||
properties: | ||
risk_engine_saved_object_configured: | ||
type: boolean | ||
example: false | ||
errors: | ||
type: array | ||
items: | ||
type: object | ||
required: | ||
- seq | ||
- error | ||
properties: | ||
seq: | ||
type: integer | ||
error: | ||
type: string |
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we define this as an Enum instead?