[ONOS-6199] Huawei driver create and instance delete.
Change-Id: I61e1a8518e9bd2a1a5ed9430052a3e6d3233f148
diff --git a/drivers/huawei/yangmodel/BUCK b/drivers/huawei/yangmodel/BUCK
new file mode 100644
index 0000000..e69ca9d
--- /dev/null
+++ b/drivers/huawei/yangmodel/BUCK
@@ -0,0 +1,13 @@
+COMPILE_DEPS = [
+ '//lib:CORE_DEPS',
+ '//lib:onos-yang-model',
+]
+
+yang_osgi_jar(
+ deps = COMPILE_DEPS,
+ name = 'onos-drivers-huawei-yangmodel',
+ srcs = glob(['src/main/**/*.yang']),
+ visibility = [
+ 'PUBLIC'
+ ],
+)
\ No newline at end of file
diff --git a/drivers/huawei/yangmodel/pom.xml b/drivers/huawei/yangmodel/pom.xml
new file mode 100644
index 0000000..ca28572
--- /dev/null
+++ b/drivers/huawei/yangmodel/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2017-present Open Networking Laboratory
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <dependencies>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-yang-model</artifactId>
+ <version>1.12.0-b7</version>
+ </dependency>
+ </dependencies>
+
+ <parent>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-drivers-huawei</artifactId>
+ <version>1.10.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>onos-drivers-huawei-yangmodel</artifactId>
+ <packaging>bundle</packaging>
+
+ <description>Huawei L3VPN YANG model</description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-yang-compiler-maven-plugin</artifactId>
+ <version>1.12.0-b7</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>yang2java</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.7</source>
+ <target>1.7</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/drivers/huawei/yangmodel/src/main/yang/ne-bgpcomm-type.yang b/drivers/huawei/yangmodel/src/main/yang/ne-bgpcomm-type.yang
new file mode 100644
index 0000000..28f98e4
--- /dev/null
+++ b/drivers/huawei/yangmodel/src/main/yang/ne-bgpcomm-type.yang
@@ -0,0 +1,115 @@
+/*
+WARNING:
+This yang model is just for fuction ONOS opensource project demo purpose only,
+And is subject to change in future, Huawei does not commit provide compatibilty
+in commercial product.
+*/
+module ne-bgpcomm-type {
+ namespace "ne-bgpcomm-type";
+ prefix bgpcomm-type;
+ organization "Huawei Technologies Co., Ltd";
+ contact "Huawei Industrial Base
+ Bantian, Longgang
+ Shenzhen 518129
+ People's Republic of China
+ Website: http://www.huawei.com
+ Email: support@huawei.com";
+ description "ne-bgpcomm-type yang";
+ revision "2014-12-25" {
+ description "Initial version";
+ }
+ typedef bgpcommImRouteProtocol {
+ type enumeration {
+ enum "direct" {
+ value 0;
+ description "direct:";
+ }
+ enum "ospf" {
+ value 1;
+ description "ospf:";
+ }
+ enum "isis" {
+ value 2;
+ description "isis:";
+ }
+ enum "static" {
+ value 3;
+ description "static:";
+ }
+ enum "rip" {
+ value 4;
+ description "rip:";
+ }
+ enum "ospfv3" {
+ value 5;
+ description "ospfv3:";
+ }
+ enum "ripng" {
+ value 6;
+ description "ripng:";
+ }
+ enum "unr" {
+ value 7;
+ description "unr:";
+ }
+ enum "op-route" {
+ value 8;
+ description "op-route:";
+ }
+ }
+ description "";
+ }
+ typedef bgpcommPrefixType {
+ type enumeration {
+ enum "ipv4uni" {
+ value 0;
+ description "ipv4uni:";
+ }
+ enum "ipv4multi" {
+ value 1;
+ description "ipv4multi:";
+ }
+ enum "ipv4vpn" {
+ value 2;
+ description "ipv4vpn:";
+ }
+ enum "ipv6uni" {
+ value 3;
+ description "ipv6uni:";
+ }
+ enum "ipv6vpn" {
+ value 4;
+ description "ipv6vpn:";
+ }
+ enum "ipv4flow" {
+ value 5;
+ description "ipv4flow:";
+ }
+ enum "l2vpnad" {
+ value 6;
+ description "l2vpnad:";
+ }
+ enum "mvpn" {
+ value 7;
+ description "mvpn:";
+ }
+ enum "evpn" {
+ value 8;
+ description "evpn:";
+ }
+ enum "ipv4vpnmcast" {
+ value 9;
+ description "ipv4vpnmcast:";
+ }
+ enum "ls" {
+ value 10;
+ description "ls:";
+ }
+ enum "mdt" {
+ value 11;
+ description "mdt:";
+ }
+ }
+ description "";
+ }
+}
diff --git a/drivers/huawei/yangmodel/src/main/yang/ne-bgpcomm.yang b/drivers/huawei/yangmodel/src/main/yang/ne-bgpcomm.yang
new file mode 100644
index 0000000..b0bb113
--- /dev/null
+++ b/drivers/huawei/yangmodel/src/main/yang/ne-bgpcomm.yang
@@ -0,0 +1,77 @@
+/*
+WARNING:
+This yang model is just for fuction ONOS opensource project demo purpose only,
+And is subject to change in future, Huawei does not commit provide compatibilty
+in commercial product.
+*/
+module ne-bgpcomm {
+ namespace "ne-bgpcomm";
+ prefix bgpcomm;
+ import ne-bgpcomm-type {
+ prefix bgpcomm-type;
+ }
+ organization "Huawei Technologies Co., Ltd";
+ contact "Huawei Industrial Base
+ Bantian, Longgang
+ Shenzhen 518129
+ People's Republic of China
+ Website: http://www.huawei.com
+ Email: support@huawei.com";
+ description "ne-bgpcomm yang";
+ revision "2014-12-25" {
+ description "Initial version";
+ }
+
+ container devices {
+ list device {
+ key deviceid;
+ leaf deviceid {
+ type string;
+ }
+ container bgp {
+ container bgpcomm {
+ description "";
+ container bgpVrfs {
+ description "";
+ list bgpVrf {
+ key "vrfName";
+ description "BGP instance class";
+ leaf vrfName {
+ description "Specifies the name of the VPN in stance.
+ It is a string of 1 to 31 case-sensitive characters.";
+ type string;
+ }
+ container bgpVrfAFs {
+ description "";
+ list bgpVrfAF {
+ key "afType";
+ description "IPv4 unicast Address family class for
+ BGP instance";
+ leaf afType {
+ type "bgpcomm-type:bgpcommPrefixType";
+ description "Address family";
+ }
+ container importRoutes {
+ description "";
+ list importRoute {
+ key "importProtocol importProcessId";
+ description "Import route class";
+ leaf importProtocol {
+ type "bgpcomm-type:bgpcommImRouteProtocol";
+ description "Specifies the protocol from
+ which routes are imported.";
+ }
+ leaf importProcessId {
+ type "string";
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/drivers/huawei/yangmodel/src/main/yang/ne-l3vpn-api.yang b/drivers/huawei/yangmodel/src/main/yang/ne-l3vpn-api.yang
new file mode 100644
index 0000000..5b0181c
--- /dev/null
+++ b/drivers/huawei/yangmodel/src/main/yang/ne-l3vpn-api.yang
@@ -0,0 +1,82 @@
+/*
+WARNING:
+This yang model is just for fuction ONOS opensource project demo purpose only,
+And is subject to change in future, Huawei does not commit provide compatibilty
+in commercial product.
+*/
+module ne-l3vpn-api {
+ namespace "ne-l3vpn-api";
+ prefix l3vpn-api;
+ import ne-l3vpncomm-type {
+ prefix l3vpncomm-type;
+ }
+ import ne-l3vpncomm {
+ prefix l3vpncomm;
+ }
+ organization "Huawei Technologies Co., Ltd";
+ contact "Huawei Industrial Base
+ Bantian, Longgang
+ Shenzhen 518129
+ People's Republic of China
+ Website: http://www.huawei.com
+ Email: support@huawei.com";
+ description "VRP V800R010 Schema";
+ revision "2014-12-25" {
+ reference "Huawei VRPV8 Schema";
+ }
+ container devices {
+ list device {
+ key deviceid;
+ leaf deviceid {
+ type string;
+ }
+ container l3vpn {
+ container l3vpncomm {
+ container l3vpnInstances {
+ description "";
+ list l3vpnInstance {
+ key "vrfName";
+ leaf vrfName {
+ type string;
+ }
+ leaf vrfDescription {
+ type string;
+ }
+ uses l3vpncomm:l3vpnIfs;
+ container vpnInstAFs {
+ description "";
+ list vpnInstAF {
+ key "afType";
+ description "Address family";
+ leaf afType {
+ type "l3vpncomm-type:l3vpncommonL3vpnPrefixType";
+ description "Address family";
+ }
+ leaf vrfRD {
+ when "vrfName != '_public_'";
+ type "string";
+ description "route-distinguisher.";
+ }
+ container vpnTargets {
+ description "";
+ list vpnTarget {
+ must "vrfName != '_public_' and vpnTarget = '0'";
+ key "vrfRTValue vrfRTType";
+ description "L3vpn vpntarget configure class";
+ leaf vrfRTValue {
+ type "string";
+ }
+ leaf vrfRTType {
+ type "l3vpncomm-type:l3vpncommonVrfRtType";
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/drivers/huawei/yangmodel/src/main/yang/ne-l3vpncomm-type.yang b/drivers/huawei/yangmodel/src/main/yang/ne-l3vpncomm-type.yang
new file mode 100644
index 0000000..3e4e10c
--- /dev/null
+++ b/drivers/huawei/yangmodel/src/main/yang/ne-l3vpncomm-type.yang
@@ -0,0 +1,54 @@
+/*
+WARNING:
+This yang model is just for fuction ONOS opensource project demo purpose only,
+And is subject to change in future, Huawei does not commit provide compatibilty
+in commercial product.
+*/
+module ne-l3vpncomm-type {
+ namespace "l3vpn-comm-type";
+ prefix l3vpncomm-type;
+ organization "Huawei Technologies Co., Ltd";
+ contact "Huawei Industrial Base
+ Bantian, Longgang
+ Shenzhen 518129
+ People's Republic of China
+ Website: http://www.huawei.com
+ Email: support@huawei.com";
+ description "";
+ revision "2014-12-25" {
+ description "Initial version";
+ }
+ typedef l3vpncommonL3vpnPrefixType {
+ type enumeration {
+ enum "ipv4uni" {
+ value 0;
+ description "ipv4uni:";
+ }
+ enum "ipv6uni" {
+ value 1;
+ description "ipv6uni:";
+ }
+ }
+ description "";
+ }
+ typedef l3vpncommonVrfRtType {
+ type enumeration {
+ enum "export_extcommunity" {
+ value 0;
+ description "export-extcommunity:";
+ }
+ enum "import_extcommunity" {
+ value 1;
+ description "import-extcommunity:";
+ }
+ }
+ description "";
+ }
+ typedef ipv4Address {
+ type string {
+ length "0..255";
+ pattern "((([1-9]?[0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}
+ ([1-9]?[0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))";
+ }
+ }
+}
diff --git a/drivers/huawei/yangmodel/src/main/yang/ne-l3vpncomm.yang b/drivers/huawei/yangmodel/src/main/yang/ne-l3vpncomm.yang
new file mode 100644
index 0000000..b03c382
--- /dev/null
+++ b/drivers/huawei/yangmodel/src/main/yang/ne-l3vpncomm.yang
@@ -0,0 +1,49 @@
+/*
+WARNING:
+This yang model is just for fuction ONOS opensource project demo purpose only,
+And is subject to change in future, Huawei does not commit provide compatibilty
+in commercial product.
+*/
+module ne-l3vpncomm {
+ namespace "ne-l3vpn-comm";
+ prefix "l3vpncomm";
+ import ne-l3vpncomm-type {
+ prefix l3vpncomm-type;
+ }
+ organization "Huawei Technologies Co., Ltd";
+ contact "Huawei Industrial Base
+ Bantian, Longgang
+ Shenzhen 518129
+ People's Republic of China
+ Website: http://www.huawei.com
+ Email: support@huawei.com";
+ description "";
+ revision "2014-12-25" {
+ description "Initial version";
+ }
+ grouping l3vpnIfs {
+ container l3vpnIfs {
+ description "";
+ list l3vpnIf {
+ key "ifName";
+ description "interface Name.";
+ leaf ifName {
+ type string;
+ description "interface Name";
+ }
+ leaf ipv4Addr {
+ when "subnetMask != null";
+ mandatory "true";
+ type "l3vpncomm-type:ipv4Address";
+ description "Interface Address.";
+ }
+ leaf subnetMask {
+ when "ipv4Addr != null";
+ mandatory "true";
+ type "l3vpncomm-type:ipv4Address";
+ description "Interface address mask.";
+ }
+ }
+ }
+ }
+}