Skip to content

Commit c838631

Browse files
authored
Do not require id & description when creating a logstash pipeline (#76616) (#76816)
* do not requie id & desc * remove id validation, it's not used in logic anyway * no id in tests * remove another wrong id usage
1 parent 93eea9d commit c838631

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ class PipelineEditorUi extends React.Component {
125125

126126
onPipelineSave = () => {
127127
const { pipelineService, toastNotifications, intl } = this.props;
128-
const { id } = this.state.pipeline;
128+
const { id, ...pipelineToStore } = this.state.pipeline;
129129
return pipelineService
130130
.savePipeline({
131131
id,
132-
upstreamJSON: this.state.pipeline,
132+
upstreamJSON: pipelineToStore,
133133
})
134134
.then(() => {
135135
toastNotifications.addSuccess(

x-pack/plugins/logstash/server/models/pipeline/pipeline.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import { i18n } from '@kbn/i18n';
1111

1212
interface PipelineOptions {
1313
id: string;
14-
description: string;
14+
description?: string;
1515
pipeline: string;
1616
username?: string;
1717
settings?: Record<string, any>;
1818
}
1919

2020
interface DownstreamPipeline {
21-
description: string;
21+
description?: string;
2222
pipeline: string;
2323
settings?: Record<string, any>;
2424
}
@@ -27,7 +27,7 @@ interface DownstreamPipeline {
2727
*/
2828
export class Pipeline {
2929
public readonly id: string;
30-
public readonly description: string;
30+
public readonly description?: string;
3131
public readonly username?: string;
3232
public readonly pipeline: string;
3333
private readonly settings: Record<string, any>;

x-pack/plugins/logstash/server/routes/pipeline/save.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ export function registerPipelineSaveRoute(router: IRouter, security?: SecurityPl
2222
id: schema.string(),
2323
}),
2424
body: schema.object({
25-
id: schema.string(),
26-
description: schema.string(),
25+
description: schema.maybe(schema.string()),
2726
pipeline: schema.string(),
2827
settings: schema.maybe(schema.object({}, { unknowns: 'allow' })),
2928
}),

x-pack/test/api_integration/apis/logstash/pipeline/delete.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export default function ({ getService }: FtrProviderContext) {
1818
.put('/api/logstash/pipeline/fast_generator')
1919
.set('kbn-xsrf', 'xxx')
2020
.send({
21-
id: 'fast_generator',
2221
description: 'foobar baz',
2322
pipeline: 'input { generator {} }\n\n output { stdout {} }',
2423
})

x-pack/test/api_integration/apis/logstash/pipeline/save.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export default function ({ getService }: FtrProviderContext) {
2626
.put('/api/logstash/pipeline/fast_generator')
2727
.set('kbn-xsrf', 'xxx')
2828
.send({
29-
id: 'fast_generator',
3029
description: 'foobar baz',
3130
pipeline: 'input { generator {} }\n\n output { stdout {} }',
3231
})

0 commit comments

Comments
 (0)