problem with "?prefix_length=64" limit for "GET /api/ipam/prefixes/<parent_pk>/available-prefixes/" #6498

Closed
opened 2025-12-29 19:41:34 +01:00 by adam · 1 comment
Owner

Originally created by @tbk2 on GitHub (May 19, 2022).

NetBox version

v3.2.3

Python version

3.8

Steps to Reproduce

We have following prefix defined:

  • prefix: <ipv6-prefix>::/48
  • id: 11

Following child prefixes are defined:

  • <ipv6-prefix>::/64
  • <ipv6-prefix>:1::/64
  • <ipv6-prefix>:2::/64
  • <ipv6-prefix>:3::/64

To reproduce the behavior:

  1. GET /api/ipam/prefixes/11/available-prefixes/?prefix_length=64

Expected Behavior

HTTP 200 OK
Allow: GET, POST, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

[
    {
        "family": 6,
        "prefix": "<ipv6-prefix>:4::/64",
        "vrf": null
    },
    {
        "family": 6,
        "prefix": "<ipv6-prefix>5::/64",
        "vrf": null
    },
    {
        "family": 6,
        "prefix": "<ipv6-prefix>6::/64",
        "vrf": null
    },
]

Observed Behavior

HTTP 200 OK
Allow: GET, POST, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

[
    {
        "family": 6,
        "prefix": "<ipv6-prefix>:4::/62",
        "vrf": null
    },
    {
        "family": 6,
        "prefix": "<ipv6-prefix>:8::/61",
        "vrf": null
    },
    {
        "family": 6,
        "prefix": "<ipv6-prefix>:10::/60",
        "vrf": null
    }
]

Is this a Bug or du I miss something?

Originally created by @tbk2 on GitHub (May 19, 2022). ### NetBox version v3.2.3 ### Python version 3.8 ### Steps to Reproduce We have following prefix defined: * prefix: `<ipv6-prefix>`::/48 * id: 11 Following child prefixes are defined: * `<ipv6-prefix>`::/64 * `<ipv6-prefix>`:1::/64 * `<ipv6-prefix>`:2::/64 * `<ipv6-prefix>`:3::/64 To reproduce the behavior: 1. `GET /api/ipam/prefixes/11/available-prefixes/?prefix_length=64` ### Expected Behavior ``` HTTP 200 OK Allow: GET, POST, HEAD, OPTIONS Content-Type: application/json Vary: Accept [ { "family": 6, "prefix": "<ipv6-prefix>:4::/64", "vrf": null }, { "family": 6, "prefix": "<ipv6-prefix>5::/64", "vrf": null }, { "family": 6, "prefix": "<ipv6-prefix>6::/64", "vrf": null }, ] ``` ### Observed Behavior ``` HTTP 200 OK Allow: GET, POST, HEAD, OPTIONS Content-Type: application/json Vary: Accept [ { "family": 6, "prefix": "<ipv6-prefix>:4::/62", "vrf": null }, { "family": 6, "prefix": "<ipv6-prefix>:8::/61", "vrf": null }, { "family": 6, "prefix": "<ipv6-prefix>:10::/60", "vrf": null } ] ``` Is this a Bug or du I miss something?
adam closed this issue 2025-12-29 19:41:34 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (May 19, 2022):

prefix_length is only available for POST requests to available-prefixes.

@kkthxbye-code commented on GitHub (May 19, 2022): `prefix_length` is only available for POST requests to available-prefixes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6498