use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.acl.ports.lookup.acl.ports.by.ip.acl.ip.prefixes.PortIds in project netvirt by opendaylight.
the class QosNeutronUtils method handleNeutronNetworkQosUpdate.
public void handleNeutronNetworkQosUpdate(Network network, Uuid qosUuid) {
LOG.trace("Handling Network QoS update: net: {} qosservice: {}", network.getUuid(), qosUuid);
QosPolicy qosPolicy = qosPolicyMap.get(qosUuid);
if (qosPolicy == null || (qosPolicy.getBandwidthLimitRules() == null || qosPolicy.getBandwidthLimitRules().isEmpty()) && (qosPolicy.getDscpmarkingRules() == null || qosPolicy.getDscpmarkingRules().isEmpty())) {
return;
}
List<Uuid> subnetIds = getSubnetIdsFromNetworkId(network.getUuid());
for (Uuid subnetId : subnetIds) {
List<Uuid> portIds = getPortIdsFromSubnetId(subnetId);
for (Uuid portId : portIds) {
Port port = neutronVpnManager.getNeutronPort(portId);
if (port != null && (port.getAugmentation(QosPortExtension.class) == null || port.getAugmentation(QosPortExtension.class).getQosPolicyId() == null)) {
jobCoordinator.enqueueJob("QosPort-" + portId.getValue(), () -> {
WriteTransaction wrtConfigTxn = dataBroker.newWriteOnlyTransaction();
List<ListenableFuture<Void>> futures = new ArrayList<>();
if (qosPolicy.getBandwidthLimitRules() != null && !qosPolicy.getBandwidthLimitRules().isEmpty()) {
setPortBandwidthLimits(port, qosPolicy.getBandwidthLimitRules().get(0), wrtConfigTxn);
}
if (qosPolicy.getDscpmarkingRules() != null && !qosPolicy.getDscpmarkingRules().isEmpty()) {
setPortDscpMarking(port, qosPolicy.getDscpmarkingRules().get(0));
}
futures.add(wrtConfigTxn.submit());
return futures;
});
}
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.acl.ports.lookup.acl.ports.by.ip.acl.ip.prefixes.PortIds in project netvirt by opendaylight.
the class QosNeutronUtils method handleNeutronNetworkQosBwRuleRemove.
public void handleNeutronNetworkQosBwRuleRemove(Network network, BandwidthLimitRules zeroBwLimitRule) {
LOG.trace("Handling Qos Bandwidth Rule Remove, net: {}", network.getUuid());
List<Uuid> subnetIds = getSubnetIdsFromNetworkId(network.getUuid());
for (Uuid subnetId : subnetIds) {
List<Uuid> portIds = getPortIdsFromSubnetId(subnetId);
for (Uuid portId : portIds) {
Port port = neutronVpnManager.getNeutronPort(portId);
if (port != null && (port.getAugmentation(QosPortExtension.class) == null || port.getAugmentation(QosPortExtension.class).getQosPolicyId() == null)) {
jobCoordinator.enqueueJob("QosPort-" + portId.getValue(), () -> {
WriteTransaction wrtConfigTxn = dataBroker.newWriteOnlyTransaction();
List<ListenableFuture<Void>> futures = new ArrayList<>();
setPortBandwidthLimits(port, zeroBwLimitRule, wrtConfigTxn);
futures.add(wrtConfigTxn.submit());
return futures;
});
}
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.acl.ports.lookup.acl.ports.by.ip.acl.ip.prefixes.PortIds in project netvirt by opendaylight.
the class QosNeutronUtils method handleNeutronNetworkQosRemove.
public void handleNeutronNetworkQosRemove(Network network, Uuid qosUuid) {
LOG.trace("Handling Network QoS removal: net: {} qosservice: {}", network.getUuid(), qosUuid);
QosPolicy qosPolicy = qosPolicyMap.get(qosUuid);
List<Uuid> subnetIds = getSubnetIdsFromNetworkId(network.getUuid());
for (Uuid subnetId : subnetIds) {
List<Uuid> portIds = getPortIdsFromSubnetId(subnetId);
for (Uuid portId : portIds) {
Port port = neutronVpnManager.getNeutronPort(portId);
if (port != null && (port.getAugmentation(QosPortExtension.class) == null || port.getAugmentation(QosPortExtension.class).getQosPolicyId() == null)) {
jobCoordinator.enqueueJob("QosPort-" + portId.getValue(), () -> {
WriteTransaction wrtConfigTxn = dataBroker.newWriteOnlyTransaction();
List<ListenableFuture<Void>> futures = new ArrayList<>();
if (qosPolicy != null && qosPolicy.getBandwidthLimitRules() != null && !qosPolicy.getBandwidthLimitRules().isEmpty()) {
BandwidthLimitRulesBuilder bwLimitBuilder = new BandwidthLimitRulesBuilder();
setPortBandwidthLimits(port, bwLimitBuilder.setMaxBurstKbps(BigInteger.ZERO).setMaxKbps(BigInteger.ZERO).build(), null);
}
if (qosPolicy != null && qosPolicy.getDscpmarkingRules() != null && !qosPolicy.getDscpmarkingRules().isEmpty()) {
unsetPortDscpMark(port);
}
futures.add(wrtConfigTxn.submit());
return futures;
});
}
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.acl.ports.lookup.acl.ports.by.ip.acl.ip.prefixes.PortIds in project netvirt by opendaylight.
the class QosAlertManager method addToQosAlertCache.
public void addToQosAlertCache(Network network) {
LOG.trace("Adding network {} in cache", network.getUuid());
List<Uuid> subnetIds = qosNeutronUtils.getSubnetIdsFromNetworkId(network.getUuid());
for (Uuid subnetId : subnetIds) {
List<Uuid> portIds = qosNeutronUtils.getPortIdsFromSubnetId(subnetId);
for (Uuid portId : portIds) {
Port port = neutronVpnManager.getNeutronPort(portId);
if (port != null && !qosNeutronUtils.portHasQosPolicy(port)) {
LOG.trace("Adding network {} port {} in cache", network.getUuid(), port.getUuid());
addToQosAlertCache(port);
}
}
}
}
Aggregations