Bug 7757 -Removing qos deprecations in carbon 51/50151/13
authorPraveen Mala <praveen.mala@intel.com>
Mon, 9 Jan 2017 23:56:31 +0000 (18:56 -0500)
committerAnil Vishnoi <vishnoianil@gmail.com>
Thu, 4 May 2017 05:28:21 +0000 (05:28 +0000)
remove leaf qos,leaf queue-uuid from the model and then the relevant code in the ovsdb plugin along with postman collection

Change-Id: I2003b0e9f7e7d17d1b28b19da0a2bf31cadd637a
Signed-off-by: Praveen Mala <praveen.mala@intel.com>
resources/commons/Qos-and-Queue-Collection.json.postman_collection
southbound/southbound-api/src/main/yang/ovsdb.yang
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/QosUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbQosUpdateCommand.java
southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java

index 4f420c69a3ea50c058e47fb1e0beff13f4c6e676..fc130b4eeda31818ded006c95352c1130c2a260a 100644 (file)
@@ -42,7 +42,7 @@
             "currentHelper": "normal",
             "helperAttributes": {},
             "time": 1454572576470,
-            "name": "Add a QpS entry to a qos-entries list",
+            "name": "Add a QoS entry to a qos-entries list",
             "description": "This restconf request will create or update a Qos entry for the ovsdb node 'HOST1'.",
             "collectionId": "b96ed27e-7aee-47e1-daa6-e3dbe3f176af",
             "responses": [],
             "responses": [],
             "rawModeData": "\r\n        {\r\n            \"node\": [\r\n                {\r\n                    \"node-id\": \"ovsdb:HOST1\",\r\n                    \"connection-info\": {\r\n                        \"ovsdb:remote-ip\": \"{{HYPERVISOR-IP}}\",\r\n                        \"ovsdb:remote-port\": \"{{HYPERVISOR-OVSDB-PORT}}\"\r\n                    }\r\n                }\r\n            ]\r\n        }\r\n"
         },
-        {
-            "id": "4298de9f-d2e0-a7c0-da4b-71ce9ecc7260",
-            "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\nAccept: application/json\n",
-            "url": "http://{{CONTROLLER-IP}}:8181/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:HOST1%2Fbridge%2Fbr-test/termination-point/testport/",
-            "preRequestScript": "",
-            "pathVariables": {},
-            "method": "PUT",
-            "data": [],
-            "dataMode": "raw",
-            "version": 2,
-            "tests": "",
-            "currentHelper": "normal",
-            "helperAttributes": {},
-            "time": 1454572769501,
-            "name": "Add existing QoS UUID to existing termination point (deprecated)",
-            "description": "This restconf request will specify the UUID of a Qos entry to associate with a port.\n\nThe Qos UUID is the actual operational value of a Qos entry.\n\nNote: The QoS model also has a QoS ID.  The preferred method for associating a QoS entry to a termination point is to use the QoS ID.",
-            "collectionId": "b96ed27e-7aee-47e1-daa6-e3dbe3f176af",
-            "responses": [],
-            "rawModeData": "{\n  \"network-topology:termination-point\": [\n    \t{\n \t  \t\t\"ovsdb:name\": \"testport\",\n \t\t\t\"tp-id\": \"testport\",\n \t\t\t\"qos\": \"4126e461-020d-497d-97b7-c8f409d1c9b9\"\n  \t\t}\n    ]\n}"
-        },
         {
             "id": "479d3281-ac30-3b30-d727-80b0b8505140",
             "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
             "helperAttributes": {},
             "rawModeData": "{\n    \"network-topology:termination-point\": [\n    \t{\n\t  \t\t\"ovsdb:name\": \"testport\",\n  \t\t\t\"tp-id\": \"testport\",\n            \"ovsdb:ingress-policing-rate\": 1000,\n            \"ovsdb:ingress-policing-burst\": 2000\n\t\t}\n    ]\n}"
         },
-        {
-            "id": "8ff38d91-00ee-e7c6-ef1a-e3d236f59641",
-            "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\nAccept: application/json\n",
-            "url": "http://{{CONTROLLER-IP}}:8181/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:HOST1%2Fbridge%2Fbr-test/termination-point/testport/",
-            "preRequestScript": "",
-            "pathVariables": {},
-            "method": "PUT",
-            "data": [],
-            "dataMode": "raw",
-            "version": 2,
-            "tests": "",
-            "currentHelper": "normal",
-            "helperAttributes": {},
-            "time": 1454572787173,
-            "name": "Delete a QoS UUID from a termination point (deprecated)",
-            "description": "This restconf request will delete a Qos entry from a port (termination point).\n\nNote - this is done by doing a PUT operation on the termination port with the Qos\nentry cleared.\n\nNote - The model now provides a QoS entry list (max number of one entry) as part of the termination point model.  This allows perfroaming a DELETE operation on the list entry instead of doing a PUT on the termination point.",
-            "collectionId": "b96ed27e-7aee-47e1-daa6-e3dbe3f176af",
-            "responses": [],
-            "rawModeData": "{\n  \"network-topology:termination-point\": [\n    \t{\n \t  \t\t\"ovsdb:name\": \"testport\",\n \t\t\t\"tp-id\": \"testport\"\n  \t\t}\n    ]\n}"
-        },
         {
             "id": "9aa6926b-70db-1d22-dc30-db269e424bec",
             "headers": "Authorization: Basic YWRtaW46YWRtaW4=\n",
index a66129a540cd9aaa9ad05681c6d872352869f7a6..0cfd6ff885c9d5166e84aa428fab63aeea18a24b 100755 (executable)
@@ -551,11 +551,6 @@ module ovsdb {
                     type ovsdb-queue-ref;
                 }
 
-                leaf queue-uuid {
-                    description "The unique identifier of the queue record.";
-                    type yang:uuid;
-                    status deprecated;
-                }
             }
             list qos-external-ids {
                 key "qos-external-id-key";
@@ -1303,12 +1298,6 @@ module ovsdb {
             }
         }
 
-        leaf qos {
-            description "The unique identifier of the QoS entry for this port.";
-            status deprecated;
-            type yang:uuid;
-        }
-
         list qos-entry {
             key "qos-key";
             max-elements 1;
index effb4e06b279a7e67b5fa8bc6adc1a51660bf5ec..cea65595dd48d6f32fb599f4b5d8282a9910b77b 100644 (file)
@@ -85,8 +85,6 @@ public class QosUpdateCommand implements TransactCommand {
                     if (queue.getQueueRef() != null) {
                         newQueueList.put(queue.getQueueNumber(),
                                 new UUID(getQueueUuid(queue.getQueueRef(), operNode)));
-                    } else if (queue.getQueueUuid() != null) {
-                        newQueueList.put(queue.getQueueNumber(), new UUID(queue.getQueueUuid().getValue()));
                     }
                 }
             }
index 7ffc21f258a99268622b8dd9b33d20d18e9d67da..b027cb1ab7482f175310cb16857658f7908e86f5 100644 (file)
@@ -37,7 +37,6 @@ import org.opendaylight.ovsdb.southbound.SouthboundConstants;
 import org.opendaylight.ovsdb.southbound.SouthboundProvider;
 import org.opendaylight.ovsdb.utils.yang.YangUtils;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbPortInterfaceAttributes.VlanMode;
@@ -187,13 +186,6 @@ public class TerminationPointUpdateCommand implements TransactCommand {
                 uuidSet.add(new UUID(SouthboundConstants.QOS_NAMED_UUID_PREFIX
                         + TransactUtils.bytesToHexString(qosId.getValue().getBytes())));
             }
-        } else {
-            // Second check if Qos is present and use that (deprecated)
-            // Do not bother to check if QosEntry and Qos are consistent if both are present
-            Uuid qosUuid = terminationPoint.getQos();
-            if (qosUuid != null) {
-                uuidSet.add(new UUID(qosUuid.getValue()));
-            }
         }
         port.setQos(uuidSet);
     }
index 6510b2d3880cbcdbf796097ea3b1580bd09bef1a..6cf93acb825ee09b1daa55b3986704fb8c6b1037 100644 (file)
@@ -351,7 +351,6 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand {
         Collection<UUID> qosUuidCol = port.getValue().getQosColumn().getData();
         if (!qosUuidCol.isEmpty()) {
             UUID qosUuid = qosUuidCol.iterator().next();
-            ovsdbTerminationPointBuilder.setQos(new Uuid(qosUuid.toString()));
 
             NodeId nodeId = node.getNodeId();
             OvsdbNodeAugmentation ovsdbNode = node.getAugmentation(OvsdbNodeAugmentation.class);
@@ -368,7 +367,6 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand {
                                 .augmentation(OvsdbTerminationPointAugmentation.class)
                                 .child(QosEntry.class,
                                       new QosEntryKey(new Long(SouthboundConstants.PORT_QOS_LIST_KEY)));
-//                                    new QosEntryKey(new OvsdbQosRef(oldQosIid)));
                             transaction.delete(LogicalDatastoreType.OPERATIONAL, oldPortQosIid);
                         }
                     }
index 916874f59af6f0a2e7e9130051d67e132a03c217..f14c11e9085bcb2c4d2a22c687b7e9f94b231986 100644 (file)
@@ -323,9 +323,9 @@ public class OvsdbQosUpdateCommand extends AbstractTransactionCommand {
                 newQueueList.add(
                     new QueueListBuilder()
                     .setQueueNumber(queueEntry.getKey())
-                    .setQueueRef(new OvsdbQueueRef(queueIid))
-                    .setQueueUuid(new Uuid(queueEntry.getValue().toString())).build());
+                    .setQueueRef(new OvsdbQueueRef(queueIid)).build());
             }
+
         }
         qosEntryBuilder.setQueueList(newQueueList);
     }
index 08e276a902b42209a6744f72fe2c2fd2693330bc..a182c7b78c69a2fdd8ee5913df785baabcaaca7f 100644 (file)
@@ -48,6 +48,7 @@ import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
 import org.opendaylight.ovsdb.lib.notation.Version;
+import org.opendaylight.ovsdb.schema.openvswitch.Queue;
 import org.opendaylight.ovsdb.southbound.SouthboundConstants;
 import org.opendaylight.ovsdb.southbound.SouthboundMapper;
 import org.opendaylight.ovsdb.southbound.SouthboundUtil;
@@ -67,6 +68,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.re
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbFailModeBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeRef;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbQueueRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbPortInterfaceAttributes.VlanMode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentationBuilder;
@@ -186,6 +188,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
     private static final NotifyingDataChangeListener OPERATIONAL_LISTENER =
             new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL);
 
+
     private static class NotifyingDataChangeListener implements DataChangeListener {
         private final LogicalDatastoreType type;
         private final Set<InstanceIdentifier<?>> createdIids = new HashSet<>();
@@ -1131,6 +1134,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
     private static class TestQueue implements AutoCloseable {
         private final ConnectionInfo connectionInfo;
         private final Uri queueId;
+        private final InstanceIdentifier<Queues> qIid;
 
         /**
          * Creates a test queue entry which can be automatically removed when no longer necessary.
@@ -1155,7 +1159,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                 .setQueuesExternalIds(externalIds)
                 .setQueuesOtherConfig(otherConfigs)
                 .build();
-            InstanceIdentifier<Queues> qIid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
+            qIid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
                     .augmentation(OvsdbNodeAugmentation.class)
                     .child(Queues.class, queue.getKey());
             final NotifyingDataChangeListener queueOperationalListener =
@@ -1173,6 +1177,9 @@ public class SouthboundIT extends AbstractMdsalTestBase {
             }
         }
 
+        public InstanceIdentifier<Queues> getInstanceIdentifier() {
+            return qIid;
+        }
         @Override
         public void close() {
             InstanceIdentifier<Queues> qIid = SouthboundUtils.createInstanceIdentifier(connectionInfo)
@@ -1956,17 +1963,14 @@ public class SouthboundIT extends AbstractMdsalTestBase {
                     createGenericOvsdbTerminationPointAugmentationBuilder();
             String portName = "testTerminationPointQos";
             ovsdbTerminationBuilder.setName(portName);
-            ovsdbTerminationBuilder.setQos(qosUuid);
             Assert.assertTrue(addTerminationPoint(nodeId, portName, ovsdbTerminationBuilder));
 
-            // READ and check that qos uuid has been added to the port
+
+           // READ and check that qos uuid has been added to the port
             InstanceIdentifier<TerminationPoint> tpEntryIid = getTpIid(connectionInfo, bridge)
                     .child(TerminationPoint.class, new TerminationPointKey(new TpId(portName)));
             TerminationPoint terminationPoint = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, tpEntryIid);
             Assert.assertNotNull(terminationPoint);
-            OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
-                    terminationPoint.getAugmentation(OvsdbTerminationPointAugmentation.class);
-            Assert.assertEquals(ovsdbTerminationPointAugmentation.getQos(), qosUuid);
 
             // UPDATE - remove the qos entry from the port
             OvsdbTerminationPointAugmentationBuilder tpUpdateAugmentationBuilder =
@@ -1986,9 +1990,6 @@ public class SouthboundIT extends AbstractMdsalTestBase {
             // READ and verify that qos uuid has been removed from port
             TerminationPoint terminationPointUpdate = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, tpEntryIid);
             Assert.assertNotNull(terminationPointUpdate);
-            OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentationUpdate =
-                    terminationPointUpdate.getAugmentation(OvsdbTerminationPointAugmentation.class);
-            Assert.assertNull(ovsdbTerminationPointAugmentationUpdate.getQos());
 
             // DELETE handled by TestBridge
         }
@@ -2491,18 +2492,23 @@ public class SouthboundIT extends AbstractMdsalTestBase {
             // configuration of the Qos row.
             OvsdbNodeAugmentation ovsdbNodeAugmentation = getOvsdbNode(connectionInfo,
                     LogicalDatastoreType.OPERATIONAL);
+
             Queues operQueue1 = getQueue(new Uri("queue1"), ovsdbNodeAugmentation);
+
             Assert.assertNotNull(operQueue1);
-            Uuid queue1Uuid = new Uuid(operQueue1.getQueueUuid().getValue());
+
+            InstanceIdentifier<Queues> queue1Iid = testQueue1.getInstanceIdentifier();
+            OvsdbQueueRef queue1Ref = new OvsdbQueueRef(queue1Iid);
+
             Queues operQueue2 = getQueue(new Uri("queue2"), ovsdbNodeAugmentation);
             Assert.assertNotNull(operQueue2);
-            Uuid queue2Uuid = new Uuid(operQueue2.getQueueUuid().getValue());
+            InstanceIdentifier<Queues> queue2Iid = testQueue2.getInstanceIdentifier();
+            OvsdbQueueRef queue2Ref = new OvsdbQueueRef(queue2Iid);
 
             List<QueueList> queueList = new ArrayList<>();
-            queueList.add(new QueueListBuilder().setQueueNumber(new Long("0"))
-                    .setQueueUuid(queue1Uuid).build());
-            queueList.add(new QueueListBuilder().setQueueNumber(new Long("1"))
-                    .setQueueUuid(queue2Uuid).build());
+            queueList.add(new QueueListBuilder().setQueueNumber(new Long("1")).setQueueRef(queue1Ref).build());
+            queueList.add(new QueueListBuilder().setQueueNumber(new Long("2")).setQueueRef(queue2Ref).build());
+
             qosBuilder.setQueueList(queueList);
 
             Assert.assertTrue(mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION,
@@ -2523,7 +2529,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
 
             // DELETE one queue from queue list and check that one remains
             KeyedInstanceIdentifier<QueueList, QueueListKey> qosQueueIid = qosIid
-                        .child(QueueList.class, new QueueListKey(new Long("0")));
+                    .child(QueueList.class, new QueueListKey(new Long("1")));
             Assert.assertTrue(mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, qosQueueIid));
             qosOperationalListener.waitForUpdate(OVSDB_UPDATE_TIMEOUT);
 
@@ -2535,10 +2541,11 @@ public class SouthboundIT extends AbstractMdsalTestBase {
             Assert.assertNotNull(operQos);
             operQueueList = operQos.getQueueList();
             Assert.assertNotNull(operQueueList);
+
             for (QueueList queueEntry : queueList) {
-                if (queueEntry.getQueueUuid().equals(queue2Uuid)) {
+                if (queueEntry.getQueueRef().equals(queue2Ref)) {
                     Assert.assertTrue(isQueueInList(operQueueList, queueEntry));
-                } else if (queueEntry.getQueueUuid().equals(queue1Uuid)) {
+                } else if (queueEntry.getQueueRef().equals(queue1Ref)) {
                     Assert.assertFalse(isQueueInList(operQueueList, queueEntry));
                 } else {
                     Assert.assertTrue("Unknown queue entry in qos queue list", false);
@@ -2561,10 +2568,11 @@ public class SouthboundIT extends AbstractMdsalTestBase {
         }
     }
 
+
+
     private Boolean isQueueInList(List<QueueList> queueList, QueueList queue) {
         for (QueueList queueEntry : queueList) {
-            if (queueEntry.getQueueNumber().equals(queue.getQueueNumber())
-                && queueEntry.getQueueUuid().equals(queue.getQueueUuid())) {
+            if (queueEntry.getQueueNumber().equals(queue.getQueueNumber())&& queueEntry.getQueueRef().equals(queue.getQueueRef())) {
                 return true;
             }
         }