yang model revise: neutron-vpnaas.yang 37/39237/5
authorIsaku Yamahata <isaku.yamahata@intel.com>
Wed, 18 May 2016 19:44:51 +0000 (12:44 -0700)
committerIsaku Yamahata <isaku.yamahata@intel.com>
Fri, 10 Jun 2016 09:14:03 +0000 (02:14 -0700)
This patch revises yang model for neutron vpnaas and the related codes.
- remove descr for consistency, which isn't very useful
- pyang warning. unused import
- eliminate deprecated methods in neutron-spi

Change-Id: I04d055d4f3ee4b2232cabfb34722312447880a72
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
16 files changed:
model/src/main/yang/neutron-vpnaas.yang
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIKEPolicy.java
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIPSECPolicy.java
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIPSECSiteConnection.java
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNService.java
neutron-spi/src/test/java/org/opendaylight/neutron/spi/NeutronVPNIKEPolicyJAXBTest.java
neutron-spi/src/test/java/org/opendaylight/neutron/spi/NeutronVPNIPSECPolicyJAXBTest.java
neutron-spi/src/test/java/org/opendaylight/neutron/spi/NeutronVPNIPSECSiteConnectionJAXBTest.java
neutron-spi/src/test/java/org/opendaylight/neutron/spi/NeutronVPNServiceJAXBTest.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIKEPoliciesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECPoliciesNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronVPNIPSECSiteConnectionsNorthbound.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronVPNIKEPolicyInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronVPNIPSECPolicyInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronVPNIPSECSiteConnectionsInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronVPNServiceInterface.java

index 2aa1ac116a279aa51348828c0558e7aaa26fac44..366e0a1d0f72fb85d36009058d252083d11728d9 100644 (file)
@@ -14,7 +14,6 @@ module neutron-vpnaas {
     prefix neutron-vpnaas;
 
     import ietf-yang-types { prefix "yang"; }
-    import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }
     import neutron-attrs { prefix "attrs"; }
 
     organization "OpenDaylight Neutron Group";
@@ -29,10 +28,6 @@ module neutron-vpnaas {
     }
 
     grouping vpnservice-attributes {
-        leaf descr {
-            type string;
-            description "Detailed description of the vpn service.";
-        }
         leaf router-id {
             description "Contains the Router ID for the vpn service.";
             type yang:uuid;
@@ -44,10 +39,6 @@ module neutron-vpnaas {
     }
 
     grouping ikepolicy-attributes {
-        leaf descr {
-            type string;
-            description "Detailed description of the ike policy.";
-        }
         leaf auth-algorithm {
             type string;
             description "Authentication hash algorithm.";
@@ -82,10 +73,6 @@ module neutron-vpnaas {
     }
 
     grouping ipsecpolicy-attributes {
-        leaf descr {
-            type string;
-            description "Detailed description of the ipsec policy.";
-        }
         leaf transform-protocol {
             type string;
             description "Transform protocol.";
@@ -120,10 +107,6 @@ module neutron-vpnaas {
     }
 
     grouping ipsecconnection-attributes {
-        leaf descr {
-            type string;
-            description "Detailed description of the ipsec policy.";
-        }
         leaf peer_address {
             type string;
             description "Peer gateway public IPv4/IPv6 address or FQDN";
index df1d276d32c5c43f4391c08f7d0f0ac78190c0f9..77b1b565ece6fc893e7a449c51c1ca9764253f10 100644 (file)
@@ -29,9 +29,6 @@ public class NeutronVPNIKEPolicy extends NeutronObject implements Serializable,
     @XmlElement (name = "name")
     String name;
 
-    @XmlElement (name = "description")
-    String description;
-
     @XmlElement (name = "auth_algorithm")
     String authAlgorithm;
 
@@ -61,14 +58,6 @@ public class NeutronVPNIKEPolicy extends NeutronObject implements Serializable,
         this.name = name;
     }
 
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
     public String getAuthAlgorithm() {
         return authAlgorithm;
     }
@@ -140,9 +129,6 @@ public class NeutronVPNIKEPolicy extends NeutronObject implements Serializable,
             if (s.equals("tenant_id")) {
                 ans.setTenantID(this.getTenantID());
             }
-            if (s.equals("description")) {
-                ans.setDescription(this.getDescription());
-            }
             if (s.equals("auth_algorithm")) {
                 ans.setAuthAlgorithm(this.getAuthAlgorithm());
             }
index b69a60b46942d78f2dcb5aab2697a1ce2b8fbe83..766cefa97d05e5e0638a7f441433ca04d2416ef2 100644 (file)
@@ -29,9 +29,6 @@ public class NeutronVPNIPSECPolicy extends NeutronObject implements Serializable
     @XmlElement (name = "name")
     String name;
 
-    @XmlElement (name = "description")
-    String description;
-
     @XmlElement (name = "transform_protocol")
     String transformProtocol;
 
@@ -61,14 +58,6 @@ public class NeutronVPNIPSECPolicy extends NeutronObject implements Serializable
         this.name = name;
     }
 
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
     public String getTransformProtocol() {
         return transformProtocol;
     }
@@ -140,9 +129,6 @@ public class NeutronVPNIPSECPolicy extends NeutronObject implements Serializable
             if (s.equals("name")) {
                 ans.setName(this.getName());
             }
-            if (s.equals("description")) {
-                ans.setDescription(this.getDescription());
-            }
             if (s.equals("transform_protocol")) {
                 ans.setTransformProtocol(this.getTransformProtocol());
             }
index b6a07006efcfe03dbe7a2a8dabc9ea194bf1f662..d0788ace78dd8e55b1d198752bf0a311b65b11a8 100644 (file)
@@ -29,9 +29,6 @@ public class NeutronVPNIPSECSiteConnection extends NeutronObject implements Seri
     @XmlElement (name = "name")
     String name;
 
-    @XmlElement (name = "description")
-    String description;
-
     @XmlElement (name = "peer_address")
     String peerAddress;
 
@@ -85,14 +82,6 @@ public class NeutronVPNIPSECSiteConnection extends NeutronObject implements Seri
         this.name = name;
     }
 
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
     public String getPeerAddress() {
         return peerAddress;
     }
@@ -227,9 +216,6 @@ public class NeutronVPNIPSECSiteConnection extends NeutronObject implements Seri
             if (s.equals("name")) {
                 ans.setName(this.getName());
             }
-            if (s.equals("description")) {
-                ans.setDescription(this.getDescription());
-            }
             if (s.equals("peer_address")) {
                 ans.setPeerAddress(this.getPeerAddress());
             }
@@ -273,7 +259,7 @@ public class NeutronVPNIPSECSiteConnection extends NeutronObject implements Seri
     @Override
     public String toString() {
         return "NeutronVPNIPSECSiteConnection{" + "id='" + uuid + '\'' + ", tenantID='" + tenantID + '\'' + ", name='"
-                + name + '\'' + ", description=" + description + ", peerAddress=" + peerAddress + ", peerID='" + peerID
+                + name + '\'' + ", peerAddress=" + peerAddress + ", peerID='" + peerID
                 + '\'' + ", routeMode='" + routeMode + '\'' + ", mtu=" + mtu + ", authMode='" + authMode + '\''
                 + ", preSharedKey='" + preSharedKey + '\'' + ", initiator='" + initiator + '\'' + ", adminStateUp="
                 + adminStateUp + ", status='" + status + '\'' + ", ikePolicyID='" + ikePolicyID + '\''
index a8b12f774db76f9d199899dc993914a72b7660f3..3850962e4272f064c284e6b9ce1d3b3e9e279bfd 100644 (file)
@@ -42,9 +42,6 @@ public class NeutronVPNService extends NeutronObject implements Serializable, IN
     @XmlElement (name = "subnet_id")
     String subnetUUID;
 
-    @XmlElement (name = "description")
-    String description;
-
     public NeutronVPNService() {
     }
 
@@ -86,14 +83,6 @@ public class NeutronVPNService extends NeutronObject implements Serializable, IN
         this.subnetUUID = subnetUUID;
     }
 
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
     public NeutronVPNService extractFields(List<String> fields) {
         NeutronVPNService ans = new NeutronVPNService();
         Iterator<String> i = fields.iterator();
@@ -105,9 +94,6 @@ public class NeutronVPNService extends NeutronObject implements Serializable, IN
             if (s.equals("admin_state_up")) {
                 ans.setAdminStateUp(this.getAdminStateUp());
             }
-            if (s.equals("description")) {
-                ans.setDescription(this.getDescription());
-            }
             if (s.equals("name")) {
                 ans.setName(this.getName());
             }
index 1d79f4293cb344d5252a0d2ff6daf30dd73afe23..7ff170d04bfc16912476a249815d801884aeb863 100644 (file)
@@ -40,9 +40,6 @@ public class NeutronVPNIKEPolicyJAXBTest {
             Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 3: Testing name failed",
                   "ikepolicy1", testObject.getName());
 
-            Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 4: Testing description failed",
-                  "updated description", testObject.getDescription());
-
             Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 5: Testing auth algorithm failed",
                   "sha1", testObject.getAuthAlgorithm());
 
index f0c70c21fb7e6945d2a791cb7aac61567f783a46..797e2a5e45d00b2e8c65b0027422bf664c98a22a 100644 (file)
@@ -41,9 +41,6 @@ public class NeutronVPNIPSECPolicyJAXBTest {
             Assert.assertEquals("NeutronVPNIPSECPolicy JAXB Test 3: Testing name failed",
                   "ipsecpolicy1", testObject.getName());
 
-            Assert.assertEquals("NeutronVPNIPSECPolicy JAXB Test 4: Testing description failed",
-                  "update description", testObject.getDescription());
-
             Assert.assertEquals("NeutronVPNIPSECPolicy JAXB Test 5: Testing transform protocol failed",
                   "esp", testObject.getTransformProtocol());
 
index ea0cd23a1d9af8b659d1274212638023239c259d..d518af9e7e8ec8b3e2077dcc03541d088bddd710 100644 (file)
@@ -52,9 +52,6 @@ public class NeutronVPNIPSECSiteConnectionJAXBTest {
             Assert.assertEquals("NeutronVPNIPSECSiteConnection JAXB Test 3: Testing name failed",
                   "myvpn", testObject.getName());
 
-            Assert.assertEquals("NeutronVPNIPSECSiteConnection JAXB Test 4: Testing description failed",
-                  "Updated description", testObject.getDescription());
-
             Assert.assertEquals("NeutronVPNIPSECSiteConnection JAXB Test 5: Testing peer address failed",
                   "172.24.4.226", testObject.getPeerAddress());
 
index b87505774de440c9a7307e19193312904bea221d..082443d9411addb68bdae14cdd08a0d276c2d49b 100644 (file)
@@ -50,9 +50,6 @@ public class NeutronVPNServiceJAXBTest {
 
             Assert.assertEquals("NeutronVPNService JAXB Test 7: Testing id failed",
                   "9faaf49f-dd89-4e39-a8c6-101839aa49bc", testObject.getID());
-
-            Assert.assertEquals("NeutronVPNService JAXB Test 8: Testing description failed",
-                  "Updated description", testObject.getDescription());
         }
         catch (Exception e) {
             Assert.fail("Tests failed");
index 5f5787f11f9cc0a3b8f77be26918f97048eeb232..60d89e6b6ddcd1ad8be43881e3a37904ddd4be30 100644 (file)
@@ -144,7 +144,6 @@ public class NeutronVPNIKEPoliciesNorthbound
             @QueryParam("id") String queryID,
             @QueryParam("name") String queryName,
             @QueryParam("tenant_id") String queryTenantID,
-            @QueryParam("description") String queryDescription,
             @QueryParam("auth_algorithm") String queryAuthAlgorithm,
             @QueryParam("encryption_algorithm") String queryEncryptionAlgorithm,
             @QueryParam("phase1_negotiation_mode") String queryPhase1NegotiationMode,
@@ -160,7 +159,6 @@ public class NeutronVPNIKEPoliciesNorthbound
             NeutronVPNIKEPolicy oSS = i.next();
             if ((queryID == null || queryID.equals(oSS.getID())) &&
                     (queryName == null || queryName.equals(oSS.getName())) &&
-                    (queryDescription == null || queryDescription.equals(oSS.getDescription())) &&
                     (queryAuthAlgorithm == null || queryAuthAlgorithm.equals(oSS.getAuthAlgorithm())) &&
                     (queryEncryptionAlgorithm == null || queryEncryptionAlgorithm.equals(oSS.getEncryptionAlgorithm())) &&
                     (queryPhase1NegotiationMode == null || queryPhase1NegotiationMode.equals(oSS.getPhase1NegotiationMode())) &&
index f099c086b93e2968199a84218a83d6f237b84a19..3ed3c4864bcdbbbc25a23013c2ff9cacc486646d 100644 (file)
@@ -145,7 +145,6 @@ public class NeutronVPNIPSECPoliciesNorthbound
             @QueryParam("id") String queryID,
             @QueryParam("tenant_id") String queryTenantID,
             @QueryParam("name") String queryName,
-            @QueryParam("description") String queryDescription,
             @QueryParam("transform_protocol") String queryTransformProtocol,
             @QueryParam("encapsulation_mode") String queryEncapsulationMode,
             @QueryParam("auth_algorithm") String queryAuthAlgorithm,
@@ -161,7 +160,6 @@ public class NeutronVPNIPSECPoliciesNorthbound
             NeutronVPNIPSECPolicy oSS = i.next();
             if ((queryID == null || queryID.equals(oSS.getID())) &&
                     (queryName == null || queryName.equals(oSS.getName())) &&
-                    (queryDescription == null || queryDescription.equals(oSS.getDescription())) &&
                     (queryAuthAlgorithm == null || queryAuthAlgorithm.equals(oSS.getAuthAlgorithm())) &&
                     (queryEncryptionAlgorithm == null || queryEncryptionAlgorithm.equals(oSS.getEncryptionAlgorithm())) &&
                     (queryPFS == null || queryPFS.equals(oSS.getPerfectForwardSecrecy())) &&
index ffc93e4aa519cd1b53d59192f7123bf0eca0aff2..54762dc2ec99f9ccd4bd83168e18f02966fd9c7e 100644 (file)
@@ -143,7 +143,7 @@ public class NeutronVPNIPSECSiteConnectionsNorthbound
             @QueryParam("fields") List<String> fields,
             // filter fields
             @QueryParam("id") String queryID, @QueryParam("tenant_id") String queryTenantID,
-            @QueryParam("name") String queryName, @QueryParam("description") String queryDescription,
+            @QueryParam("name") String queryName,
             @QueryParam("peer_address") String queryPeerAddress, @QueryParam("peer_id") String queryPeerID,
             @QueryParam("route_mode") String queryRouteMode, @QueryParam("mtu") Integer queryMtu,
             @QueryParam("auth_mode") String queryAuthMode, @QueryParam("psk") String queryPsk,
@@ -163,7 +163,6 @@ public class NeutronVPNIPSECSiteConnectionsNorthbound
             if ((queryID == null || queryID.equals(oSS.getID()))
                     && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))
                     && (queryName == null || queryName.equals(oSS.getName()))
-                    && (queryDescription == null || queryDescription.equals(oSS.getDescription()))
                     && (queryPeerAddress == null || queryPeerAddress.equals(oSS.getPeerAddress()))
                     && (queryPeerID == null || queryPeerID.equals(oSS.getPeerID()))
                     && (queryRouteMode == null || queryRouteMode.equals(oSS.getRouteMode()))
index 3a753128fb0fbdf332497f9ee67125b1bb3afb64..b692f4511da33b33994c99fc4ad67f0e834b3be5 100644 (file)
@@ -82,9 +82,6 @@ public class NeutronVPNIKEPolicyInterface extends AbstractNeutronInterface<Ikepo
         if (ikePolicy.getTenantId() != null) {
             answer.setTenantID(ikePolicy.getTenantId());
         }
-        if (ikePolicy.getDescr() != null) {
-            answer.setDescription(ikePolicy.getDescr());
-        }
         if (ikePolicy.getAuthAlgorithm() != null) {
             answer.setAuthAlgorithm(ikePolicy.getAuthAlgorithm());
         }
@@ -122,9 +119,6 @@ ikePolicy.getLifetime();
         if (ikePolicy.getTenantID() != null) {
             ikePolicyBuilder.setTenantId(toUuid(ikePolicy.getTenantID()));
         }
-        if (ikePolicy.getDescription() != null) {
-            ikePolicyBuilder.setDescr(ikePolicy.getDescription());
-        }
         if (ikePolicy.getAuthAlgorithm() != null) {
             ikePolicyBuilder.setAuthAlgorithm(ikePolicy.getAuthAlgorithm());
         }
index c429673dc08af6283dc33af3d871445e87d7edad..9effa1578586792ca2b704276e98519328b5d300 100644 (file)
@@ -82,9 +82,6 @@ public class NeutronVPNIPSECPolicyInterface extends AbstractNeutronInterface<Ips
         if (ipsecPolicy.getTenantId() != null) {
             answer.setTenantID(ipsecPolicy.getTenantId());
         }
-        if (ipsecPolicy.getDescr() != null) {
-            answer.setDescription(ipsecPolicy.getDescr());
-        }
         if (ipsecPolicy.getAuthAlgorithm() != null) {
             answer.setAuthAlgorithm(ipsecPolicy.getAuthAlgorithm());
         }
@@ -121,9 +118,6 @@ public class NeutronVPNIPSECPolicyInterface extends AbstractNeutronInterface<Ips
         if (ipsecPolicy.getTenantID() != null) {
             ipsecPolicyBuilder.setTenantId(toUuid(ipsecPolicy.getTenantID()));
         }
-        if (ipsecPolicy.getDescription() != null) {
-            ipsecPolicyBuilder.setDescr(ipsecPolicy.getDescription());
-        }
         if (ipsecPolicy.getAuthAlgorithm() != null) {
             ipsecPolicyBuilder.setAuthAlgorithm(ipsecPolicy.getAuthAlgorithm());
         }
index 7ca83374a2c1902d7d547801fb2fc18f6e83d295..25ebe088cf6b5b666a5944246e9ea38ef3caa4a6 100644 (file)
@@ -87,9 +87,6 @@ public class NeutronVPNIPSECSiteConnectionsInterface extends AbstractNeutronInte
         if (ipsecSiteConnection.isAdminStateUp() != null) {
             answer.setAdminStateUp(ipsecSiteConnection.isAdminStateUp());
         }
-        if (ipsecSiteConnection.getDescr() != null) {
-            answer.setDescription(ipsecSiteConnection.getDescr());
-        }
         if (ipsecSiteConnection.getPeerAddress() != null) {
             answer.setPeerAddress(ipsecSiteConnection.getPeerAddress());
         }
@@ -153,9 +150,6 @@ public class NeutronVPNIPSECSiteConnectionsInterface extends AbstractNeutronInte
         if (ipsecSiteConnection.getAdminStateUp() != null) {
             ipsecSiteConnectionBuilder.setAdminStateUp(ipsecSiteConnection.getAdminStateUp());
         }
-        if (ipsecSiteConnection.getDescription() != null) {
-            ipsecSiteConnectionBuilder.setDescr(ipsecSiteConnection.getDescription());
-        }
         if (ipsecSiteConnection.getPeerAddress() != null) {
             ipsecSiteConnectionBuilder.setPeerAddress(ipsecSiteConnection.getPeerAddress());
         }
index 7a8472c569984669960243dc19edf6991801e010..7e5572ff7a6c569edbfaff7ead183b2308707453 100644 (file)
@@ -81,9 +81,6 @@ public class NeutronVPNServiceInterface extends AbstractNeutronInterface<Vpnserv
         if (vpnService.getStatus() != null) {
             answer.setStatus(vpnService.getStatus());
         }
-        if (vpnService.getDescr() != null) {
-            answer.setDescription(vpnService.getDescr());
-        }
         if (vpnService.getSubnetId() != null) {
             answer.setSubnetUUID(vpnService.getSubnetId().getValue());
         }
@@ -109,9 +106,6 @@ public class NeutronVPNServiceInterface extends AbstractNeutronInterface<Vpnserv
         if (vpnService.getStatus() != null) {
             vpnServiceBuilder.setStatus(vpnService.getStatus());
         }
-        if (vpnService.getDescription() != null) {
-            vpnServiceBuilder.setDescr(vpnService.getDescription());
-        }
         if (vpnService.getSubnetUUID() != null) {
             vpnServiceBuilder.setSubnetId(toUuid(vpnService.getSubnetUUID()));
         }