laforge has submitted this change. (
https://gerrit.osmocom.org/c/osmo-remsim/+/28563 )
Change subject: Install + package remsim-apitool as separate sub-package
......................................................................
Install + package remsim-apitool as separate sub-package
As the script depends on python3, let's put it into a new
osmo-remsim-apitool package.
As we're installing the tool system-wide, rename it from
remsim-apitool.py to osmo-remsim-apitool.
Closes: OS#5612
Change-Id: I11d779f66833b5294ffeb422ce6b2a705719a899
---
M Makefile.am
M contrib/Makefile.am
R contrib/osmo-remsim-apitool
M contrib/osmo-remsim.spec.in
M debian/control
A debian/osmo-remsim-apitool.install
M doc/manuals/chapters/overview.adoc
M doc/manuals/chapters/remsim-apitool.adoc
8 files changed, 45 insertions(+), 20 deletions(-)
Approvals:
laforge: Looks good to me, approved; Verified
Jenkins Builder: Verified
diff --git a/Makefile.am b/Makefile.am
index 664e3b7..a740ecc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,7 +10,6 @@
README.md \
asn1 \
contrib/osmo-remsim.spec.in \
- contrib/remsim-apitool.py \
debian \
$(NULL)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 17f56ed..a172ab3 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -1,3 +1,5 @@
SUBDIRS = etc_default systemd
-EXTRA_DIST = remsim-apitool.py owhw-event-script.sh
+EXTRA_DIST = osmo-remsim-apitool owhw-event-script.sh
+
+bin_SCRIPTS = osmo-remsim-apitool
diff --git a/contrib/remsim-apitool.py b/contrib/osmo-remsim-apitool
similarity index 100%
rename from contrib/remsim-apitool.py
rename to contrib/osmo-remsim-apitool
diff --git a/contrib/osmo-remsim.spec.in b/contrib/osmo-remsim.spec.in
index 3097b8f..150a8ec 100644
--- a/contrib/osmo-remsim.spec.in
+++ b/contrib/osmo-remsim.spec.in
@@ -95,6 +95,17 @@
it maintains a list of clients + bankds connected to it, as well as the
dynamic SIM card mappings between them.
+%package -n osmo-remsim-apitool
+Summary: Osmocom Remote SIM - API tool for Server
+License: GPL-2.0-or-later
+Group: Productivity/Telephony/Servers
+Requires: python3
+
+%description -n osmo-remsim-apitool
+This is a small python tool for generating API requests to remsim-server,
+which can be used by the system administrator to introspect and/or modify
+the state (mostly slotmaps).
+
%package -n osmo-remsim-bankd
Summary: Osmocom Remote SIM - Bank Daemon
License: GPL-2.0-or-later
@@ -191,6 +202,9 @@
%{_bindir}/osmo-remsim-server
%{_unitdir}/osmo-remsim-server.service
+%files -n osmo-remsim-server
+%{_bindir}/osmo-remsim-apitool
+
%files -n osmo-remsim-bankd
%{_bindir}/osmo-remsim-bankd
%{_unitdir}/osmo-remsim-bankd.service
diff --git a/debian/control b/debian/control
index 7a847b8..b899b0f 100644
--- a/debian/control
+++ b/debian/control
@@ -51,6 +51,15 @@
it maintains a list of clients + bankds connected to it, as well as the
dynamic SIM card mappings between them.
+Package: osmo-remsim-apitool
+Architecture: any
+Multi-Arch: same
+Depends: ${misc:Depends}, python3
+Description: Osmocom Remote SIM - API tool for server
+ This is a small python tool for generating API requests to remsim-server,
+ which can be used by the system administrator to introspect and/or modify
+ the state (mostly slotmaps).
+
Package: osmo-remsim-bankd
Architecture: any
Multi-Arch: same
diff --git a/debian/osmo-remsim-apitool.install b/debian/osmo-remsim-apitool.install
new file mode 100644
index 0000000..fd47f34
--- /dev/null
+++ b/debian/osmo-remsim-apitool.install
@@ -0,0 +1 @@
+usr/bin/osmo-remsim-apitool
diff --git a/doc/manuals/chapters/overview.adoc b/doc/manuals/chapters/overview.adoc
index 1e19d05..fac03c5 100644
--- a/doc/manuals/chapters/overview.adoc
+++ b/doc/manuals/chapters/overview.adoc
@@ -96,9 +96,9 @@
For more information, please see <<remsim-bankd>>.
-=== remsim-apitool.py
+=== osmo-remsim-apitool
-The `remsim-apitool.py` utility is an optional tool that can be used to
+The `osmo-remsim-apitool` 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.
diff --git a/doc/manuals/chapters/remsim-apitool.adoc
b/doc/manuals/chapters/remsim-apitool.adoc
index 3c4d858..ad97524 100644
--- a/doc/manuals/chapters/remsim-apitool.adoc
+++ b/doc/manuals/chapters/remsim-apitool.adoc
@@ -1,7 +1,7 @@
[[remsim-apitool]]
-== remsim-apitool.py
+== osmo-remsim-apitool
-`remsim-apitool.py` is a small python script whic can be used to manually
+`osmo-remsim-apitool` 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.
@@ -20,37 +20,37 @@
==== Listing connected clients
-The command `remsim-apitool.py -c` can be used to list all currently connected clients.
+The command `osmo-remsim-apitool -c` can be used to list all currently connected
clients.
----
-$ remsim-apitool.py -c
+$ osmo-remsim-apitool -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.
+The command `osmo-remsim-apitool -b` can be used to list all currently connected bankds.
----
-$ remsim-apitool.py -b
+$ osmo-remsim-apitool -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.
+The command `osmo-remsim-apitool -s` can be used to list all currently installed
slotmaps.
----
-$ remsim-apitool.py -s
+$ osmo-remsim-apitool -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).
+The command `osmo-remsim-apitool -a` can be used to list all information (clients,
bankds, slotmaps).
----
-$ remsim-apitool.py -a
+$ osmo-remsim-apitool -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'}]}
@@ -58,28 +58,28 @@
==== 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.
+The command `osmo-remsim-apitool -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
+$ osmo-remsim-apitool -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.
+The command `osmo-remsim-apitool -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
+$ osmo-remsim-apitool -m 1 1
----
==== Reset all state
-The command `remsim-apitool.py -r` can be used to reset all state in bankd, including all
slotmaps.
+The command `osmo-remsim-apitool -r` can be used to reset all state in bankd, including
all slotmaps.
----
-$ remsim-apitool.py -r
+$ osmo-remsim-apitool -r
----
WARNING: Use with extreme caution, particularly in production environments.
--
To view, visit
https://gerrit.osmocom.org/c/osmo-remsim/+/28563
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I11d779f66833b5294ffeb422ce6b2a705719a899
Gerrit-Change-Number: 28563
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged