mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
Do not require id & description when creating a logstash pipeline (#76616)
* do not requie id & desc * remove id validation, it's not used in logic anyway * no id in tests * remove another wrong id usage
This commit is contained in:
parent
b3a85c546d
commit
db67eb0b29
5 changed files with 6 additions and 9 deletions
|
@ -125,11 +125,11 @@ class PipelineEditorUi extends React.Component {
|
|||
|
||||
onPipelineSave = () => {
|
||||
const { pipelineService, toastNotifications, intl } = this.props;
|
||||
const { id } = this.state.pipeline;
|
||||
const { id, ...pipelineToStore } = this.state.pipeline;
|
||||
return pipelineService
|
||||
.savePipeline({
|
||||
id,
|
||||
upstreamJSON: this.state.pipeline,
|
||||
upstreamJSON: pipelineToStore,
|
||||
})
|
||||
.then(() => {
|
||||
toastNotifications.addSuccess(
|
||||
|
|
|
@ -11,14 +11,14 @@ import { i18n } from '@kbn/i18n';
|
|||
|
||||
interface PipelineOptions {
|
||||
id: string;
|
||||
description: string;
|
||||
description?: string;
|
||||
pipeline: string;
|
||||
username?: string;
|
||||
settings?: Record<string, any>;
|
||||
}
|
||||
|
||||
interface DownstreamPipeline {
|
||||
description: string;
|
||||
description?: string;
|
||||
pipeline: string;
|
||||
settings?: Record<string, any>;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ interface DownstreamPipeline {
|
|||
*/
|
||||
export class Pipeline {
|
||||
public readonly id: string;
|
||||
public readonly description: string;
|
||||
public readonly description?: string;
|
||||
public readonly username?: string;
|
||||
public readonly pipeline: string;
|
||||
private readonly settings: Record<string, any>;
|
||||
|
|
|
@ -22,8 +22,7 @@ export function registerPipelineSaveRoute(router: IRouter, security?: SecurityPl
|
|||
id: schema.string(),
|
||||
}),
|
||||
body: schema.object({
|
||||
id: schema.string(),
|
||||
description: schema.string(),
|
||||
description: schema.maybe(schema.string()),
|
||||
pipeline: schema.string(),
|
||||
settings: schema.maybe(schema.object({}, { unknowns: 'allow' })),
|
||||
}),
|
||||
|
|
|
@ -18,7 +18,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
.put('/api/logstash/pipeline/fast_generator')
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({
|
||||
id: 'fast_generator',
|
||||
description: 'foobar baz',
|
||||
pipeline: 'input { generator {} }\n\n output { stdout {} }',
|
||||
})
|
||||
|
|
|
@ -26,7 +26,6 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
.put('/api/logstash/pipeline/fast_generator')
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({
|
||||
id: 'fast_generator',
|
||||
description: 'foobar baz',
|
||||
pipeline: 'input { generator {} }\n\n output { stdout {} }',
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue