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

Error to use virtualization interface model #103

Closed
smutel opened this issue Oct 25, 2020 · 0 comments · Fixed by #104
Closed

Error to use virtualization interface model #103

smutel opened this issue Oct 25, 2020 · 0 comments · Fixed by #104

Comments

@smutel
Copy link
Contributor

smutel commented Oct 25, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant