Command line (CLI)

Capabilities

Capability

Support

Comment

Values read

Supported feature

See command summary

Values subscribe

Supported feature

See command summary

Values update

Supported feature

See command summary

Restart module

Supported feature

See command summary

Create an alarm

Supported feature

See command summary

Concepts

Overview

The CLI (Command Line Interface) offers a method for interacting with OnSphere through an interactive command line. It allows you to visualize value, restart modules, create alarms ….

Requirements

To operate with CLI two modules are required :

Launching cli server

See the schema module description.

Launching cli-client

The client is directly launched when the osp-client-client container is started.

docker container run  --volume /tmp/onsphere/certs/ca/:/tmp/ osp-cli-client:<version>  --cafile /tmp/ca.crt  --host 10.110.0.120 --port 9999 --user user --password onsphere

Warning

Do not forget the -it for docker run otherwise the CLI is not interactive and returns this kind of error :

WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
osp> Exception in thread "main" org.jline.reader.EndOfFileException
    at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:653)
    at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:468)
    at ch.swissdotnet.osp.cli_client.cli.OspCli.run(OspCli.java:84)
    at ch.swissdotnet.osp.cli_client.Main.main(Main.java:60)

Arguments of CLI

  • -h, –help: shows the help message and exits

  • –host: The address of the osp-cli module

  • –port: The port of the osp-cli module

  • –user: The user to connect to the osp-cli module

  • –password: The password to connect to the osp-cli module

Command summary

  • help: shows the current command help documentation

  • values: action on the values

    • read: reads one or multiple values once

    • subscribe: subscribes to the changes of one or multiple values

    • update: changes the value of a variable value

  • modules:

    • restart: sends a restart command to one module

  • alarms:

    • create: creates an alarm