NeutronBgpvpnTests.runTests(base);
NeutronL2GatewayTests.runTests(base);
NeutronL2GatewayConnectionTests.runTests(base);
+ NeutronQosPolicyTests.runTests(base);
// tests related to bugs
Neutron_Bug3812_Tests.runTests(base);
@XmlElement (name="mtu")
Integer mtu;
+ @XmlElement (name = "qos_policy_id")
+ String qosPolicyId;
+
/* This attribute lists the ports associated with an instance
* which is needed for determining if that instance can be deleted
*/
mtu = input;
}
+ public String getQosPolicyId() {
+ return qosPolicyId;
+ }
+
+ public void setQosPolicyId(String qosPolicyId) {
+ this.qosPolicyId = qosPolicyId;
+ }
+
/**
* This method copies selected fields from the object and returns them
* as a new object, suitable for marshaling.
if (s.equals("network_type")) {
ans.setProviderNetworkType(this.getProviderNetworkType());
}
+ if (s.equals("qos_policy_id")) {
+ ans.setQosPolicyId(this.getQosPolicyId());
+ }
+
}
return ans;
}
+ adminStateUp + ", shared=" + shared + ", tenantID=" + tenantID + ", routerExternal=" + routerExternal
+ ", providerNetworkType=" + providerNetworkType + ", providerPhysicalNetwork="
+ providerPhysicalNetwork + ", providerSegmentationID=" + providerSegmentationID + ", status=" + status
+ + ", qosPolicyId =" + qosPolicyId
+ ", segments = " + segments + "]";
}
}
@XmlElement (defaultValue = "true", name = "port_security_enabled")
Boolean portSecurityEnabled;
+ @XmlElement (name = "qos_policy_id")
+ String qosPolicyId;
+
public NeutronPort() {
}
}
return portSecurityEnabled;
}
+ public String getQosPolicyId() {
+ return qosPolicyId;
+ }
+
+ public void setQosPolicyId(String qosPolicyId) {
+ this.qosPolicyId = qosPolicyId;
+ }
+
public void setPortSecurityEnabled(Boolean newValue) {
portSecurityEnabled = newValue;
if ("port_security_enabled".equals(field)) {
ans.setPortSecurityEnabled(this.getPortSecurityEnabled());
}
+ if ("qos_policy_id".equals(field)) {
+ ans.setQosPolicyId(this.getQosPolicyId());
+ }
}
return ans;
}
+ ", bindingvifType=" + bindingvifType
+ ", vifDetails=" + vifDetails
+ ", extraDHCPOptions=" + extraDHCPOptions
- + ", portSecurityEnabled=" + portSecurityEnabled +"]";
+ + ", portSecurityEnabled=" + portSecurityEnabled
+ + ", qosPolicyId=" + qosPolicyId +"]";
}
}
--- /dev/null
+/*
+ * Copyright (c) 2016 Intel Corporation All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.neutron.spi;
+
+import org.junit.Assert;
+import org.junit.Test;
+import javax.xml.bind.JAXBException;
+
+public class NeutronNetworkQosJAXBTest {
+ private static final String NeutronNetworkQosEnabled_sourceJson="{ " +
+ "\"status\": \"ACTIVE\", " +
+ "\"subnets\": [ \"3b80198d-4f7b-4f77-9ef5-774d54e17126\" ], " +
+ "\"name\": \"net1\", " +
+ "\"admin_state_up\": true, " +
+ "\"tenant_id\": \"9bacb3c5d39d41a79512987f338cf177\", " +
+ "\"router:external\": false, " +
+ "\"provider:segmentation_id\": \"2\", " +
+ "\"provider:physical_network\": \"8bab8453-1bc9-45af-8c70-f83aa9b50453\", " +
+ "\"provider:network_type\": \"vlan\", " +
+ "\"shared\": false, " +
+ "\"qos_policy_id\": \"d6220bbb-35f3-48ab-8eae-69c60aef3546\", " +
+ "\"id\": \"4e8e5957-649f-477b-9e5b-f1f75b21c03c\" }";
+
+ @Test
+ public void test_NeutronNetworkQos_JAXB() throws JAXBException {
+ NeutronNetwork dummyObject = new NeutronNetwork();
+
+ NeutronNetwork testObject = (NeutronNetwork) JaxbTestHelper.jaxbUnmarshall(dummyObject,
+ NeutronNetworkQosEnabled_sourceJson);
+ Assert.assertEquals("NeutronNetwork JAXB Test 1: Testing id failed",
+ "4e8e5957-649f-477b-9e5b-f1f75b21c03c", testObject.getID());
+
+ Assert.assertEquals("NeutronNetwork JAXB Test 2: Testing tenant_id failed",
+ "9bacb3c5d39d41a79512987f338cf177", testObject.getTenantID());
+
+ Assert.assertEquals("NeutronNetwork JAXB Test 3: Testing physical network id failed",
+ "8bab8453-1bc9-45af-8c70-f83aa9b50453", testObject.getProviderPhysicalNetwork());
+
+ Assert.assertEquals("NeutronNetwork JAXB Test 4: Testing status failed",
+ "ACTIVE", testObject.getStatus());
+
+ Assert.assertEquals("NeutronNetwork JAXB Test 6: Testing name failed",
+ "net1", testObject.getNetworkName());
+
+ Assert.assertEquals("NeutronNetwork JAXB Test 7: Testing admin state up failed",
+ true, testObject.getAdminStateUp());
+
+ Assert.assertEquals("NeutronNetwork JAXB Test 8: Testing router external failed",
+ false, testObject.getRouterExternal());
+
+ Assert.assertEquals("NeutronNetwork JAXB Test 9: Testing provider segmentation id failed",
+ "2", testObject.getProviderSegmentationID());
+
+ Assert.assertEquals("NeutronNetwork JAXB Test 10: Testing provider network type id failed",
+ "vlan", testObject.getProviderNetworkType());
+
+ Assert.assertEquals("NeutronNetwork JAXB Test 11: Testing shared failed",
+ false, testObject.getShared());
+
+ Assert.assertEquals("NeutronNetwork JAXB Test 12: Testing qos_policy_id failed",
+ "d6220bbb-35f3-48ab-8eae-69c60aef3546", testObject.getQosPolicyId());
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Intel Corporation All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.neutron.spi;
+
+import org.junit.Assert;
+import org.junit.Test;
+import javax.xml.bind.JAXBException;
+import java.util.List;
+import java.util.Map;
+
+public class NeutronPortQosJAXBTest {
+
+ private static final String NeutronPortQosEnabled_sourceJson = "{ "
+ + "\"status\": \"ACTIVE\", "
+ + "\"name\": \"net1\", "
+ + "\"admin_state_up\": true, "
+ + "\"tenant_id\": \"9bacb3c5d39d41a79512987f338cf177\", "
+ + "\"fixed_ips\": [ { \"ip_address\":\"192.168.111.3\" , \"subnet_id\": \"22b44fc2-4ffb-4de4-b0f9-69d58b37ae27\" } ],"
+ + "\"binding:vif_details\": {\"port_filter\": \"true\" , \"ovs_hybrid_plug\": \"false\" }, "
+ + "\"extra_dhcp_opts\": [\"\"], " + "\"security_groups\": [\"\"], " + "\"allowed_address_pairs\": [\"\"], "
+ + "\"device_id\": \"257614cc-e178-4c92-9c61-3b28d40eca44\", " + "\"device_owner\": \"\", "
+ + "\"binding:host_id\": \"\", " + "\"binding:vif_type\": \"unbound\", "
+ + "\"binding:vnic_type\": \"normal\", " + "\"mac_address\": \"fa:16:3e:c9:cb:f0\", "
+ + "\"network_id\": \"e9330b1f-a2ef-4160-a991-169e56ab17f5\", "
+ + "\"qos_policy_id\": \"d6220bbb-35f3-48ab-8eae-69c60aef3546\", "
+ + "\"id\": \"4e8e5957-649f-477b-9e5b-f1f75b21c03c\" }";
+
+ @Test
+ public void test_PortQosEnabled_JAXB() throws JAXBException {
+ NeutronPort testObject = new NeutronPort();
+
+ NeutronPort neutronObject = (NeutronPort) JaxbTestHelper.jaxbUnmarshall(testObject, NeutronPortQosEnabled_sourceJson);
+ Assert.assertEquals("NeutronPort JAXB Test 1: Testing id failed", "4e8e5957-649f-477b-9e5b-f1f75b21c03c",
+ neutronObject.getID());
+
+ Assert.assertEquals("NeutronPort JAXB Test 2: Testing tenant_id failed",
+ "9bacb3c5d39d41a79512987f338cf177", neutronObject.getTenantID());
+
+ Assert.assertEquals("NeutronPort JAXB Test 3: Testing network_id failed",
+ "e9330b1f-a2ef-4160-a991-169e56ab17f5", neutronObject.getNetworkUUID());
+
+ Assert.assertEquals("NeutronPort JAXB Test 4: Testing status failed", "ACTIVE", neutronObject.getStatus());
+
+ List<Neutron_IPs> fixedIPs = neutronObject.getFixedIPs();
+ Assert.assertEquals(" NeutronPort JAXB Test 5.1: Testing fixed_ips list length failed", 1, fixedIPs.size());
+
+ Assert.assertEquals(" NeutronPort JAXB Test 5.2: Testing ip_address value failed", "192.168.111.3",
+ fixedIPs.get(0).ipAddress);
+
+ Assert.assertEquals(" NeutronPort JAXB Test 5.3: Testing subnet_id value failed",
+ "22b44fc2-4ffb-4de4-b0f9-69d58b37ae27", fixedIPs.get(0).subnetUUID);
+
+ List<NeutronPort_ExtraDHCPOption> extraDHCPOptions = neutronObject.getExtraDHCPOptions();
+
+ Assert.assertEquals("NeutronPort JAXB Test 6: Testing extra_dhcp_opts list length failed", 1,
+ extraDHCPOptions.size());
+
+ List<NeutronSecurityGroup> securityGroups = neutronObject.getSecurityGroups();
+ Assert.assertEquals("NeutronPort JAXB Test 7: Testing security_groups list length failed", 1,
+ securityGroups.size());
+
+ List<NeutronPort_AllowedAddressPairs> allowedAddressPairs = neutronObject.getAllowedAddressPairs();
+ Assert.assertEquals("NeutronPort JAXB Test 8: Testing allowed_address_pairs list length failed", 1,
+ allowedAddressPairs.size());
+
+ Map<String, String> vifDetails = neutronObject.getVIFDetails();
+ Assert.assertEquals("NeutronPort JAXB Test 9.1: Testing vif_details list length failed", 2,
+ vifDetails.size());
+
+ Assert.assertEquals("NeutronPort JAXB Test 9.2: Testing port_filter value failed", "true",
+ vifDetails.get("port_filter"));
+
+ Assert.assertEquals("NeutronPort JAXB Test 9.3: Testing ovs_hybrid_plug value failed", "false",
+ vifDetails.get("ovs_hybrid_plug"));
+
+ Assert.assertEquals("NeutronPort JAXB Test 10: Testing name failed", "net1", neutronObject.getName());
+
+ Assert.assertEquals("NeutronPort JAXB Test 11: Testing admin_state_up failed", true,
+ neutronObject.getAdminStateUp());
+
+ Assert.assertEquals("NeutronPort JAXB Test 12: Testing binding:vif_type failed", "unbound",
+ neutronObject.getBindingvifType());
+
+ Assert.assertEquals("NeutronPort JAXB Test 13: Testing binding:vnic_type failed", "normal",
+ neutronObject.getBindingvnicType());
+
+ Assert.assertEquals("NeutronPort JAXB Test 14: Testing mac_address failed", "fa:16:3e:c9:cb:f0",
+ neutronObject.getMacAddress());
+
+ Assert.assertEquals("NeutronPort JAXB Test 15: Testing device_id failed",
+ "257614cc-e178-4c92-9c61-3b28d40eca44", neutronObject.getDeviceID());
+
+ Assert.assertEquals("NeutronPort JAXB Test 16: Testing device_owner failed", "",
+ neutronObject.getDeviceOwner());
+
+ Assert.assertEquals("NeutronPort JAXB Test 17: Testing binding:host_id failed", "",
+ neutronObject.getBindinghostID());
+
+ Assert.assertEquals("NeutronPort JAXB Test 18: Testing qos_policy_id failed", "d6220bbb-35f3-48ab-8eae-69c60aef3546",
+ neutronObject.getQosPolicyId());
+ }
+}
@QueryParam("provider_network_type") String queryProviderNetworkType,
@QueryParam("provider_physical_network") String queryProviderPhysicalNetwork,
@QueryParam("provider_segmentation_id") String queryProviderSegmentationID,
+ @QueryParam("qos_policy_id") String queryQosPolicyId,
// linkTitle
@QueryParam("limit") Integer limit,
@QueryParam("marker") String marker,
(queryStatus == null || queryStatus.equals(oSN.getStatus())) &&
(bShared == null || bShared.booleanValue() == oSN.isShared()) &&
(bRouterExternal == null || bRouterExternal.booleanValue() == oSN.isRouterExternal()) &&
- (queryTenantID == null || queryTenantID.equals(oSN.getTenantID()))) {
+ (queryTenantID == null || queryTenantID.equals(oSN.getTenantID())) &&
+ (queryQosPolicyId == null || queryQosPolicyId.equals(oSN.getQosPolicyId()))) {
if (fields.size() > 0) {
ans.add(extractFields(oSN,fields));
} else {
classes.add(NeutronSFCPortPairsNorthbound.class);
classes.add(NeutronSFCPortPairGroupsNorthbound.class);
classes.add(NeutronSFCPortChainsNorthbound.class);
+ classes.add(NeutronQosPolicyNorthbound.class);
classes.add(MOXyJsonProvider.class);
return classes;
@QueryParam("device_owner") String queryDeviceOwner,
@QueryParam("tenant_id") String queryTenantID,
@QueryParam("port_security_enabled") Boolean queryPortSecurityEnabled,
+ @QueryParam("qos_policy_id") String queryQosPolicyId,
// linkTitle
@QueryParam("limit") Integer limit,
@QueryParam("marker") String marker,
(queryDeviceID == null || queryDeviceID.equals(oSS.getDeviceID())) &&
(queryDeviceOwner == null || queryDeviceOwner.equals(oSS.getDeviceOwner())) &&
(queryTenantID == null || queryTenantID.equals(oSS.getTenantID())) &&
- (queryPortSecurityEnabled == null || queryPortSecurityEnabled.equals(oSS.getPortSecurityEnabled()))) {
+ (queryPortSecurityEnabled == null || queryPortSecurityEnabled.equals(oSS.getPortSecurityEnabled())) &&
+ (queryQosPolicyId == null || queryQosPolicyId.equals(oSS.getQosPolicyId()))) {
if (fields.size() > 0) {
ans.add(extractFields(oSS,fields));
} else {
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.NetworkTypeVxlan;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.provider.ext.rev150712.NetworkProviderExtension;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.provider.ext.rev150712.NetworkProviderExtensionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.ext.rev160613.QosNetworkExtension;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.ext.rev160613.QosNetworkExtensionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
segments.add(neutronSegment);
}
}
+ final QosNetworkExtension qos = network.getAugmentation(QosNetworkExtension.class);
+ if(qos != null && qos.getQosPolicyId() != null) {
+ result.setQosPolicyId(qos.getQosPolicyId().getValue());
+ }
result.setSegments(segments);
return result;
}
if (network.getProviderSegmentationID() != null) {
providerExtensionBuilder.setSegmentationId(network.getProviderSegmentationID());
}
-
+ if (network.getQosPolicyId() != null) {
+ final QosNetworkExtensionBuilder qosExtensionBuilder = new QosNetworkExtensionBuilder();
+ qosExtensionBuilder.setQosPolicyId(toUuid(network.getQosPolicyId()));
+ networkBuilder.addAugmentation(QosNetworkExtension.class, qosExtensionBuilder.build());
+ }
networkBuilder.addAugmentation(NetworkL3Extension.class,
l3ExtensionBuilder.build());
networkBuilder.addAugmentation(NetworkProviderExtension.class,
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.PortBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.portsecurity.rev150712.PortSecurityExtension;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.portsecurity.rev150712.PortSecurityExtensionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.ext.rev160613.QosPortExtension;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.ext.rev160613.QosPortExtensionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.types.rev160517.IpPrefixOrAddress;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
}
}
+ private void qosExtension(Port port, NeutronPort result) {
+ final QosPortExtension qos = port.getAugmentation(QosPortExtension.class);
+ if(qos != null && qos.getQosPolicyId() != null) {
+ result.setQosPolicyId(qos.getQosPolicyId().getValue());
+ }
+ }
+
protected NeutronPort fromMd(Port port) {
final NeutronPort result = new NeutronPort();
result.setAdminStateUp(port.isAdminStateUp());
result.setID(port.getUuid().getValue());
addExtensions(port, result);
portSecurityExtension(port, result);
+ qosExtension(port, result);
return result;
}
} else {
LOGGER.warn("Attempting to write neutron port without UUID");
}
+ if (neutronPort.getQosPolicyId() != null) {
+ final QosPortExtensionBuilder qosExtensionBuilder = new QosPortExtensionBuilder();
+ qosExtensionBuilder.setQosPolicyId(toUuid(neutronPort.getQosPolicyId()));
+ portBuilder.addAugmentation(QosPortExtension.class, qosExtensionBuilder.build());
+ }
return portBuilder.build();
}
--- /dev/null
+/*
+ * Copyright (c) 2016 Intel Corporation and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.neutron.transcriber;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.neutron.spi.INeutronQosPolicyCRUD;
+import org.opendaylight.neutron.spi.NeutronQosBandwidthRule;
+import org.opendaylight.neutron.spi.NeutronQosDscpMarkingRule;
+import org.opendaylight.neutron.spi.NeutronQosPolicy;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.QosPolicies;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.QosPolicy;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.QosPolicyBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.qos.policy.BandwidthLimitRules;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.qos.policy.BandwidthLimitRulesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.qos.policy.DscpmarkingRules;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.qos.policy.DscpmarkingRulesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.util.ArrayList;
+import java.util.List;
+
+public class NeutronQosPolicyInterface extends AbstractNeutronInterface <QosPolicy, QosPolicies, NeutronQosPolicy>
+ implements INeutronQosPolicyCRUD {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(NeutronQosPolicyInterface.class);
+
+ NeutronQosPolicyInterface(DataBroker db) {
+ super(db);
+ }
+
+ @Override
+ protected List<QosPolicy> getDataObjectList(QosPolicies qosPolicies) {
+ return qosPolicies.getQosPolicy();
+ }
+
+ @Override
+ protected InstanceIdentifier<QosPolicy> createInstanceIdentifier(QosPolicy port) {
+ return InstanceIdentifier.create(Neutron.class).child(QosPolicies.class).child(QosPolicy.class, port.getKey());
+ }
+
+ @Override
+ protected InstanceIdentifier<QosPolicies> createInstanceIdentifier() {
+ return InstanceIdentifier.create(Neutron.class).child(QosPolicies.class);
+ }
+
+ @Override
+ protected QosPolicy toMd(NeutronQosPolicy qosPolicy) {
+ final QosPolicyBuilder qosPolicyBuilder = new QosPolicyBuilder();
+ if (qosPolicy.getID() != null) {
+ qosPolicyBuilder.setUuid(toUuid(qosPolicy.getID()));
+ } else {
+ LOGGER.warn("Attempting to write neutron Qos Policy without UUID");
+ }
+ if (qosPolicy.getTenantID() != null) {
+ qosPolicyBuilder.setTenantId(toUuid(qosPolicy.getTenantID()));
+ }
+ if (qosPolicy.getQosPolicyName() != null) {
+ qosPolicyBuilder.setName(qosPolicy.getQosPolicyName());
+ }
+ if (qosPolicy.getPolicyIsShared() != null) {
+ qosPolicyBuilder.setShared(qosPolicy.getPolicyIsShared());
+ }
+ if (qosPolicy.getBwLimitRules() != null) {
+ final List<BandwidthLimitRules> listBandwith = new ArrayList<>();
+ final BandwidthLimitRulesBuilder bandwidthLimitRulesBuilder =
+ new BandwidthLimitRulesBuilder();
+ for (final NeutronQosBandwidthRule bandWidthRule : qosPolicy.getBwLimitRules()) {
+ bandwidthLimitRulesBuilder.setUuid(toUuid(bandWidthRule.getID()));
+ bandwidthLimitRulesBuilder.setTenantId(toUuid(bandWidthRule.getTenantID()));
+ bandwidthLimitRulesBuilder.setMaxKbps(bandWidthRule.getMaxKbps());
+ bandwidthLimitRulesBuilder.setMaxBurstKbps(bandWidthRule.getMaxBurstKbps());
+ listBandwith.add(bandwidthLimitRulesBuilder.build());
+ }
+ qosPolicyBuilder.setBandwidthLimitRules(listBandwith);
+ }
+ if (qosPolicy.getDscpRules() != null) {
+ final List<DscpmarkingRules> listDscp = new ArrayList<>();
+ final DscpmarkingRulesBuilder dscpmarkingRulesBuilder = new DscpmarkingRulesBuilder();
+ for (final NeutronQosDscpMarkingRule dscpRule : qosPolicy.getDscpRules()) {
+ dscpmarkingRulesBuilder.setUuid(toUuid(dscpRule.getID()));
+ dscpmarkingRulesBuilder.setTenantId(toUuid(dscpRule.getTenantID()));
+ dscpmarkingRulesBuilder.setDscpMark(dscpRule.getDscpMark());
+ listDscp.add(dscpmarkingRulesBuilder.build());
+ }
+ qosPolicyBuilder.setDscpmarkingRules(listDscp);
+ }
+ return qosPolicyBuilder.build();
+ }
+
+ @Override
+ protected QosPolicy toMd(String uuid) {
+ final QosPolicyBuilder policyBuilder = new QosPolicyBuilder();
+ policyBuilder.setUuid(toUuid(uuid));
+ return policyBuilder.build();
+ }
+
+ @Override
+ protected NeutronQosPolicy fromMd(QosPolicy qosPolicy) {
+ final NeutronQosPolicy result = new NeutronQosPolicy();
+ if (qosPolicy.getUuid() != null) {
+ result.setID(qosPolicy.getUuid().getValue());
+ }
+ if (qosPolicy.getTenantId() != null) {
+ result.setTenantID(qosPolicy.getTenantId());
+ }
+ if (qosPolicy.getName() != null) {
+ result.setQosPolicyName(qosPolicy.getName());
+ }
+ if (qosPolicy.isShared() != null) {
+ result.setPolicyIsShared(qosPolicy.isShared());
+ }
+ if (qosPolicy.getBandwidthLimitRules() != null) {
+ final List<NeutronQosBandwidthRule> bandWidthRules = new ArrayList<>();
+ for (final BandwidthLimitRules rule : qosPolicy.getBandwidthLimitRules()) {
+ NeutronQosBandwidthRule opt = new NeutronQosBandwidthRule();
+ opt.setID(rule.getUuid().getValue());
+ opt.setTenantID(rule.getTenantId().getValue());
+ opt.setMaxKbps(rule.getMaxKbps());
+ opt.setMaxBurstKbps(rule.getMaxBurstKbps());
+ bandWidthRules.add(opt);
+ }
+ result.setQosBwLimitRules(bandWidthRules);
+ }
+ if (qosPolicy.getDscpmarkingRules() != null) {
+ final List<NeutronQosDscpMarkingRule> dscpRules = new ArrayList<>();
+ for (final DscpmarkingRules rule : qosPolicy.getDscpmarkingRules()) {
+ NeutronQosDscpMarkingRule opt = new NeutronQosDscpMarkingRule();
+ opt.setID(rule.getUuid().getValue());
+ opt.setTenantID(rule.getTenantId().getValue());
+ opt.setDscpMark(rule.getDscpMark());
+ dscpRules.add(opt);
+ }
+ result.setDscpRules(dscpRules);
+ }
+ return result;
+ }
+}
import org.opendaylight.neutron.spi.INeutronVPNIPSECPolicyCRUD;
import org.opendaylight.neutron.spi.INeutronVPNIPSECSiteConnectionsCRUD;
import org.opendaylight.neutron.spi.INeutronVPNServiceCRUD;
+import org.opendaylight.neutron.spi.INeutronQosPolicyCRUD;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.slf4j.Logger;
private NeutronSFCPortPairInterface sfcPortPairInterface;
private NeutronSFCPortPairGroupInterface sfcPortPairGroupInterface;
private NeutronSFCPortChainInterface sfcPortChainInterface;
+ private NeutronQosPolicyInterface qosPolicyInterface;
public NeutronTranscriberProvider(BundleContext context, DataBroker db) {
LOGGER.debug("DataBroker set to: {}", db);
sfcPortChainInterface = new NeutronSFCPortChainInterface(db);
registerCRUDInterface(INeutronSFCPortChainCRUD.class, sfcPortChainInterface);
+ qosPolicyInterface = new NeutronQosPolicyInterface(db);
+ registerCRUDInterface(INeutronQosPolicyCRUD.class, qosPolicyInterface);
+
// We don't need context any more
this.context = null;
}