Tenancy for Plugin Objects #4882

Closed
opened 2025-12-29 19:21:38 +01:00 by adam · 7 comments
Owner

Originally created by @liquid-metal on GitHub (May 6, 2021).

NetBox version

v2.11.2

Feature type

Change to existing functionality

Proposed functionality

When creating objects in Plugins with an assigned Tenancy, it should be possible to add them in the tenancy Overview page in the stats as a clickable element count. Currently, the fields are hardcoded and cannot be extended by plugins: netbox/templates/tenancy/tenant.html

Use case

Specific example: the netbox-bgp plugin adds BGP sessions, which may be assigned to an existing tenant. In the tenant view, the stats should display the count of assigned Sessions as well.

Database changes

none

External dependencies

none

Originally created by @liquid-metal on GitHub (May 6, 2021). ### NetBox version v2.11.2 ### Feature type Change to existing functionality ### Proposed functionality When creating objects in Plugins with an assigned Tenancy, it should be possible to add them in the tenancy Overview page in the stats as a clickable element count. Currently, the fields are hardcoded and cannot be extended by plugins: netbox/templates/tenancy/tenant.html ### Use case Specific example: the [netbox-bgp plugin](https://github.com/k01ek/netbox-bgp) adds BGP sessions, which may be assigned to an existing tenant. In the tenant view, the stats should display the count of assigned Sessions as well. ### Database changes none ### External dependencies none
adam added the type: featurepending closurestatus: revisions needed labels 2025-12-29 19:21:38 +01:00
adam closed this issue 2025-12-29 19:21:38 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 6, 2021):

Please elaborate on the specific implementation you're proposing.

@jeremystretch commented on GitHub (May 6, 2021): Please elaborate on the specific implementation you're proposing.
Author
Owner

@liquid-metal commented on GitHub (May 6, 2021):

In places with stats overviews (Site and Tenant to my knowledge, please correct me if there are more places like that) plugins should be able to insert custom boxes for new elements.

site

I propose placeholders for optional plugin inserts, just like the {% plugin_*_page object %}, e.g. {% plugin_site_stats %} and {% plugin_tenant_stats %}: (Please excuse incorrect wording, I am not very familiar with Django and Jinja)

...
                <div class="col-md-4 text-center">
                    <h2><a href="{% url 'virtualization:cluster_list' %}?tenant_id={{ object.pk }}" class="btn {% if stats.cluster_count %}btn-primary{% else %}btn-default{% endif %} btn-lg">{{ stats.cluster_count }}</a></h2>
                    <p>Clusters</p>
                </div>

-->             {% plugin_site_stats %}

            </div>
        </div>
        {% plugin_right_page object %}
    </div>
</div>
...
@liquid-metal commented on GitHub (May 6, 2021): In places with stats overviews (Site and Tenant to my knowledge, please correct me if there are more places like that) plugins should be able to insert custom boxes for new elements. ![site](https://user-images.githubusercontent.com/56035107/117299584-00a4ac80-ae79-11eb-9e8d-a1714713b45c.png) I propose placeholders for optional plugin inserts, just like the `{% plugin_*_page object %}`, e.g. `{% plugin_site_stats %}` and `{% plugin_tenant_stats %}`: (Please excuse incorrect wording, I am not very familiar with Django and Jinja) ``` ... <div class="col-md-4 text-center"> <h2><a href="{% url 'virtualization:cluster_list' %}?tenant_id={{ object.pk }}" class="btn {% if stats.cluster_count %}btn-primary{% else %}btn-default{% endif %} btn-lg">{{ stats.cluster_count }}</a></h2> <p>Clusters</p> </div> --> {% plugin_site_stats %} </div> </div> {% plugin_right_page object %} </div> </div> ... ```
Author
Owner

@liquid-metal commented on GitHub (May 25, 2021):

@jeremystretch are there still "revisions needed"?
I cannot promise, but I might have a look and implement it myself. Obviously, I don't want to write something that will be rejected anyway

@liquid-metal commented on GitHub (May 25, 2021): @jeremystretch are there still "revisions needed"? I cannot promise, but I might have a look and implement it myself. Obviously, I don't want to write something that will be rejected anyway
Author
Owner

@github-actions[bot] commented on GitHub (Jul 25, 2021):

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 (Jul 25, 2021): 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

@esoubihe commented on GitHub (Aug 12, 2021):

This would be an interesting addition. We have plugins that we'd like to add to the tenant overview page too. Willing to contribute if there's enough interest here.

@esoubihe commented on GitHub (Aug 12, 2021): This would be an interesting addition. We have plugins that we'd like to add to the tenant overview page too. Willing to contribute if there's enough interest here.
Author
Owner

@991jo commented on GitHub (Sep 7, 2021):

I am also very interested in this change. This would make plugin objects a bit more like a first class citizen in NetBox.

@991jo commented on GitHub (Sep 7, 2021): I am also very interested in this change. This would make plugin objects a bit more like a first class citizen in NetBox.
Author
Owner

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

I'm afraid that merely expressing interest in a general idea for a feature is not sufficient to move it forward. As no detailed implementation has been proposed despite this issue having been open for several months, I'm going to close it.

If anyone would like to revisit this idea and come with a specific implementation plan, please open a new feature request to present it for discussion.

@jeremystretch commented on GitHub (Sep 7, 2021): I'm afraid that merely expressing interest in a general idea for a feature is not sufficient to move it forward. As no detailed implementation has been proposed despite this issue having been open for several months, I'm going to close it. If anyone would like to revisit this idea and come with a specific implementation plan, please open a new feature request to present it for discussion.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4882