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

@@ -47,8 +47,9 @@ func flattenDisks(disks []compute.InfoDisk) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
for _, disk := range disks {
temp := map[string]interface{}{
"disk_id": disk.ID,
"pci_slot": disk.PCISlot,
"bus_number": disk.BusNumber,
"disk_id": disk.ID,
"pci_slot": disk.PCISlot,
}
res = append(res, temp)
}
@@ -69,30 +70,49 @@ func flattenInterfaces(interfaces compute.ListInterfaces) []map[string]interface
res := make([]map[string]interface{}, 0, len(interfaces))
for _, interfaceItem := range interfaces {
temp := map[string]interface{}{
"conn_id": interfaceItem.ConnID,
"conn_type": interfaceItem.ConnType,
"def_gw": interfaceItem.DefGW,
"enabled": interfaceItem.Enabled,
"flip_group_id": interfaceItem.FLIPGroupID,
"guid": interfaceItem.GUID,
"ip_address": interfaceItem.IPAddress,
"listen_ssh": interfaceItem.ListenSSH,
"mac": interfaceItem.MAC,
"name": interfaceItem.Name,
"net_id": interfaceItem.NetID,
"netmask": interfaceItem.NetMask,
"net_type": interfaceItem.NetType,
"node_id": interfaceItem.NodeID,
"pci_slot": interfaceItem.PCISlot,
"qos": flattenQOS(interfaceItem.QOS),
"target": interfaceItem.Target,
"type": interfaceItem.Type,
"vnfs": interfaceItem.VNFs,
"bus_number": interfaceItem.BusNumber,
"conn_id": interfaceItem.ConnID,
"conn_type": interfaceItem.ConnType,
"def_gw": interfaceItem.DefGW,
"enabled": interfaceItem.Enabled,
"flip_group_id": interfaceItem.FLIPGroupID,
"guid": interfaceItem.GUID,
"ip_address": interfaceItem.IPAddress,
"listen_ssh": interfaceItem.ListenSSH,
"mac": interfaceItem.MAC,
"mtu": interfaceItem.MTU,
"name": interfaceItem.Name,
"net_id": interfaceItem.NetID,
"netmask": interfaceItem.NetMask,
"net_type": interfaceItem.NetType,
"node_id": interfaceItem.NodeID,
"pci_slot": interfaceItem.PCISlot,
"qos": flattenQOS(interfaceItem.QOS),
"target": interfaceItem.Target,
"type": interfaceItem.Type,
"vnfs": interfaceItem.VNFs,
"libvirt_settings": flattenLibvirtSettings(interfaceItem.LibvirtSettings),
}
res = append(res, temp)
}
return res
}
func flattenLibvirtSettings(libvirtSettings compute.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 flattenSnapSets(snapSets compute.ListSnapSets) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len(snapSets))
for _, snapSet := range snapSets {
@@ -165,6 +185,7 @@ func flattenComputeList(computes *compute.ListComputes) []map[string]interface{}
"arch": compute.Architecture,
"boot_order": compute.BootOrder,
"bootdisk_size": compute.BootDiskSize,
"chipset": compute.Chipset,
"cd_image_id": compute.CdImageId,
"clone_reference": compute.CloneReference,
"clones": compute.Clones,
@@ -348,6 +369,7 @@ func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute, pc
d.Set("cd_image_id", computeRec.CdImageId)
d.Set("sep_id", bootDisk.SepID)
d.Set("pool", bootDisk.Pool)
d.Set("chipset", computeRec.Chipset)
d.Set("clone_reference", computeRec.CloneReference)
d.Set("clones", computeRec.Clones)
d.Set("computeci_id", computeRec.ComputeCIID)
@@ -503,6 +525,7 @@ func flattenListComputeDisks(disks compute.ListComputeDisks) []map[string]interf
"acl": string(acl),
"account_id": disk.AccountID,
"boot_partition": disk.BootPartition,
"bus_number": disk.BusNumber,
"created_time": disk.CreatedTime,
"deleted_time": disk.DeletedTime,
"description": disk.Description,
@@ -590,6 +613,7 @@ func flattenDataCompute(d *schema.ResourceData, computeRec compute.RecordCompute
d.Set("affinity_weight", computeRec.AffinityWeight)
d.Set("anti_affinity_rules", flattenListRules(computeRec.AntiAffinityRules))
d.Set("arch", computeRec.Architecture)
d.Set("chipset", computeRec.Chipset)
d.Set("boot_order", computeRec.BootOrder)
d.Set("bootdisk_size", computeRec.BootDiskSize)
d.Set("cd_image_id", computeRec.CdImageId)