available-ips endpoint is broken when using VRFs #5145

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

Originally created by @fabi125 on GitHub (Aug 5, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

3.0-dev

Python version

3.8

Steps to Reproduce

  1. Go to https://beta-demo.netbox.dev/
  2. Create a VRF
  3. Create a prefix inside that VRF
  4. Go to https://beta-demo.netbox.dev/api/ipam/prefixes/id/available-ips/

Expected Behavior

List of available IPs is returned.

Observed Behavior

{"error": "Object of type VRF is not JSON serializable", "exception": "TypeError", "netbox_version": "3.0-dev", "python_version": "3.8.10"}

This is what the prefix looks like:

{
    "id": 73,
    "url": "https://beta-demo.netbox.dev/api/ipam/prefixes/73/",
    "display": "10.0.0.0/24",
    "family": {
        "value": 4,
        "label": "IPv4"
    },
    "prefix": "10.0.0.0/24",
    "site": null,
    "vrf": {
        "id": 1,
        "url": "https://beta-demo.netbox.dev/api/ipam/vrfs/1/",
        "display": "Test VRF",
        "name": "Test VRF",
        "rd": null
    },
    "tenant": null,
    "vlan": null,
    "status": {
        "value": "active",
        "label": "Active"
    },
    "role": null,
    "is_pool": false,
    "mark_utilized": false,
    "description": "",
    "tags": [],
    "custom_fields": {},
    "created": "2021-08-05",
    "last_updated": "2021-08-05T11:51:42.530747Z",
    "children": 0,
    "_depth": 0
}
Originally created by @fabi125 on GitHub (Aug 5, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version 3.0-dev ### Python version 3.8 ### Steps to Reproduce 1. Go to https://beta-demo.netbox.dev/ 2. Create a VRF 3. Create a prefix inside that VRF 4. Go to https://beta-demo.netbox.dev/api/ipam/prefixes/id/available-ips/ ### Expected Behavior List of available IPs is returned. ### Observed Behavior `{"error": "Object of type VRF is not JSON serializable", "exception": "TypeError", "netbox_version": "3.0-dev", "python_version": "3.8.10"}` This is what the prefix looks like: ``` { "id": 73, "url": "https://beta-demo.netbox.dev/api/ipam/prefixes/73/", "display": "10.0.0.0/24", "family": { "value": 4, "label": "IPv4" }, "prefix": "10.0.0.0/24", "site": null, "vrf": { "id": 1, "url": "https://beta-demo.netbox.dev/api/ipam/vrfs/1/", "display": "Test VRF", "name": "Test VRF", "rd": null }, "tenant": null, "vlan": null, "status": { "value": "active", "label": "Active" }, "role": null, "is_pool": false, "mark_utilized": false, "description": "", "tags": [], "custom_fields": {}, "created": "2021-08-05", "last_updated": "2021-08-05T11:51:42.530747Z", "children": 0, "_depth": 0 } ```
adam added the type: bugstatus: acceptedbeta labels 2025-12-29 19:24:48 +01:00
adam closed this issue 2025-12-29 19:24:48 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5145