Skip to content

Commit

Permalink
Register Data source to savedObject & Update license header (#2037)
Browse files Browse the repository at this point in the history
Signed-off-by: Kristen Tian <tyarong@amazon.com>
  • Loading branch information
kristenTian authored Aug 3, 2022
1 parent 18278a1 commit 25a97cb
Show file tree
Hide file tree
Showing 16 changed files with 73 additions and 72 deletions.
6 changes: 6 additions & 0 deletions src/plugins/data_source/common/data_sources/index.ts
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 './types';
11 changes: 11 additions & 0 deletions src/plugins/data_source/common/data_sources/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { SavedObjectAttributes } from 'src/core/types';

export interface DataSourceAttributes extends SavedObjectAttributes {
title: string;
endpoint: string;
}
2 changes: 2 additions & 0 deletions src/plugins/data_source/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from 'src/core/server';
import { dataSource } from './saved_objects';

import { DataSourcePluginSetup, DataSourcePluginStart } from './types';

Expand All @@ -16,6 +17,7 @@ export class DataSourcePlugin implements Plugin<DataSourcePluginSetup, DataSourc

public setup(core: CoreSetup) {
this.logger.debug('data_source: Setup');
core.savedObjects.registerType(dataSource);

return {};
}
Expand Down
37 changes: 37 additions & 0 deletions src/plugins/data_source/server/saved_objects/data_source.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { SavedObjectsType } from 'opensearch-dashboards/server';

export const dataSource: SavedObjectsType = {
name: 'data-source',
namespaceType: 'agnostic',
hidden: false,
management: {
icon: 'apps', // todo: pending ux #2034
defaultSearchField: 'title',
importableAndExportable: true,
getTitle(obj) {
return obj.attributes.title;
},
// todo: update getEditUrl & getInAppUrl after #2021
},
mappings: {
dynamic: false,
properties: {
title: {
type: 'text',
},
endpoint: {
type: 'keyword',
index: false,
doc_values: false,
},
version: {
type: 'integer',
},
},
},
};
6 changes: 6 additions & 0 deletions src/plugins/data_source/server/saved_objects/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export { dataSource } from './data_source';
8 changes: 1 addition & 7 deletions src/plugins/data_source_management/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

export const PLUGIN_ID = 'dataSourceManagement';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"id": "dataSourceManagement",
"version": "1.0.0",
"opensearchDashboardsVersion": "opensearchDashboards",
"version": "opensearchDashboards",
"server": false,
"ui": true,
"requiredPlugins": ["management"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import { EuiTitle } from '@elastic/eui';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

export { CreateDataSourceWizardWithRouter } from './create_data_source_wizard';
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import { EuiTitle } from '@elastic/eui';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

export { DataSourceTableWithRouter } from './data_source_table';
8 changes: 1 addition & 7 deletions src/plugins/data_source_management/public/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import { DataSourceManagementPlugin } from './plugin';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

export { mountManagementSection } from './mount_management_section';
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import { StartServicesAccessor } from 'src/core/public';
Expand Down
8 changes: 1 addition & 7 deletions src/plugins/data_source_management/public/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import { CoreSetup, CoreStart, Plugin } from '../../../core/public';
Expand Down
8 changes: 1 addition & 7 deletions src/plugins/data_source_management/public/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import {
Expand Down

0 comments on commit 25a97cb

Please sign in to comment.