HC2VPP-128 - interface role specification api 30/6230/6
authorJan Srnicek <[email protected]>
Thu, 20 Apr 2017 14:07:43 +0000 (16:07 +0200)
committerMarek Gradzki <[email protected]>
Thu, 27 Apr 2017 07:50:26 +0000 (07:50 +0000)
Change-Id: I534e4d67d43006e61b8cb7355460bf440b20476f
Signed-off-by: Jan Srnicek <[email protected]>
interface-role/api/asciidoc/Readme.adoc [new file with mode: 0644]
interface-role/api/pom.xml [new file with mode: 0644]
interface-role/api/src/main/yang/interface-role.yang [new file with mode: 0644]
interface-role/pom.xml [new file with mode: 0644]
pom.xml

diff --git a/interface-role/api/asciidoc/Readme.adoc b/interface-role/api/asciidoc/Readme.adoc
new file mode 100644 (file)
index 0000000..c2a75a3
--- /dev/null
@@ -0,0 +1,3 @@
+= api
+
+Overview of api
\ No newline at end of file
diff --git a/interface-role/api/pom.xml b/interface-role/api/pom.xml
new file mode 100644 (file)
index 0000000..16dba94
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+    <parent>
+        <groupId>io.fd.hc2vpp.common</groupId>
+        <artifactId>api-parent</artifactId>
+        <version>1.17.07-SNAPSHOT</version>
+        <relativePath>../../common/api-parent</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>io.fd.hc2vpp.iface.role</groupId>
+    <artifactId>api</artifactId>
+    <version>1.17.07-SNAPSHOT</version>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>yang-ext</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>ietf-interfaces</artifactId>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/interface-role/api/src/main/yang/interface-role.yang b/interface-role/api/src/main/yang/interface-role.yang
new file mode 100644 (file)
index 0000000..72af173
--- /dev/null
@@ -0,0 +1,78 @@
+module interface-role {
+
+  yang-version 1;
+  namespace "urn:opendaylight:params:xml:ns:yang:interface:role";
+  prefix "if-role";
+
+  // TODO - update revision number to 17.07 release date
+  revision "2017-03-15" {
+    description "Basic specification of interface roles";
+  }
+
+  import ietf-interfaces {
+    prefix "if";
+  }
+
+  import yang-ext {
+    prefix "ext";
+  }
+
+  identity network-role-base {
+    description "Base identity for network interface roles";
+  }
+
+  identity virtual-domain-interface {
+    base network-role-base;
+    description "Tenant network interface. Interface must be enabled and have ip assigned";
+  }
+
+  identity public-interface {
+    base network-role-base;
+    description "Public interface for external access. Interface must be enabled and have ip assigned";
+  }
+
+  typedef network-role {
+    type identityref {
+      base network-role-base;
+    }
+    description "Base type for network interface roles";
+  }
+
+  grouping interface-role-grouping {
+    container roles {
+      list role {
+        key role-name;
+
+        leaf role-name {
+          type string;
+          description "Unique name for role";
+          mandatory true;
+        }
+
+        leaf role-type {
+          type network-role;
+          description "Specifies type of network role";
+          mandatory true;
+        }
+
+        leaf description {
+          type string;
+          description "Any additional metadata for this assignment of network role";
+        }
+      }
+    }
+  }
+
+  augment /if:interfaces/if:interface {
+    ext:augment-identifier "interface-role-augmentation";
+
+    uses interface-role-grouping;
+  }
+
+  augment /if:interfaces-state/if:interface {
+    ext:augment-identifier "interface-role-state-augmentation";
+
+    uses interface-role-grouping;
+  }
+}
+
diff --git a/interface-role/pom.xml b/interface-role/pom.xml
new file mode 100644 (file)
index 0000000..bbfb72e
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+    <parent>
+        <artifactId>hc2vpp-parent</artifactId>
+        <groupId>io.fd.hc2vpp.common</groupId>
+        <version>1.17.07-SNAPSHOT</version>
+        <relativePath>../common/hc2vpp-parent</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>io.fd.hc2vpp.iface.role</groupId>
+    <artifactId>interface-role-aggregator</artifactId>
+    <packaging>pom</packaging>
+    <version>1.17.07-SNAPSHOT</version>
+
+    <modules>
+        <module>api</module>
+    </modules>
+</project>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index a58dcd3..fef706b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -52,5 +52,6 @@
     <module>l3</module>
     <module>vpp-management</module>
     <module>it</module>
+    <module>interface-role</module>
   </modules>
 </project>
\ No newline at end of file