Skip to content
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

[Entity Analytics] [Entity Store] Add basic e2e tests and + tidy API route names #193161

Merged
merged 14 commits into from
Sep 24, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Init Entity Store types
* title: Init Entity Engine
* version: 2023-10-31
*/

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

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

export type InitEntityStoreRequestParams = z.infer<typeof InitEntityStoreRequestParams>;
export const InitEntityStoreRequestParams = z.object({
export type InitEntityEngineRequestParams = z.infer<typeof InitEntityEngineRequestParams>;
export const InitEntityEngineRequestParams = 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 InitEntityStoreRequestParamsInput = z.input<typeof InitEntityStoreRequestParams>;
export type InitEntityEngineRequestParamsInput = z.input<typeof InitEntityEngineRequestParams>;

export type InitEntityStoreRequestBody = z.infer<typeof InitEntityStoreRequestBody>;
export const InitEntityStoreRequestBody = z.object({
export type InitEntityEngineRequestBody = z.infer<typeof InitEntityEngineRequestBody>;
export const InitEntityEngineRequestBody = z.object({
indexPattern: IndexPattern.optional(),
filter: z.string().optional(),
});
export type InitEntityStoreRequestBodyInput = z.input<typeof InitEntityStoreRequestBody>;
export type InitEntityEngineRequestBodyInput = z.input<typeof InitEntityEngineRequestBody>;

export type InitEntityStoreResponse = z.infer<typeof InitEntityStoreResponse>;
export const InitEntityStoreResponse = EngineDescriptor;
export type InitEntityEngineResponse = z.infer<typeof InitEntityEngineResponse>;
export const InitEntityEngineResponse = EngineDescriptor;
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
openapi: 3.0.0

info:
title: Init Entity Store types
title: Init Entity Engine
version: '2023-10-31'
paths:
/api/entity_store/engines/{entityType}/init:
post:
x-labels: [ess, serverless]
x-codegen-enabled: true
operationId: InitEntityStore
summary: Initialize the Entity Store
operationId: InitEntityEngine
summary: Initialize 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').
requestBody:
description: Schema for the engine initialization
required: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: List Entity Store engines
* title: List Entity Engines
* version: 2023-10-31
*/

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

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

export type ListEntityStoreEnginesResponse = z.infer<typeof ListEntityStoreEnginesResponse>;
export const ListEntityStoreEnginesResponse = z.object({
export type ListEntityEnginesResponse = z.infer<typeof ListEntityEnginesResponse>;
export const ListEntityEnginesResponse = z.object({
count: z.number().int().optional(),
engines: z.array(EngineDescriptor).optional(),
});
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
openapi: 3.0.0
info:
title: List Entity Store engines
title: List Entity Engines
version: '2023-10-31'
paths:
/api/entity_store/engines:
get:
x-labels: [ess, serverless]
x-codegen-enabled: true
operationId: ListEntityStoreEngines
summary: List the Entity Store engines
operationId: ListEntityEngines
summary: List the Entity Engines
responses:
'200':
description: Successful response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Start the entity store engine
* title: Start an Entity Engine
* version: 2023-10-31
*/

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

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

export type StartEntityStoreRequestParams = z.infer<typeof StartEntityStoreRequestParams>;
export const StartEntityStoreRequestParams = z.object({
export type StartEntityEngineRequestParams = z.infer<typeof StartEntityEngineRequestParams>;
export const StartEntityEngineRequestParams = 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 StartEntityStoreRequestParamsInput = z.input<typeof StartEntityStoreRequestParams>;
export type StartEntityEngineRequestParamsInput = z.input<typeof StartEntityEngineRequestParams>;

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

info:
title: Start the entity store engine
title: Start an Entity Engine
version: '2023-10-31'
paths:
/api/entity_store/engines/{entityType}/start:
post:
x-labels: [ess, serverless]
x-codegen-enabled: true
operationId: StartEntityStore
summary: Start the Entity Store engine
operationId: StartEntityEngine
summary: Start 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
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Get the entity store engine stats
* title: Get Entity Engine stats
* version: 2023-10-31
*/

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

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

export type GetEntityStoreStatsRequestParams = z.infer<typeof GetEntityStoreStatsRequestParams>;
export const GetEntityStoreStatsRequestParams = z.object({
export type GetEntityEngineStatsRequestParams = z.infer<typeof GetEntityEngineStatsRequestParams>;
export const GetEntityEngineStatsRequestParams = 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 GetEntityStoreStatsRequestParamsInput = z.input<
typeof GetEntityStoreStatsRequestParams
export type GetEntityEngineStatsRequestParamsInput = z.input<
typeof GetEntityEngineStatsRequestParams
>;

export type GetEntityStoreStatsResponse = z.infer<typeof GetEntityStoreStatsResponse>;
export const GetEntityStoreStatsResponse = z.object({
export type GetEntityEngineStatsResponse = z.infer<typeof GetEntityEngineStatsResponse>;
export const GetEntityEngineStatsResponse = z.object({
type: EntityType.optional(),
indexPattern: IndexPattern.optional(),
status: EngineStatus.optional(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
openapi: 3.0.0

info:
title: Get the entity store engine stats
title: Get Entity Engine stats
version: '2023-10-31'
paths:
/api/entity_store/engines/{entityType}/stats:
post:
x-labels: [ess, serverless]
x-codegen-enabled: true
operationId: GetEntityStoreStats
summary: Get the Entity Store engine stats
operationId: GetEntityEngineStats
summary: Get Entity Engine stats
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator.
*
* info:
* title: Stop the entity store engine
* title: Stop an Entity Engine
* version: 2023-10-31
*/

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

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

export type StopEntityStoreRequestParams = z.infer<typeof StopEntityStoreRequestParams>;
export const StopEntityStoreRequestParams = z.object({
export type StopEntityEngineRequestParams = z.infer<typeof StopEntityEngineRequestParams>;
export const StopEntityEngineRequestParams = 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 StopEntityStoreRequestParamsInput = z.input<typeof StopEntityStoreRequestParams>;
export type StopEntityEngineRequestParamsInput = z.input<typeof StopEntityEngineRequestParams>;

export type StopEntityStoreResponse = z.infer<typeof StopEntityStoreResponse>;
export const StopEntityStoreResponse = z.object({
export type StopEntityEngineResponse = z.infer<typeof StopEntityEngineResponse>;
export const StopEntityEngineResponse = z.object({
stopped: z.boolean().optional(),
});
Loading