feat: add support for auto (safe) interface deletion and a new endpoint to delete a disabled intf #191
Labels
2024.1
Kytos-ng 2024.1
enhancement
New feature or request
epic_general
Generic enhancement and/or fixes
This is a feature request from @italovalcy.
Context:
Requirements:
'.*.switch.interface.deleted'
that comes from aOFPPR_DELETE
(you can simulate this by deleting an interface on OvS -sudo ip link delete s1-eth4
), if the given interface has no links and no flows (either onin_port
match or{"action_type": "output", "port": x}
), no allocated vlans, then it should be OK to automatically hard delete it. Otherwise justlog.info
that the interface couldn't automatically safely be deleted.DELETE v3/interfaces/{intf_id}
(similar to how @Alopalao implemented for links and switches recentely). On this endpoint, it should only hard delete if the interface has been disabled, has no associated links, and has no associated flows (same as previous paragraph)To hard delete: The interface should be removed on a switch
switch.remove_interface(intf)
, and then remove from the DB in theswitches.interfaces[]
collection it should be pulled from the array, and removed frominterface_details
.The priority and target will still be defined.
Side note, this following script has been used recently to hard delete a non existing disabled interface (it was also filtering for not active due to special case in prod):
The text was updated successfully, but these errors were encountered: