Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rodvand opened this issue Sep 24, 2023 · 3 comments
Assignees
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@rodvand
Copy link
Contributor

rodvand commented Sep 24, 2023

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.

@rodvand rodvand added the type: bug A confirmed report of unexpected behavior in the application label Sep 24, 2023
@rodvand rodvand changed the title Missing return data on /api/ipam/prefixes/<id>/available-ips/ Unable to assign IP Address to interface with /api/ipam/prefixes/<id>/available-ips/ Sep 24, 2023
@jeremystretch
Copy link
Member

Potentially related to #13746

@jeremystretch jeremystretch added the status: under review Further discussion is needed to determine this issue's scope and/or implementation label Sep 25, 2023
@arthanson
Copy link
Collaborator

DUPE OF #13746

@arthanson
Copy link
Collaborator

Closing as fixed by #13889

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation severity: medium Results in substantial degraded or broken functionality for specfic workflows and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Oct 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

3 participants