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

Option to filter links between devices via tags #57

Closed
bortok opened this issue Jun 26, 2023 · 2 comments · Fixed by #118
Closed

Option to filter links between devices via tags #57

bortok opened this issue Jun 26, 2023 · 2 comments · Fixed by #118
Assignees
Labels
feature request New capability requested by the community

Comments

@bortok
Copy link
Contributor

bortok commented Jun 26, 2023

Even if two interconnected devices should be present in the exported topology, it is sometimes necessary to limit the list of connections between them to a certain subset. For example, in a multi-tenant setup, some links maybe dedicated for one customer, and other links to another. To filter a list of connections tags could be used.

Requestor: @frederic-loui

@bortok bortok self-assigned this Jun 26, 2023
@bortok bortok added the feature request New capability requested by the community label Jun 26, 2023
@bortok
Copy link
Contributor Author

bortok commented Jun 26, 2023

List of interfaces is extracted for each device individually: https://github.com/netreplica/nrx/blob/main/nrx/nrx.py#L191, and then each interface is checked for type (ethernet) and if it is connected. A check could be added for a supplied tag, to limit the export.

Although interfaces can be tagged in netbox, this approach has a drawback – both sides of the link would have to be tagged.

Potential CLI UI options:

  1. Use separate list of tags for interfaces. This option is less elegant, but more flexible to allow use of different tags for devices and interfaces. Adding filtering for another entity like cables would require another parameter like --cable-tags:

    # when only interfaces carry tenant information, not devices (quite likely scenario)
    ./nrx.py --tags dc1 --interface-tags customer1
    # export WAN topology with links from a particular provider only
    ./nrx.py --tags wan --interface-tags provider1
  2. Use a common list of tags, and enable filtering of interfaces. This option is more elegant and extendable to other entities like cables without adding more parameters, but does not allow use of different tags between devices and interfaces:

    ./nrx.py --tags customer1 --filter devices,interfaces

Option 1 seems to be better suited for common use cases outlined above, while the second option would be problematic to apply to those.

@frederic-loui
Copy link
Contributor

Hi ! 1 seems to be more flexible. I have a question though while entering data into nbx.rare.nmaas.eu. While having to parse tag at interface and cable layer, would not it be preferable to use circuit tag in order to deal with tenancy export ? In that case we would have topology for core network but we would also have an other type for customer/tenant topology export ? As usual, we can have a quick VC if needed, as this use case applies to to what we would like to achieve. Depending on your choice we will follow your decision :-)

@bortok bortok linked a pull request Apr 28, 2024 that will close this issue
@bortok bortok closed this as completed Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New capability requested by the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants