-
Notifications
You must be signed in to change notification settings - Fork 263
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 ability to create custom relationships between objects of the same type. #157
Comments
This has already come up a few times. Will definitely require some exploratory efforts here The use case we've heard already was FEX devices, but would love to hear if there are other use cases, even beyond virtual chassis. |
The ability to relate Sites to Sites could help with #230 . Similarly, I'd love to have VLAN Groups be able to inherit from each other so that VLANs that span several "sites" or "buildings" can be made available to all interfaces within a site/building. |
Agree, nested sites is a long term request of ours which never got traction. But if we can associate prefixes with any object - eg rack groups or regions, then it's not so important to us. |
Chiming in on this feature request, this would also open up the possibilities for point-to-multipoint and multipoint-to-multipoint connectivity, if one could define custom connectivity between interfaces. Probably better suited for a generalized multipoint circuit model, but this could be another approach to modelling the outlined scenario. |
Updating this issue with some of the concerns raised in #846: Directionality
We probably need a design that can support both directional and non-directional relations. This may require defining additional types of Relationship ("one-to-one-nondirectional", ...?) or perhaps just adding a "directional" flag to the Relationship model - details TBD. Mutual exclusivity of source/destinationIn some types of same-to-same relationship, (particularly non-directional one-to-one relations, but possibly others as well) adding a relationship association in which a record is the "source" should prohibit creation of a different relationship association in which the same record is the "destination" (i.e, Device A (source) <--> Device B (destination) association should prevent creation of Device C (source) <--> Device A (destination) or Device B (source) <--> Device C (destination)). This behavior might be implied by the type of relationship specified, or it might need to be another separate field on the Relationship definition - more investigation is needed here. GraphQL representationAdditionally, the current GraphQL implementation of RelationshipAssociation rendering simply uses the relationship name (
|
Based on the best information we have so far, all of the concrete use cases we have examined for same-to-same relationships fall into the "mutually exclusive" category, so for at least the time being, we will not be supporting the option for an object to act as both source and destination for the same Relationship. |
…846) * Permit definition of Relationships between a model and its own type. Fixes #157. * Refactoring and improved documentation/comments * Black * Support for symmetric relationships (#985) * Add support for symmetric relationships * Add some test cases * More test cases * Add bulk-delete views for Relationship and RelationshipAssociation * Flake8 * Update docs * Add "_source" and "_destination" to GraphQL field name only for non-symmetric same-type relationships. (#1021) Fix some issues with data validation when creating the GraphQL schema. * Apply suggestions from code review Co-authored-by: Jathan McCollum <jathan@gmail.com> * Clarify docs around symmetric many-to-many relationships * Add release-note and feature overview Co-authored-by: Jathan McCollum <jathan@gmail.com>
Implemented in |
Environment
Proposed Functionality
Extend the custom relationship feature to be able to create relationships of the same object type. EG. between dcim.device and dcim.device.
Use Case
This would allow to create a simpler type of Virtual Chassis or perhaps a custom relationship for Cisco FEX devices. There may be other creative uses by removing this limitation.
Database Changes
Unsure.
External Dependencies
There should not be any external dependencies.
The text was updated successfully, but these errors were encountered: