Skip to content

Commit

Permalink
[8.x] [Entity Analytics] [Entity Store] Add basic e2e tests and + tid…
Browse files Browse the repository at this point in the history
…y API route names (#193161) (#193829)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Entity Analytics] [Entity Store] Add basic e2e tests and + tidy API
route names (#193161)](#193161)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Mark
Hopkin","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-24T08:31:32Z","message":"[Entity
Analytics] [Entity Store] Add basic e2e tests and + tidy API route names
(#193161)\n\n## Summary\r\n\r\nAdds basic end to end tests for the
engine CRUD routes.\r\n\r\nI also noticed there was some inconsistency
in the naming of the API\r\nroutes which I have
fixed.\r\n\r\n---------\r\n\r\nCo-authored-by: machadoum
<[email protected]>\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Tiago Vila Verde
<[email protected]>","sha":"0b4f8774dd933dbfb9cc7816b2484bf5cc25752e","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:
SecuritySolution","backport:prev-minor","Feature:Entity
Analytics","Team:Entity Analytics","v8.16.0"],"title":"[Entity
Analytics] [Entity Store] Add basic e2e tests and + tidy API route
names","number":193161,"url":"https://github.com/elastic/kibana/pull/193161","mergeCommit":{"message":"[Entity
Analytics] [Entity Store] Add basic e2e tests and + tidy API route names
(#193161)\n\n## Summary\r\n\r\nAdds basic end to end tests for the
engine CRUD routes.\r\n\r\nI also noticed there was some inconsistency
in the naming of the API\r\nroutes which I have
fixed.\r\n\r\n---------\r\n\r\nCo-authored-by: machadoum
<[email protected]>\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Tiago Vila Verde
<[email protected]>","sha":"0b4f8774dd933dbfb9cc7816b2484bf5cc25752e"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193161","number":193161,"mergeCommit":{"message":"[Entity
Analytics] [Entity Store] Add basic e2e tests and + tidy API route names
(#193161)\n\n## Summary\r\n\r\nAdds basic end to end tests for the
engine CRUD routes.\r\n\r\nI also noticed there was some inconsistency
in the naming of the API\r\nroutes which I have
fixed.\r\n\r\n---------\r\n\r\nCo-authored-by: machadoum
<[email protected]>\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Tiago Vila Verde
<[email protected]>","sha":"0b4f8774dd933dbfb9cc7816b2484bf5cc25752e"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Mark Hopkin <[email protected]>
  • Loading branch information
kibanamachine and hop-dev authored Sep 24, 2024
1 parent 13c26d4 commit ce74770
Show file tree
Hide file tree
Showing 33 changed files with 562 additions and 290 deletions.
40 changes: 20 additions & 20 deletions oas_docs/output/kibana.serverless.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8129,7 +8129,7 @@ paths:
- Security Solution Endpoint Management API
/api/entity_store/engines:
get:
operationId: ListEntityStoreEngines
operationId: ListEntityEngines
responses:
'200':
content:
Expand All @@ -8145,14 +8145,14 @@ paths:
#/components/schemas/Security_Solution_Entity_Analytics_API_EngineDescriptor
type: array
description: Successful response
summary: List the Entity Store engines
summary: List the Entity Engines
tags:
- Security Solution Entity Analytics API
'/api/entity_store/engines/{entityType}':
delete:
operationId: DeleteEntityStore
operationId: DeleteEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -8175,13 +8175,13 @@ paths:
deleted:
type: boolean
description: Successful response
summary: Delete the Entity Store engine
summary: Delete the Entity Engine
tags:
- Security Solution Entity Analytics API
get:
operationId: GetEntityStoreEngine
operationId: GetEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -8196,14 +8196,14 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_EngineDescriptor
description: Successful response
summary: Get the Entity Store engine
summary: Get an Entity Engine
tags:
- Security Solution Entity Analytics API
'/api/entity_store/engines/{entityType}/init':
post:
operationId: InitEntityStore
operationId: InitEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand Down Expand Up @@ -8231,14 +8231,14 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_EngineDescriptor
description: Successful response
summary: Initialize the Entity Store
summary: Initialize an Entity Engine
tags:
- Security Solution Entity Analytics API
'/api/entity_store/engines/{entityType}/start':
post:
operationId: StartEntityStore
operationId: StartEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -8255,14 +8255,14 @@ paths:
started:
type: boolean
description: Successful response
summary: Start the Entity Store engine
summary: Start an Entity Engine
tags:
- Security Solution Entity Analytics API
'/api/entity_store/engines/{entityType}/stats':
post:
operationId: GetEntityStoreStats
operationId: GetEntityEngineStats
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand Down Expand Up @@ -8294,14 +8294,14 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_EntityType
description: Successful response
summary: Get the Entity Store engine stats
summary: Get Entity Engine stats
tags:
- Security Solution Entity Analytics API
'/api/entity_store/engines/{entityType}/stop':
post:
operationId: StopEntityStore
operationId: StopEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -8318,7 +8318,7 @@ paths:
stopped:
type: boolean
description: Successful response
summary: Stop the Entity Store engine
summary: Stop an Entity Engine
tags:
- Security Solution Entity Analytics API
/api/entity_store/entities/list:
Expand Down
40 changes: 20 additions & 20 deletions oas_docs/output/kibana.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11576,7 +11576,7 @@ paths:
- Security Solution Endpoint Management API
/api/entity_store/engines:
get:
operationId: ListEntityStoreEngines
operationId: ListEntityEngines
responses:
'200':
content:
Expand All @@ -11592,14 +11592,14 @@ paths:
#/components/schemas/Security_Solution_Entity_Analytics_API_EngineDescriptor
type: array
description: Successful response
summary: List the Entity Store engines
summary: List the Entity Engines
tags:
- Security Solution Entity Analytics API
'/api/entity_store/engines/{entityType}':
delete:
operationId: DeleteEntityStore
operationId: DeleteEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -11622,13 +11622,13 @@ paths:
deleted:
type: boolean
description: Successful response
summary: Delete the Entity Store engine
summary: Delete the Entity Engine
tags:
- Security Solution Entity Analytics API
get:
operationId: GetEntityStoreEngine
operationId: GetEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -11643,14 +11643,14 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_EngineDescriptor
description: Successful response
summary: Get the Entity Store engine
summary: Get an Entity Engine
tags:
- Security Solution Entity Analytics API
'/api/entity_store/engines/{entityType}/init':
post:
operationId: InitEntityStore
operationId: InitEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand Down Expand Up @@ -11678,14 +11678,14 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_EngineDescriptor
description: Successful response
summary: Initialize the Entity Store
summary: Initialize an Entity Engine
tags:
- Security Solution Entity Analytics API
'/api/entity_store/engines/{entityType}/start':
post:
operationId: StartEntityStore
operationId: StartEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -11702,14 +11702,14 @@ paths:
started:
type: boolean
description: Successful response
summary: Start the Entity Store engine
summary: Start an Entity Engine
tags:
- Security Solution Entity Analytics API
'/api/entity_store/engines/{entityType}/stats':
post:
operationId: GetEntityStoreStats
operationId: GetEntityEngineStats
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand Down Expand Up @@ -11741,14 +11741,14 @@ paths:
$ref: >-
#/components/schemas/Security_Solution_Entity_Analytics_API_EntityType
description: Successful response
summary: Get the Entity Store engine stats
summary: Get Entity Engine stats
tags:
- Security Solution Entity Analytics API
'/api/entity_store/engines/{entityType}/stop':
post:
operationId: StopEntityStore
operationId: StopEntityEngine
parameters:
- description: The entity type of the store (either 'user' or 'host').
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
Expand All @@ -11765,7 +11765,7 @@ paths:
stopped:
type: boolean
description: Successful response
summary: Stop the Entity Store engine
summary: Stop an Entity Engine
tags:
- Security Solution Entity Analytics API
/api/entity_store/entities/list:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Delete the entity store engine
* title: Delete an Entity Engine
* version: 2023-10-31
*/

Expand All @@ -19,25 +19,25 @@ import { BooleanFromString } from '@kbn/zod-helpers';

import { EntityType } from '../common.gen';

export type DeleteEntityStoreRequestQuery = z.infer<typeof DeleteEntityStoreRequestQuery>;
export const DeleteEntityStoreRequestQuery = z.object({
export type DeleteEntityEngineRequestQuery = z.infer<typeof DeleteEntityEngineRequestQuery>;
export const DeleteEntityEngineRequestQuery = z.object({
/**
* Control flag to also delete the entity data.
*/
data: BooleanFromString.optional(),
});
export type DeleteEntityStoreRequestQueryInput = z.input<typeof DeleteEntityStoreRequestQuery>;
export type DeleteEntityEngineRequestQueryInput = z.input<typeof DeleteEntityEngineRequestQuery>;

export type DeleteEntityStoreRequestParams = z.infer<typeof DeleteEntityStoreRequestParams>;
export const DeleteEntityStoreRequestParams = z.object({
export type DeleteEntityEngineRequestParams = z.infer<typeof DeleteEntityEngineRequestParams>;
export const DeleteEntityEngineRequestParams = z.object({
/**
* The entity type of the store (either 'user' or 'host').
* The entity type of the engine (either 'user' or 'host').
*/
entityType: EntityType,
});
export type DeleteEntityStoreRequestParamsInput = z.input<typeof DeleteEntityStoreRequestParams>;
export type DeleteEntityEngineRequestParamsInput = z.input<typeof DeleteEntityEngineRequestParams>;

export type DeleteEntityStoreResponse = z.infer<typeof DeleteEntityStoreResponse>;
export const DeleteEntityStoreResponse = z.object({
export type DeleteEntityEngineResponse = z.infer<typeof DeleteEntityEngineResponse>;
export const DeleteEntityEngineResponse = z.object({
deleted: z.boolean().optional(),
});
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
openapi: 3.0.0

info:
title: Delete the entity store engine
title: Delete an Entity Engine
version: '2023-10-31'
paths:
/api/entity_store/engines/{entityType}:
delete:
x-labels: [ess, serverless]
x-codegen-enabled: true
operationId: DeleteEntityStore
summary: Delete the Entity Store engine
operationId: DeleteEntityEngine
summary: Delete the Entity Engine
parameters:
- name: entityType
in: path
required: true
schema:
$ref: '../common.schema.yaml#/components/schemas/EntityType'
description: The entity type of the store (either 'user' or 'host').
description: The entity type of the engine (either 'user' or 'host').

- name: data
in: query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,22 @@
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Get Entity Store engine
* title: Get Entity Engine
* version: 2023-10-31
*/

import { z } from '@kbn/zod';

import { EntityType, EngineDescriptor } from '../common.gen';

export type GetEntityStoreEngineRequestParams = z.infer<typeof GetEntityStoreEngineRequestParams>;
export const GetEntityStoreEngineRequestParams = z.object({
export type GetEntityEngineRequestParams = z.infer<typeof GetEntityEngineRequestParams>;
export const GetEntityEngineRequestParams = z.object({
/**
* The entity type of the store (either 'user' or 'host').
* The entity type of the engine (either 'user' or 'host').
*/
entityType: EntityType,
});
export type GetEntityStoreEngineRequestParamsInput = z.input<
typeof GetEntityStoreEngineRequestParams
>;
export type GetEntityEngineRequestParamsInput = z.input<typeof GetEntityEngineRequestParams>;

export type GetEntityStoreEngineResponse = z.infer<typeof GetEntityStoreEngineResponse>;
export const GetEntityStoreEngineResponse = EngineDescriptor;
export type GetEntityEngineResponse = z.infer<typeof GetEntityEngineResponse>;
export const GetEntityEngineResponse = EngineDescriptor;
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
openapi: 3.0.0
info:
title: Get Entity Store engine
title: Get Entity Engine
version: '2023-10-31'
paths:
/api/entity_store/engines/{entityType}:
get:
x-labels: [ess, serverless]
x-codegen-enabled: true
operationId: GetEntityStoreEngine
summary: Get the Entity Store engine
operationId: GetEntityEngine
summary: Get an Entity Engine
parameters:
- name: entityType
in: path
required: true
schema:
$ref: '../common.schema.yaml#/components/schemas/EntityType'
description: The entity type of the store (either 'user' or 'host').
description: The entity type of the engine (either 'user' or 'host').
responses:
'200':
description: Successful response
Expand Down
Loading

0 comments on commit ce74770

Please sign in to comment.