Karaf
...
shell
OpenNaaS The Mantychore server uses a Karaf shell to manage Fuse and the OSGi container and Fuse. To get information.
The shell is local to the server (although it can be configured to be acceded remotely) and is the primary interface to administer OpenNaaS.
It supports scripting, among many other interesting features you would like to take advantage of, for sure
To get more information about karaf itself:
- Karaf shell - http://karaf.apache.org/
- Karaf user's guide - http://karaf.apache.org/manual/latest-2.2.x/users-guide/index.html
- Karaf complet complete list commands: https://cwiki.apache.org/KARAF/41-console-and-commands.html#4.1.ConsoleandCommands-OSGishell
OSGI Commands
...
...
DESCRIPTION
...
SYNTAX
...
ARGUMENTS
...
OPTIONS
...
osgi:list
...
list all installed bundles
...
osgi:list [options]
...
...
-s Shows the symbolic name
-l Show the locations
-u Shows the update locations
...
osgi:ls
...
list OSGi services
...
osgi:ls [options] [ids]
...
ids Show only services for the given bundle ids
...
-u Shows services which are in use
-a Shows all services
...
osgi:start
...
Start bundle(s)
...
osgi:start [options] ids
...
ids The list of bundle IDs separated by white spaces
...
--force Forces the command to execute
...
osgi:stop
...
Stop bundle(s)
...
osgi:stop [options] ids
...
ids The list of bundle IDs separated by white spaces
...
--force Forces the command to execute
Features Management Commands
COMMAND | DESCRIPTION | SYNTAX | ARGUMENTS | OPTIONS |
---|---|---|---|---|
features:list | List all existing features available from the defined repositories. | features:list [options] |
| -i, --installed |
features:install | Installs a feature with the specified name and version | features:install [options] name [version] | name | -r, --no-auto-refresh |
features:uninstall | Uninstalls a feature with the specified name and version | features:install name [version] | name |
|
Mantychore Commands
The Mantychore server have a custom commands implemented in order to configure the platform via console shell.
Nexus commands
COMMAND | DESCRIPTION | SYNTAX | ARGUMENTS | OPTIONS |
---|---|---|---|---|
nexus:platform | Get platform details | nexus:platform |
|
|
Protocol commands
...
COMMAND
...
DESCRIPTION
...
SYNTAX
...
ARGUMENTS
...
OPTIONS
...
protocols:add
...
Brings up a live connection from the pool with the given protocol if there is none.
...
protocols:add resourceType:resourceName protocol
...
...
protocols:context
...
Manipulates protocol contexts for used to create new sessions. Call without protocol to list.
...
protocols:context [options] resourceType:resourceName [protocol] [uri]
...
--remove, -r
Instead of adding a context, remove it for the named protocol.
CLI commands
Karaf command line console offers a set of pre-defined commands to manage osgi bundles and features, but it has been extended by exporting other customized commands required to operate OpenNaaS.
Each command has a namespace and a command name. The way to invoke them is as follows:
No Format |
---|
>namespace:commandname [options] arguments |
As a quick reference, each OpenNaaS module exports commands required to interact with it. Namespaces are used to identify the context of a command or, more precisely, the component it comes from. In this manner, ResourceManager defines the "resources" namespace, ProtocolSessionManager the "protocols" one, and so on. Each capability defines a namespace that identifies its functionality, too.
The list of all available commands (and its namespaces) is accessible by pressing "tab" key twice form a clean prompt:
No Format |
---|
>[tab tab]
>Display all 341 possibilities? (y or n) |
For a description of the commands, each one has a "--help" option that describes the command syntax, its semantics and how to invoke it, enumerating required arguments and available options. An example of this option output is shown just below:
No Format |
---|
>resource:list --help
DESCRIPTION
resource:list
List all resources in the platform
SYNTAX
resource:list [options]
OPTIONS
--help
Display this help message
--all, -a
Extensive version
--type, -t
Specifies the type of resources to list (if specified, only resources of this type will be listed) |
If you are having problems using the shell, please refer to Getting Support section.
...
protocols:info
...
Provide extended information on a protocol session.
...
protocols:info resourceType:resourceName sessionId
...
resourceType:resourceName The device owning the session.
sessionId
The session to lookup.
...
...
protocols:list
...
List devices to which we have a live protocol session.
...
protocols:list [options] [resourceType:resourceName]
...
resourceType:resourceName
If present, only connections to this device will be listed.
...
--protocols, -p
Print supported protocols.
--verbose, -v
Do not only print list devices to which we have a live protocol session, print all connections information.
...
protocols:purge
...
Brings up a live connection from the pool with the given protocol if there is none.
...
protocols:purge [resourceType:resourceName] [seconds]
...
...
protocols:remove
...
Removes a live connection from the pool, closing it.
...
protocols:remove [options] resourceType:resourceName [sessionId]
...
resourceType:resourceName
The resource owning the session.
sessionId
The name of the session id that will be destroyed.
...
--all, -a
Remove all active sessions.
Description
In Mantychore, each resource needs to have linked a protocol to can communicate with the physical device which it virtualises. These list of commands are responsible to save in the Mantychore software which type of connection are linked to some resource. For this reason, it exists the protocol commands, protocols:context links these connection parameters. Also, in order to reuse these protocols in other resources, you can use protocols:add. Finally, for the protocol management, it exists: protocols:list, protocols:remove, protocols:info, etc...
Resource commands
COMMAND | DESCRIPTION | SYNTAX | ARGUMENTS | OPTIONS |
resource:create | Create one or more resources from a given descriptor | resource:create [options] paths or urls | paths or urls | --profile, -p |
resource:export | Export the descriptor of a resource to a file | resource:export resourceType:resourceName fileName | resourceType:resourceName |
|
resource:info | Provides extended information about one or more resources | resource:info resourceType:resourceName | resourceType:resourceName |
|
resource:list | List the resources in the platform | resource:list [options] |
| --type, -t |
resource:modify | Modify one or more existing resources | resource:modify resourceType:resourceName path or url | resourceType:resourceName |
|
resource:remove | Remove one or more resources from the platform | resource:remove resourceType:resourceName | resourceType:resourceName |
|
resource:start | Start one or more resources | resource:start resourceType:resourceName | resourceType:resourceName |
|
resource:stop | Stop one or more resources | resource:stop resourceType:resourceName | resourceType:resourceName |
|
Profile commands
COMMAND | DESCRIPTION | SYNTAX | ARGUMENTS | OPTIONS |
profile:info | Provides extended information about one or more profiles | profile:info profile ids | profile ids |
|
profile:list | List all available profiles | profile:list |
|
|
profile:remove | Remove a profile from available ones. | profile:remove profileName | profileName |
|
IP Capability commands
COMMAND | DESCRIPTION | SYNTAX | ARGUMENTS | OPTIONS |
chassis:listInterfaces | List all the interfaces of a given resource | chassis:listInterfaces resourceType:resourceName | resourceType:resourceName |
|
chassis:setInterface | Set a IP in a the interface of a given resource | chassis:setInterface resource type:name interface IP MASK | resourceType:resourceName |
|
ROADM Connections Capability commands
COMMAND | DESCRIPTION | SYNTAX | ARGUMENTS | OPTIONS |
connections:listConnections | Shows given resource connections | connections:listConnections resourceType:resourceName | resourceType:resourceName |
|
connections:getInventory | Shows given resource cards and connections information | connections:getInventory [options] resourceType:resourceName | resourceType:resourceName | --refresh, -r Refresh model prior to show information |
connections:makeConnection | Makes a connection between given ports af given resource, and configures which lambda enters and which gets out of the connection | connections:makeConnection resourceType:resourceName sourceport inputlambda porttarget outputlambda | resourceType:resourceName sourceport | |
connections:removeConnection | Removes a connection between given ports af given resource | connections:removeConnection resourceType:resourceName sourceport inputlambda porttarget outputlambda | resourceType:resourceName The resource id to make connection. sourceport Connection source port (input) inputlambda Input lambda (wavelength in nm) porttarget Connection target port (output) outputlambda Output lambda (wavelength in nm) |
Description
All the capability operations which work above a resource have the same work flow. A capability command is sent to the resource's queue and it will be executed
Monitoring Capability commands
...
COMMAND
...
DESCRIPTION
...
SYNTAX
...
ARGUMENTS
...
OPTIONS
...
alarms:list
...
List alarms of given resource (all alarms if no resource is given)
...
alarms:list resourceType:resourceName
...
resourceType:resourceName
A space delimited list of resource type and name
...
...
alarms:clear
...
Clear alarms
...
alarms:clear resourceType:resourceName
...
resourceType:resourceName
A space delimited list of resource type and name
Description
The alarms command include operations to list and clear the received alarms.