forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add empty data source plugin (opensearch-project#2052)
Adds empty data source plugin.
- Loading branch information
1 parent
1d15a30
commit 247e9b0
Showing
6 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
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,13 @@ | ||
# data_source | ||
|
||
A OpenSearch Dashboards plugin | ||
|
||
This plugin introduce OpenSearch data source into OpenSearch Dashboards, and provides related functions to connect to OpenSearch data sources. | ||
|
||
--- | ||
|
||
## Development | ||
|
||
See the [OpenSearch Dashboards contributing | ||
guide](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/CONTRIBUTING.md) for instructions | ||
setting up your development environment. |
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,7 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export const PLUGIN_ID = 'dataSource'; | ||
export const PLUGIN_NAME = 'data_source'; |
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,9 @@ | ||
{ | ||
"id": "dataSource", | ||
"version": "opensearchDashboards", | ||
"opensearchDashboardsVersion": "opensearchDashboards", | ||
"server": true, | ||
"ui": false, | ||
"requiredPlugins": [], | ||
"optionalPlugins": [] | ||
} |
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,24 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { schema, TypeOf } from '@osd/config-schema'; | ||
import { PluginConfigDescriptor, PluginInitializerContext } from 'src/core/server'; | ||
import { DataSourcePlugin } from './plugin'; | ||
|
||
export const configSchema = schema.object({ | ||
enabled: schema.boolean({ defaultValue: false }), | ||
}); | ||
|
||
export type DataSourcePluginConfigType = TypeOf<typeof configSchema>; | ||
|
||
export const config: PluginConfigDescriptor<DataSourcePluginConfigType> = { | ||
schema: configSchema, | ||
}; | ||
|
||
export function plugin(initializerContext: PluginInitializerContext) { | ||
return new DataSourcePlugin(initializerContext); | ||
} | ||
|
||
export { DataSourcePluginSetup, DataSourcePluginStart } from './types'; |
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,29 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from 'src/core/server'; | ||
|
||
import { DataSourcePluginSetup, DataSourcePluginStart } from './types'; | ||
|
||
export class DataSourcePlugin implements Plugin<DataSourcePluginSetup, DataSourcePluginStart> { | ||
private readonly logger: Logger; | ||
|
||
constructor(initializerContext: PluginInitializerContext) { | ||
this.logger = initializerContext.logger.get(); | ||
} | ||
|
||
public setup(core: CoreSetup) { | ||
this.logger.debug('data_source: Setup'); | ||
|
||
return {}; | ||
} | ||
|
||
public start(core: CoreStart) { | ||
this.logger.debug('data_source: Started'); | ||
return {}; | ||
} | ||
|
||
public stop() {} | ||
} |
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,9 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface DataSourcePluginSetup {} | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface DataSourcePluginStart {} |