Skip to content

Commit

Permalink
Merge pull request #174 from k01ek/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
k01ek authored Jan 11, 2024
2 parents 9bb67da + 334e6cb commit 789b547
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PYTHON_VER?=3.8
NETBOX_VER?=v3.6.1
NETBOX_VER?=v3.7.0

NAME=netbox-bgp

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This plugin provide following Models:
| NetBox 3.4 | >= 0.9.0 |
| NetBox 3.5 | >= 0.10.0 |
| NetBox 3.6 | >= 0.11.0 |
| NetBox 3.7 | >= 0.12.0 |

## Installation

Expand Down
2 changes: 1 addition & 1 deletion netbox_bgp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class BGPConfig(PluginConfig):
base_url = 'bgp'
required_settings = []
min_version = '3.5.0'
max_version = '3.6.99'
max_version = '3.7.99'
default_settings = {
'device_ext_page': 'right',
'top_level_menu' : False,
Expand Down
16 changes: 10 additions & 6 deletions netbox_bgp/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def to_representation(self, value):
class RoutingPolicySerializer(NetBoxModelSerializer):
class Meta:
model = RoutingPolicy
fields = ['id', 'name', 'description']
fields = ['id', 'name', 'description', 'tags', 'custom_fields']


class NestedRoutingPolicySerializer(WritableNestedSerializer):
Expand Down Expand Up @@ -62,15 +62,15 @@ class BGPPeerGroupSerializer(NetBoxModelSerializer):

class Meta:
model = BGPPeerGroup
fields = ['id', 'name', 'description', 'import_policies', 'export_policies']
fields = ['id', 'display', 'name', 'description', 'import_policies', 'export_policies']


class NestedBGPPeerGroupSerializer(WritableNestedSerializer):
url = HyperlinkedIdentityField(view_name='plugins:netbox_bgp:bgppeergroup')

class Meta:
model = BGPPeerGroup
fields = ['id', 'url', 'name', 'description']
fields = ['id', 'display', 'url', 'name', 'description']
validators = []


Expand Down Expand Up @@ -132,7 +132,7 @@ class NestedBGPSessionSerializer(WritableNestedSerializer):

class Meta:
model = BGPSession
fields = ['id', 'url', 'name', 'description']
fields = ['id', 'url', 'name', 'display','description']
validators = []


Expand Down Expand Up @@ -170,7 +170,7 @@ class Meta:
class PrefixListSerializer(NetBoxModelSerializer):
class Meta:
model = PrefixList
fields = ['id', 'name', 'description', 'family']
fields = ['id', 'name', 'display','description', 'family', 'tags', 'custom_fields']


class RoutingPolicyRuleSerializer(NetBoxModelSerializer):
Expand All @@ -193,7 +193,11 @@ class RoutingPolicyRuleSerializer(NetBoxModelSerializer):

class Meta:
model = RoutingPolicyRule
fields = ['id', 'index', 'action', 'match_ip_address', 'routing_policy', 'match_community']
fields = [
'id', 'index', 'display' ,'action', 'match_ip_address',
'routing_policy', 'match_community', 'match_custom', 'set_actions',
'match_ipv6_address', 'description', 'tags', 'custom_fields',
]


class PrefixListRuleSerializer(NetBoxModelSerializer):
Expand Down
2 changes: 1 addition & 1 deletion netbox_bgp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Community(BGPBase):
"""
value = models.CharField(
max_length=64,
validators=[RegexValidator(r'\d+:\d+')]
validators=[RegexValidator(r'[\d\.\*]+:[\d\.\*]+')]
)

class Meta:
Expand Down
10 changes: 10 additions & 0 deletions netbox_bgp/templates/netbox_bgp/bgpsession.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ <h5 class="card-header">
{% endif %}
</td>
</tr>
<tr>
<td>Site</td>
<td>
{% if object.site %}
<a href="{{ object.device.get_absolute_url }}">{{ object.site }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
</td>
</tr>
<tr>
<td>Local AS</td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion netbox_bgp/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.11.1"
__version__ = "0.12.0"

0 comments on commit 789b547

Please sign in to comment.