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.
[Security Solution] Add missing Alert index API OpenAPI specs (elasti…
…c#186401) **Addresses:** elastic#183661 ## Summary This PR adds missing OpenAPI specs for the Alert Index API endpoints available in ESS - `POST /api/detection_engine/index` - `GET /api/detection_engine/index` - `DELETE /api/detection_engine/index`
- Loading branch information
Showing
15 changed files
with
242 additions
and
41 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
22 changes: 22 additions & 0 deletions
22
...ty_solution/common/api/detection_engine/index_management/create_index/create_index.gen.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,22 @@ | ||
/* | ||
* 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: Create an alerts index API endpoint | ||
* version: 2023-10-31 | ||
*/ | ||
|
||
import { z } from 'zod'; | ||
|
||
export type CreateAlertsIndexResponse = z.infer<typeof CreateAlertsIndexResponse>; | ||
export const CreateAlertsIndexResponse = z.object({ | ||
acknowledged: z.boolean(), | ||
}); |
47 changes: 47 additions & 0 deletions
47
...lution/common/api/detection_engine/index_management/create_index/create_index.schema.yaml
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,47 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Create an alerts index API endpoint | ||
version: '2023-10-31' | ||
paths: | ||
/api/detection_engine/index: | ||
post: | ||
x-labels: [ess] | ||
operationId: CreateAlertsIndex | ||
x-codegen-enabled: true | ||
summary: Create an alerts index | ||
tags: | ||
- Alert index API | ||
responses: | ||
200: | ||
description: Successful response | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
acknowledged: | ||
type: boolean | ||
required: [acknowledged] | ||
401: | ||
description: Unsuccessful authentication response | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../../model/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' | ||
403: | ||
description: Not enough permissions response | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../../model/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' | ||
404: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../../model/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' | ||
500: | ||
description: Internal server error response | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../../model/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' |
10 changes: 0 additions & 10 deletions
10
..._solution/common/api/detection_engine/index_management/create_index/create_index_route.ts
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
...ty_solution/common/api/detection_engine/index_management/delete_index/delete_index.gen.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,22 @@ | ||
/* | ||
* 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: Delete an alerts index API endpoint | ||
* version: 2023-10-31 | ||
*/ | ||
|
||
import { z } from 'zod'; | ||
|
||
export type DeleteAlertsIndexResponse = z.infer<typeof DeleteAlertsIndexResponse>; | ||
export const DeleteAlertsIndexResponse = z.object({ | ||
acknowledged: z.boolean(), | ||
}); |
48 changes: 48 additions & 0 deletions
48
...lution/common/api/detection_engine/index_management/delete_index/delete_index.schema.yaml
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,48 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Delete an alerts index API endpoint | ||
version: '2023-10-31' | ||
paths: | ||
/api/detection_engine/index: | ||
delete: | ||
x-labels: [ess] | ||
operationId: DeleteAlertsIndex | ||
x-codegen-enabled: true | ||
summary: Delete an alerts index | ||
tags: | ||
- Alert index API | ||
responses: | ||
200: | ||
description: Successful response | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
acknowledged: | ||
type: boolean | ||
required: [acknowledged] | ||
401: | ||
description: Unsuccessful authentication response | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../../model/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' | ||
403: | ||
description: Not enough permissions response | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../../model/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' | ||
404: | ||
description: Index does not exist response | ||
content: | ||
application/json: | ||
schema: | ||
type: string | ||
500: | ||
description: Internal server error response | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../../model/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' |
10 changes: 0 additions & 10 deletions
10
..._solution/common/api/detection_engine/index_management/delete_index/delete_index_route.ts
This file was deleted.
Oops, something went wrong.
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
23 changes: 23 additions & 0 deletions
23
...curity_solution/common/api/detection_engine/index_management/read_index/read_index.gen.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,23 @@ | ||
/* | ||
* 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: Get alerts index name API endpoint | ||
* version: 2023-10-31 | ||
*/ | ||
|
||
import { z } from 'zod'; | ||
|
||
export type GetAlertsIndexResponse = z.infer<typeof GetAlertsIndexResponse>; | ||
export const GetAlertsIndexResponse = z.object({ | ||
name: z.string(), | ||
index_mapping_outdated: z.boolean().nullable(), | ||
}); |
50 changes: 50 additions & 0 deletions
50
...y_solution/common/api/detection_engine/index_management/read_index/read_index.schema.yaml
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,50 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Get alerts index name API endpoint | ||
version: '2023-10-31' | ||
paths: | ||
/api/detection_engine/index: | ||
get: | ||
x-labels: [ess] | ||
operationId: GetAlertsIndex | ||
x-codegen-enabled: true | ||
summary: Gets the alert index name if it exists | ||
tags: | ||
- Alert index API | ||
responses: | ||
200: | ||
description: Successful response | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
index_mapping_outdated: | ||
type: boolean | ||
nullable: true | ||
required: [name, index_mapping_outdated] | ||
401: | ||
description: Unsuccessful authentication response | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../../model/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' | ||
403: | ||
description: Not enough permissions response | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../../model/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' | ||
404: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../../model/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' | ||
500: | ||
description: Internal server error response | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../../model/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' |
11 changes: 0 additions & 11 deletions
11
...rity_solution/common/api/detection_engine/index_management/read_index/read_index_route.ts
This file was deleted.
Oops, something went wrong.
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