Hi Guys,
For the IP route editing in nmstate, the parietal editing is
problematic:
User case A:
Current routes: 1.1.1.0/24 via 2.2.2.2 dev eth1
Desired routes: changed next hope to 3.3.3.3
User case B:
Current routes: 1.1.1.0/24 via 2.2.2.2 dev eth1
Desired routes: add another route entry,
1.1.1.0/24 via 3.3.3.3 dev eth1
for load balance.
With partial editing:
For A), nmstate API user need to mark exiting routes as 'absent',
then add new one.
For B), nmstate API user just add new one.
Pro:
* It's easy for user to add new route entry with
minimum/incremental data passing to nmstate API.
Cons:
* When editing certain entry, user need to search it from
current state and mark it as absent. This adds a lot more
works in API user.
* The API is complexing the common user case -- editing route.
With full editing: API user just define what he/she wants.
Pro:
* It simple and clear to say in API document about route:
You get what you asked, nothing else.
Cons:
* API user need to define the whole state, which might be
a headache with 10k+ routes.
I personally favor the full editing staff and add below functions when
full editing is a real concern in the future:
* nmstate.netapplier.add() # Add new stuff
* nmstate.netapplier.edit() # Override existing stuff
* nmstate.netapplier.remove() # Remove stuff
Any comments and suggestions?
Thank you very much.
Best regards.
--
Gris Ge
Attachment:
signature.asc
Description: PGP signature