Merge "Fixed Group and Meter RPC model to use MD-SAL routing correctly"
authorEd Warnicke <eaw@cisco.com>
Thu, 28 Nov 2013 10:49:40 +0000 (10:49 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 28 Nov 2013 10:49:40 +0000 (10:49 +0000)
opendaylight/config/pom.xml [changed mode: 0755->0644]
opendaylight/md-sal/model/model-flow-base/src/main/yang/table-types.yang
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataModification.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/api/RestconfService.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.xtend
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/XmlProvidersTest.java
opendaylight/netconf/config-netconf-connector/pom.xml [changed mode: 0755->0644]
opendaylight/topologymanager/implementation/pom.xml [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 1b6a689750df8e3bd88e8ef632791b7a65384f3a..3774f950fc63aa139b35749cfaf9e2c4ffad0af4 100644 (file)
@@ -19,7 +19,186 @@ module opendaylight-table-types {
         type bits {
             bit DEPRECATED-MASK;
         }
-    }  
+    }
+
+    // field types
+    identity match-field {
+        description "Base identity for match Fields";
+    }
+
+    identity in_port {
+        base match-field;
+        description "Match for Switch input port.";
+    }
+    identity in_phy_port {
+        base match-field;
+        description "Match for Switch physical input port.";
+    }
+    identity metadata {
+        base match-field;
+        description "Match for Metadata passed between tables.";
+    }
+    identity eth_dst {
+        base match-field;
+        description "Match for Ethernet destination address.";
+    }
+    identity eth_src {
+        base match-field;
+        description "Match for Ethernet source address.";
+    }
+    identity eth_type {
+        base match-field;
+        description "Match for Ethernet frame type.";
+    }
+    identity vlan_vid {
+        base match-field;
+        description "Match for VLAN id.";
+    }
+    identity vlan_pcp {
+        base match-field;
+        description "Match for VLAN priority.";
+    }
+    identity ip_dscp {
+        base match-field;
+        description "Match for IP DSCP (6 bits in ToS field).";
+    }
+    identity ip_ecn {
+        base match-field;
+        description "Match for IP ECN (2 bits in ToS field).";
+    }
+    identity ip_proto {
+        base match-field;
+        description "Match for IP protocol.";
+    }
+    identity ipv4_src {
+        base match-field;
+        description "Match for IPv4 source address.";
+    }
+    identity ipv4_dst {
+        base match-field;
+        description "Match for IPv4 destination address.";
+    }
+    identity tcp_src {
+        base match-field;
+        description "Match for TCP source port.";
+    }
+    identity tcp_dst {
+        base match-field;
+        description "Match for TCP destination port.";
+    }
+    identity udp_src {
+        base match-field;
+        description "Match for UDP source port.";
+    }
+    identity udp_dst {
+        base match-field;
+        description "Match for UDP destination port.";
+    }
+    identity sctp_src {
+        base match-field;
+        description "Match for SCTP source port.";
+    }
+    identity sctp_dst {
+        base match-field;
+        description "Match for SCTP destination port.";
+    }
+    identity icmpv4_type {
+        base match-field;
+        description "Match for ICMP type.";
+    }
+    identity icmpv4_code {
+        base match-field;
+        description "Match for ICMP code.";
+    }
+    identity arp_op {
+        base match-field;
+        description "Match for ARP opcode.";
+    }
+    identity arp_spa {
+        base match-field;
+        description "Match for ARP source IPv4 address.";
+    }
+    identity arp_tpa {
+        base match-field;
+        description "Match for ARP target IPv4 address.";
+    }
+    identity arp_sha {
+        base match-field;
+        description "Match for ARP source hardware address.";
+    }
+    identity arp_tha {
+        base match-field;
+        description "Match for ARP target hardware address.";
+    }
+    identity ipv6_src {
+        base match-field;
+        description "Match for IPv6 source address.";
+    }
+    identity ipv6_dst {
+        base match-field;
+        description "Match for IPv6 destination address.";
+    }
+    identity ipv6_flabel {
+        base match-field;
+        description "Match for IPv6 Flow Label";
+    }
+    identity icmpv6_type {
+        base match-field;
+        description "Match for ICMPv6 type.";
+    }
+    identity icmpv6_code {
+        base match-field;
+        description "Match for ICMPv6 code.";
+    }
+    identity ipv6_nd_target {
+        base match-field;
+        description "Match for Target address for ND.";
+    }
+    identity ipv6_nd_sll {
+        base match-field;
+        description "Match for Source link-layer for ND.";
+    }
+    identity ipv6_nd_tll {
+        base match-field;
+        description "Match for Target link-layer for ND.";
+    }
+    identity mpls_label {
+        base match-field;
+        description "Match for MPLS label.";
+    }
+    identity mpls_tc {
+        base match-field;
+        description "Match for MPLS TC.";
+    }
+    identity mpls_bos {
+        base match-field;
+        description "Match for MPLS BoS bit.";
+    }
+    identity pbb_isid {
+        base match-field;
+        description "Match for PBB I-SID.";
+    }
+    identity tunnel_id {
+        base match-field;
+        description "Match for Logical Port Metadata";
+    }
+    identity ipv6_exthdr {
+        base match-field;
+        description "Match for IPv6 Extension Header pseudo-field";
+    }
+        
+    grouping set-field-match {
+        list set-field-match {
+            leaf match-type {
+                type identityref {
+                    base match-field;
+                }
+            }
+            leaf has-mask {
+                type boolean;
+            } 
+        }
+    }
       
     grouping table-feature-prop-type {
         choice table-feature-prop-type {
@@ -37,24 +216,16 @@ module opendaylight-table-types {
 
             case next-table {   
                 container tables {
-                    list table-id {
-                        key "table";                        
-                        
-                        leaf table-id {
-                            type table-ref;
-                        } 
+                    leaf-list table-ids {
+                        type uint8;
                     }
                 } 
             }
             
             case next-table-miss {   
                 container tables {
-                    list table-id {
-                        key "table-id";                        
-                        
-                        leaf table-id {
-                            type table-ref;
-                        } 
+                    leaf-list table-ids {
+                        type uint8;
                     }
                 } 
             }
@@ -83,52 +254,28 @@ module opendaylight-table-types {
                 } 
             }
             
-            case match {   
-                container matches {
-                    leaf-list match {                                              
-                        type uint32;
-                    }
-                } 
+            case match {
+                uses set-field-match; 
             }
             
             case wildcards {   
-                container wildcards {
-                    leaf-list wildcard {                                              
-                        type uint32;
-                    }
-                } 
+                uses set-field-match;
             }
             
             case write-setfield {   
-                container write-setfield {
-                    leaf-list setfield {                                              
-                        type uint32;
-                    }
-                } 
+                uses set-field-match;
             }
             
             case write-setfield-miss {   
-                container write-setfield-miss {
-                    leaf-list setfield {                                              
-                        type uint32;
-                    }
-                } 
+                uses set-field-match;
             }
             
             case apply-setfield {   
-                container apply-setfield {
-                    leaf-list setfield {                                              
-                        type uint32;
-                    }
-                } 
+                uses set-field-match; 
             }
             
             case apply-setfield-miss {   
-                container apply-setfield-miss {
-                    leaf-list setfield {                                              
-                        type uint32;
-                    }
-                } 
+                uses set-field-match; 
             }
         }
     } 
@@ -138,7 +285,7 @@ module opendaylight-table-types {
             key "table-id";
             
             leaf table-id {
-                type table-ref;
+                type uint8;
             }      
             
             leaf name {
@@ -167,15 +314,15 @@ module opendaylight-table-types {
             }
             
             container table-properties {
-                list instruction-id {
-                    key "order";
-                    leaf order {
-                        type int32;
-                    }
-                    
-                    uses table-feature-prop-type;
+                list table-feature-properties {
+                     key "order";
+                     leaf order {
+                         type int32;
+                     }
+                     uses table-feature-prop-type;
                 }
             }
+
         }
     }    
-}
\ No newline at end of file
+}
index d059766dea71bee37fb8fa26a051c52b2e044cfa..d74b26dae24ae374aa5b03f987eea27c12fe7113 100644 (file)
@@ -29,11 +29,12 @@ public interface DataModification<P/* extends Path<P> */, D> extends DataChange<
 
     /**
      * 
-     * Use {@link #putOperationalData(Object, Object)} instead.
+     * @deprecated Use {@link #putOperationalData(Object, Object)} instead.
      * 
      * @param path
      * @param data
      */
+    @Deprecated
     void putRuntimeData(P path, D data);
 
     void putOperationalData(P path, D data);
@@ -41,10 +42,11 @@ public interface DataModification<P/* extends Path<P> */, D> extends DataChange<
     void putConfigurationData(P path, D data);
 
     /**
-     * Use {@link #removeOperationalData(Object)}
+     * @deprecated Use {@link #removeOperationalData(Object)}
      * 
      * @param path
      */
+    @Deprecated
     void removeRuntimeData(P path);
 
     void removeOperationalData(P path);
index 5d08b3e7b6cb27bec3e2bbb68c5c1f9927f603aa..012b51fb5e339b6a0a4332e44d146b72f7e7ee76 100644 (file)
@@ -92,16 +92,4 @@ public interface RestconfService extends RestconfServiceLegacy {
                MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
     public StructuredData readOperationalData(@PathParam("identifier") String identifier);
 
-    @POST
-    @Path("/operational/{identifier:.+}")
-    @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML, 
-               MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
-    public Response createOperationalData(@PathParam("identifier") String identifier, CompositeNode payload);
-
-    @PUT
-    @Path("/operational/{identifier:.+}")
-    @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML, 
-               MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
-    public Response updateOperationalData(@PathParam("identifier") String identifier, CompositeNode payload);
-
 }
index 8f6ca1685bbb4b0c6f81ec2dc85ae4fd4c92d5f2..b6426c65bfdd55c8f984a8433eaddbb9ccb20dbc 100644 (file)
@@ -2,12 +2,11 @@ package org.opendaylight.controller.sal.restconf.impl
 
 import java.util.List
 import javax.ws.rs.core.Response
+import org.opendaylight.controller.md.sal.common.api.TransactionStatus
 import org.opendaylight.controller.sal.rest.api.RestconfService
 import org.opendaylight.yangtools.yang.data.api.CompositeNode
 import org.opendaylight.yangtools.yang.model.api.DataNodeContainer
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode
-import org.opendaylight.controller.md.sal.common.api.TransactionStatus
-import javax.ws.rs.WebApplicationException
 
 class RestconfImpl implements RestconfService {
     
@@ -96,26 +95,6 @@ class RestconfImpl implements RestconfService {
         createConfigurationData(identifier,payload);
     }
     
-    override createOperationalData(String identifier, CompositeNode payload) {
-        val identifierWithSchemaNode = identifier.resolveInstanceIdentifier
-        val value = resolveNodeNamespaceBySchema(payload, identifierWithSchemaNode.schemaNode)
-        val status = broker.commitOperationalDataPut(identifierWithSchemaNode.instanceIdentifier,value).get();
-        switch status.result {
-            case TransactionStatus.COMMITED: Response.status(Response.Status.OK).build
-            default: Response.status(Response.Status.INTERNAL_SERVER_ERROR).build
-        }
-    }
-    
-    override updateOperationalData(String identifier, CompositeNode payload) {
-        val identifierWithSchemaNode = identifier.resolveInstanceIdentifier
-        val value = resolveNodeNamespaceBySchema(payload, identifierWithSchemaNode.schemaNode)
-        val status = broker.commitOperationalDataPut(identifierWithSchemaNode.instanceIdentifier,value).get();
-        switch status.result {
-            case TransactionStatus.COMMITED: Response.status(Response.Status.NO_CONTENT).build
-            default: Response.status(Response.Status.INTERNAL_SERVER_ERROR).build
-        }
-    }
-    
     private def InstanceIdWithSchemaNode resolveInstanceIdentifier(String identifier) {
         val identifierWithSchemaNode = identifier.toInstanceIdentifier
         if (identifierWithSchemaNode === null) {
index 4336ac8a8325b14ab883834a7e9b91a0a6fb7655..10885b642b8a75de219a2e997e95d362fbf43085 100644 (file)
@@ -133,7 +133,7 @@ public class XmlProvidersTest extends JerseyTest {
         response = target(uri).request(MEDIA_TYPE_DRAFT02).post(entity);
         assertEquals(200, response.getStatus());
         
-        uri = createUri("/operational/", "ietf-interfaces:interfaces/interface/eth0");
+        uri = createUri("/config/", "ietf-interfaces:interfaces/interface/eth0");
         response = target(uri).request(MEDIA_TYPE_DRAFT02).put(entity);
         assertEquals(204, response.getStatus());
         response = target(uri).request(MEDIA_TYPE_DRAFT02).post(entity);
@@ -162,7 +162,7 @@ public class XmlProvidersTest extends JerseyTest {
         response = target(uri).request(MEDIA_TYPE_DRAFT02).post(entity);
         assertEquals(500, response.getStatus());
         
-        uri = createUri("/operational/", "ietf-interfaces:interfaces/interface/eth0");
+        uri = createUri("/config/", "ietf-interfaces:interfaces/interface/eth0");
         response = target(uri).request(MEDIA_TYPE_DRAFT02).put(entity);
         assertEquals(500, response.getStatus());
         response = target(uri).request(MEDIA_TYPE_DRAFT02).post(entity);