From 0a00e953f7ba69a8fce3aee9fc30e39a84999f62 Mon Sep 17 00:00:00 2001 From: Deepthi V V Date: Mon, 16 Feb 2015 12:04:39 +0530 Subject: [PATCH] Initial checkin for vpnservice. 1. Added .gitreview 2. Support karaf features and distribution for vpnservice 3. VPN Manager support: POM, config-subsytem yang, vpnservice yang. Signed-off-by: Deepthi V V Change-Id: I8b3b8726c8646922f768f0fc5bf6d792f026c077 --- distribution/karaf/pom.xml | 55 +++++++++++ features/pom.xml | 75 +++++++++++++++ features/src/main/features/features.xml | 36 +++++++ pom.xml | 51 ++++++++++ vpnmanager-api/pom.xml | 53 ++++++++++ vpnmanager-api/src/main/yang/vpnservice.yang | 96 +++++++++++++++++++ vpnmanager-impl/pom.xml | 31 ++++++ .../src/main/config/default-config.xml | 30 ++++++ .../src/main/config/maven-metadata-local.xml | 20 ++++ .../vpnservice/VpnserviceProvider.java | 29 ++++++ .../impl/rev150216/VpnserviceImplModule.java | 33 +++++++ .../VpnserviceImplModuleFactory.java | 20 ++++ .../src/main/yang/vpnservice-impl.yang | 35 +++++++ vpnservice-artifacts/pom.xml | 39 ++++++++ 14 files changed, 603 insertions(+) create mode 100644 distribution/karaf/pom.xml create mode 100644 features/pom.xml create mode 100644 features/src/main/features/features.xml create mode 100644 pom.xml create mode 100644 vpnmanager-api/pom.xml create mode 100644 vpnmanager-api/src/main/yang/vpnservice.yang create mode 100644 vpnmanager-impl/pom.xml create mode 100644 vpnmanager-impl/src/main/config/default-config.xml create mode 100644 vpnmanager-impl/src/main/config/maven-metadata-local.xml create mode 100644 vpnmanager-impl/src/main/java/org/opendaylight/vpnservice/VpnserviceProvider.java create mode 100644 vpnmanager-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/vpnservice/impl/rev150216/VpnserviceImplModule.java create mode 100644 vpnmanager-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/vpnservice/impl/rev150216/VpnserviceImplModuleFactory.java create mode 100644 vpnmanager-impl/src/main/yang/vpnservice-impl.yang create mode 100644 vpnservice-artifacts/pom.xml diff --git a/distribution/karaf/pom.xml b/distribution/karaf/pom.xml new file mode 100644 index 00000000..055cfc68 --- /dev/null +++ b/distribution/karaf/pom.xml @@ -0,0 +1,55 @@ + + + + + org.opendaylight.controller + karaf-parent + 1.5.0-SNAPSHOT + + + 4.0.0 + org.opendaylight.vpnservice + vpnservice-karaf + 1.0-SNAPSHOT + ${project.artifactId} + + 3.1.1 + + + odl-vpnservice-impl-ui + + + + + ${project.groupId} + vpnservice-artifacts + ${project.version} + pom + import + + + + + + + org.apache.karaf.features + framework + kar + + + + ${project.groupId} + vpnservice-features + features + xml + runtime + + + diff --git a/features/pom.xml b/features/pom.xml new file mode 100644 index 00000000..33043444 --- /dev/null +++ b/features/pom.xml @@ -0,0 +1,75 @@ + + + + + org.opendaylight.odlparent + features-parent + 1.5.0-SNAPSHOT + + + org.opendaylight.vpnservice + vpnservice-features + 1.0-SNAPSHOT + ${project.artifactId} + 4.0.0 + + 3.1.1 + + + 1.2.0-SNAPSHOT + 0.7.0-SNAPSHOT + + + + + + org.opendaylight.controller + mdsal-artifacts + ${mdsal.version} + pom + import + + + + + + org.opendaylight.yangtools + features-yangtools + features + ${yangtools.version} + xml + runtime + + + org.opendaylight.controller + features-mdsal + features + ${mdsal.version} + xml + runtime + + + org.opendaylight.controller + features-restconf + features + ${mdsal.version} + xml + runtime + + + ${project.groupId} + vpnmanager-impl + ${project.version} + + + ${project.groupId} + vpnmanager-api + ${project.version} + + + diff --git a/features/src/main/features/features.xml b/features/src/main/features/features.xml new file mode 100644 index 00000000..a896fdf8 --- /dev/null +++ b/features/src/main/features/features.xml @@ -0,0 +1,36 @@ + + + + + mvn:org.opendaylight.yangtools/features-yangtools/${yangtools.version}/xml/features + mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features + mvn:org.opendaylight.controller/features-restconf/${mdsal.version}/xml/features + + odl-yangtools-models + mvn:org.opendaylight.vpnservice/vpnmanager-api/${project.version} + + + odl-mdsal-broker + odl-vpnservice-api + mvn:org.opendaylight.vpnservice/vpnmanager-impl/${project.version} + mvn:org.opendaylight.vpnservice/vpnmanager-impl/${project.version}/xml/config + + + odl-vpnservice-impl + odl-restconf + + + odl-vpnservice-impl-rest + odl-mdsal-apidocs + odl-mdsal-xsql + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..d856c728 --- /dev/null +++ b/pom.xml @@ -0,0 +1,51 @@ + + + + org.opendaylight.vpnservice + vpnservice + 1.0-SNAPSHOT + ${project.artifactId} + pom + 4.0.0 + + 3.1.1 + + + vpnmanager-api + vpnmanager-impl + distribution/karaf + features + vpnservice-artifacts + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + org.apache.maven.plugins + maven-install-plugin + + true + + + + + + scm:git:ssh://git.opendaylight.org:29418/vpnservice.git + scm:git:ssh://git.opendaylight.org:29418/vpnservice.git + https://wiki.opendaylight.org/view/VPNService:Main + HEAD + + diff --git a/vpnmanager-api/pom.xml b/vpnmanager-api/pom.xml new file mode 100644 index 00000000..b738bc6a --- /dev/null +++ b/vpnmanager-api/pom.xml @@ -0,0 +1,53 @@ + + + + + org.opendaylight.yangtools + binding-parent + 0.7.0-SNAPSHOT + + + + 4.0.0 + org.opendaylight.vpnservice + vpnmanager-api + 1.0-SNAPSHOT + bundle + + + + 2010.09.24.7-SNAPSHOT + 2010.09.24.7-SNAPSHOT + 2013.09.07.7-SNAPSHOT + 0.7.0-SNAPSHOT + + + + + org.opendaylight.yangtools + yang-binding + ${yangtools.version} + + + org.opendaylight.yangtools + yang-common + ${yangtools.version} + + + org.opendaylight.yangtools.model + ietf-inet-types + ${ietf.inet.types.version} + + + org.opendaylight.yangtools.model + ietf-yang-types + ${ietf.yang.types.version} + + + diff --git a/vpnmanager-api/src/main/yang/vpnservice.yang b/vpnmanager-api/src/main/yang/vpnservice.yang new file mode 100644 index 00000000..52dd9823 --- /dev/null +++ b/vpnmanager-api/src/main/yang/vpnservice.yang @@ -0,0 +1,96 @@ + +module vpnService { + namespace "urn:opendaylight:l3vpn"; + prefix l3vpn; + import ietf-inet-types {prefix inet;} + revision "2015-01-11" { + description "L3 VPN Service module"; + } + + typedef port_type { + type enumeration { + enum untagged { value 1; } + enum vlan { value 2; } + enum qinq { value 3; } + } + description "vpn port type, can be untagged, vlan and qinq, default is untagged"; + } + + grouping vlan_info{ + leaf ctag {type uint16;} + leaf stag {type uint16;} + description "optional VLAN tag values"; + } + typedef l3service_result { + type enumeration { + enum "success" { value 0; description "operation successful";} + enum "error" { value 1; description "Error happened";} + } + description "Result types"; + } + + grouping vpn_key { + leaf tenantId { type uint32;} + leaf vpn_name { type string;} + } + + grouping vpn_instance_info { + leaf routeDistinguisher{ type string; } + leaf-list exportrts{ type string;} + leaf-list importrts{ type string;} + } + + grouping vpn_port_attributes { + leaf port_name {type string;} + leaf port_type {type port_type;} + uses vlan_info; /* optional */ + leaf mac_address {type string;} + leaf ip_address {type string;} + leaf prefix_length {type uint8;} + } + + rpc createVpnInstance { + description "Create a new L3 VPN"; + input { + uses vpn_key; + uses vpn_instance_info; + } + output { + leaf result {type l3service_result;} + } + } + + rpc deleteVpnInstance { + description "Delete L3 VPN"; + input { uses vpn_key;} + output { + leaf result {type l3service_result;} + } + } + + rpc get_vpn{ + input { uses vpn_key;} + output {uses vpn_instance_info;} + } + + rpc add_port_to_vpn{ + input { + uses vpn_key; + uses vpn_port_attributes; + } + output { + leaf result {type l3service_result;} + } + } + rpc remove_port_from_vpn{ + input { + uses vpn_key; + uses vpn_port_attributes; + } + output { + leaf result {type l3service_result;} + } + + } + +} \ No newline at end of file diff --git a/vpnmanager-impl/pom.xml b/vpnmanager-impl/pom.xml new file mode 100644 index 00000000..59cd96d7 --- /dev/null +++ b/vpnmanager-impl/pom.xml @@ -0,0 +1,31 @@ + + + + + + org.opendaylight.controller + config-parent + 0.3.0-SNAPSHOT + + + + 4.0.0 + org.opendaylight.vpnservice + vpnmanager-impl + 1.0-SNAPSHOT + bundle + + + ${project.groupId} + vpnmanager-api + ${project.version} + + + + diff --git a/vpnmanager-impl/src/main/config/default-config.xml b/vpnmanager-impl/src/main/config/default-config.xml new file mode 100644 index 00000000..040db603 --- /dev/null +++ b/vpnmanager-impl/src/main/config/default-config.xml @@ -0,0 +1,30 @@ + + + + + + urn:opendaylight:params:xml:ns:yang:vpnservice:impl?module=vpnservice-impl&revision=2015-02-16 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28 + + + + + + + prefix:vpnservice-impl + vpnservice-default + + binding:binding-broker-osgi-registry + binding-osgi-broker + + + + + + diff --git a/vpnmanager-impl/src/main/config/maven-metadata-local.xml b/vpnmanager-impl/src/main/config/maven-metadata-local.xml new file mode 100644 index 00000000..258959f2 --- /dev/null +++ b/vpnmanager-impl/src/main/config/maven-metadata-local.xml @@ -0,0 +1,20 @@ + + + org.opendaylight.vpnservice + vpnmanager-impl + 1.0-SNAPSHOT + + + true + + 20150213123103 + + + config + xml + 1.0-SNAPSHOT + 20150213123103 + + + + diff --git a/vpnmanager-impl/src/main/java/org/opendaylight/vpnservice/VpnserviceProvider.java b/vpnmanager-impl/src/main/java/org/opendaylight/vpnservice/VpnserviceProvider.java new file mode 100644 index 00000000..ef4223ff --- /dev/null +++ b/vpnmanager-impl/src/main/java/org/opendaylight/vpnservice/VpnserviceProvider.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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.vpnservice; + +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext; +import org.opendaylight.controller.sal.binding.api.BindingAwareProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class VpnserviceProvider implements BindingAwareProvider, AutoCloseable { + + private static final Logger LOG = LoggerFactory.getLogger(VpnserviceProvider.class); + + @Override + public void onSessionInitiated(ProviderContext session) { + LOG.info("VpnserviceProvider Session Initiated"); + } + + @Override + public void close() throws Exception { + LOG.info("VpnserviceProvider Closed"); + } + +} diff --git a/vpnmanager-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/vpnservice/impl/rev150216/VpnserviceImplModule.java b/vpnmanager-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/vpnservice/impl/rev150216/VpnserviceImplModule.java new file mode 100644 index 00000000..e484e95b --- /dev/null +++ b/vpnmanager-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/vpnservice/impl/rev150216/VpnserviceImplModule.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpnservice.impl.rev150216; + +import org.opendaylight.vpnservice.VpnserviceProvider; + +public class VpnserviceImplModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpnservice.impl.rev150216.AbstractVpnserviceImplModule { + public VpnserviceImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } + + public VpnserviceImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpnservice.impl.rev150216.VpnserviceImplModule oldModule, java.lang.AutoCloseable oldInstance) { + super(identifier, dependencyResolver, oldModule, oldInstance); + } + + @Override + public void customValidation() { + // add custom validation form module attributes here. + } + + @Override + public java.lang.AutoCloseable createInstance() { + VpnserviceProvider provider = new VpnserviceProvider(); + getBrokerDependency().registerProvider(provider); + return provider; + } + +} diff --git a/vpnmanager-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/vpnservice/impl/rev150216/VpnserviceImplModuleFactory.java b/vpnmanager-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/vpnservice/impl/rev150216/VpnserviceImplModuleFactory.java new file mode 100644 index 00000000..0bd756ad --- /dev/null +++ b/vpnmanager-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/vpnservice/impl/rev150216/VpnserviceImplModuleFactory.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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 + */ +/* +* Generated file +* +* Generated from: yang module name: vpnservice yang module local name: vpnservice +* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator +* Generated at: Fri Feb 13 17:27:11 IST 2015 +* +* Do not modify this file unless it is present under src/main directory +*/ +package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpnservice.impl.rev150216; +public class VpnserviceImplModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpnservice.impl.rev150216.AbstractVpnserviceImplModuleFactory { + +} diff --git a/vpnmanager-impl/src/main/yang/vpnservice-impl.yang b/vpnmanager-impl/src/main/yang/vpnservice-impl.yang new file mode 100644 index 00000000..3c5fb3dd --- /dev/null +++ b/vpnmanager-impl/src/main/yang/vpnservice-impl.yang @@ -0,0 +1,35 @@ +module vpnservice-impl { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpnservice:impl"; + prefix "vpnservice-impl"; + + import config { prefix config; revision-date 2013-04-05; } + import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;} + + description + "Service definition for vpnservice project"; + + revision "2015-02-16" { + description + "Initial revision"; + } + + identity vpnservice-impl { + base config:module-type; + config:java-name-prefix VpnserviceImpl; + } + + augment "/config:modules/config:module/config:configuration" { + case vpnservice-impl { + when "/config:modules/config:module/config:type = 'vpnservice-impl'"; + container broker { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity md-sal-binding:binding-broker-osgi-registry; + } + } + } + } + } +} diff --git a/vpnservice-artifacts/pom.xml b/vpnservice-artifacts/pom.xml new file mode 100644 index 00000000..a30b9989 --- /dev/null +++ b/vpnservice-artifacts/pom.xml @@ -0,0 +1,39 @@ + + + + + + 4.0.0 + org.opendaylight.vpnservice + vpnservice-artifacts + 1.0-SNAPSHOT + pom + + + + + ${project.groupId} + vpnmanager-api + ${project.version} + + + ${project.groupId} + vpnmanager-impl + ${project.version} + + + ${project.groupId} + vpnservice-features + ${project.version} + features + xml + + + + -- 2.36.6