From 58f01f9c6f4496af88bd87c676324afa9f55a7b1 Mon Sep 17 00:00:00 2001 From: Romain Jamet Date: Thu, 19 Dec 2024 11:34:54 +0100 Subject: [PATCH] feat(logs): add dbaas/logs missing types ref: MANAGER-15918 Signed-off-by: Romain Jamet --- .../src/data/types/dbaas/logs/Service.ts | 24 ++++++++ .../data/types/dbaas/logs/ServicePlanEnum.ts | 5 ++ .../data/types/dbaas/logs/ServiceStateEnum.ts | 7 +++ .../src/data/types/dbaas/logs/Stream.ts | 59 +++++++++++++++++++ .../logs/StreamColdStorageCompressionEnum.ts | 7 +++ .../logs/StreamColdStorageContentEnum.ts | 6 ++ .../dbaas/logs/StreamColdStorageTargetEnum.ts | 6 ++ .../src/data/types/dbaas/logs/Url.ts | 9 +++ .../src/data/types/dbaas/logs/UrlTypeEnum.ts | 31 ++++++++++ .../src/data/types/dbaas/logs/index.ts | 9 +++ 10 files changed, 163 insertions(+) create mode 100644 packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/Service.ts create mode 100644 packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/ServicePlanEnum.ts create mode 100644 packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/ServiceStateEnum.ts create mode 100644 packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/Stream.ts create mode 100644 packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/StreamColdStorageCompressionEnum.ts create mode 100644 packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/StreamColdStorageContentEnum.ts create mode 100644 packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/StreamColdStorageTargetEnum.ts create mode 100644 packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/Url.ts create mode 100644 packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/UrlTypeEnum.ts diff --git a/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/Service.ts b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/Service.ts new file mode 100644 index 000000000000..65c36cba5047 --- /dev/null +++ b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/Service.ts @@ -0,0 +1,24 @@ +import { ServicePlanEnum } from './ServicePlanEnum'; +import { ServiceStateEnum } from './ServiceStateEnum'; + +/** Service */ +export interface Service { + /** Service creation */ + createdAt: string; + /** Service custom name */ + displayName?: string; + /** If set, can perform extra action on cluster */ + isClusterOwner: boolean; + /** Is IAM enabled for this service? */ + isIamEnabled: boolean; + /** Service plan */ + plan: ServicePlanEnum; + /** Service name */ + serviceName: string; + /** Service state */ + state: ServiceStateEnum; + /** Service last update */ + updatedAt?: string; + /** Username on DBaaS Logs */ + username: string; +} diff --git a/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/ServicePlanEnum.ts b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/ServicePlanEnum.ts new file mode 100644 index 000000000000..d4248b77d278 --- /dev/null +++ b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/ServicePlanEnum.ts @@ -0,0 +1,5 @@ +/** Possible values for ServicePlanEnum */ +export enum ServicePlanEnum { + 'ENTERPRISE' = 'ENTERPRISE', + 'STANDARD' = 'STANDARD', +} diff --git a/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/ServiceStateEnum.ts b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/ServiceStateEnum.ts new file mode 100644 index 000000000000..149b786d6c82 --- /dev/null +++ b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/ServiceStateEnum.ts @@ -0,0 +1,7 @@ +/** Possible values for ServiceStateEnum */ +export enum ServiceStateEnum { + 'DISABLED' = 'DISABLED', + 'ENABLED' = 'ENABLED', + 'INIT' = 'INIT', + 'TO_CONFIG' = 'TO_CONFIG', +} diff --git a/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/Stream.ts b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/Stream.ts new file mode 100644 index 000000000000..d68c86afa08c --- /dev/null +++ b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/Stream.ts @@ -0,0 +1,59 @@ +import { StreamColdStorageCompressionEnum } from './StreamColdStorageCompressionEnum'; +import { StreamColdStorageContentEnum } from './StreamColdStorageContentEnum'; +import { StreamColdStorageTargetEnum } from './StreamColdStorageTargetEnum'; + +/** Graylog stream */ +export interface Stream { + /** Indicates if the current user can create alert on the stream */ + canAlert: boolean; + /** Cluster ID */ + clusterId: string; + /** Cold storage compression method */ + coldStorageCompression?: StreamColdStorageCompressionEnum; + /** ColdStorage content */ + coldStorageContent?: StreamColdStorageContentEnum; + /** Is Cold storage enabled? */ + coldStorageEnabled?: boolean; + /** Notify on new Cold storage archive */ + coldStorageNotifyEnabled?: boolean; + /** Cold storage retention in year */ + coldStorageRetention?: number; + /** ColdStorage destination */ + coldStorageTarget?: StreamColdStorageTargetEnum; + /** Stream creation */ + createdAt: string; + /** Stream description */ + description: string; + /** Encryption keys used to encrypt stream archives */ + encryptionKeysIds?: string[]; + /** Indexing current size (in bytes) */ + indexingCurrentSize?: number; + /** Enable ES indexing */ + indexingEnabled?: boolean; + /** Maximum indexing size (in GB) */ + indexingMaxSize?: number; + /** If set, notify when size is near 80, 90 or 100 % of the maximum configured setting */ + indexingNotifyEnabled?: boolean; + /** Indicates if you are allowed to edit entry */ + isEditable: boolean; + /** Number of alert condition */ + nbAlertCondition: number; + /** Number of coldstored archives */ + nbArchive: number; + /** Number of subscriptions targeting this stream */ + nbSubscription: number; + /** Parent stream ID */ + parentStreamId?: string; + /** If set, pause indexing when maximum size is reach */ + pauseIndexingOnMaxSize?: boolean; + /** Retention ID */ + retentionId: string; + /** Stream ID */ + streamId: string; + /** Stream description */ + title: string; + /** Stream last update */ + updatedAt?: string; + /** Enable Websocket */ + webSocketEnabled?: boolean; +} diff --git a/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/StreamColdStorageCompressionEnum.ts b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/StreamColdStorageCompressionEnum.ts new file mode 100644 index 000000000000..1fd4278c3226 --- /dev/null +++ b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/StreamColdStorageCompressionEnum.ts @@ -0,0 +1,7 @@ +/** Possible values for StreamColdStorageCompressionEnum */ +export enum StreamColdStorageCompressionEnum { + 'DEFLATED' = 'DEFLATED', + 'GZIP' = 'GZIP', + 'LZMA' = 'LZMA', + 'ZSTD' = 'ZSTD', +} diff --git a/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/StreamColdStorageContentEnum.ts b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/StreamColdStorageContentEnum.ts new file mode 100644 index 000000000000..5a169f3e1a0b --- /dev/null +++ b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/StreamColdStorageContentEnum.ts @@ -0,0 +1,6 @@ +/** Possible values for StreamColdStorageContentEnum */ +export enum StreamColdStorageContentEnum { + 'ALL' = 'ALL', + 'GELF' = 'GELF', + 'PLAIN' = 'PLAIN', +} diff --git a/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/StreamColdStorageTargetEnum.ts b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/StreamColdStorageTargetEnum.ts new file mode 100644 index 000000000000..76f6571db5d3 --- /dev/null +++ b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/StreamColdStorageTargetEnum.ts @@ -0,0 +1,6 @@ +/** Possible values for StreamColdStorageTargetEnum */ +export enum StreamColdStorageTargetEnum { + 'PCA' = 'PCA', + 'PCI_DSS' = 'PCI_DSS', + 'PCS' = 'PCS', +} diff --git a/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/Url.ts b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/Url.ts new file mode 100644 index 000000000000..c24424653f89 --- /dev/null +++ b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/Url.ts @@ -0,0 +1,9 @@ +import { UrlTypeEnum } from './UrlTypeEnum'; + +/** Web address */ +export interface Url { + /** Web URI */ + address: string; + /** Service type */ + type: UrlTypeEnum; +} diff --git a/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/UrlTypeEnum.ts b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/UrlTypeEnum.ts new file mode 100644 index 000000000000..860e81e6b92f --- /dev/null +++ b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/UrlTypeEnum.ts @@ -0,0 +1,31 @@ +/** Possible values for UrlTypeEnum */ +export enum UrlTypeEnum { + 'CONSOLE' = 'CONSOLE', + 'ELASTICSEARCH_API' = 'ELASTICSEARCH_API', + 'GRAYLOG_API' = 'GRAYLOG_API', + 'GRAYLOG_WEBUI' = 'GRAYLOG_WEBUI', + 'HTTP_GELF' = 'HTTP_GELF', + 'HTTP_TLS_GELF' = 'HTTP_TLS_GELF', + 'KIBANA_WEBUI' = 'KIBANA_WEBUI', + 'OPENSEARCH_API' = 'OPENSEARCH_API', + 'OSD_WEBUI' = 'OSD_WEBUI', + 'SERVICE_DOMAIN' = 'SERVICE_DOMAIN', + 'TCP_BEATS' = 'TCP_BEATS', + 'TCP_CAP_N_PROTO' = 'TCP_CAP_N_PROTO', + 'TCP_GELF' = 'TCP_GELF', + 'TCP_LTSV_LINE' = 'TCP_LTSV_LINE', + 'TCP_LTSV_NUL' = 'TCP_LTSV_NUL', + 'TCP_RFC5424' = 'TCP_RFC5424', + 'TCP_TLS_BEATS' = 'TCP_TLS_BEATS', + 'TCP_TLS_CAP_N_PROTO' = 'TCP_TLS_CAP_N_PROTO', + 'TCP_TLS_GELF' = 'TCP_TLS_GELF', + 'TCP_TLS_LTSV_LINE' = 'TCP_TLS_LTSV_LINE', + 'TCP_TLS_LTSV_NUL' = 'TCP_TLS_LTSV_NUL', + 'TCP_TLS_RFC5424' = 'TCP_TLS_RFC5424', + 'UDP_CAP_N_PROTO' = 'UDP_CAP_N_PROTO', + 'UDP_GELF' = 'UDP_GELF', + 'UDP_LTSV_LINE' = 'UDP_LTSV_LINE', + 'UDP_LTSV_NUL' = 'UDP_LTSV_NUL', + 'UDP_RFC5424' = 'UDP_RFC5424', + 'WEB_SOCKET' = 'WEB_SOCKET', +} diff --git a/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/index.ts b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/index.ts index f1f79db7433e..03df9060b3e0 100644 --- a/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/index.ts +++ b/packages/manager/modules/logs-to-customer/src/data/types/dbaas/logs/index.ts @@ -5,3 +5,12 @@ export * from './LogSubscriptionResource'; export * from './LogSubscriptionResponse'; export * from './LogUrlCreation'; export * from './TemporaryLogsLink'; +export * from './Service'; +export * from './ServicePlanEnum'; +export * from './ServiceStateEnum'; +export * from './Stream'; +export * from './StreamColdStorageCompressionEnum'; +export * from './StreamColdStorageContentEnum'; +export * from './StreamColdStorageTargetEnum'; +export * from './Url'; +export * from './UrlTypeEnum';