[PR #5161] [MERGED] #2179: Support multiple port numbers for services #12972

Closed
opened 2025-12-29 22:24:40 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/5161
Author: @jeremystretch
Created: 9/21/2020
Status: Merged
Merged: 9/21/2020
Merged by: @jeremystretch

Base: develop-2.10Head: 2179-service-port-arrays


📝 Commits (4)

  • f97d896 Initial work on #2179: Allow a service to have multiple ports
  • e77f1bd Introduce array_to_string() utility function; add port_list property to Service
  • b85990d Fix return URL when editing a service
  • 3a90366 Fix filtering services by port number

📊 Changes

18 files changed (+156 additions, -73 deletions)

View changed files

📝 netbox/dcim/models/racks.py (+2 -8)
📝 netbox/ipam/api/nested_serializers.py (+1 -1)
📝 netbox/ipam/api/serializers.py (+1 -1)
📝 netbox/ipam/filters.py (+6 -2)
📝 netbox/ipam/forms.py (+14 -11)
netbox/ipam/migrations/0039_service_ports_array.py (+43 -0)
netbox/ipam/migrations/0040_service_drop_port.py (+15 -0)
📝 netbox/ipam/models.py (+18 -11)
📝 netbox/ipam/tables.py (+6 -2)
📝 netbox/ipam/tests/test_api.py (+7 -7)
📝 netbox/ipam/tests/test_filters.py (+8 -8)
📝 netbox/ipam/tests/test_views.py (+6 -6)
📝 netbox/ipam/views.py (+0 -3)
📝 netbox/templates/ipam/inc/service.html (+5 -8)
📝 netbox/templates/ipam/service.html (+2 -2)
📝 netbox/templates/ipam/service_edit.html (+1 -1)
📝 netbox/utilities/filters.py (+10 -2)
📝 netbox/utilities/utils.py (+11 -0)

📄 Description

Closes: #2179

  • Rename port to ports; convert from IntegerField to ArrayField
  • Introduce array_to_string utility function (also used for RackReservation units)
  • Introduce NumericArrayFilter for filtering services by port number

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/5161 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 9/21/2020 **Status:** ✅ Merged **Merged:** 9/21/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop-2.10` ← **Head:** `2179-service-port-arrays` --- ### 📝 Commits (4) - [`f97d896`](https://github.com/netbox-community/netbox/commit/f97d8963f2767df5ab4fc9879d33c67100ad7003) Initial work on #2179: Allow a service to have multiple ports - [`e77f1bd`](https://github.com/netbox-community/netbox/commit/e77f1bdd850f087da615910a31827a020f024d0d) Introduce array_to_string() utility function; add port_list property to Service - [`b85990d`](https://github.com/netbox-community/netbox/commit/b85990daa6adc5212bf2a8a180003f102a207933) Fix return URL when editing a service - [`3a90366`](https://github.com/netbox-community/netbox/commit/3a90366538d935edf110d8b7c1c3ad0b17ccadef) Fix filtering services by port number ### 📊 Changes **18 files changed** (+156 additions, -73 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/models/racks.py` (+2 -8) 📝 `netbox/ipam/api/nested_serializers.py` (+1 -1) 📝 `netbox/ipam/api/serializers.py` (+1 -1) 📝 `netbox/ipam/filters.py` (+6 -2) 📝 `netbox/ipam/forms.py` (+14 -11) ➕ `netbox/ipam/migrations/0039_service_ports_array.py` (+43 -0) ➕ `netbox/ipam/migrations/0040_service_drop_port.py` (+15 -0) 📝 `netbox/ipam/models.py` (+18 -11) 📝 `netbox/ipam/tables.py` (+6 -2) 📝 `netbox/ipam/tests/test_api.py` (+7 -7) 📝 `netbox/ipam/tests/test_filters.py` (+8 -8) 📝 `netbox/ipam/tests/test_views.py` (+6 -6) 📝 `netbox/ipam/views.py` (+0 -3) 📝 `netbox/templates/ipam/inc/service.html` (+5 -8) 📝 `netbox/templates/ipam/service.html` (+2 -2) 📝 `netbox/templates/ipam/service_edit.html` (+1 -1) 📝 `netbox/utilities/filters.py` (+10 -2) 📝 `netbox/utilities/utils.py` (+11 -0) </details> ### 📄 Description ### Closes: #2179 - Rename `port` to `ports`; convert from IntegerField to ArrayField - Introduce `array_to_string` utility function (also used for RackReservation `units`) - Introduce NumericArrayFilter for filtering services by port number --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:24:40 +01:00
adam closed this issue 2025-12-29 22:24:40 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12972