-
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
Ingest pipeline setup client #6497
Ingest pipeline setup client #6497
Conversation
@@ -0,0 +1,58 @@ | |||
import uiModules from 'ui/modules'; |
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.
This file can be merged with the existing service in ui/public/ingest
. Also when creating modules with Angular services it's preferable to just return the factory function so that the module can be used with the Private
module loader.
Some tests for the simulatePipeline function would also be good.
return data; | ||
} | ||
|
||
return $http.post(`../api/kibana/ingest/simulate`, pack(pipeline)) |
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.
Use ingestAPIPrefix
constant in the url
} | ||
|
||
addExisting(existingProcessor) { | ||
const Type = this._processorTypes[existingProcessor.typeId]; |
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.
Did const Type = existingProcessor.constructor
not work for some reason? I would have expected it to, and if it did this would be much simpler and eliminate the need for this _processorTypes property.
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.
reverted.
Left a few followups on existing inline comments and a few new ones. Overall this is looking great. Other than the inline comments, I think there are just a couple things left:
|
jenkins, test it |
expect(actual).to.be(expected); | ||
}); | ||
|
||
it('should throw an error if given an unknown id', function () { |
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 don't think throwing an error is the right thing to do here. Every usage of getProcessorById will need to be wrapped in a try/catch. I think it would be better to just return undefined.
Once the tests pass, this LGTM |
Ingest pipeline setup client
Whooo 🎉 |
Replaces #6071 (2 of 3)
Creates the client-side functionality for node ingest simulate.