-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Reporting] generate csv from new api for saved object ids #31188
[Reporting] generate csv from new api for saved object ids #31188
Conversation
d00adb1
to
92e15fa
Compare
92e15fa
to
33781b0
Compare
33781b0
to
816d386
Compare
Sorry to let this fall by the wayside, I'll take a gander on Monday morning! Hope is to get this in, then #30895 so we can use the types you've got! |
…/reporting/csv-export-panel-action-csv-api
@joelgriffith not a huge rush on this! I think |
Ok, I'm not so sure I want to take on a fix for sorting in this PR. Currently in master, TSVB is showing odd things for sort: If TSVB table sorting is all happening on the client side, this API will have to be another layer of data modeling to sort the result data. Also, it will need to get the sorting options in the |
…/reporting/csv-export-panel-action-csv-api
|
||
const generateCsv = createGenerateCsv(logger); | ||
return async function executeJob(job: JobDocPayload): Promise<JobDocOutputPseudo> { | ||
const { basePath, objects, headers: serializedEncryptedHeaders, jobParams } = job; // FIXME how to remove payload.objects for cleanup? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to be pulling/playing with this branch today, stay tuned |
Cool! I think this is in usable shape for saved search by ID |
…/reporting/csv-export-panel-action-csv-api
docvalue_fields: [], | ||
query: { | ||
bool: { | ||
filter: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: use kibanaSavedObjectMeta.searchSourceJSON
to get the filters
|
||
export const WHITELISTED_JOB_CONTENT_TYPES = [ | ||
'application/json', | ||
'application/pdf', | ||
'text/csv', | ||
CONTENT_TYPE_CSV, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason it's uppercased here? Not sure if there's a semantic reason... my guess is not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's also exported as a const and used elsewhere
This looks good, and seems to be working well in my panel work. LGTM |
fe8c4fe
to
97eb031
Compare
26077df
to
d08767a
Compare
@joelgriffith sorry I missed your review. I rewinded other changes I made back to the point that you reviewed |
💔 Build Failed |
This PR was missing a file that was referenced. It was actually from a file rename. I pushed the fix in this commit: cc2a451940 |
Summary
This PR explores a way of generating CSV using a new API that uses simple params in the query string and meaninful params in a POST body.
Usage
New API endpoints:
/api/reporting/v1/generate/immediate/csv/saved-object/<id>
/api/reporting/v1/generate/csv/saved-object/<id>
:For now, this can probably only support TSVB tables. Future expansion is possible, starting with visualization types that query / model their data on the server side.
Screenshot
TODO:
term
[ ] Fix sortSee [Reporting] generate csv from new api for saved object ids #31188 (comment)Release notes: none. This is an internal-only API until it is able to support more types of saved objects.