Change in osmo-remsim[master]: doc: Add documentation for remsim-apitool.py

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Mar 4 14:52:45 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/17347 )


Change subject: doc: Add documentation for remsim-apitool.py
......................................................................

doc: Add documentation for remsim-apitool.py

Change-Id: I0e280cd4276e1aff7d6f694ac4affbca0336eba5
---
M doc/manuals/chapters/overview.adoc
A doc/manuals/chapters/remsim-apitool.adoc
M doc/manuals/osmo-remsim-usermanual.adoc
3 files changed, 95 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/47/17347/1

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 @@
 
 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
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 <<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.
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/remsim-server.adoc[]
 
+include::{srcdir}/chapters/remsim-apitool.adoc[]
+
 include::{srcdir}/chapters/remsim-client.adoc[]
 
 include::{srcdir}/chapters/remsim-bankd.adoc[]

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/17347
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I0e280cd4276e1aff7d6f694ac4affbca0336eba5
Gerrit-Change-Number: 17347
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200304/5e19a053/attachment.htm>


More information about the gerrit-log mailing list