blob: ad975249b67638541ba8091938a839d40ad03578 [file] [log] [blame]
Harald Welte830026a2020-03-04 15:48:49 +01001[[remsim-apitool]]
Harald Welte4e0e5b82022-07-11 22:29:40 +02002== osmo-remsim-apitool
Harald Welte830026a2020-03-04 15:48:49 +01003
Harald Welte4e0e5b82022-07-11 22:29:40 +02004`osmo-remsim-apitool` is a small python script whic can be used to manually
Harald Welte830026a2020-03-04 15:48:49 +01005control `osmo-remsim-server` via its RESTful interface in setups where
6no external back-end application is controlling this interface.
7
8For more information about The RESTful inteface, see <<RSRES>>.
9
10=== Usage
11
12Common command line arguments that can be used with any of the commands below:
13
14*-H, --host HOST*::
15 Specify the hostname / IP of the `osmo-remsim-server` to connect to. Default: localhost
16*-P, --port PORT*::
17 Specify the remote TCP port of the RSRES interface of `osmo-remsim-server`. Default: 9997
18*-v, --verbose*
19 Increase verbosity of output: Show the GET request generated, not just the response.
20
21==== Listing connected clients
22
Harald Welte4e0e5b82022-07-11 22:29:40 +020023The command `osmo-remsim-apitool -c` can be used to list all currently connected clients.
Harald Welte830026a2020-03-04 15:48:49 +010024
25----
Harald Welte4e0e5b82022-07-11 22:29:40 +020026$ osmo-remsim-apitool -c
Harald Welte830026a2020-03-04 15:48:49 +010027/clients: {'clients': [{'peer': 'C23:0', 'state': 'CONNECTED_CLIENT', 'component_id': {'type_': 'remsimClient', 'name': 'nataraja', 'software': 'remsim-client', 'swVersion': '0.2.2.63-844b'}}]}
28----
29
30==== Listing connected bankds
31
Harald Welte4e0e5b82022-07-11 22:29:40 +020032The command `osmo-remsim-apitool -b` can be used to list all currently connected bankds.
Harald Welte830026a2020-03-04 15:48:49 +010033
34----
Harald Welte4e0e5b82022-07-11 22:29:40 +020035$ osmo-remsim-apitool -b
Harald Welte830026a2020-03-04 15:48:49 +010036/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}]}
37----
38
39==== Listing installed slotmaps
40
Harald Welte4e0e5b82022-07-11 22:29:40 +020041The command `osmo-remsim-apitool -s` can be used to list all currently installed slotmaps.
Harald Welte830026a2020-03-04 15:48:49 +010042
43----
Harald Welte4e0e5b82022-07-11 22:29:40 +020044$ osmo-remsim-apitool -s
Harald Welte830026a2020-03-04 15:48:49 +010045/slotmaps: {'slotmaps': [{'bank': {'bankId': 1, 'slotNr': 1}, 'client': {'clientId': 23, 'slotNr': 0}, 'state': 'ACTIVE'}]}
46----
47
48==== Listing all information
49
Harald Welte4e0e5b82022-07-11 22:29:40 +020050The command `osmo-remsim-apitool -a` can be used to list all information (clients, bankds, slotmaps).
Harald Welte830026a2020-03-04 15:48:49 +010051
52----
Harald Welte4e0e5b82022-07-11 22:29:40 +020053$ osmo-remsim-apitool -a
Harald Welte830026a2020-03-04 15:48:49 +010054/clients: {'clients': [{'peer': 'C23:0', 'state': 'CONNECTED_CLIENT', 'component_id': {'type_': 'remsimClient', 'name': 'nataraja', 'software': 'remsim-client', 'swVersion': '0.2.2.63-844b'}}]}
55/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}]}
56/slotmaps: {'slotmaps': [{'bank': {'bankId': 1, 'slotNr': 1}, 'client': {'clientId': 23, 'slotNr': 0}, 'state': 'ACTIVE'}]}
57----
58
59==== Creating a slotmap
60
Harald Welte4e0e5b82022-07-11 22:29:40 +020061The command `osmo-remsim-apitool -m bank_id bankd_slot client_id client_slot` can be used to create a new slotmap.
Harald Welte830026a2020-03-04 15:48:49 +010062
63.Create a slotmap between Bankd 1 Slot a (B1:1) and Client 23 Slot 0 (C23:0)
64----
Harald Welte4e0e5b82022-07-11 22:29:40 +020065$ osmo-remsim-apitool -m 1 1 23 0
Harald Welte830026a2020-03-04 15:48:49 +010066----
67
68==== Deleting a slotmap
69
Harald Welte4e0e5b82022-07-11 22:29:40 +020070The command `osmo-remsim-apitool -d bank_id bank_slot` can be used to create a new slotmap.
Harald Welte830026a2020-03-04 15:48:49 +010071
72.Remove a slotmap for Bankd 1 Slot a (B1:1)
73----
Harald Welte4e0e5b82022-07-11 22:29:40 +020074$ osmo-remsim-apitool -m 1 1
Harald Welte830026a2020-03-04 15:48:49 +010075----
76
77==== Reset all state
78
Harald Welte4e0e5b82022-07-11 22:29:40 +020079The command `osmo-remsim-apitool -r` can be used to reset all state in bankd, including all slotmaps.
Harald Welte830026a2020-03-04 15:48:49 +010080
81----
Harald Welte4e0e5b82022-07-11 22:29:40 +020082$ osmo-remsim-apitool -r
Harald Welte830026a2020-03-04 15:48:49 +010083----
84
85WARNING: Use with extreme caution, particularly in production environments.