public NewHostNetworkQosModel(Model sourceModel, StoragePool dataCenter) { super(new HostNetworkQos(), new SharedHostNetworkQosParametersModel(), sourceModel, dataCenter); }
private QosBase createNewQosEntityForQosType(QosType qosType) { switch (qosType) { case STORAGE: return new StorageQos(); case CPU: return new CpuQos(); case NETWORK: return new NetworkQoS(); case HOSTNETWORK: return new HostNetworkQos(); default: throw new IllegalArgumentException("Unsupported QoS type \"" + qosType + "\""); } }
private static QosBase createNewQosEntityForQosType(QosType qosType) { switch (qosType) { case STORAGE: return new StorageQos(); case CPU: return new CpuQos(); case NETWORK: return new NetworkQoS(); case HOSTNETWORK: return new HostNetworkQos(); default: throw new IllegalArgumentException("Unsupported QoS type"); } }
@Override public HostNetworkQos createQosEntity(ResultSet rs) throws SQLException { HostNetworkQos entity = new HostNetworkQos(); entity.setOutAverageLinkshare(getInteger(rs, OUT_AVERAGE_LINKSHARE)); entity.setOutAverageUpperlimit(getInteger(rs, OUT_AVERAGE_UPPERLIMIT)); entity.setOutAverageRealtime(getInteger(rs, OUT_AVERAGE_REALTIME)); return entity; } }
public static HostNetworkQos fromAnonymousHostNetworkQos(AnonymousHostNetworkQos hostNetworkQos) { if (hostNetworkQos == null) { return null; } HostNetworkQos result = new HostNetworkQos(); result.setId(hostNetworkQos.getId()); result.hostNetworkQosProperties = new HostNetworkQosProperties(hostNetworkQos.getHostNetworkQosProperties()); return result; }
public static HostNetworkQos createEmptyHostNetworkQos() { HostNetworkQos qos = new HostNetworkQos(); qos.setName(ConstantsManager.getInstance().getConstants().unlimitedQoSTitle()); qos.setId(Guid.Empty); return qos; }
@Override public void init(HostNetworkQos qos) { if (qos == null) { qos = new HostNetworkQos(); } getOutAverageLinkshare().setEntity(render(qos.getOutAverageLinkshare())); getOutAverageUpperlimit().setEntity(render(qos.getOutAverageUpperlimit())); getOutAverageRealtime().setEntity(render(qos.getOutAverageRealtime())); }
@Override protected HostNetworkQos generateNewEntity() { HostNetworkQos newQos = new HostNetworkQos(); newQos.setId(new Guid("de956031-6be2-43d6-bb90-5191c9253321")); newQos.setName("host_network_qos_d"); newQos.setStoragePoolId(FixturesTool.STORAGE_POOL_NO_DOMAINS); newQos.setOutAverageLinkshare(1000); newQos.setOutAverageUpperlimit(2000); newQos.setOutAverageRealtime(500); return newQos; }
HostNetworkQos overriddenQos = new HostNetworkQos(); networkAttachmentModel.getQosModel().flush(overriddenQos); AnonymousHostNetworkQos hostNetworkQos = fromHostNetworkQos(overriddenQos);
@BeforeEach public void setUp() { sampleDnsResolverConfiguration = new DnsResolverConfiguration(); sampleDnsResolverConfiguration.setNameServers(Arrays.asList( new NameServer("192.168.1.1"), new NameServer("2001:0db8:85a3:0000:0000:8a2e:0370:7334"))); sampleDnsResolverConfiguration2 = new DnsResolverConfiguration(); sampleDnsResolverConfiguration2.setNameServers(Arrays.asList( new NameServer("192.168.1.2"), new NameServer("2002:0db8:85a3:0000:0000:8a2e:0370:7334"))); sampleDnsResolverConfigurationWithReversedNameServers = reverseNameServersOrder(sampleDnsResolverConfiguration); ifaceQos = new HostNetworkQos(); networkQos = new HostNetworkQos(); iface = new VdsNetworkInterface(); //needed because network is vm network by default iface.setBridged(true); iface.setQos(ifaceQos); iface.setReportedSwitchType(SwitchType.LEGACY); iface.setIpv4DefaultRoute(false); iface.setMtu(getDefaultHostMtu()); network = new Network(); network.setDnsResolverConfiguration(sampleDnsResolverConfiguration); testedNetworkAttachment = new NetworkAttachment(); testedNetworkAttachment.setIpConfiguration(new IpConfiguration()); cluster = new Cluster(); cluster.setCompatibilityVersion(Version.v4_2); cluster.setRequiredSwitchTypeForCluster(SwitchType.LEGACY); }
@BeforeEach @Override public void setUp() throws Exception { super.setUp(); existingVdsInterface = dao.get(FixturesTool.VDS_NETWORK_INTERFACE); newQos = new HostNetworkQos(); newQos.setOutAverageLinkshare(30); newQos.setOutAverageUpperlimit(30); newQos.setOutAverageRealtime(30); newVdsInterface = new VdsNetworkInterface(); newVdsInterface.setStatistics(new VdsNetworkStatistics()); newVdsInterface.setId(Guid.newGuid()); newVdsInterface.setName("eth77"); newVdsInterface.setNetworkName("enginet"); newVdsInterface.setSpeed(1000); newVdsInterface.setType(3); newVdsInterface.setMacAddress("01:C0:81:21:71:17"); newVdsInterface.setIpv4BootProtocol(Ipv4BootProtocol.STATIC_IP); newVdsInterface.setIpv4Address("192.168.122.177"); newVdsInterface.setIpv4Subnet("255.255.255.0"); newVdsInterface.setIpv4Gateway("192.168.122.1"); newVdsInterface.setIpv6BootProtocol(Ipv6BootProtocol.AUTOCONF); newVdsInterface.setIpv6Address("ipv6 address"); newVdsInterface.setIpv6Prefix(666); newVdsInterface.setIpv6Gateway("ipv6 gateway"); newVdsInterface.setMtu(1500); newVdsInterface.setQos(newQos); newVdsStatistics = newVdsInterface.getStatistics(); }