Ability to filter interfaces by 'mark_connected' or those with a connected cable #6063

Closed
opened 2025-12-29 19:36:14 +01:00 by adam · 9 comments
Owner

Originally created by @jasonyates on GitHub (Feb 7, 2022).

Originally assigned to: @arthanson on GitHub.

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//interfaces/ view allows me to fairly quickly see which are connected / not connected albeit with no way to filter.

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

Originally created by @jasonyates on GitHub (Feb 7, 2022). Originally assigned to: @arthanson on GitHub. ### 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/<device>/interfaces/ view allows me to fairly quickly see which are connected / not connected albeit with no way to filter. 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_
adam added the status: acceptedtype: feature labels 2025-12-29 19:36:14 +01:00
adam closed this issue 2025-12-29 19:36:14 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (May 30, 2022):

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.

@github-actions[bot] commented on GitHub (May 30, 2022): 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](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@jeremystretch commented on GitHub (May 31, 2022):

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.

@jeremystretch commented on GitHub (May 31, 2022): > 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.
Author
Owner

@jeremystretch commented on GitHub (May 31, 2022):

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:

  1. Extend the cabled filter to include objects with mark_connected set to True
  2. Introduce a new filter for objects which are cabled or which have mark_connected set to True
  3. Introduce a new filter which matches only on the mark_connected field (this could not be practically combined with the cabled 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.

@jeremystretch commented on GitHub (May 31, 2022): 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: 1. Extend the `cabled` filter to include objects with `mark_connected` set to True 2. Introduce a new filter for objects which are cabled _or_ which have `mark_connected` set to True 3. Introduce a new filter which matches only on the `mark_connected` field (this could not be practically combined with the `cabled` 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.
Author
Owner

@github-actions[bot] commented on GitHub (Jul 31, 2022):

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.

@github-actions[bot] commented on GitHub (Jul 31, 2022): 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](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@jeremystretch commented on GitHub (Aug 3, 2022):

  1. Extend the cabled filter to include objects with mark_connected set to True

This makes the most sense IMO, but this is still open to debate.

@jeremystretch commented on GitHub (Aug 3, 2022): > 1. Extend the `cabled` filter to include objects with `mark_connected` set to True This makes the most sense IMO, but this is still open to debate.
Author
Owner

@DanSheps commented on GitHub (Aug 3, 2022):

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).

@DanSheps commented on GitHub (Aug 3, 2022): 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).
Author
Owner

@baldgeek commented on GitHub (Aug 3, 2022):

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:
@.***>

@baldgeek commented on GitHub (Aug 3, 2022): 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: > ***@***.***> >
Author
Owner

@arthanson commented on GitHub (Sep 7, 2022):

@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 commented on GitHub (Sep 7, 2022): @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
Author
Owner

@jeremystretch commented on GitHub (Sep 7, 2022):

@arthanson that sounds good to me!

@jeremystretch commented on GitHub (Sep 7, 2022): @arthanson that sounds good to me!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6063