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

Permit nestable LocationTypes (region-like) #2608

Closed
1 of 12 tasks
glennmatthews opened this issue Oct 12, 2022 · 1 comment · Fixed by #2616
Closed
1 of 12 tasks

Permit nestable LocationTypes (region-like) #2608

glennmatthews opened this issue Oct 12, 2022 · 1 comment · Fixed by #2616
Assignees
Labels
type: feature Introduction of new or enhanced functionality to the application

Comments

@glennmatthews
Copy link
Contributor

As ...

Austin - Network Automation Engineer

I want ...

To represent my organizational data as a LocationTypes/Locations hierarchy that may have a variable number of intermediary "layers", similar to the current Region model. In other words, I want to be able to represent a hierarchy like:

  • North America (1)
    • United States (2)
      • Eastern US (2)
        • Atlanta (3)
        • Athens (3)
  • EMEA (1)
    • Western Europe (1)
      • Spain (2)
        • Madrid (3)

where (1), (2), and (3) are my distinct LocationTypes. Note that the hierarchy (1 is a parent of 2, 2 is a parent of 3) is the same across the data, but additionally a 1 may have another 1 as its child and a 2 may have another 2 as its child, to model the case where a given location of that type does or does not have relevant sub-locations of that same general type.

The goal here is to avoid having to define multiple redundant location types in order to represent a hierarchy like the above, i.e., under the current LocationType model restrictions, this data would have to be modeled with seven distinct LocationTypes instead of three:

  • North America (1)
    • United States (2)
      • Eastern US (2a)
        • Atlanta (3a)
        • Athens (3a)
  • EMEA (1)
    • Western Europe (1a)
      • Spain (2b)
        • Madrid (3b)

So that ...

  1. I can represent a hierarchy of variable depth with a minimal number of distinct LocationTypes, reducing redundancy of my data and the potential for user confusion.

  2. As a foundation for Epic: Collapse Region and Site models into Location #2517, it will be straightforward to migrate an existing hierarchy of Regions into a hierarchy of LocationTypes and Locations without data loss or overly complex migration logic.

I know this is done when...

  • When defining a LocationType, there is an optional checkbox allowing me to indicate that locations of this type may be self-referential or self-parented, allowing nesting of this type.
  • When defining a Location, if its corresponding LocationType is configured to allow self-references, that I can make the parent of this Location either a Location matching the parent LocationType of this LocationType or a Location of the same LocationType as this one.

Optional - Feature groups this request pertains to.

  • Automation
  • Circuits
  • DCIM
  • IPAM
  • Misc (including Data Sources)
  • Organization
  • Plugins (and other Extensibility)
  • Security (Secrets, etc)
  • Image Management
  • UI/UX
  • Documentation
  • Other (not directly a platform feature)

Database Changes

Added checkbox/boolean field on LocationType.

External Dependencies

None.

@glennmatthews glennmatthews added the type: feature Introduction of new or enhanced functionality to the application label Oct 12, 2022
@glennmatthews glennmatthews self-assigned this Oct 13, 2022
@glennmatthews glennmatthews changed the title Permit self-referential LocationTypes (region-like) Permit nestable LocationTypes (region-like) Oct 14, 2022
@bryanculver bryanculver linked a pull request Oct 17, 2022 that will close this issue
6 tasks
@glennmatthews
Copy link
Contributor Author

Implemented for 1.5 by #2616.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature Introduction of new or enhanced functionality to the application
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant