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_machine
method, which is a shortcut for*Machine.deploy_machines(machine.lab, selected_machines={machine.name})
- [x] Add
deploy_link
method, which is a shortcut for*Link.deploy_links(link.lab, selected_links={link.name})
- [x] Add
undeploy_machine
method, which is a shortcut for*Machine.undeploy_machines(machine.lab.hash, selected_machines={machine.name})
- [x] Change
*Link.undeploy
method to accept a list ofselected_links
as optional parameter - [x] Add
undeploy_link
method, 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_lab
method 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
, andLink
objects 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
--eth
onvconfig
in--add
in order to be more semantically correct. - [x] Add a
--rm
parameter onvconfig
to delete an interface. - [x] Rename
--eth
onlconfig
in--add
in order to be more semantically correct. - [x] Add a
--rm
parameter onlconfig
to delete an interface.