Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

id is not expected in the request body

return pipelineService
.savePipeline({
id,
upstreamJSON: this.state.pipeline,
upstreamJSON: pipelineToStore,
})
.then(() => {
toastNotifications.addSuccess(
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/logstash/server/models/pipeline/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}
Expand All @@ -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>;
Expand Down
3 changes: 1 addition & 2 deletions x-pack/plugins/logstash/server/routes/pipeline/save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' })),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {} }',
})
Expand Down
1 change: 0 additions & 1 deletion x-pack/test/api_integration/apis/logstash/pipeline/save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {} }',
})
Expand Down