commit | d69e42211489c1ad8d93672dda824a38bafddf39 | [log] [tgz] |
---|---|---|
author | Scott Baker <smbaker@gmail.com> | Wed Aug 21 16:46:05 2019 -0700 |
committer | Scott Baker <smbaker@gmail.com> | Thu Sep 19 13:03:57 2019 -0700 |
tree | 9e42e39cfa1bb7396049ad91d59ca4e7f0a76c74 | |
parent | 2b0ad65fe0b14c80f9001d75c0d07a894f9db2e5 [diff] |
VOL-1848 loglevel commands Change-Id: I0db607e85d9a53220438fd999c1fa3cf53516ed7
voltctl
- A command line tools to access VOLTHAIn today's VOLTHA implementation the operator interacts with VOLTHA via a CLI that is accessed by SSH
ing to the VOLTHA tool. While is can be convenent as it requires not external tool to be installed it is an abirtation in terms of industry trends for tools such as docker
and kubernetes
, which are both tools that VOLTHA leverages.
This repository contains a tool that attempts to provide a use model for VOLTHA that is similar to that of docker
and kubernetes
in that a simple control application is provided to invoke various funcs and the output can be displayed as a customized/filtered table or as JSON
.
To install the voltctl
command you can use the following:
mkdir myworkdir cd myworkdir export GOPATH=$(pwd) git clone http://github.com/ciena/voltctl src/github.com/ciena/voltctl cd src/github.com/ciena/voltctl make build cp ./voltctl <to any place you want in your path>
voltctl
has only been tested with go
version 1.12.x.
voltctl
supports shell completion for the bash
shell. To enable shell Completion you can use the following command on most *nix based system.
source <(voltctl completion bash)
If this does not work on your system, as is the case with the standard bash shell on MacOS, then you can try the following command:
source /dev/stdin <<<"$(voltctl completion bash)"
If you which to make bash
shell completion automatic when you login to your account you can append the output of voltctl completion bash
to your $HOME/.bashrc
:
voltctl completion base >> $HOME/.bashrc
Currently the configuration only supports the specification of the VOLTHA server. There is a sample configuration file name voltctl.config
. You can copy this to ~/.volt/config
and modify the server parameter to your environment. Alternatively you can specify the server on the command line as well, voltctl -server host:port ...
.
Currently only two commands are working
voltctl adapter list
- displays the installed adaptersvoltctl device list
- displays the devices in the systemvoltctl device create [-t type] [-i ipv4] [-m mac] [-H host_and_port]
- create or pre-provision a devicevoltctl delete DEVICE_ID [DEVICE_ID...]
- delete one or more devicesvoltctl enable DEVICE_ID [DEVICE_ID...]
- enable one or more devicesvoltctl disable DEVICE_ID [DEVICE_ID...]
- disable one or more devicesvoltctl version
- display the client and server versionEach command has a default output table format. This can be overriden from the command line using the voltctl --format=...
option. The specification of the format is roughly equivalent to the docker
or kubectl
command. If the prefix table
is specified a table with headers will be displayed, else each line will be output as specified.
The output of a command may also be written as JSON
or YAML
by using the --outputas
or -o
command line option. Valid values for this options are table
, json
, or yaml
.
voltctl adapter list ID VENDOR VERSION acme Acme Inc. 0.1 adtran_olt ADTRAN, Inc. 1.36 adtran_onu ADTRAN, Inc. 1.25 asfvolt16_olt Edgecore 0.98 brcm_openomci_onu Voltha project 0.50 broadcom_onu Voltha project 0.46 cig_olt CIG Tech 0.11 cig_openomci_onu CIG Tech 0.10 dpoe_onu Sumitomo Electric, Inc. 0.1 maple_olt Voltha project 0.4 microsemi_olt Microsemi / Celestica 0.2 openolt OLT white box vendor 0.1 pmcs_onu PMCS 0.1 ponsim_olt Voltha project 0.4 ponsim_onu Voltha project 0.4 simulated_olt Voltha project 0.1 simulated_onu Voltha project 0.1 tellabs_olt Tellabs Inc. 0.1 tellabs_openomci_onu Tellabs Inc. 0.1 tibit_olt Tibit Communications Inc. 0.1 tibit_onu Tibit Communications Inc. 0.1 tlgs_onu TLGS 0.1
voltctl device list ID TYPE ROOT PARENTID SERIALNUMBER VLAN ADMINSTATE OPERSTATUS CONNECTSTATUS 00015bbbfdb3c068 ponsim_olt true 0001aabbccddeeff 10.1.4.4:50060 0 ENABLED ACTIVE REACHABLE 0001552615104a2c ponsim_onu false 00015bbbfdb3c068 PSMO12345678 128 ENABLED ACTIVE REACHABLE
voltctl device list --format 'table{{.Id}}\t{{.SerialNumber}}\t{{.ConnectStatus}}' ID SERIALNUMBER CONNECTSTATUS 00015bbbfdb3c068 10.1.4.4:50060 REACHABLE 0001552615104a2c PSMO12345678 REACHABLE
voltctl --server voltha:50555 device list --format '{{.Id}},{{.SerialNumber}},{{.ConnectStatus}}' 00015bbbfdb3c068,10.1.4.4:50060,REACHABLE 0001552615104a2c,PSMO12345678,REACHABLE
voltctl device list --outputas json [{"id":"00015bbbfdb3c068","type":"ponsim_olt","root":true,"parent_id":"0001aabbccddeeff","vendor":"ponsim","model":"n/a","serial_number":"10.1.4.4:50060","adapter":"ponsim_olt","Address":{"HostAndPort":"10.1.4.4:50060"},"admin_state":3,"oper_status":4,"connect_status":2},{"id":"0001552615104a2c","type":"ponsim_onu","parent_id":"00015bbbfdb3c068","parent_port_no":1,"vendor":"ponsim","model":"n/a","serial_number":"PSMO12345678","vlan":128,"Address":null,"proxy_address":{"device_id":"00015bbbfdb3c068","channel_id":128},"admin_state":3,"oper_status":4,"connect_status":2}]
WIP - just barely started