Matteo Scandolo | 9f61949 | 2019-10-25 13:11:58 -0700 | [diff] [blame] | 1 | .. _BBSimCtl: |
| 2 | |
| 3 | BBSimCtl |
| 4 | ======== |
| 5 | |
| 6 | BBSim comes with a gRPC interface to control the internal state. This |
| 7 | interface can be queried using `bbsimctl` (the tool can be build with |
| 8 | `make build` and it's available inside the `bbsim` container): |
| 9 | |
| 10 | .. code:: bash |
| 11 | |
| 12 | $ ./bbsimctl --help |
| 13 | Usage: |
| 14 | bbsimctl [OPTIONS] <command> |
| 15 | |
| 16 | Global Options: |
| 17 | -c, --config=FILE Location of client config file [$BBSIMCTL_CONFIG] |
| 18 | -s, --server=SERVER:PORT IP/Host and port of XOS |
| 19 | -d, --debug Enable debug mode |
| 20 | |
| 21 | Help Options: |
| 22 | -h, --help Show this help message |
| 23 | |
| 24 | Available commands: |
| 25 | completion generate shell compleition |
| 26 | config generate bbsimctl configuration |
| 27 | log set bbsim log level |
| 28 | olt OLT Commands |
| 29 | onu ONU Commands |
| 30 | |
| 31 | ``bbsimctl`` can be configured via a config file such as: |
| 32 | |
| 33 | .. code:: bash |
| 34 | |
| 35 | $ cat ~/.bbsim/config |
| 36 | apiVersion: v1 |
| 37 | server: 127.0.0.1:50070 |
| 38 | grpc: |
| 39 | timeout: 10s |
| 40 | |
| 41 | Example commands |
| 42 | ---------------- |
| 43 | |
| 44 | .. code:: bash |
| 45 | |
| 46 | $ ./bbsimctl olt get |
| 47 | ID SERIALNUMBER OPERSTATE INTERNALSTATE |
| 48 | 0 BBSIM_OLT_0 up enabled |
| 49 | |
| 50 | |
| 51 | $ ./bbsimctl olt pons |
| 52 | PON Ports for : BBSIM_OLT_0 |
| 53 | |
| 54 | ID OPERSTATE |
| 55 | 0 up |
| 56 | 1 up |
| 57 | 2 up |
| 58 | 3 up |
| 59 | |
| 60 | |
| 61 | $ ./bbsimctl onu list |
| 62 | PONPORTID ID SERIALNUMBER STAG CTAG OPERSTATE INTERNALSTATE |
| 63 | 0 1 BBSM00000001 900 900 up eap_response_identity_sent |
| 64 | 0 2 BBSM00000002 900 901 up eap_start_sent |
| 65 | 0 3 BBSM00000003 900 902 up auth_failed |
| 66 | 0 4 BBSM00000004 900 903 up auth_failed |
| 67 | 1 1 BBSM00000101 900 904 up eap_response_success_received |
| 68 | 1 2 BBSM00000102 900 905 up eap_response_success_received |
| 69 | 1 3 BBSM00000103 900 906 up eap_response_challenge_sent |
| 70 | 1 4 BBSM00000104 900 907 up auth_failed |
| 71 | 2 1 BBSM00000201 900 908 up auth_failed |
| 72 | 2 2 BBSM00000202 900 909 up eap_start_sent |
| 73 | 2 3 BBSM00000203 900 910 up eap_response_identity_sent |
| 74 | 2 4 BBSM00000204 900 911 up eap_start_sent |
| 75 | 3 1 BBSM00000301 900 912 up eap_response_identity_sent |
| 76 | 3 2 BBSM00000302 900 913 up auth_failed |
| 77 | 3 3 BBSM00000303 900 914 up auth_failed |
| 78 | 3 4 BBSM00000304 900 915 up auth_failed |
| 79 | |
| 80 | Autocomplete |
| 81 | ------------ |
| 82 | |
| 83 | ``bbsimctl`` comes with autocomplete, just run: |
| 84 | |
| 85 | .. code:: bash |
| 86 | |
| 87 | source <(bbsimctl completion bash) |