Skip to content

Error to use virtualization interface model #103

@smutel

Description

@smutel

Hello,

Using this piece of code with netbox 2.9.7:

params := ipam.NewIpamIPAddressesListParams().WithID(&resourceID)

I received the error message below:

Error: json: cannot unmarshal number into Go struct field IPAddress.assigned_object of type string

When I checked in the JSON api I got:

"assigned_object": {
        "id": 5,
        "url": "http://127.0.0.1:32768/api/virtualization/interfaces/5/",
        "virtual_machine": {
            "id": 6,
            "url": "http://127.0.0.1:32768/api/virtualization/virtual-machines/6/",
            "name": "test"
        },
        "name": "default"
    },

which is not compatible with the definition in the code:

AssignedObject map[string]string `json:"assigned_object,omitempty"`

Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions