Skip to content

sclctl#

sclctl is a CLI client to interact with the SCL API. It is available in the scl.sclctl package of the repository.

Configuration options#

The tool can be configured using the configuration file config/sclctl.toml or environment variables, which have higher precedence. The configuration keys are listed below. When using environment variables, all keys must be capitalized and prefixed with SCLCTL_.

Key Description Default
api_url SCL API URL. https://127.0.0.1:8008/api/v1
certificate_file The file that contains the TLS root certificates to authenticate the SCL API. ./config/certs/certs.pem
identity_file The file that contains the private key and public certificate to authenticate the controller to the SCL API. ./config/certs/id.pem

Usage#

The sclctl interface is based on an object and action design, which is implemented via subcommands.

USAGE:
    sclctl <SUBCOMMAND>

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

SUBCOMMANDS:
    controller    Manage Controller objects
    help          Print this message or the help of the given subcommand(s)
    node          Manage Node objects
    router        Manage Router objects
    sc            Manage SeparationContext objects
    vm            Manage VirtualMachine objects
    volume        Manage Volume objects

The option --help can be used on any level to list all available subcommands or arguments, e.g.:

  • sclctl vm --help
  • sclctl vm create --help

Example#

The following sequence illustrates a typical interaction. Note that we assume that the SCL API and all controllers are up and running, and that there is some image registry available at 127.0.0.1:9999 serving cirros-0.5.2-x86_64-disk.raw. We also expect a valid cloud-init user-data configuration file (~/user-data.yaml) and a valid cloud-init network configuration file (~/network.yaml).

It is worth noting that for a single-node deployment, the Node's L2 network management API can be accessed at 127.0.0.1:9000. The IP address corresponds to the default configuration provided in the config/node_l2_net_api.toml.

sclctl node create singlenode \
  --vcpu 4 --ram 1024 \
  --nic-api http://127.0.0.1:9000 \
  --node-api http://127.0.0.1:9000

sclctl sc create sc01

sclctl volume create sc01 vol01 --size 200 \
  --url http://127.0.0.1:9999/cirros-0.5.2-x86_64-disk.raw

sclctl vm create sc01 vm01 \
  --vcpu 1 --ram 256 --boot-volume name=vol01 \
  --network-device-name tapvm01 \
  --cloud-init-user-data ~/user-data.yaml \
  --cloud-init-network-config ~/network.yaml

sclctl router create sc01 router01 \
  --external-ip 192.168.168.2 \
  --internal-ip 192.168.10.1 \
  --internal-ip-netmask 255.255.255.0 \
  --forward-tcp 2222:192.168.10.1:5555 \
  --forward-udp 2222:192.168.10.1:5555

sclctl router delete sc01 router01
sclctl vm delete sc01 vm01
sclctl volume delete sc01 vol01
sclctl sc delete sc01
sclctl node delete singlenode

A complete example is provided in our nix-based integration tests.