Skip to content

Commit

Permalink
Merge pull request #208 from netbox-community/develop
Browse files Browse the repository at this point in the history
Release 0.13.3
  • Loading branch information
cruse1977 authored Oct 7, 2024
2 parents e87af39 + 4dd3e3c commit 721342d
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 171 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ This plugin provide following Models:

## Compatibility

| | |
|-------------|-----------|
| NetBox 3.4 | >= 0.9.0 |
| NetBox 3.5 | >= 0.10.0 |
| NetBox 3.6 | >= 0.11.0 |
| NetBox 3.7 | >= 0.12.0 |
| NetBox 4.0 | >= 0.13.2 |
| | |
|---------------|-----------|
| NetBox 3.4.x | >= 0.9.0 |
| NetBox 3.5.x | >= 0.10.0 |
| NetBox 3.6.x | >= 0.11.0 |
| NetBox 3.7.x | >= 0.12.0 |
| NetBox 4.0.x | >= 0.13.3 |

## Installation

Expand Down
4 changes: 2 additions & 2 deletions develop/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG python_ver=3.12
FROM python:${python_ver}

ARG netbox_ver=master
ARG netbox_ver=v4.0.11
ENV PYTHONUNBUFFERED 1

RUN mkdir -p /opt
Expand All @@ -23,6 +23,6 @@ WORKDIR /source
COPY . /source

#RUN pip install -r requirements.txt
RUN python setup.py develop
RUN python -m pip install --editable .

WORKDIR /opt/netbox/netbox/
46 changes: 10 additions & 36 deletions netbox_bgp/graphql/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,58 +27,32 @@
)


@strawberry.type
@strawberry.type(name="Query")
class NetBoxBGPQuery:
@strawberry.field
def netbox_bgp_community(self, id: int) -> CommunityType:
return Community.objects.get(pk=id)

netbox_bgp_community: CommunityType = strawberry_django.field()
netbox_bgp_community_list: List[CommunityType] = strawberry_django.field()

@strawberry.field
def netbox_bgp_session(self, id: int) -> BGPSessionType:
return BGPSession.objects.get(pk=id)

netbox_bgp_session: BGPSessionType = strawberry_django.field()
netbox_bgp_session_list: List[BGPSessionType] = strawberry_django.field()

@strawberry.field
def netbox_bgp_peer_group(self, id: int) -> BGPPeerGroupType:
return BGPPeerGroup.objects.get(pk=id)

netbox_bgp_peer_group: BGPPeerGroupType = strawberry_django.field()
netbox_bgp_peer_group_list: List[BGPPeerGroupType] = strawberry_django.field()

@strawberry.field
def netbox_bgp_routing_policy(self, id: int) -> RoutingPolicyType:
return RoutingPolicy.objects.get(pk=id)

netbox_bgp_routing_policy: RoutingPolicyType = strawberry_django.field()
netbox_bgp_routing_policy_list: List[RoutingPolicyType] = strawberry_django.field()

@strawberry.field
def netbox_bgp_routing_policy_rule(self, id: int) -> RoutingPolicyRuleType:
return RoutingPolicyRule.objects.get(pk=id)

netbox_bgp_routing_policy_rule: RoutingPolicyRuleType = strawberry_django.field()
netbox_bgp_routing_policy_rule_list: List[RoutingPolicyRuleType] = strawberry_django.field()

@strawberry.field
def netbox_bgp_prefixlist(self, id: int) -> PrefixListType:
return PrefixList.objects.get(pk=id)

netbox_bgp_prefixlist: PrefixListType = strawberry_django.field()
netbox_bgp_prefixlist_list: List[PrefixListType] = strawberry_django.field()

@strawberry.field
def netbox_bgp_prefixlist_rule(self, id: int) -> PrefixListRuleType:
return PrefixListRule.objects.get(pk=id)

netbox_bgp_prefixlist_rule: PrefixListRuleType = strawberry_django.field()
netbox_bgp_prefixlist_rule_list: List[PrefixListRuleType] = strawberry_django.field()

@strawberry.field
def netbox_bgp_communitylist(self, id: int) -> CommunityListType:
return CommunityList.objects.get(pk=id)

netbox_bgp_communitylist: CommunityListType = strawberry_django.field()
netbox_bgp_communitylist_list: List[CommunityListType] = strawberry_django.field()

@strawberry.field
def netbox_bgp_communitylist_rule(self, id: int) -> CommunityListRuleType:
return CommunityListRule.objects.get(pk=id)

netbox_bgp_communitylist_rule: CommunityListRuleType = strawberry_django.field()
netbox_bgp_communitylist_rule_list: List[CommunityListRuleType] = strawberry_django.field()
18 changes: 7 additions & 11 deletions netbox_bgp/graphql/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CommunityType(NetBoxObjectType):
site: Annotated["SiteType", strawberry.lazy("dcim.graphql.types")] | None
tenant: Annotated["TenantType", strawberry.lazy("tenancy.graphql.types")] | None
status: str
role: str
role: Annotated["RoleType", strawberry.lazy("ipam.graphql.types")] | None
description: str


Expand All @@ -45,7 +45,7 @@ class BGPSessionType(NetBoxObjectType):
name: str
site: Annotated["SiteType", strawberry.lazy("dcim.graphql.types")] | None
tenant: Annotated["TenantType", strawberry.lazy("tenancy.graphql.types")] | None
device: Annotated["DeviceType", strawberry.lazy("dcim.graphql.types")]
device: Annotated["DeviceType", strawberry.lazy("dcim.graphql.types")] | None
local_address: Annotated["IPAddressType", strawberry.lazy("ipam.graphql.types")]
remote_address: Annotated["IPAddressType", strawberry.lazy("ipam.graphql.types")]
local_as: Annotated["ASNType", strawberry.lazy("ipam.graphql.types")]
Expand All @@ -62,12 +62,8 @@ class BGPSessionType(NetBoxObjectType):
export_policies: List[
Annotated["RoutingPolicyType", strawberry.lazy("netbox_bgp.graphql.types")]
]
prefix_list_in: List[
Annotated["PrefixListType", strawberry.lazy("netbox_bgp.graphql.types")]
]
prefix_list_out: List[
Annotated["PrefixListType", strawberry.lazy("netbox_bgp.graphql.types")]
]
prefix_list_in: Annotated["PrefixListType", strawberry.lazy("netbox_bgp.graphql.types")] | None
prefix_list_out: Annotated["PrefixListType", strawberry.lazy("netbox_bgp.graphql.types")] | None


@strawberry_django.type(BGPPeerGroup, fields="__all__", filters=BGPPeerGroupFilter)
Expand Down Expand Up @@ -98,7 +94,7 @@ class RoutingPolicyRuleType(NetBoxObjectType):
index: BigInt
action: str
description: str
continue_entry: BigInt
continue_entry: BigInt | None
match_community: List[
Annotated["CommunityType", strawberry.lazy("netbox_bgp.graphql.types")]
]
Expand Down Expand Up @@ -127,8 +123,8 @@ class PrefixListRuleType(NetBoxObjectType):
]
index: BigInt
action: str
prefix: Annotated["PrefixType", strawberry.lazy("ipam.graphql.types")]
prefix_custom: str
prefix: Annotated["PrefixType", strawberry.lazy("ipam.graphql.types")] | None
prefix_custom: str | None
ge: BigInt
le: BigInt
description: str
Expand Down
14 changes: 0 additions & 14 deletions netbox_bgp/templates/netbox_bgp/bgppeergroup.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@
<li class="breadcrumb-item"><a href="{% url 'plugins:netbox_bgp:bgppeergroup_list' %}">Peer Groups</a></li>
{% endblock %}

{% block tabs %}
<ul class="nav nav-tabs px-3">
{% block tab_items %}
<li class="nav-item" role="presentation">
<a class="nav-link{% if not active_tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a>
</li>
{% endblock tab_items %}
{% if perms.extras.view_objectchange %}
<li role="presentation" class="nav-item">
<a href="{% url 'plugins:netbox_bgp:bgppeergroup_changelog' pk=object.pk %}" class="nav-link{% if active_tab == 'changelog'%} active{% endif %}">Change Log</a>
</li>
{% endif %}
</ul>
{% endblock tabs %}

{% block content %}
<div class="row mb-3">
Expand Down
14 changes: 0 additions & 14 deletions netbox_bgp/templates/netbox_bgp/bgpsession.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@
<li class="breadcrumb-item"><a href="{% url 'plugins:netbox_bgp:bgpsession_list' %}">BGP Sessions</a></li>
{% endblock %}

{% block tabs %}
<ul class="nav nav-tabs px-3">
{% block tab_items %}
<li class="nav-item" role="presentation">
<a class="nav-link{% if not active_tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a>
</li>
{% endblock tab_items %}
{% if perms.extras.view_objectchange %}
<li role="presentation" class="nav-item">
<a href="{% url 'plugins:netbox_bgp:bgpsession_changelog' pk=object.pk %}" class="nav-link{% if active_tab == 'changelog'%} active{% endif %}">Change Log</a>
</li>
{% endif %}
</ul>
{% endblock tabs %}

{% block content %}
<div class="row mb-3">
Expand Down
14 changes: 0 additions & 14 deletions netbox_bgp/templates/netbox_bgp/community.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@
<li class="breadcrumb-item"><a href="{% url 'plugins:netbox_bgp:community_list' %}">Communities</a></li>
{% endblock %}

{% block tabs %}
<ul class="nav nav-tabs px-3">
{% block tab_items %}
<li class="nav-item" role="presentation">
<a class="nav-link{% if not active_tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a>
</li>
{% endblock tab_items %}
{% if perms.extras.view_objectchange %}
<li role="presentation" class="nav-item">
<a href="{% url 'plugins:netbox_bgp:community_changelog' pk=object.pk %}" class="nav-link{% if active_tab == 'changelog'%} active{% endif %}">Change Log</a>
</li>
{% endif %}
</ul>
{% endblock tabs %}

{% block content %}
<div class="row mb-3">
Expand Down
14 changes: 0 additions & 14 deletions netbox_bgp/templates/netbox_bgp/communitylist.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@
{% endif %}
</div>
{% endblock extra_controls %}
{% block tabs %}
<ul class="nav nav-tabs px-3">
{% block tab_items %}
<li class="nav-item" role="presentation">
<a class="nav-link{% if not active_tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a>
</li>
{% endblock tab_items %}
{% if perms.extras.view_objectchange %}
<li role="presentation" class="nav-item">
<a href="{% url 'plugins:netbox_bgp:communitylist_changelog' pk=object.pk %}" class="nav-link{% if active_tab == 'changelog'%} active{% endif %}">Change Log</a>
</li>
{% endif %}
</ul>
{% endblock tabs %}

{% block content %}
<div class="row mb-3">
Expand Down
14 changes: 0 additions & 14 deletions netbox_bgp/templates/netbox_bgp/prefixlist.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@
{% endif %}
</div>
{% endblock extra_controls %}
{% block tabs %}
<ul class="nav nav-tabs px-3">
{% block tab_items %}
<li class="nav-item" role="presentation">
<a class="nav-link{% if not active_tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a>
</li>
{% endblock tab_items %}
{% if perms.extras.view_objectchange %}
<li role="presentation" class="nav-item">
<a href="{% url 'plugins:netbox_bgp:prefixlist_changelog' pk=object.pk %}" class="nav-link{% if active_tab == 'changelog'%} active{% endif %}">Change Log</a>
</li>
{% endif %}
</ul>
{% endblock tabs %}

{% block content %}
<div class="row mb-3">
Expand Down
14 changes: 0 additions & 14 deletions netbox_bgp/templates/netbox_bgp/routingpolicy.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@
{% endif %}
</div>
{% endblock extra_controls %}
{% block tabs %}
<ul class="nav nav-tabs px-3">
{% block tab_items %}
<li class="nav-item" role="presentation">
<a class="nav-link{% if not active_tab %} active{% endif %}" href="{{ object.get_absolute_url }}">{{ object|meta:"verbose_name"|bettertitle }}</a>
</li>
{% endblock tab_items %}
{% if perms.extras.view_objectchange %}
<li role="presentation" class="nav-item">
<a href="{% url 'plugins:netbox_bgp:routingpolicy_changelog' pk=object.pk %}" class="nav-link{% if active_tab == 'changelog'%} active{% endif %}">Change Log</a>
</li>
{% endif %}
</ul>
{% endblock tabs %}

{% block content %}
<div class="row mb-3">
Expand Down
Loading

0 comments on commit 721342d

Please sign in to comment.