-
Notifications
You must be signed in to change notification settings - Fork 15
HTTP POST to create new pipeline cannot contain stages #194
Comments
@E7ernal Please provide the full error message and, if possible, an example of how you use the Graylog REST API (including complete HTTP request specs and the payload you're sending). |
Here's the response I get from Graylog (using python requests to make the call):
Here is the request information: url: postdata: {"source": "pipeline \"Test\"\nstage 0 match either\nend", "stages": [{"rules": [], "match_all": false, "stage": 0}], "description": "Test", "title": "Test"} I know I'm doing the formatting correctly since other calls do work. This is the only one which fails in this way (that I've seen). If you need to reproduce, I made a pipeline with the GUI with default everything and the name/desc = "Test". Using the response for the GET to the URL above, I constructed the POST data for the call. I removed the original pipeline with the GUI and then tried to run the above. FYI, if I omit the stages from the JSON entirely, it does work. |
Some important Jackson annotations were missing from the StageSource class which prevented proper deserialization via the Graylog REST API. Fixes #194
* Fix serialization/deserialization of StageSource Some important Jackson annotations were missing from the StageSource class which prevented proper deserialization via the Graylog REST API. Fixes #194 * Add missing "stages" attribute to PipelineSource JsonCreator
Problem description
The stages for a pipeline do not properly deserialize on the server side. Graylog complains about being unable to create an Abstract class and needing information for a concrete implementation.
Looking at the code, I can see there's a missing annotation "@JsonAutoDetect" that's in RuleSource but not StageSource which might be the reason it's not working.
You'd think that you can take the output of a call to GET a pipeline and use that as the basis for a POST to make a new one, but stages make that break.
FYI: This is impeding my ability to use automation to set up pipelines and I don't have a workaround.
Steps to reproduce the problem
Try to use the REST API to create a new pipeline with stages as more than a blank array.
Environment
The text was updated successfully, but these errors were encountered: