New resourcemanager bundle with yang models 10/40810/1
authorkaranrajsingh <karan.raj.s.singh@ericsson.com>
Fri, 24 Jun 2016 06:50:12 +0000 (12:20 +0530)
committerkaranrajsingh <karan.raj.s.singh@ericsson.com>
Fri, 24 Jun 2016 10:53:29 +0000 (16:23 +0530)
This review contains initial changes for resource manager and relevant
yang models.

Change-Id: Ibe4834479b746ec53b80fe5635adaa7e25e753e2
Signed-off-by: karanrajsingh <karan.raj.s.singh@ericsson.com>
features/pom.xml
features/src/main/features/features.xml
pom.xml
resourcemanager/pom.xml [new file with mode: 0644]
resourcemanager/resourcemanager-api/pom.xml [new file with mode: 0644]
resourcemanager/resourcemanager-api/src/main/yang/resource-manager.yang [new file with mode: 0644]
resourcemanager/resourcemanager-impl/pom.xml [new file with mode: 0644]
resourcemanager/resourcemanager-impl/src/main/config/default-config.xml [new file with mode: 0644]

index a99b9176db2efdf0b8ddabc22bd0ba05d30b4747..d40cd15a3200153fa370ac305e6e9a0a25695bf3 100644 (file)
@@ -286,6 +286,22 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
       <artifactId>fcapsapplication-impl</artifactId>
       <version>${project.version}</version>
     </dependency>
-
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>resourcemanager-impl</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>resourcemanager-impl</artifactId>
+      <version>${project.version}</version>
+      <type>xml</type>
+      <classifier>config</classifier>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>resourcemanager-api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
   </dependencies>
 </project>
index 7b512d39edc96a7c423848e8b928e6fcddca2a82..af0ca6c28ba65d51ea787409f8def204bb0f4351 100644 (file)
@@ -33,6 +33,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <bundle>mvn:org.opendaylight.genius/alivenessmonitor-api/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.genius/interfacemanager-api/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.genius/itm-api/{{VERSION}}</bundle>
+    <bundle>mvn:org.opendaylight.genius/resourcemanager-api/{{VERSION}}</bundle>
   </feature>
   <feature name='odl-genius' version='${project.version}' description='OpenDaylight :: genius'>
     <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
@@ -49,6 +50,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <bundle>mvn:org.opendaylight.genius/alivenessmonitor-impl/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.genius/interfacemanager-impl/{{VERSION}}</bundle>
     <bundle>mvn:org.opendaylight.genius/itm-impl/{{VERSION}}</bundle>
+    <bundle>mvn:org.opendaylight.genius/resourcemanager-impl/{{VERSION}}</bundle>
     <configfile finalname="lockmanager-impl-default-config.xml">mvn:org.opendaylight.genius/lockmanager-impl/{{VERSION}}/xml/config</configfile>
     <configfile finalname="idmanager-impl-default-config.xml">mvn:org.opendaylight.genius/idmanager-impl/{{VERSION}}/xml/config</configfile>
     <configfile finalname="mdsalutil-impl-default-config.xml">mvn:org.opendaylight.genius/mdsalutil-impl/{{VERSION}}/xml/config</configfile>
@@ -56,6 +58,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <configfile finalname="arputil-impl-default-config.xml">mvn:org.opendaylight.genius/arputil-impl/{{VERSION}}/xml/config</configfile>
     <configfile finalname="alivenessmonitor-impl-default-config.xml">mvn:org.opendaylight.genius/alivenessmonitor-impl/{{VERSION}}/xml/config</configfile>
     <configfile finalname="itm-impl-default-config.xml">mvn:org.opendaylight.genius/itm-impl/{{VERSION}}/xml/config</configfile>
+    <configfile finalname="resourcemanager-impl-default-config.xml">mvn:org.opendaylight.genius/resourcemanager-impl/{{VERSION}}/xml/config</configfile>
    </feature>
   <feature name='odl-genius-rest' version='${project.version}' description='OpenDaylight :: genius :: REST'>
     <feature version="${project.version}">odl-genius</feature>
diff --git a/pom.xml b/pom.xml
index 40c8f55f2cf8a95d4917a8e7d898d1b28e6808a9..db73a91c6c507d939e3f96b49658e933d66aa319 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -48,6 +48,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
     <module>artifacts</module>
     <module>fcapsmanager</module>
     <module>fcapsapplication</module>
+    <module>resourcemanager</module>
     <!--module>it</module-->
   </modules>
 
diff --git a/resourcemanager/pom.xml b/resourcemanager/pom.xml
new file mode 100644 (file)
index 0000000..e7ee9dc
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2016 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 INTERNAL
+-->
+<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>org.opendaylight.odlparent</groupId>
+    <artifactId>odlparent</artifactId>
+    <version>1.7.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <groupId>org.opendaylight.genius</groupId>
+  <artifactId>resourcemanager-aggregator</artifactId>
+  <version>0.1.0-SNAPSHOT</version>
+  <name>resourcemanager</name>
+  <packaging>pom</packaging>
+  <modelVersion>4.0.0</modelVersion>
+  <prerequisites>
+    <maven>3.1.1</maven>
+  </prerequisites>
+  <modules>
+    <module>resourcemanager-api</module>
+    <module>resourcemanager-impl</module>
+  </modules>
+  <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-deploy-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/resourcemanager/resourcemanager-api/pom.xml b/resourcemanager/resourcemanager-api/pom.xml
new file mode 100644 (file)
index 0000000..763227c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2016 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
+-->
+<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>
+
+  <parent>
+    <groupId>org.opendaylight.genius</groupId>
+    <artifactId>binding-parent</artifactId>
+    <version>0.1.0-SNAPSHOT</version>
+    <relativePath>../../commons/binding-parent</relativePath>
+  </parent>
+
+  <groupId>org.opendaylight.genius</groupId>
+  <artifactId>resourcemanager-api</artifactId>
+  <version>0.1.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.mdsal</groupId>
+      <artifactId>yang-binding</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.genius</groupId>
+      <artifactId>idmanager-api</artifactId>
+      <version>${genius.version}</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/resourcemanager/resourcemanager-api/src/main/yang/resource-manager.yang b/resourcemanager/resourcemanager-api/src/main/yang/resource-manager.yang
new file mode 100644 (file)
index 0000000..5f21ed0
--- /dev/null
@@ -0,0 +1,117 @@
+module resource-manager {
+    namespace "urn:opendaylight:genius:resourcemanager";
+    prefix resourcemgr;
+
+    import id-manager {
+        prefix idmgr;
+    }
+
+    revision "2016-06-22" {
+        description "YANG model exposes RPCs that can be used by the applications for allocating a block of IDs for tables, groups, meters, etc. This yang-model enables ODL Resource Sharing Framework";
+    }
+
+
+    identity resource-type-base {
+        description "Base identity for all resource-types";
+    }
+
+    identity resource-type-table-ids {
+        description "Resource type for tables";
+        base resource-type-base;
+    }
+
+    identity resource-type-group-ids {
+        description "Resource type for groups";
+        base resource-type-base;
+    }
+
+    identity resource-type-meter-ids {
+        description "Resource type for meters";
+        base resource-type-base;
+    }
+
+    rpc releaseResource {
+        input {
+             leaf resource-type {
+                type identityref{
+                    base resource-type-base;
+                }
+             }
+             leaf id-key {
+                type string;
+             }
+        }
+    }
+
+    rpc allocateResource {
+        input {
+             leaf resource-type {
+                type identityref{
+                    base resource-type-base;
+                }
+             }
+             leaf id-key {
+                type string;
+             }
+             leaf size {
+                type uint32;
+             }
+        }
+        output {
+             leaf-list id-values{
+                type uint32;
+                ordered-by user;
+             }
+        }
+    }
+
+    rpc getAvailableResources{
+        input {
+             leaf resource-type {
+                type identityref{
+                    base resource-type-base;
+                }
+             }
+        }
+        output{
+             leaf total-available-id-count {
+                type uint32;
+             }
+        }
+    }
+
+    rpc getResourcePool{
+        input{
+             leaf resource-type {
+                type identityref{
+                    base resource-type-base;
+                }
+             }
+        }
+        output{
+             list available-ids{
+                uses available-resource-ids;
+             }
+             uses released-resource-ids;
+        }
+    }
+
+    grouping available-resource-ids {
+        leaf start {
+             type uint32;
+        }
+        leaf end {
+             type uint32;
+        }
+    }
+
+    grouping released-resource-ids {
+        leaf delayed-time-sec {
+            type uint32;
+            mandatory true;
+        }
+        list delayed-id-entries {
+            uses idmgr:delayed-id-entry;
+        }
+    }
+}
diff --git a/resourcemanager/resourcemanager-impl/pom.xml b/resourcemanager/resourcemanager-impl/pom.xml
new file mode 100644 (file)
index 0000000..49ddf8b
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2016 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
+-->
+<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>
+
+  <parent>
+    <groupId>org.opendaylight.genius</groupId>
+    <artifactId>config-parent</artifactId>
+    <version>0.1.0-SNAPSHOT</version>
+    <relativePath>../../commons/config-parent</relativePath>
+  </parent>
+
+  <groupId>org.opendaylight.genius</groupId>
+  <artifactId>resourcemanager-impl</artifactId>
+  <version>0.1.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.genius</groupId>
+      <artifactId>resourcemanager-api</artifactId>
+      <version>${genius.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.genius</groupId>
+      <artifactId>idmanager-api</artifactId>
+      <version>${genius.version}</version>
+    </dependency>
+    <!-- Testing Dependencies -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-all</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/resourcemanager/resourcemanager-impl/src/main/config/default-config.xml b/resourcemanager/resourcemanager-impl/src/main/config/default-config.xml
new file mode 100644 (file)
index 0000000..10138ec
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2016 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
+-->
+<snapshot>
+  <required-capabilities>
+      <capability>urn:opendaylight:genius:resourcemanager:impl?module=resourcemanager-impl&amp;revision=2016-04-06</capability>
+      <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
+  </required-capabilities>
+  <configuration>
+
+    <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+      <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+        <module>
+          <type xmlns:prefix="urn:opendaylight:genius:resourcemanager:impl">prefix:resourcemanager-impl</type>
+          <name>resourcemanager-default</name>
+          <broker>
+            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
+            <name>binding-osgi-broker</name>
+          </broker>
+          <rpc-registry>
+            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
+            <name>binding-rpc-broker</name>
+          </rpc-registry>
+        </module>
+      </modules>
+    </data>
+  </configuration>
+</snapshot>