diff --git a/x-pack/plugins/ingest_manager/common/services/datasources_to_agent_inputs.ts b/x-pack/plugins/ingest_manager/common/services/datasources_to_agent_inputs.ts index 15298607e32a1..27959de716dfe 100644 --- a/x-pack/plugins/ingest_manager/common/services/datasources_to_agent_inputs.ts +++ b/x-pack/plugins/ingest_manager/common/services/datasources_to_agent_inputs.ts @@ -65,77 +65,3 @@ export const storedDatasourcesToAgentInputs = ( return fullInputs; }; - -// export const storedDatasourcesToAgentInputs = (datasource: Datasource): FullAgentConfigInput => { -// const { id, name, namespace, enabled, package: pkg, inputs } = datasource; - -// const fullStreams: FullAgentConfigInputStream[] = []; - -// inputs.forEach((input) => { -// if (!input.enabled || !input.streams || !input.streams.length) { -// return; -// } -// const streams: FullAgentConfigInputStream[] = input.streams -// .filter((stream) => stream.enabled) -// .map((stream) => { -// const fullStream: FullAgentConfigInputStream = { -// id: stream.id, -// processors: stream.processors, -// 'dataset.type': stream.dataset, -// ...stream.agent_stream, -// ...Object.entries(stream.config || {}).reduce((acc, [key, { value }]) => { -// acc[key] = value; -// return acc; -// }, {} as { [k: string]: any }), -// }; -// return fullStream; -// }); -// fullStreams.concat(streams); -// }); - -// const fullInput: FullAgentConfigInput = { -// id: id || name, -// name, -// 'dataset.namespace': namespace, -// use_output: DEFAULT_OUTPUT.name, // TODO: hardcoded to default output for now -// streams: inputs -// .filter((input) => input.enabled) -// .map((input) => { -// const fullInput = { -// ...input, -// ...Object.entries(input.config || {}).reduce((acc, [key, { value }]) => { -// acc[key] = value; -// return acc; -// }, {} as { [k: string]: any }), -// streams: input.streams -// .filter((stream) => stream.enabled) -// .map((stream) => { -// const fullStream = { -// ...stream, -// ...stream.agent_stream, -// ...Object.entries(stream.config || {}).reduce((acc, [key, { value }]) => { -// acc[key] = value; -// return acc; -// }, {} as { [k: string]: any }), -// }; -// delete fullStream.agent_stream; -// delete fullStream.vars; -// delete fullStream.config; -// return fullStream; -// }), -// }; -// delete fullInput.vars; -// delete fullInput.config; -// return fullInput; -// }), -// }; - -// if (pkg) { -// fullInput.package = { -// name: pkg.name, -// version: pkg.version, -// }; -// } - -// return fullInput; -// };