OpenSearch-Dashboards
OpenSearch-Dashboards copied to clipboard
[Workspace] Import sample data to specific workspace
Is your feature request related to a problem? Please describe.
~~When workspace plugin enabled, current import sample data feature will be break if you're in a specific workspace. The sample data won't be import to current workspace. The imported index patterns and dashboards won't be displayed. The Add data
button will be hidden and the Remove
button will always be displayed if user import sample data before.~~
The import sample data page is a sub page under home application. For now the home application is not visible inside specific workspace. So there is no entry for importing sample data page after enter specific workspace. It's not convenient for user to experience workspace features. It would be very valuable to add an entry for importing data in the workspace overview page.
Describe the solution you'd like
~~1. Pass current workspace id to import sample data install / uninstall / list API
2. Refactor getDataSourceIntegratedDashboard
to getDashboardWithPrefix
, support passing workspace id when checking overviewDashboard
id.
3. Add getWorkspaceIntegratedSavedObjects
, generate sample data with workspace id when installing and uninstalling~~
- Register import sample data as a standalone application
- Add import sample data entry point to workspace overview page
- Get workspace id from import sample data list / uninstall / list API request
- Add workspace id parameter to
getDataSourceIntegratedDashboard
- Add workspace id parameter to
getDataSourceIntegratedDefaultIndex
- Overwrite saved object id with workspace id prefix for pending import sample datas
Describe alternatives you've considered
N/A
Additional context
#4944
There are two parts for sample data
- generated data which ingested to sample-ecommerce, opensearch_dashboards_sample_data_logs, opensearch_dashboards_sample_data_flights
- dashboards, visualizations for above data.
could we elaborate a little bit, which part is broken
cc: @bandinib-amzn @BionIT @Flyingliuhub
Hi @seraphjiang, my issue was not clear. I'm very apologize for this.
I think the first part would be fine when workspace enabled and in a specific workspace. The index for sample-ecommerce
, opensearch_dashboards_sample_data_logs
and opensearch_dashboards_sample_data_flights
will be deleted and re-upload after supporting import sample data to different workspaces.
Since the public saved object client will add current workspace id to all the CRUD methods if options.workspaces
doesn't exists. It only return saved objects in current workspace when call public saved object client find method in front end page. So for sample data we need to bulkCreate
with current workspace id when install sample data in specific workspace. Beside this, since the saved object id is unique, we need to generate saved object id the with current workspace id. Or the saved objects id will be conflict after importing to different workspaces.
@wanglam Can we resolve this issue?
Sure, since import sample data to workspace has been added in #6105 . We can close this issue.