Unable to assign IP Address to interface with /api/ipam/prefixes/<id>/available-ips/ #8669

Closed
opened 2025-12-29 20:39:39 +01:00 by adam · 3 comments
Owner

Originally created by @rodvand on GitHub (Sep 24, 2023).

Originally assigned to: @arthanson on GitHub.

NetBox version

v3.6.2

Python version

3.8

Steps to Reproduce

  1. Create a device Test1, with an interface named eth0. Take note of the interface ID.
  2. Create a prefix 10.10.0.0/16, status active. Take note of the ID of the prefix.
  3. Create an IP Address assigned to the interface from that prefix using the API endpoint /available-ips/
curl -X 'POST' \
  'https://demo.netbox.dev/api/ipam/prefixes/96/available-ips/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-CSRFTOKEN: egTrik2RSlpArnjvo76kTM4jYjZRkXEtvsxsV2ey9oVMmeAzBhAtifJEsT6c7QaI' \
  -d '[
  {
    "status": "active",
    "assigned_object_type": "dcim.interface",
    "assigned_object_id": 1736
  }
]'

Expected Behavior

I expect the newly created IP Address to be assigned the interface specified.

Observed Behavior

I get the following returned from the API:

[
  {
    "id": 194,
    "url": "https://demo.netbox.dev/api/ipam/ip-addresses/194/",
    "display": "10.10.0.3/16",
    "family": {
      "value": 4,
      "label": "IPv4"
    },
    "address": "10.10.0.3/16",
    "vrf": null,
    "tenant": null,
    "status": {
      "value": "active",
      "label": "Active"
    },
    "role": null,
    "assigned_object_type": null,
    "assigned_object_id": null,
    "assigned_object": null,
    "nat_inside": null,
    "nat_outside": [],
    "dns_name": "",
    "description": "",
    "comments": "",
    "tags": [],
    "custom_fields": {},
    "created": "2023-09-24T19:33:47.225091Z",
    "last_updated": "2023-09-24T19:33:47.225121Z"
  }
]

So the assigned_object_type and assigned_object_id is not populated as I expect it to be.

Originally created by @rodvand on GitHub (Sep 24, 2023). Originally assigned to: @arthanson on GitHub. ### NetBox version v3.6.2 ### Python version 3.8 ### Steps to Reproduce 1. Create a device Test1, with an interface named eth0. Take note of the interface ID. 1. Create a prefix 10.10.0.0/16, status active. Take note of the ID of the prefix. 2. Create an IP Address assigned to the interface from that prefix using the API endpoint /available-ips/ ``` curl -X 'POST' \ 'https://demo.netbox.dev/api/ipam/prefixes/96/available-ips/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H 'X-CSRFTOKEN: egTrik2RSlpArnjvo76kTM4jYjZRkXEtvsxsV2ey9oVMmeAzBhAtifJEsT6c7QaI' \ -d '[ { "status": "active", "assigned_object_type": "dcim.interface", "assigned_object_id": 1736 } ]' ``` ### Expected Behavior I expect the newly created IP Address to be assigned the interface specified. ### Observed Behavior I get the following returned from the API: ``` [ { "id": 194, "url": "https://demo.netbox.dev/api/ipam/ip-addresses/194/", "display": "10.10.0.3/16", "family": { "value": 4, "label": "IPv4" }, "address": "10.10.0.3/16", "vrf": null, "tenant": null, "status": { "value": "active", "label": "Active" }, "role": null, "assigned_object_type": null, "assigned_object_id": null, "assigned_object": null, "nat_inside": null, "nat_outside": [], "dns_name": "", "description": "", "comments": "", "tags": [], "custom_fields": {}, "created": "2023-09-24T19:33:47.225091Z", "last_updated": "2023-09-24T19:33:47.225121Z" } ] ``` So the `assigned_object_type` and `assigned_object_id` is not populated as I expect it to be.
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 20:39:39 +01:00
adam closed this issue 2025-12-29 20:39:39 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 25, 2023):

Potentially related to #13746

@jeremystretch commented on GitHub (Sep 25, 2023): Potentially related to #13746
Author
Owner

@arthanson commented on GitHub (Sep 25, 2023):

DUPE OF #13746

@arthanson commented on GitHub (Sep 25, 2023): DUPE OF #13746
Author
Owner

@arthanson commented on GitHub (Oct 5, 2023):

Closing as fixed by https://github.com/netbox-community/netbox/pull/13889

@arthanson commented on GitHub (Oct 5, 2023): Closing as fixed by https://github.com/netbox-community/netbox/pull/13889
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8669