Add support for group trigger deletion in hawkular alerts#23
Add support for group trigger deletion in hawkular alerts#23burmanm merged 1 commit intohawkular:masterfrom
Conversation
|
@cben @simon3z @rubenvp8510 @enoodle please review |
|
@dkorn The metrics solution of only GET was usable when the client was created (there were no endpoints that would send response in PUT/POST other than error cases). Could you rebase this and the other PRs? I wanted to merge the Travis PR before other PRs (for obvious reasons) |
Adding delete_group_trigger method in hawkular alerts and test_delete_group_trigger to alerts tests. Since the `DELETE` action returns only a response code, without body, I added `parse_json` flag to `_http` method in `hawkular/client.py`. Without this addition an error is raised when trying to load the json with no content. I'm setting it to `True` by default, while sending it with `False` from the `_delete` method. This Issue was solved in `hawkular/metrics.py` by checking that the method is `GET`, a wrong solution IMHO cause `POST` and `PUT` methods also return body.
acefa63 to
52e1edd
Compare
I understand, makes sense.
Done. @burmanm we still need to decide on a solution in cases where there is no response body.
this was also discussed in #28 (review) |
|
@dkorn I actually like the parse_json flag, not because it is automatic but because it isn't. When we create methods that expect a JSON to be returned, we've defined some sort of agreement. If the JSON wasn't there or it couldn't be parsed, we really should get an error (instead of silent failure). |
|
I reviewed this PR and LGTM, I agree with the change to include the |
Adding
delete_group_triggermethod in hawkular alerts andtest_delete_group_triggerto alerts tests.Since the
DELETEaction returns only a response code, without body, I addedparse_jsonflag to_httpmethod inhawkular/client.py. Without this addition an error is raised when trying to loadthe json with no content.
I'm setting it to
Trueby default, while sending it withFalsefrom the_deletemethod.This Issue was solved in
hawkular/metrics.pyby checking that the method isGET, a wrong solution IMHO causePOSTandPUTmethods also return body.