API virtual-machines only return primary ip address #4189

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

Originally created by @vnStrawHat on GitHub (Oct 15, 2020).

Environment

  • Python version: 3.6.8
  • NetBox version: v2.8.3

Steps to Reproduce

  1. create new Virtual Machine
  2. create new Interface
  3. assign Interface to Virtual Machine
  4. Assign IP 01 to Interface and mark as primary IP
  5. Assign IP 02 to interface
    image

Expected Behavior

When access to the API https://netbox.local:8443/api/virtualization/virtual-machines/
the result should include 02 IP address

Observed Behavior

When access to the API https://netbox.local:8443/api/virtualization/virtual-machines/
The result only have primary IP

How can we get all IP Address of Virtual Machine instead of primary IP only ?

Originally created by @vnStrawHat on GitHub (Oct 15, 2020). ### Environment * Python version: 3.6.8 * NetBox version: v2.8.3 ### Steps to Reproduce 1. create new Virtual Machine 2. create new Interface 3. assign Interface to Virtual Machine 4. Assign IP 01 to Interface and mark as primary IP 5. Assign IP 02 to interface ![image](https://user-images.githubusercontent.com/4435695/96074481-fd44d600-0ed2-11eb-9614-c85b04ff4103.png) ### Expected Behavior When access to the API https://netbox.local:8443/api/virtualization/virtual-machines/<id> the result should include 02 IP address <!-- What happened instead? --> ### Observed Behavior When access to the API https://netbox.local:8443/api/virtualization/virtual-machines/<id> The result only have primary IP How can we get all IP Address of Virtual Machine instead of primary IP only ?
adam closed this issue 2025-12-29 18:33:46 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 15, 2020):

This is expected behavior. Please see the documentation for instructions on using the REST API, or post to our mailing list for assistance.

@jeremystretch commented on GitHub (Oct 15, 2020): This is expected behavior. Please see [the documentation](https://netbox.readthedocs.io/en/stable/rest-api/overview/) for instructions on using the REST API, or post to our [mailing list](https://groups.google.com/g/netbox-discuss) for assistance.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4189