Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

Example and guidline of creating the OSGi Feature for SDN-R with name helloworld.

HINT: This example is located in the sdnr sandbox and not in ONAP gerrit ccsdk/features repository

The SDN-R template structure has the elements

namecontent
featureOSGi xml feature and dependency
installerZIP file containg mavenrepository content of helloworld feature for delivery to distribution ODL Karaf container.
modelOSGi bundles export interface source files as java or yang source
providerOSGi bundles implementation source files as java or yang source

Hello World

In the wiki page Creating and Installing an Instance of SDNRSDN-R (Casablanca) we saw how the docker container is constructed and how features are prepared for installationinstalled into OpenDaylight.  We now discuss how to create and add a new feature to SDNR.  As an example, we will create a Hello World feature in the ccsdk/features repository using the subdirectory sdnr/northboundHere This is the initial file structure.

...

Helloworld is simpler than sliapi (a zip file is available) because code used in installations prior to Casablanca has been removed , e.g.,

  • installer/src/assembly/assemble-installer_zip.xml
  • installer/src/main/resources/scripts/install.sh

and the features directory has been simplified and renamed to featureAs we saw in Creating and Installing an Instance of SDN-R , features/sdnr-helloworld(Casablanca), feature/pom.xml creates a features.xml file and installer/pom.xml zips up the maven repository.  We can then modify ccsdk/distribution/odlsli/src/maindocker/Dockerfile to include helloworld in the boot features, as shown here.

...

The final steps are to add helloworld to the dependencies in ccsdk/distributikon/odlsli/pom.xml and then rebuild the docker image.

As before, to rebuild, execute 'mvn --activate-profiles docker clean package' in ccsdk/distribution/odlsli.