This tutorial describes the first steps to use OpenNaaS. we We are going to add a device and we will do the perform first operations to manage it. You can find more information about the Karaf platform and others commands related with the resources on Server ConsoleFor this tutorial we are going to use the karaf shell to interact with OpenNaaS. This shell is described in detail in Server Console section.
In this tutorial we are going to use commands from "resources" and "protocols" namespaces.
OpenNaaS concepts
OpenNaaS is a framework which is developed through based on the OSGi technology. OSGi consists of a set of components (named bundles) which provide the necessary operations. In this point, Mantychore adds our bundles with their operations. All these operations represent the capabilities for the end users. When you execute OpenNaaS ( ./opennaas.sh (Linux) or ./opennaas.bat (Windows), it will provide a command line (cli) prompt and you will be able to check the different loaded capabilities ( if you type <tab> or list).
To get more information about bundles and how Mantychore use them, go to this link.
Creating resources
required logic. OpenNaaS includes many bundles providing resources and capabilities abstraction (see System Architecture section). When running OpenNaaS (see Getting started section), all its bundles are loaded and exported functionality is available through the command line.
Creating resources
First step in OpenNaaS is registering existing infrastructure. For this tutorial, there is a single router device to be registered.
In order to register a resource, a resource descriptor file is required. This file describes resource device type and name, all capabilities OpenNaaS should load for it, and what drivers will it use. More information about the Resource descriptor concept is available in System Architecture sectionThe first step in OpenNaaS is the resource virtualization. In this step, a new device is added to the Mantychore system. For this action, it is necessary to create a file to describe what features and capabilities this virtual resource will be able to have.
For this tutorial, a template from this list template descriptor from the project examples directory can be used as example (for more information, the wiki has a section to describe each parameter). The command will be:
Code Block |
---|
resource:create /homepath/carlosto/Escritoriodescriptor/resource.descriptor |
About resource descriptors and how it works link.
Adding protocols
Each resource has to be linked to the necessary protocols which are used to communicate with the physical device and send its operations. This is an example which uses a netconf protocol to connect with the resource:
...
A resource is in a set of states which each allow a set of operations. This picture describes these states:
Mainly, a resource will enable all its capabilities when started. For this reason, the next step will be start our resource:
...