Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

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:

OSGI Commands

...

COMMAND

...

DESCRIPTION

...

SYNTAX

...

ARGUMENTS

...

OPTIONS

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="78a28b85-e559-44c6-bd2e-f9a67c44244e"><ac:plain-text-body><![CDATA[

...

osgi:list

...

...

osgi:list [options]

 

...

-s Shows the symbolic name
]]></ac:plain-text-body></ac:structured-macro>
-l Show the locations
-u Shows the update locations

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="d2db954f-3e47-47eb-a1dc-59567d3e395e"><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:plain-text-body></ac:structured-macro>
-a Shows all services

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="5849ebae-cc68-4067-8486-65986836b02a"><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="4dec3a64-64c3-44d3-8eed-0ae5a6405253"><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="10b27784-13d6-49c9-859e-11acebf48675"><ac:plain-text-body><![CDATA[

features:list

List all existing features available from the defined repositories.

features:list [options]

 

-i, --installed
]]></ac:plain-text-body></ac:structured-macro>
Display a list of all installed only

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="3934ff65-ca04-42f5-af9a-52e07f42f79f"><ac:plain-text-body><![CDATA[

features:install

Installs a feature with the specified name and version

features:install [options] name [version]

name
]]></ac:plain-text-body></ac:structured-macro>
The name of the feature
version
The version of the feature

-r, --no-auto-refresh
Do not automatically refresh bundles
-c, --no-clean
Do not uninstall bundles on failure

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="cb716dd7-4563-475b-99fe-9a71611c0286"><ac:plain-text-body><![CDATA[

features:uninstall

Uninstalls a feature with the specified name and version

features:install [options] name [version]

name 
]]></ac:plain-text-body></ac:structured-macro>
The name of the feature
version 
The version of the feature

 

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="f7451daa-758d-4873-8656-158f29d1cc4a"><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="30a7df4f-1e86-4748-b009-0d604ca10b68"><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="771e94c2-9fad-4427-82d2-66bdb5c9e284"><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="e971266a-85e2-47d4-8647-a78b380a73ba"><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="0e91976d-01a6-476f-94a7-24ffa83920d9"><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="7ae06796-195c-4657-82c3-23e5bf4acd65"><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="7839b10a-5c00-4085-bddc-0d9233eb820c"><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.

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

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="8d122516-41e4-4267-8808-7929126d4b3e"><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
]]></ac:plain-text-body></ac:structured-macro>
A space delimited list of file paths or urls to resource descriptors

--profile, -p
 
Allows explicit declaration of profile to be used

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="17468e3a-fb5c-429d-81d8-2569424241a9"><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:plain-text-body></ac:structured-macro>
The resource whose descriptor is going to be exported
fileName
The path to the file where the descriptor will be exported

 

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c03d13b1-526a-411d-a165-7fc663fd2baa"><ac:plain-text-body><![CDATA[

resource:info

Provides extended information about one or more resources

resource:info [options] resourceType:resourceName

resourceType:resourceName
]]></ac:plain-text-body></ac:structured-macro>
A space delimited list of resource type and name

 

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="8d521f31-f9e2-414c-a824-7b3e92703308"><ac:plain-text-body><![CDATA[

resource:list

List the resources in the platform

resource:list [options]

 

--type, -t
]]></ac:plain-text-body></ac:structured-macro>
The resource's type you want to obtain a list

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c941f03d-baea-431f-b6c2-99819276d079"><ac:plain-text-body><![CDATA[

resource:modify

Modify one or more existing resources

resource:modify [options] resourceType:resourceName path or url

resourceType:resourceName
]]></ac:plain-text-body></ac:structured-macro>
The name of the existing resource to modify
path or url
The file path or url to new resource descriptor

 

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6561250e-63a9-47ea-9542-b068d3aac651"><ac:plain-text-body><![CDATA[

resource:remove

Remove one or more resources from the platform

resource:remove [options] resourceType:resourceName

resourceType:resourceName
]]></ac:plain-text-body></ac:structured-macro>
A space delimited list of resource type:name to be deleted

 

resource:start
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="040e3bce-9e34-45fc-8c9c-c3ee8241f8a5"><ac:plain-text-body><![CDATA[ 

Start one or more resources

resource:start [options] resourceType:resourceName

resourceType:resourceName
]]></ac:plain-text-body></ac:structured-macro>
A space delimited list of resource type:name to be started

 

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2a966a2d-483f-4061-9384-a0f064edd58d"><ac:plain-text-body><![CDATA[

resource:stop

Stop one or more resources

resource:stop [options] resourceType:resourceName

resourceType:resourceName
]]></ac:plain-text-body></ac:structured-macro>
A space delimited list of resource type:name to be stopped

 

Profile commands

...

COMMAND

...

DESCRIPTION

...

SYNTAX

...

ARGUMENTS

...

OPTIONS

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0d93b968-2049-4bf3-a3d6-14f7f59a56eb"><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="f865e508-481d-47c1-bd6e-8b0ac3896e52"><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="1b19e773-813b-4a6f-951a-00ff3502a232"><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="f509b57a-7750-4653-b6c2-cf43f7f3b46b"><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="37091c1a-112d-48e2-9bb7-46e9c3429ec9"><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

...

resourceType:resourceName
]]></ac:plain-text-body></ac:structured-macro>
The resource id to set the interface
interface
The name of the interface to be setted
IP
A valid IPv4: x.x.x.x 
MASK
A valid MASK IPv4: x.x.x.x

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. Now, this command, which is in the queue with others, is ready to be confirmed and start the communication with the physical device.