public Collection<DiskInterface> getDiskHotpluggableInterfaces(Integer osId, Version version) { Set<String> diskHotpluggableInterfaces = getDiskHotpluggableInterfacesMap().get(new Pair<>(osId, version)); if (diskHotpluggableInterfaces == null) { return Collections.emptySet(); } Collection<DiskInterface> diskInterfaces = new HashSet<>(); for (String diskHotpluggableInterface : diskHotpluggableInterfaces) { diskInterfaces.add(DiskInterface.valueOf(diskHotpluggableInterface)); } return diskInterfaces; }
public void getDiskInterfaceList( int osId, Version clusterVersion, ChipsetType chipset, AsyncQuery<List<DiskInterface>> asyncQuery) { asyncQuery.converterCallback = returnValue -> { ArrayList<String> interfaces = (ArrayList<String>) returnValue; List<DiskInterface> interfaceTypes = new ArrayList<>(); for (String diskIfs : interfaces) { try { interfaceTypes.add(DiskInterface.valueOf(diskIfs)); } catch (IllegalArgumentException e) { // ignore if we can't find the enum value. } } return interfaceTypes; }; Frontend.getInstance().runQuery(QueryType.OsRepository, new OsQueryParameters(OsRepositoryVerb.GetDiskInterfaces, osId, clusterVersion, chipset), asyncQuery); }
protected void initGeneralDiskAttributes(XmlNode node, Disk disk, DiskVmElement dve) { if (node.attributes.get("ovf:disk-interface") != null) { if (!StringUtils.isEmpty(node.attributes.get("ovf:disk-interface").getValue())) { dve.setDiskInterface(DiskInterface.valueOf(node.attributes.get("ovf:disk-interface") .getValue()));