From 830026a9c0b85db066e7286673abd83e24d234f5 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 4 Mar 2020 15:48:49 +0100 Subject: [PATCH] doc: Add documentation for remsim-apitool.py Change-Id: I0e280cd4276e1aff7d6f694ac4affbca0336eba5 --- doc/manuals/chapters/overview.adoc | 8 +++ doc/manuals/chapters/remsim-apitool.adoc | 85 ++++++++++++++++++++++++ doc/manuals/osmo-remsim-usermanual.adoc | 2 + 3 files changed, 95 insertions(+) create mode 100644 doc/manuals/chapters/remsim-apitool.adoc diff --git a/doc/manuals/chapters/overview.adoc b/doc/manuals/chapters/overview.adoc index d39a4f6..1e19d05 100644 --- a/doc/manuals/chapters/overview.adoc +++ b/doc/manuals/chapters/overview.adoc @@ -96,6 +96,14 @@ The tasks of `osmo-remsim-bankd` include: For more information, please see <>. +=== 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 <>. + === RSPRO RSPRO is the *R*emote *S*IM *PRO*tocol. It is a binary protocol diff --git a/doc/manuals/chapters/remsim-apitool.adoc b/doc/manuals/chapters/remsim-apitool.adoc new file mode 100644 index 0000000..3c4d858 --- /dev/null +++ b/doc/manuals/chapters/remsim-apitool.adoc @@ -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 <>. + +=== 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. diff --git a/doc/manuals/osmo-remsim-usermanual.adoc b/doc/manuals/osmo-remsim-usermanual.adoc index 854271a..1679db2 100644 --- a/doc/manuals/osmo-remsim-usermanual.adoc +++ b/doc/manuals/osmo-remsim-usermanual.adoc @@ -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[]