doc: Add documentation for remsim-apitool.py

Change-Id: I0e280cd4276e1aff7d6f694ac4affbca0336eba5
This commit is contained in:
Harald Welte 2020-03-04 15:48:49 +01:00
parent 5103ea0a43
commit 830026a9c0
3 changed files with 95 additions and 0 deletions

View File

@ -96,6 +96,14 @@ The tasks of `osmo-remsim-bankd` include:
For more information, please see <<remsim-bankd>>.
=== remsim-apitool.py
The `remsim-apitool.py` utility is an optional tool that can be used to
manually interface with the RSRES interface of `osmo-remsim-server` in
absence of a back-end system managing this.
For more information, please see <<remsim-apitool>>.
=== RSPRO
RSPRO is the *R*emote *S*IM *PRO*tocol. It is a binary protocol

View File

@ -0,0 +1,85 @@
[[remsim-apitool]]
== remsim-apitool.py
`remsim-apitool.py` is a small python script whic can be used to manually
control `osmo-remsim-server` via its RESTful interface in setups where
no external back-end application is controlling this interface.
For more information about The RESTful inteface, see <<RSRES>>.
=== Usage
Common command line arguments that can be used with any of the commands below:
*-H, --host HOST*::
Specify the hostname / IP of the `osmo-remsim-server` to connect to. Default: localhost
*-P, --port PORT*::
Specify the remote TCP port of the RSRES interface of `osmo-remsim-server`. Default: 9997
*-v, --verbose*
Increase verbosity of output: Show the GET request generated, not just the response.
==== Listing connected clients
The command `remsim-apitool.py -c` can be used to list all currently connected clients.
----
$ remsim-apitool.py -c
/clients: {'clients': [{'peer': 'C23:0', 'state': 'CONNECTED_CLIENT', 'component_id': {'type_': 'remsimClient', 'name': 'nataraja', 'software': 'remsim-client', 'swVersion': '0.2.2.63-844b'}}]}
----
==== Listing connected bankds
The command `remsim-apitool.py -b` can be used to list all currently connected bankds.
----
$ remsim-apitool.py -b
/banks: {'banks': [{'peer': 'B1', 'state': 'CONNECTED_BANKD', 'component_id': {'type_': 'remsimBankd', 'name': 'fixme-name', 'software': 'remsim-bankd', 'swVersion': '0.2.2.46-3598'}, 'bankId': 1, 'numberOfSlots': 5}]}
----
==== Listing installed slotmaps
The command `remsim-apitool.py -s` can be used to list all currently installed slotmaps.
----
$ remsim-apitool.py -s
/slotmaps: {'slotmaps': [{'bank': {'bankId': 1, 'slotNr': 1}, 'client': {'clientId': 23, 'slotNr': 0}, 'state': 'ACTIVE'}]}
----
==== Listing all information
The command `remsim-apitool.py -a` can be used to list all information (clients, bankds, slotmaps).
----
$ remsim-apitool.py -a
/clients: {'clients': [{'peer': 'C23:0', 'state': 'CONNECTED_CLIENT', 'component_id': {'type_': 'remsimClient', 'name': 'nataraja', 'software': 'remsim-client', 'swVersion': '0.2.2.63-844b'}}]}
/banks: {'banks': [{'peer': 'B1', 'state': 'CONNECTED_BANKD', 'component_id': {'type_': 'remsimBankd', 'name': 'fixme-name', 'software': 'remsim-bankd', 'swVersion': '0.2.2.46-3598'}, 'bankId': 1, 'numberOfSlots': 5}]}
/slotmaps: {'slotmaps': [{'bank': {'bankId': 1, 'slotNr': 1}, 'client': {'clientId': 23, 'slotNr': 0}, 'state': 'ACTIVE'}]}
----
==== Creating a slotmap
The command `remsim-apitool.py -m bank_id bankd_slot client_id client_slot` can be used to create a new slotmap.
.Create a slotmap between Bankd 1 Slot a (B1:1) and Client 23 Slot 0 (C23:0)
----
$ remsim-apitool.py -m 1 1 23 0
----
==== Deleting a slotmap
The command `remsim-apitool.py -d bank_id bank_slot` can be used to create a new slotmap.
.Remove a slotmap for Bankd 1 Slot a (B1:1)
----
$ remsim-apitool.py -m 1 1
----
==== Reset all state
The command `remsim-apitool.py -r` can be used to reset all state in bankd, including all slotmaps.
----
$ remsim-apitool.py -r
----
WARNING: Use with extreme caution, particularly in production environments.

View File

@ -10,6 +10,8 @@ include::{srcdir}/chapters/overview.adoc[]
include::{srcdir}/chapters/remsim-server.adoc[]
include::{srcdir}/chapters/remsim-apitool.adoc[]
include::{srcdir}/chapters/remsim-client.adoc[]
include::{srcdir}/chapters/remsim-bankd.adoc[]