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

error no value given for required property interface_count

Open yourh3ro opened this issue 1 year ago • 3 comments
trafficstars

I was just trying to make it work.

package main

import (
	"context"
	"log"

	"github.com/netbox-community/go-netbox/v4"
)

func main() {
	ctx := context.Background()
	c := netbox.NewAPIClientFor("https://netbox.demo.com", "88x7agsxxyxuhbx8iyg")

	res, _, err := c.VirtualizationAPI.VirtualizationVirtualMachinesList(ctx).Limit(1).Execute()

	if err != nil {
		log.Fatal(err)
	}

	log.Printf("%v", res.Results)
}

I get an error every time

2024/07/25 23:03:53 no value given for required property interface_count
exit status 1

I tried to follow the instructions and add

res, _, err := c.VirtualizationAPI.VirtualizationVirtualMachinesList(ctx).InterfaceCount([]int32{0}).Limit(1).Execute()

But I got the same error

yourh3ro avatar Jul 25 '24 20:07 yourh3ro

It seems that the latest release is completely broken 😞

lucian-tx avatar Oct 01 '24 11:10 lucian-tx

I don't know if it helps but I rollback to version v3.7.7-0 where has a similar code as v4.0.3-0 and it worked in my context.

https://github.com/netbox-community/go-netbox/tree/v3.7.7-0

edualb avatar Oct 09 '24 14:10 edualb

I think this the same problem from #177

vlaborie avatar Oct 25 '24 11:10 vlaborie

Fixed in #194

nutgood avatar Jan 24 '25 14:01 nutgood