-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Data connection saved-object type for external connections
Signed-off-by: Megha Goyal <[email protected]>
- Loading branch information
Showing
5 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/plugins/data_source/common/data_connections/data_connection_saved_object_attributes.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,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; |
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,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export * from './data_connection_saved_object_attributes'; |
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
32 changes: 32 additions & 0 deletions
32
src/plugins/data_source/server/saved_objects/data_connection.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,32 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { SavedObjectsType } from 'opensearch-dashboards/server'; | ||
|
||
export const dataConnection: SavedObjectsType = { | ||
name: 'data-connection', | ||
namespaceType: 'agnostic', | ||
hidden: false, | ||
management: { | ||
icon: 'apps', | ||
defaultSearchField: 'connectionId', | ||
importableAndExportable: true, | ||
}, | ||
mappings: { | ||
dynamic: false, | ||
properties: { | ||
connectionId: { | ||
type: 'text', | ||
}, | ||
type: { | ||
type: 'text', | ||
}, | ||
meta: { | ||
type: 'text', | ||
}, | ||
}, | ||
}, | ||
migrations: {}, | ||
}; |
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