netbox-community / go-netbox

The official Go API client for Netbox IPAM and DCIM service.
Other
194 stars 144 forks source link

Enabled (true / false) does not work with vm interface #105

Closed smutel closed 1 year ago

smutel commented 3 years ago

Hello,

When using this piece of code:

description := "Interface de test"
name := "default"
enabled := false
taggedvlans := []

newResource := &models.WritableVMInterface{
    Description:    description,
    Enabled:        enabled,
    Name:           &name,
    TaggedVlans:    taggedVlans,
    VirtualMachine: 8,
  }

resource := virtualization.NewVirtualizationInterfacesCreateParams().WithData(newResource)
resourceCreated, err := client.Virtualization.VirtualizationInterfacesCreate(resource, nil)

The JSON sent to Netbox is the following:

{"description":"Interface de test","name":"default","tagged_vlans":[],"virtual_machine":8}

We can see that the parameter enabled is not sent to Netbox.

Regards.

v0ctor commented 1 year ago

Closing in favor of #107.