Extend /incidents endpoint to handle POST requests as well#456
Conversation
96b20d2 to
1d68d24
Compare
|
Sorry, I've dropped two superfluous if statements. |
1d68d24 to
dfeea7b
Compare
de39baa to
702cace
Compare
|
I've changed the JSON decoder for the POST handler to reject unknown fields. |
702cace to
c860bd6
Compare
|
While testing Icinga/icingadb#1145, I noticed that using just the NOT EXISTS JSON filter syntax without any other postive matches caused to yield all incidents, which is completely wrong as that would defeat the whole the user must know what he's looking for argument from Johannes. So, the endpoint will now reject the request with 400 if the provided filter contains only negated conditions and documented it accordingly. |
9fc1e06 to
820bc97
Compare
|
Sorry, the latest two pushes weren't intentional! I accidentally pushed something here that's supposed to go to #460, so dropped the corresponding changes again. |
820bc97 to
8e9b3ff
Compare
|
Reduced the PR by ~20 LOC by squashing the some test cases into a loop :). |
8e9b3ff to
4ae97f7
Compare
4ae97f7 to
7f15d05
Compare
oxzi
left a comment
There was a problem hiding this comment.
LGTM, thanks. Only one small nitpicks where the docs diverge from the code. Please change it, and than it's good for me!
7f15d05 to
17d20db
Compare
This PR extends the existing
/incidentsHTTP handler to allowPOSTrequests as described in #452 as well. Also, both theGETandPOSThandler requires afilterparameter as described in the referenced issue. The changes to the endpoint are trivial but the PR is just that big simply because of the new documentation explaining the new behavior of both HTTP methods and also unit tests for the query string filter parsing and evaluating.resolves #452