tree: a3679dc25d6476d4b1af867bb42a2da5f911949f [path history] [tgz]
  1. hello_world.json
  2. README.md
lighty/docs/README.md

Integration of the lighty.io with the CCSDK

These artifacts contain the examples of how can be the CCSDK integrated with the lighty.io. This integration removes the dependency on the OSGi framework (Karaf) and the Blueprint dependency injection - instead it uses only the plain java like main method to start the application and plain java constructors as DI (but it is ready to be integrated with other frameworks).

The CCSDK lighty.io modules can be all started at once (as in this example) or only the selected group of them - in case there is no need to run them all.

For more information about the lighty.io visit the official web-page https://lighty.io or the GitHub repository.

Artifact ccsdk-lighty-module

The artifact ccsdk-lighty-module contains implementation of the lighty.io module that groups all the other lighty.io modules from the other repositories (core, adaptors, plugins, northbound). These grouped modules can be started all at once using just a few lines of code.

In addition it contains implementation of the lighty.io module that groups the lighty.io controller (base services from the ODL), the RESTCONF lighty.io module (the RESTCONF from the ODL integrated with the lighty.io) and the CCSDK lighty.io module

Artifact ccsdk-lighty-distribution

The CCSDK lighty.io application can be started via main method from the Main class. This artifact generates the .zip file containing the .jar file and all other necessary libraries.

The path to the lighty.io configuration file can be passed to the main method (or to the .jar file) as an argument. This configuration file contains configuration for the lighty.io controller and the RESTCONF (for example the port or the IP address where should the RESTCONF listen or the yang modules that should be imported into the application). The example of the configuration file can be found in the resources directory. If path to the configuration file will not be passed through the main method then the default configuration will be used.

Artifact distribution-lighty-ubuntu-docker

The artifact distribution-lighty-ubuntu-docker contains the Dockerfile and the docker-compose.yml files for the CCSDK lighty.io. Dockerfile is very similar to the original file from the distribution-odlsli-ubuntu artifact and the docker-compose.yml to the original file from the src/main/yaml directory in the root of this repository.

Necessary configuration files and the .zip file containing the CCSDK lighty.io application are copied by the maven plugins into the respective directories during the the maven build.

The Dockerfile unpacks the .zip distribution generated by the ccsdk-lighty-distribution artifact and runs the startODL.sh script that starts the CCSDK lighty.io .jar file using the src/main/properties/lightyCcsdkConfig.json configuration file.

The docker-compose.yml file contains three images - database, CCSDK lighty.io application and the DG builder.

How to run

In order to run the CCSDK lighty.io application build the distribution-lighty repository using the maven with the docker profile enabled (command: mvn clean install -P docker). Then run the docker-compose from the src/main/docker directory (command: docker-compose -f docker-compose.yml up).

After a few seconds CCSDK lighty.io application should be up and running together with the database and the DG builder.

DG builder web UI can be accessed through the http://localhost:3000 address and RESTCONF at the http://localhost:8383/restconf address.

DG Builder and the CCSDK lighty.io application example

In the browser open the localhost:3000 URL. Login with the default username dguser and the password test123. In the top right corner click on the menu -> import -> Clipboard. Copy and paste the content of the hello_world.json file (from the same directory where is this readme file located) to the text box. Then click on the OK button and place the graph to the sheet.

To upload and activate the imported graph click on the small empty square on the left side of the DGSTART node and then click on the Upload XML button. Then click on the ViewDG List button and on the Activate link in the row where imported graph is.

After the graph is activated it can be called using the POST REST request on the address:

http://<restconf_address:port>/restconf/operations/SLI-API:execute-graph

With the body like:

{
  "input": {
    "module-name": "<name of the module (service-logic type node)>",
    "rpc-name": "<name of the rpc (method type node)>",
    "mode": "sync",
    "sli-parameter": [
    ]
  }
}

So in order to call imported hello world graph send the POST request to the address:

http://localhost:8383/restconf/operations/SLI-API:execute-graph

with the body:

{
  "input": {
    "module-name": "Test",
    "rpc-name": "helloWorld",
    "mode": "sync",
    "sli-parameter": [
    ]
  }
}

Now the hello world message should be displayed in the console where the CCSDK lighty.io application is running.