Skip to content
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 deploy/undeploy device/link methods to Manager #173

Closed
13 tasks done
Skazza94 opened this issue Jun 7, 2022 · 0 comments
Closed
13 tasks done

Add deploy/undeploy device/link methods to Manager #173

Skazza94 opened this issue Jun 7, 2022 · 0 comments
Assignees
Labels
enhancement next release The feature will be added in the next release

Comments

@Skazza94
Copy link
Member

Skazza94 commented Jun 7, 2022

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:

  • Add deploy_machine method, which is a shortcut for *Machine.deploy_machines(machine.lab, selected_machines={machine.name})
  • Add deploy_link method, which is a shortcut for *Link.deploy_links(link.lab, selected_links={link.name})
  • Add undeploy_machine method, which is a shortcut for *Machine.undeploy_machines(machine.lab.hash, selected_machines={machine.name})
  • Change *Link.undeploy method to accept a list of selected_links as optional parameter
  • 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:

  • Remove the Manager.update_lab method completely
  • Add a Manager.connect_machine_to_link(machine: Machine, link: Link) method that will perform a similar code to the current update_lab, and will also update the Lab, Machine, and Link objects state accordingly.
  • 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:

  • 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.
  • Rename --eth on vconfig in --add in order to be more semantically correct.
  • Add a --rm parameter on vconfig to delete an interface.
  • Rename --eth on lconfig in --add in order to be more semantically correct.
  • Add a --rm parameter on lconfig to delete an interface.
@Skazza94 Skazza94 self-assigned this Jun 7, 2022
Skazza94 added a commit that referenced this issue Aug 25, 2022
Skazza94 added a commit that referenced this issue Aug 26, 2022
Skazza94 added a commit that referenced this issue Aug 26, 2022
Co-authored-by: tcaiazzi <tommasocaiazzi@gmail.com>
Skazza94 added a commit that referenced this issue Sep 1, 2022
tcaiazzi added a commit that referenced this issue Sep 1, 2022
@tcaiazzi tcaiazzi self-assigned this Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement next release The feature will be added in the next release
Projects
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants