Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Add Routes for Get Visualizations & Saved Search #57

Merged

Conversation

davidcui1225
Copy link
Contributor

Issue #, if available:
N/A
Description of changes:
Add routes to get list of visualizations and saved searches for user to select from when creating a report definition.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

server/routes/getSavedSearches.ts Outdated Show resolved Hide resolved
server/routes/getVisualizations.ts Outdated Show resolved Hide resolved
};
try {
const esResp = await context.core.elasticsearch.legacy.client.callAsInternalUser(
'search',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it required to be 'search' here?

size: 10000,
};
try {
const esResp = await context.core.elasticsearch.legacy.client.callAsInternalUser(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be use full string like esResponse?

async (
context,
request,
response
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to be output param, if so may be use outResponse?

Copy link
Member

@zhongnansu zhongnansu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest group all these 3 routes into one to avoid duplicate code.
getVisualizationRoute & get SavedSearch & getDashboard --> something like getReportSource

server/routes/getSavedSearches.ts Outdated Show resolved Hide resolved
Copy link
Member

@zhongnansu zhongnansu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge into one router

@davidcui1225 davidcui1225 merged commit 233a8f2 into opendistro-for-elasticsearch:dev Sep 2, 2020
@davidcui1225 davidcui1225 deleted the get-vis-and-search branch October 26, 2020 16:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants