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
COMMAND | DESCRIPTION | SYNTAX | ARGUMENTS | OPTIONS | ||
---|---|---|---|---|---|---|
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="643642c7-7340-4c4e-92f3-c8c3f0f64d9a"><ac:plain-text-body><![CDATA[ | osgi:list | list all installed bundles | osgi:list [options] |
| -s Shows the symbolic name | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="046a9744-9fe6-4908-b002-33030094fba6"><ac:plain-text-body><![CDATA[ | 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 | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="799580fb-7d5f-4bd7-b0ea-f83882c43b87"><ac:plain-text-body><![CDATA[ | 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 | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="1abeb8e0-b699-4d0e-9119-d11cdc62aa25"><ac:plain-text-body><![CDATA[ | 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 | ]]></ac:plain-text-body></ac:structured-macro> |
Features Management Commands
COMMAND | DESCRIPTION | SYNTAX | ARGUMENTS | OPTIONS | |
---|---|---|---|---|---|
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e7169a5b-96df-4986-b794-ef50afef71d4"><ac:plain-text-body><![CDATA[ | features:list | List all existing features available from the defined repositories. | features:list [options] |
| -i, --installed |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c99bb611-0090-4b9a-9e54-df90969cafb0"><ac:plain-text-body><![CDATA[ | features:install | Installs a feature with the specified name and version | features:install [options] name [version] | name | -r, --no-auto-refresh |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="5b69d3ef-99a9-48a1-bdc8-69d9f366f2e6"><ac:plain-text-body><![CDATA[ | features:uninstall | Uninstalls a feature with the specified name and version | features:install [options] 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 | ||
---|---|---|---|---|---|---|
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ac44de96-86f8-4135-9b66-7c187a5a8c9b"><ac:plain-text-body><![CDATA[ | nexus:platform | Get platform details | nexus:platform [options] |
|
| ]]></ac:plain-text-body></ac:structured-macro> |
Protocol commands
...
COMMAND
...
DESCRIPTION
...
SYNTAX
...
ARGUMENTS
...
OPTIONS
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ed99cb17-b004-4a46-bcfc-713a652fd5b5"><ac:plain-text-body><![CDATA[
...
protocols:add
...
Brings up a live connection from the pool with the given protocol if there is none.
...
protocols:add [options] resourceType:resourceName protocol
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="7b5e2d6b-7d40-4609-8c00-113f5313f352"><ac:plain-text-body><![CDATA[
...
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.
...
protocols:info
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="b93f9982-efb1-4cdd-80c5-c4e218dc397e"><ac:plain-text-body><![CDATA[
...
Provide extended information on a protocol session.
...
protocols:info [options] resourceType:resourceName sessionId
...
resourceType:resourceName The device owning the session.
]]></ac:plain-text-body></ac:structured-macro>
sessionId
The session to lookup.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6ee13009-2b65-4181-984f-c765f13dd179"><ac:plain-text-body><![CDATA[
...
protocols:list
...
List devices to which we have a live protocol session.
...
protocols:list [options] [resourceType:resourceName]
...
resourceType:resourceName
]]></ac:plain-text-body></ac:structured-macro>
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.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="28e16410-1157-438d-b259-b2713fb3b940"><ac:plain-text-body><![CDATA[
...
protocols:purge
...
Brings up a live connection from the pool with the given protocol if there is none.
...
protocols:purge [options] [resourceType:resourceName] [seconds]
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="9599667a-85ec-4355-83de-78f71e979a11"><ac:plain-text-body><![CDATA[
...
protocols:remove
...
Removes a live connection from the pool, closing it.
...
protocols:remove [options] resourceType:resourceName [sessionId]
...
resourceType:resourceName
]]></ac:plain-text-body></ac:structured-macro>
The resource owning the session.
sessionId
The name of the session id that will be destroyed.
...
--all, -a
Remove all active sessions.
Resource commands
COMMAND | DESCRIPTION | SYNTAX | ARGUMENTS | OPTIONS | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="677268e6-c494-451f-bc67-53a1551b0f95"><ac:plain-text-body><![CDATA[ | resource:create | Create one or more resources from a given descriptor | resource:create [options] paths or urls | paths or urls | --profile, -p |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="8b019a0e-05cb-4155-9f44-66d40e7397af"><ac:plain-text-body><![CDATA[ | resource:export | Export the descriptor of a resource to a file | resource:export [options] resourceType:resourceName fileName | resourceType:resourceName |
|
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="4f1f5b6d-7eaf-4d4a-9f5f-b835ef47882b"><ac:plain-text-body><![CDATA[ | resource:info | Provides extended information about one or more resources | resource:info [options] resourceType:resourceName | resourceType:resourceName |
|
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="acb21c77-e985-4193-8476-1a340f0f70ae"><ac:plain-text-body><![CDATA[ | resource:list | List the resources in the platform | resource:list [options] |
| --type, -t |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e668a8e3-b3c9-4444-930a-a1b512f08c85"><ac:plain-text-body><![CDATA[ | resource:modify | Modify one or more existing resources | resource:modify [options] resourceType:resourceName path or url | resourceType:resourceName |
|
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="823cf621-4d03-4974-b742-d51a911f912c"><ac:plain-text-body><![CDATA[ | resource:remove | Remove one or more resources from the platform | resource:remove [options] resourceType:resourceName | resourceType:resourceName |
|
resource:start | Start one or more resources | resource:start [options] resourceType:resourceName | resourceType:resourceName |
| |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c2d563f0-9154-4fc2-a8e9-8126d3b78c3d"><ac:plain-text-body><![CDATA[ | resource:stop | Stop one or more resources | resource:stop [options] resourceType:resourceName | resourceType:resourceName |
|
Profile commands
...
COMMAND
...
DESCRIPTION
...
SYNTAX
...
ARGUMENTS
...
OPTIONS
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="7c29ef51-0a29-461a-98f5-38f2f45d7e6e"><ac:plain-text-body><![CDATA[
...
profile:info
...
Provides extended information about one or more profiles
...
profile:info [options] profile ids
...
profile ids
]]></ac:plain-text-body></ac:structured-macro>
A space delimited list of profiles ids.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="cd09dc20-fa33-493c-b4f8-b29335a45e88"><ac:plain-text-body><![CDATA[
...
profile:list
...
List all available profiles
...
profile:list [options]
...
]]></ac:plain-text-body></ac:structured-macro>
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.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2978be0c-92a5-4849-ae68-30423467b4bb"><ac:plain-text-body><![CDATA[
...
profile:remove
...
Remove a profile from available ones.
...
profile:remove [options] profileName
...
profileName
]]></ac:plain-text-body></ac:structured-macro>
The profile Id to be deleted
Capability commands
...
COMMAND
...
DESCRIPTION
...
SYNTAX
...
ARGUMENTS
...
OPTIONS
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="d25c503f-55f0-4b86-a6e2-6cdee28ea01e"><ac:plain-text-body><![CDATA[
...
chassis:listInterfaces
...
List all the interfaces of a given resource
...
chasis:listInterfaces [options] resourceType:resourceName
...
resourceType:resourceName
]]></ac:plain-text-body></ac:structured-macro>
The resource name to show the interfaces
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="1cd5e820-cac1-45d3-a830-ef91a09f41e7"><ac:plain-text-body><![CDATA[
...
chassis:setInterface
...
Set a IP in a the interface of a given resource
...
chasis:setInterface [options] resource type:name interface IP MASK
...