FHRP group ID is misrepresented on the group assignments API endpoint when brief mode is used #9243

Closed
opened 2025-12-29 20:47:25 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Feb 13, 2024).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

NetBox Cloud

NetBox Version

v3.7.2

Python Version

3.11

Steps to Reproduce

  1. Create an FHRP group
  2. Assigned FHRP group to a device interface (details are unimportant)
  3. Query the /api/ipam/fhrp-group-assignments/ REST API endpoint
  4. Make a second query to the endpoint, this time using brief mode ?brief=true
  5. Compare the results, specifically the group field

Example results for reference:

Normal mode

{
    "id": 1,
    "url": "http://netbox:8000/api/ipam/fhrp-group-assignments/1/",
    "display": "GigabitEthernet1/0/3: foobar123 VRRPv3: 10 (1)",
    "group": {
        "id": 1,
        "url": "http://netbox:8000/api/ipam/fhrp-groups/1/",
        "display": "foobar123 VRRPv3: 10",
        "protocol": "vrrp3",
        "group_id": 10
    },
    "interface_type": "dcim.interface",
    "interface_id": 172,
    "interface": {
        ...
    },
    "priority": 1,
    "created": "2024-02-13T13:55:10.906366Z",
    "last_updated": "2024-02-13T13:55:10.906373Z"
}

Brief mode

{
    "id": 1,
    "url": "http://netbox:8000/api/ipam/fhrp-group-assignments/1/",
    "display": "GigabitEthernet1/0/3: foobar123 VRRPv3: 10 (1)",
    "interface_type": 39,
    "interface_id": 172,
    "group_id": 1,
    "priority": 1
}

Expected Behavior

The group field should be present in and consistent between both responses.

Observed Behavior

The group field is omitted in the brief mode response, and a group_id field is included instead. Note that this is not the numeric group ID assigned by the user to the FHRP group, but rather the unique database ID for the group object.

Originally created by @jeremystretch on GitHub (Feb 13, 2024). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type NetBox Cloud ### NetBox Version v3.7.2 ### Python Version 3.11 ### Steps to Reproduce 1. Create an FHRP group 2. Assigned FHRP group to a device interface (details are unimportant) 3. Query the `/api/ipam/fhrp-group-assignments/` REST API endpoint 4. Make a second query to the endpoint, this time using brief mode `?brief=true` 5. Compare the results, specifically the `group` field Example results for reference: #### Normal mode ``` { "id": 1, "url": "http://netbox:8000/api/ipam/fhrp-group-assignments/1/", "display": "GigabitEthernet1/0/3: foobar123 VRRPv3: 10 (1)", "group": { "id": 1, "url": "http://netbox:8000/api/ipam/fhrp-groups/1/", "display": "foobar123 VRRPv3: 10", "protocol": "vrrp3", "group_id": 10 }, "interface_type": "dcim.interface", "interface_id": 172, "interface": { ... }, "priority": 1, "created": "2024-02-13T13:55:10.906366Z", "last_updated": "2024-02-13T13:55:10.906373Z" } ``` #### Brief mode ``` { "id": 1, "url": "http://netbox:8000/api/ipam/fhrp-group-assignments/1/", "display": "GigabitEthernet1/0/3: foobar123 VRRPv3: 10 (1)", "interface_type": 39, "interface_id": 172, "group_id": 1, "priority": 1 } ``` ### Expected Behavior The `group` field should be present in and consistent between both responses. ### Observed Behavior The `group` field is omitted in the brief mode response, and a `group_id` field is included instead. Note that this is **not** the numeric group ID assigned by the user to the FHRP group, but rather the unique database ID for the group object.
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 20:47:25 +01:00
adam closed this issue 2025-12-29 20:47:25 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9243