netbox
netbox copied to clipboard
Ability to filter interfaces by 'mark_connected' or those with a connected cable
NetBox version
3.1.7
Feature type
New functionality
Proposed functionality
Add the ability to filter interfaces under /dcim/interfaces/ by those that are marked / not marked as 'mark_connected' Add the ability to filter interfaces under /dcim/interfaces/ by those that have / have not got a cable connected
Use case
A large switch with multiple interfaces can be trick to sort/filter in the current GUI. E.g. I have a 9410 switch with 358 interfaces, the /dcim/devices/
However when looking at /dcim/interfaces/ I can add the Mark Connected and Cable columns but i'm unable to filter by interfaces that are marked connected or have a cable attached
Database changes
No response
External dependencies
No response
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.
Add the ability to filter interfaces under /dcim/interfaces/ by those that have / have not got a cable connected
This is already provided by the cabled
boolean filter on relevant models.
We currently have two relevent filters in place:
-
cabled
- Boolean filter returning only models which have a cable assigned -
connected
- Boolean filter for path endpoints which returns only models with a complete end-to-end path assigned
Given that the current connected
filter serves a different purpose than whats being proposed here, we have a few choices:
- Extend the
cabled
filter to include objects withmark_connected
set to True - Introduce a new filter for objects which are cabled or which have
mark_connected
set to True - Introduce a new filter which matches only on the
mark_connected
field (this could not be practically combined with thecabled
filter as the two are mutually exclusive)
IMO the second option is preferable because it preserves the existing behavior of the cabled
function and avoids potential confusion. However, I'm not sure what the new filter should be called.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.
- Extend the
cabled
filter to include objects withmark_connected
set to True
This makes the most sense IMO, but this is still open to debate.
I know it is a bit of a change, but, would it make sense to have the following filters?
- is_cabled
- has_endpoint
- is_connected
is_connected
would include both cabled and marked conections.
The has_endpoint
would replace the current connected
filter currently.
It would be a breaking change and perhaps we can deprecate it over the next couple of cycles but argueably has_endpoint makes more sense then "connected" in my own eye. I also prefer the is_/has_ semantic and we have used it elsewhere where we have a Boolean (is_private
in RIR model, is_full_depth
, is_pool
, has_primary_ip
, etc).
I personally like this option, but I am not the one who would have to implement it. |is_connected| always drives me nuts when I check the box "mark connected" and this still comes back false.
On 8/3/22 4:56 PM, Daniel Sheppard wrote:
I know it is a bit of a change, but, would it make sense to have the following filters?
- is_cabled
- has_endpoint
- is_connected
|is_connected| would include both cabled and marked conections.
The |has_endpoint| would replace the current |connected| filter currently.
It would be a breaking change and perhaps we can deprecate it over the next couple of cycles but argueably has_endpoint makes more sense then "connected" in my own eye. I also prefer the is_/has_ semantic and we have used it elsewhere where we have a Boolean (|is_private| in RIR model, |is_full_depth|, |is_pool|, |has_primary_ip|, etc).
— Reply to this email directly, view it on GitHub https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnetbox-community%2Fnetbox%2Fissues%2F8580%23issuecomment-1204474444&data=05%7C01%7Cjos100%40psu.edu%7C9e9fa23dde4b4fdecc3d08da7592ac20%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637951570066785310%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=384CFedu%2BVSqTnuA4H8hFJyNR%2BToZhwFJyeJNHH4JTU%3D&reserved=0, or unsubscribe https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FANYW3MO2CCJGEZKA72EKA7DVXLMIXANCNFSM5NYA3HRQ&data=05%7C01%7Cjos100%40psu.edu%7C9e9fa23dde4b4fdecc3d08da7592ac20%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637951570066785310%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=em83gfezn5g4nD3VgIJz%2BGhHKmGSGtefP8q2sxkt0XY%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.***>
@jeremystretch per discussion, proposal is (does this sound correct):
Keep the current two filters as is:
cabled - Boolean filter returning only models which have a cable assigned connected - Boolean filter for path endpoints which returns only models with a complete end-to-end path assigned
Add a new filter:
is_occupied - Boolean filter for objects which are cabled or which have mark_connected set to True
@arthanson that sounds good to me!