This tutorial describes the first steps to use Mantychore. we are going to add a router and we will do the first operations to manage it (In this case, we only do a simple operation, to configure an IP). You can find more infomation about the Karaf platform and others commands related with the resources on Server Console
Mantychore concepts
Mantychore is a framework which is developed through 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 executes Mantychore ( ./mantychore.sh (Linux) or ./mantychore.bat (Windows), it will appear a command line (cli) 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 it link.
Creating resources
The first step in Mantychore is the resource virtualization. In this step, it is added a new device 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, can you use this template as example (for more information, the wiki has a section to describe each parameter). The command will be:
Code Block |
---|
resource:create /home/carlos/Escritorio/resource.descriptor |
Resource descriptor: to get more information about how it works, you can use this link.
Adding protocols
Each resource has to be linked to the necessary protocols which are used to connect with the physical device (the real router which we want to virtualize). In this case, we will use a netconf protocol to connect with the router:
Code Block |
---|
protocols:context router:junos20 netconf ssh://myuser:mypassword@193.1.190.254:22/netconf |
Description of the connection parameters:
- router:junos20 - specify resource type (router) and resource name (junos20). It specifies what resource will use this protocol
- netconf - name to describe which protocol it will be used
- ssh://myuser:mypassword@1.1.1.1:22/netconf - URI to describe connection parameters.
Panel |
---|
The format is: transport://user:password@ip:port/subsystem The parameters are quite easy to understand. The subsystem param specifics any extra necessary parameter to specify in the connection. |
Resources states
A resource is in a set of states which it permits do or not a set of operations. This picture describes these states:
Mainly, a resource will activate all its capabilities if it is started. For this reason, the next step will be start our resource:
Code Block |
---|
resource:start router:junos20 |
Doing operations with the resource
Now, we have a started resource with a set of available operations. These operations will be send to the real device. In this case, we will be execute an ip configuration:
Code Block |
---|
chassis:setInterface router:junos20 fe-0/1/2.0 192.168.1.1 255.255.255.0 |
To get the configuration result:
Code Block |
---|
chassis:listInterfaces router:junos20 |
Removing a resource
Finally, if you don't need more our resource, you can stop and remove it. First, we need to stop it:
Code Block |
---|
resource:stop router:junos20 |
The resource will deactivate all its capabilities and it will be reset. After, we will destroy it and we will delete any resource information in Mantychore.
Code Block |
---|
resource:remove router:junos20 |