-
Notifications
You must be signed in to change notification settings - Fork 35
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
DELETE /v1/rules should return what it deleted #357
Comments
Thinking about this some more, the DELETE response body should probably include the resources that were deleted, not just a list of ids, because the id list isn't so useful once the resources no longer exist and can't be read. |
One issue if we switch everything to OR semantics is that we can no longer do a query of all rules of type action with destination X. We would get all rules with type action or destination X, which isn't very useful. Similarly, if you wanted to delete all rules with the tag |
I didn't know there was a query param for type? It's not in the API doc (https://www.amalgam8.io/api/controller/#!/default/delete_v1_rules).
Maybe adding tags query param to DELETE /v1/rules/routes/{destination} and DELETE /v1/rules/actions/{destination} would be a better way to handle this case? |
Under the covers there is a filter for rule type that is handled the same as the other filters, like ID, tags and destinations. |
It sounds like there are pros and cons to either approach (AND or OR), so I guess we leave it as is. The only part of this issue that needs to be resolved is that DELETE returns the resource it deleted. I changed the issue title correspondingly. |
For the
/v1/rules?query
(GET and DELETE) rules APIs, the handling of query parameters is inconsistent.If there are multiple id=, multiple tag=, or multiple destination= query parameters, the current API uses OR semantics (e.g.,
GET /v1/rules?id=123&id=456
returns two rules).However when there is a mix of these parameters (e.g.,
GET /v1/rules?id=123&tag=mytag&destination=reviews
) the semantics is AND, so the API currently returns only the rules that match all the specified criteria.This should be changed to also use OR semantics. That is, the semantics should be to include all of the rules identified the set of query params.
Another semantics problem, with
DELETE /v1/rules?query
specifically, is that the identified list of rules that are then deleted needs to be returned in the response body (e.g., list of ids, similar to POST).Right now there is no indication of what rules actually were deleted.
The text was updated successfully, but these errors were encountered: