go-netbox icon indicating copy to clipboard operation
go-netbox copied to clipboard

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

Open smutel opened this issue 5 years ago • 0 comments
trafficstars

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.

smutel avatar Oct 25 '20 20:10 smutel