-
Notifications
You must be signed in to change notification settings - Fork 40
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
add API endpoint for BGP announce set modification #6024
Conversation
Basic testing performed in a4x2 and things work as expected. |
What's the difference between create and update if they take the same body? |
More concisely, the update is a complete specification, and the announce set will match the request payload exactly on successful return, whereas a create can only add entries. I think for create, we may want to consider returning an error code if the announce set already exists. |
Ok. I think that should be added as a description in the doc comment on each endpoint. Something like "Replaces existing announce set with the one specified." and "Adds new entries but does not modify existing ones." That mostly solves the issue in the following musings, so take them however you want. The names update and create are a little counterintuitive to me for these operations — update less so than create. Update here works similarly to updating a project or whatever: you expect the state after the request to match what you passed in. "Create" is worse because when I see "create set" I expect it to create a set, not union the existing set with what I pass in. Erroring if the set already exists would fix that, but that also means create becomes a special case of update for when there is no existing set, which makes me wonder whether we really need both. It seems like we could do ok with just update. That's the model we follow for firewall rules, though I admit it's kind of a pain and requires shenanigans in the client to simulate adding one rule at a time. |
Done
So say we all. |
Co-authored-by: David Crespo <[email protected]>
Fixes #6022