diff --git a/changelogs/fragments/7925.yml b/changelogs/fragments/7925.yml new file mode 100644 index 000000000000..124d909f60e5 --- /dev/null +++ b/changelogs/fragments/7925.yml @@ -0,0 +1,2 @@ +feat: +- Introduce a data-connection saved-object type for external data connections ([#7925](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7925)) \ No newline at end of file diff --git a/src/plugins/data_source/common/data_connections/data_connection_saved_object_attributes.ts b/src/plugins/data_source/common/data_connections/data_connection_saved_object_attributes.ts new file mode 100644 index 000000000000..f685780e28d0 --- /dev/null +++ b/src/plugins/data_source/common/data_connections/data_connection_saved_object_attributes.ts @@ -0,0 +1,28 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { SavedObjectAttributes } from 'src/core/types'; + +export const DATA_CONNECTION_SAVED_OBJECT_TYPE = 'data-connection'; + +/** + * Represents the attributes of a data connection saved object. + * @property connectionId: The name of the data connection. + * @property type: The type of the data connection based on enum DataConnectionType + * @property meta: Additional metadata associated with the data connection. + */ +export interface DataConnectionSavedObjectAttributes extends SavedObjectAttributes { + connectionId: string; + type: DataConnectionType; + meta?: string; +} + +export enum DataConnectionType { + CloudWatch = 'AWS CloudWatch', + SecurityLake = 'AWS Security Lake', + NA = 'None', +} + +export const DATA_CONNECTION_ID_LENGTH_LIMIT = 32; diff --git a/src/plugins/data_source/common/data_connections/index.ts b/src/plugins/data_source/common/data_connections/index.ts new file mode 100644 index 000000000000..9d1259d8692d --- /dev/null +++ b/src/plugins/data_source/common/data_connections/index.ts @@ -0,0 +1,6 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export * from './data_connection_saved_object_attributes'; diff --git a/src/plugins/data_source/server/plugin.ts b/src/plugins/data_source/server/plugin.ts index bbf5a89d1b53..a2e2f51d6323 100644 --- a/src/plugins/data_source/server/plugin.ts +++ b/src/plugins/data_source/server/plugin.ts @@ -22,7 +22,7 @@ import { DataSourcePluginConfigType } from '../config'; import { LoggingAuditor } from './audit/logging_auditor'; import { CryptographyService, CryptographyServiceSetup } from './cryptography_service'; import { DataSourceService, DataSourceServiceSetup } from './data_source_service'; -import { DataSourceSavedObjectsClientWrapper, dataSource } from './saved_objects'; +import { dataConnection, dataSource, DataSourceSavedObjectsClientWrapper } from './saved_objects'; import { AuthenticationMethod, DataSourcePluginSetup, DataSourcePluginStart } from './types'; import { DATA_SOURCE_SAVED_OBJECT_TYPE } from '../common'; @@ -55,6 +55,7 @@ export class DataSourcePlugin implements Plugin