Kathara
Kathara copied to clipboard
Add deploy/undeploy device/link methods to Manager
Currently, there's no way to deploy/undeploy a single device or collision domain. The only way is to use deploy_lab and undeploy_lab with the selected_machines parameter.
Moreover, the only way to update a device is to call the update_lab method with a diff from the previous state. This design limits the flexibility, especially for the update. In fact, it is not even possible to disconnect a device from a collision domain.
Requested changes are:
- [x] Add
deploy_machinemethod, which is a shortcut for*Machine.deploy_machines(machine.lab, selected_machines={machine.name}) - [x] Add
deploy_linkmethod, which is a shortcut for*Link.deploy_links(link.lab, selected_links={link.name}) - [x] Add
undeploy_machinemethod, which is a shortcut for*Machine.undeploy_machines(machine.lab.hash, selected_machines={machine.name}) - [x] Change
*Link.undeploymethod to accept a list ofselected_linksas optional parameter - [x] Add
undeploy_linkmethod, which is a shortcut for*Link.undeploy(link.lab.hash, selected_links={link.name})
In order to support more expressive device updates, it will also:
- [x] Remove the
Manager.update_labmethod completely - [x] Add a
Manager.connect_machine_to_link(machine: Machine, link: Link)method that will perform a similar code to the currentupdate_lab, and will also update theLab,Machine, andLinkobjects state accordingly. - [x] Add a
Manager.disconnect_machine_from_link(machine: Machine, link: Link)method that will disconnect a device from a specific collision domain.
In order to support disconnecting a collision domain from CLI, it will also:
- [x] Add a method in Manager to reconstruct a network scenario state from API objects. This is required to correctly check if a device is connected to a collision domain at runtime, since it could be done using the above methods at any time and the original object is lost after the CLI command exits.
- [x] Rename
--ethonvconfigin--addin order to be more semantically correct. - [x] Add a
--rmparameter onvconfigto delete an interface. - [x] Rename
--ethonlconfigin--addin order to be more semantically correct. - [x] Add a
--rmparameter onlconfigto delete an interface.