netbox-community / go-netbox

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

Add option to find device by serial #7

Closed andrewrynhard closed 4 years ago

andrewrynhard commented 7 years ago

It would be nice to be able to find a device by its' serial.

mdlayher commented 7 years ago

Hello! Since NetBox is going to have API 2.0 in the near future, my plan was to more or less "freeze" the existing code and then focus effort in that area when it arrives.

In the mean time, would it help if I exported Client.newRequest and Client.do so you could perform the query you need outside this package?

andrewrynhard commented 7 years ago

@mdlayher That would be great. Do you know when 2.0 will be released?

mdlayher commented 7 years ago

I can do that. I don't have any info, but I suggest you check out the mailing list as they'll be the first ones to know.

mdlayher commented 7 years ago

Just merged #8 so you should be able to construct the query you need by making some type that implements netbox.Valuer and making a request with it. Hope this helps.

I'll keep this open in case it's relevant for API 2.0.

andrewrynhard commented 7 years ago

Great, appreciate it!