ipam/prefixes not persisting requests #3651

Closed
opened 2025-12-29 18:30:22 +01:00 by adam · 1 comment
Owner

Originally created by @spirrello on GitHub (May 7, 2020).

Environment

  • Python version: 3.7.3
  • NetBox version: 2.8.2
  • Helmchart: bootc/netbox-chart (2.1.0)

This is a brand new install

Steps to Reproduce

Using Python 3 to automate the process of loading prefixes:

prefix = {"prefix": "10.1.0.0/24", "vrf": "xyz1"}
headers = { 'Authorization' : 'Token ' + netboxAPIToken }
r = requests.post('https://mysite.com/netbox/api/ipam/prefixes', headers=headers, data = prefix, timeout=5)

Output:


{'count': 1, 'next': None, 'previous': None, 'results': [{'id': 15, 'family': {'value': 4, 'label': 'IPv4'}, 'prefix': '10.0.0.0/8', 'site': None, 'vrf': {'id': 1, 'url': 'http://mysite.com/netbox/api/ipam/vrfs/1/', 'name': 'xyz1', 'rd': None}, 'tenant': None, 'vlan': None, 'status': {'value': 'active', 'label': 'Active', 'id': 1}, 'role': None, 'is_pool': True, 'description': '', 'tags': [], 'custom_fields': {}, 'created': '2020-05-06', 'last_updated': '2020-05-06T22:31:16.706282Z'}]}

Expected Behavior

My expectation is that the submitted prefix in my request would be persisted.

Observed Behavior

The existing subnet of 10.0.0.0/8 is returned in the HTTP response. If I delete the existing 10.0.0.0/8 prefix, I receive the following response.

{'count': 0, 'next': None, 'previous': None, 'results': []}

Originally created by @spirrello on GitHub (May 7, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report, and that any plugins have been disabled. --> ### Environment * Python version: 3.7.3 * NetBox version: 2.8.2 * Helmchart: bootc/netbox-chart (2.1.0) **This is a brand new install** <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox. Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a client library such as pynetbox. --> ### Steps to Reproduce Using Python 3 to automate the process of loading prefixes: prefix = {"prefix": "10.1.0.0/24", "vrf": "xyz1"} headers = { 'Authorization' : 'Token ' + netboxAPIToken } r = requests.post('https://mysite.com/netbox/api/ipam/prefixes', headers=headers, data = prefix, timeout=5) Output: ``` {'count': 1, 'next': None, 'previous': None, 'results': [{'id': 15, 'family': {'value': 4, 'label': 'IPv4'}, 'prefix': '10.0.0.0/8', 'site': None, 'vrf': {'id': 1, 'url': 'http://mysite.com/netbox/api/ipam/vrfs/1/', 'name': 'xyz1', 'rd': None}, 'tenant': None, 'vlan': None, 'status': {'value': 'active', 'label': 'Active', 'id': 1}, 'role': None, 'is_pool': True, 'description': '', 'tags': [], 'custom_fields': {}, 'created': '2020-05-06', 'last_updated': '2020-05-06T22:31:16.706282Z'}]} ``` <!-- What did you expect to happen? --> ### Expected Behavior My expectation is that the submitted prefix in my request would be persisted. <!-- What happened instead? --> ### Observed Behavior The existing subnet of 10.0.0.0/8 is returned in the HTTP response. If I delete the existing 10.0.0.0/8 prefix, I receive the following response. {'count': 0, 'next': None, 'previous': None, 'results': []}
adam closed this issue 2025-12-29 18:30:22 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 7, 2020):

Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided here. For general discussion, questions, or assistance with installation issues, please post to our mailing list instead.

@jeremystretch commented on GitHub (May 7, 2020): Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided [here](https://github.com/netbox-community/netbox/issues/new/choose). For general discussion, questions, or assistance with installation issues, please post to our [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss) instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3651