Skip to content

Updating a GFK field via API does not return the new value #12328

@amhn

Description

@amhn

NetBox version

v3.4.8

Python version

3.10

Steps to Reproduce

  1. Create IP-Address (do not assign object)
  2. Create Object to assign (e.g. FHRP Group
  3. curl -H "Authorization: Token $NETBOX_TOKEN" -H "Content-type: application/json" $NETBOX_SCHEME://$NETBOX_URL/api/ipam/ip-addresses/1/ -X PATCH --data '{"assigned_object_type": "ipam.fhrpgroup", "assigned_object_id":1}'

Expected Behavior

assigned_object in the response is not null.

Observed Behavior

assigned_object is null:

{
    "id": 1,
    "url": "http://localhost:8000/api/ipam/ip-addresses/1/",
    "display": "127.0.0.1/32",
    "family": {
        "value": 4,
        "label": "IPv4"
    },
    "address": "127.0.0.1/32",
    "vrf": null,
    "tenant": null,
    "status": {
        "value": "active",
        "label": "Active"
    },
    "role": null,
    "assigned_object_type": "ipam.fhrpgroup",
    "assigned_object_id": 1,
    "assigned_object": null,
    "nat_inside": null,
    "nat_outside": [],
    "dns_name": "",
    "description": "",
    "comments": "",
    "tags": [],
    "custom_fields": {},
    "created": "2023-04-23T09:32:24.766755Z",
    "last_updated": "2023-04-23T09:35:09.908879Z"
}

This is only the case if the assigned_object was not assigned before the request. Changing or removing the assigned object gives the correct response.

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions