From 7ae116c9dd771aa8e802542f11cf6fb681dfa464 Mon Sep 17 00:00:00 2001 From: Ewald van Geffen Date: Tue, 10 Sep 2024 11:12:57 +0200 Subject: [PATCH] data_source nb_interface additional field interface-type --- netbox/data_source_netbox_interfaces.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/netbox/data_source_netbox_interfaces.go b/netbox/data_source_netbox_interfaces.go index b2e0e6c0..683dfda5 100644 --- a/netbox/data_source_netbox_interfaces.go +++ b/netbox/data_source_netbox_interfaces.go @@ -135,6 +135,10 @@ func dataSourceNetboxInterfaces() *schema.Resource { Type: schema.TypeInt, Computed: true, }, + "type": { + Type: schema.TypeString, + Computed: true, + }, }, }, }, @@ -233,6 +237,10 @@ func dataSourceNetboxInterfaceRead(d *schema.ResourceData, m interface{}) error mapping["vm_id"] = v.VirtualMachine.ID + if v.Type != nil { + mapping["type"] = *v.Type.Value + } + s = append(s, mapping) }