This commit is contained in:
2024-11-12 13:41:38 +03:00
parent 040af43607
commit 36879efd58
517 changed files with 37877 additions and 1900 deletions

View File

@@ -154,6 +154,47 @@ func vnfInterfaceSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
"mtu": {
Type: schema.TypeInt,
Computed: true,
Description: "mtu",
},
"libvirt_settings": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"guid": {
Type: schema.TypeString,
Computed: true,
},
"txmode": {
Type: schema.TypeString,
Computed: true,
},
"ioeventfd": {
Type: schema.TypeString,
Computed: true,
},
"event_idx": {
Type: schema.TypeString,
Computed: true,
},
"queues": {
Type: schema.TypeInt,
Computed: true,
},
"rx_queue_size": {
Type: schema.TypeInt,
Computed: true,
},
"tx_queue_size": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
"name": {
Type: schema.TypeString,
Computed: true,
@@ -170,7 +211,7 @@ func vnfInterfaceSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
"node_id" : {
"node_id": {
Type: schema.TypeInt,
Computed: true,
},
@@ -178,6 +219,10 @@ func vnfInterfaceSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
"bus_number": {
Type: schema.TypeInt,
Computed: true,
},
"qos": {
Type: schema.TypeList,
Computed: true,

View File

@@ -83,6 +83,11 @@ func dataSourceVinsListSchemaMake() map[string]*schema.Schema {
Optional: true,
Description: "Filter by external IP address",
},
"vnf_dev_id": {
Type: schema.TypeInt,
Optional: true,
Description: "Filter by VNF Device id",
},
"include_deleted": {
Type: schema.TypeBool,
Optional: true,

View File

@@ -87,25 +87,28 @@ func flattenInterfaces(interfaces []vins.ItemVNFInterface) []map[string]interfac
res := make([]map[string]interface{}, 0, len(interfaces))
for _, vnfInterface := range interfaces {
temp := map[string]interface{}{
"conn_id": vnfInterface.ConnID,
"conn_type": vnfInterface.ConnType,
"def_gw": vnfInterface.DefGW,
"enabled": vnfInterface.Enabled,
"flipgroup_id": vnfInterface.FLIPGroupID,
"guid": vnfInterface.GUID,
"ip_address": vnfInterface.IPAddress,
"listen_ssh": vnfInterface.ListenSSH,
"mac": vnfInterface.MAC,
"name": vnfInterface.Name,
"net_id": vnfInterface.NetID,
"net_mask": vnfInterface.NetMask,
"net_type": vnfInterface.NetType,
"node_id": vnfInterface.NodeID,
"pci_slot": vnfInterface.PCISlot,
"qos": flattenQOS(vnfInterface.QOS),
"target": vnfInterface.Target,
"type": vnfInterface.Type,
"vnfs": vnfInterface.VNFs,
"conn_id": vnfInterface.ConnID,
"conn_type": vnfInterface.ConnType,
"def_gw": vnfInterface.DefGW,
"enabled": vnfInterface.Enabled,
"flipgroup_id": vnfInterface.FLIPGroupID,
"guid": vnfInterface.GUID,
"ip_address": vnfInterface.IPAddress,
"listen_ssh": vnfInterface.ListenSSH,
"mac": vnfInterface.MAC,
"mtu": vnfInterface.MTU,
"name": vnfInterface.Name,
"net_id": vnfInterface.NetID,
"net_mask": vnfInterface.NetMask,
"net_type": vnfInterface.NetType,
"node_id": vnfInterface.NodeID,
"pci_slot": vnfInterface.PCISlot,
"bus_number": vnfInterface.BusNumber,
"qos": flattenQOS(vnfInterface.QOS),
"target": vnfInterface.Target,
"type": vnfInterface.Type,
"vnfs": vnfInterface.VNFs,
"libvirt_settings": flattenLibvirtSettings(vnfInterface.LibvirtSettings),
}
res = append(res, temp)
}
@@ -113,6 +116,21 @@ func flattenInterfaces(interfaces []vins.ItemVNFInterface) []map[string]interfac
return res
}
func flattenLibvirtSettings(libvirtSettings vins.LibvirtSettings) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
temp := map[string]interface{}{
"guid": libvirtSettings.GUID,
"txmode": libvirtSettings.TXMode,
"ioeventfd": libvirtSettings.IOEventFD,
"event_idx": libvirtSettings.EventIDx,
"queues": libvirtSettings.Queues,
"rx_queue_size": libvirtSettings.RXQueueSize,
"tx_queue_size": libvirtSettings.TXQueueSize,
}
res = append(res, temp)
return res
}
func flattenVNFDev(vnfDev vins.RecordVNFDev) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
temp := map[string]interface{}{

View File

@@ -66,6 +66,10 @@ func utilityVinsListCheckPresence(ctx context.Context, d *schema.ResourceData, m
req.ExtIP = ext_ip.(string)
}
if VNFDevId, ok := d.GetOk("vnfdev_id"); ok {
req.VNFDevId = uint64(VNFDevId.(int))
}
if includeDeleted, ok := d.GetOk("include_deleted"); ok {
req.IncludeDeleted = includeDeleted.(bool)
}