Harald Welte | 5103ea0 | 2020-03-04 15:31:58 +0100 | [diff] [blame] | 1 | [[remsim-server]] |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 2 | == osmo-remsim-server |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 3 | |
| 4 | === Running |
| 5 | |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 6 | `osmo-remsim-server` currently has no command-line arguments. It will |
| 7 | bind to INADDR_ANY and offer the following TCP ports: |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 8 | |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 9 | * Port 9998 for the inbound control connections from `osmo-remsim-client` |
| 10 | and `osmo-remsim-bankd` |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 11 | * Port 9997 for the RESTful/JSON Web API (role: HTTP server) |
| 12 | |
| 13 | It is intended to make these settings (IP addresses, ports) configurable |
| 14 | in future versions. |
| 15 | |
Harald Welte | 6a93cfb | 2021-12-09 12:56:27 +0100 | [diff] [blame] | 16 | ==== SYNOPSIS |
| 17 | |
| 18 | *osmo-remsim-server* [-h] [-V] [-d LOGOPT] |
| 19 | |
| 20 | ==== OPTIONS |
| 21 | |
| 22 | *-h, --help*:: |
| 23 | Print a short help message about the supported options |
| 24 | *-V, --version*:: |
| 25 | Print the software version number |
| 26 | *-d, --debug LOGOPT*:: |
| 27 | Configure the logging verbosity, see <<remsim_logging>>. |
| 28 | |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 29 | === Logging |
| 30 | |
Harald Welte | 6a93cfb | 2021-12-09 12:56:27 +0100 | [diff] [blame] | 31 | `osmo-remsim-server` currently logs to stderr only; the logging |
| 32 | verbosity is configurable via command line argument only. However, as |
| 33 | the libosmocore logging framework is used, extending this is an easy |
| 34 | modification. |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 35 | |
Harald Welte | 5103ea0 | 2020-03-04 15:31:58 +0100 | [diff] [blame] | 36 | [[rsres]] |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 37 | === RESTful/JSON Web API |
| 38 | |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 39 | `osmo-remsim-server` provides a RESTful/JSON WEB API for application logic |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 40 | integration. The purpose of the API is to allow run-time configuration |
| 41 | and monitoring of the entire osmo-remsim system. |
| 42 | |
| 43 | The API currently has version 1, and the URL prefix is /api/backend/v1 |
| 44 | |
Harald Welte | ddbe43a | 2020-03-04 15:30:37 +0100 | [diff] [blame] | 45 | WARNING: The RESTful/JSON Web API operates in plain-text, |
| 46 | There is no authentication or encryption built into the protocol. It is |
| 47 | assumed that the protocol is only spoken over trusted, controlled IP |
| 48 | networks, such as inside a VPN or a closed / private corporate network. |
| 49 | |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 50 | ==== /api/backend/v1/clients |
| 51 | |
| 52 | *GET* obtains a JSON list where each element represents one currently |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 53 | connected `osmo-remsim-client`. |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 54 | |
| 55 | No other HTTP operation is implemented. |
| 56 | |
| 57 | ==== /api/backend/v1/clients/:client_id |
| 58 | |
| 59 | *GET* obtains a single JSON object representing one specific currently |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 60 | connected `osmo-remsim-client`. |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 61 | |
| 62 | No other HTTP operation is implemented. |
| 63 | |
Harald Welte | 3afbf73 | 2019-05-08 17:23:12 +0200 | [diff] [blame] | 64 | ==== /api/backend/v1/banks |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 65 | |
| 66 | *GET* obtains a JSON list where each element represents one currently |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 67 | connected `osmo-remsim-bankd`. |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 68 | |
| 69 | No other HTTP operation is implemented. |
| 70 | |
Harald Welte | 3afbf73 | 2019-05-08 17:23:12 +0200 | [diff] [blame] | 71 | ==== /api/backend/v1/banks/:bank_id |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 72 | |
| 73 | *GET* obtains a single JSON object representing one specific currently |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 74 | connected `osmo-remsim-bankd`. |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 75 | |
| 76 | No other HTTP operation is implemented. |
| 77 | |
| 78 | ==== /api/backend/v1/slotmaps |
| 79 | |
| 80 | *GET* obtains a JSON list where each element represents one provisioned |
| 81 | slot mapping. |
| 82 | |
| 83 | *POST* creates a new slot mapping as specified in the JSON syntax |
| 84 | contained in the HTTP body. |
| 85 | |
| 86 | No other HTTP operation is implemented. |
| 87 | |
| 88 | ==== /api/backend/v1/slotmaps/:slotmap_id |
| 89 | |
| 90 | *DELETE* deletes a slot mapping by its identifier. If the mapping is |
| 91 | currently in use, the related bankd is instructed to disconnect the |
| 92 | client from the card. |
| 93 | |
| 94 | No other HTTP operation is implemented. |
| 95 | |
| 96 | ==== /api/backend/v1/global-reset |
| 97 | |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 98 | *POST* performs a global reset of the `osmo-remsim-server` state. This |
| 99 | means all mappings are removed. |
Joachim Steiger | c8bc5e7 | 2019-07-03 19:14:19 +0200 | [diff] [blame] | 100 | |
| 101 | ==== Examples |
| 102 | .remsim-server is on 10.2.3.4, one simbank with 5 cards: http://10.2.3.4:9997/api/backend/v1/banks |
| 103 | ---- |
| 104 | {"banks":[{"peer":"B1","state":"CONNECTED_BANKD","component_id":{"type_":"remsimBankd","name":"fixme-name","software":"remsim-bankd","swVersion":"0.1.0.17-6d8a"},"bankId":1,"numberOfSlots":5}]} |
| 105 | ---- |
| 106 | .remsim-server is on 10.2.3.4, 4 clients: http://10.2.3.4:9997/api/backend/v1/clients |
| 107 | ---- |
| 108 | {"clients":[{"peer":"C0:2","state":"CONNECTED_CLIENT","component_id":{"type_":"remsimClient","name":"simtrace2-remsim-client","software":"remsim-client","swVersion":"0.1.0.17-6d8a"}},{"peer":"C0:0","state":"CONNECTED_CLIENT","component_id":{"type_":"remsimClient","name":"simtrace2-remsim-client","software":"remsim-client","swVersion":"0.1.0.17-6d8a"}},{"peer":"C0:3","state":"CONNECTED_CLIENT","component_id":{"type_":"remsimClient","name":"simtrace2-remsim-client","software":"remsim-client","swVersion":"0.1.0.17-6d8a"}},{"peer":"C0:1","state":"CONNECTED_CLIENT","component_id":{"type_":"remsimClient","name":"simtrace2-remsim-client","software":"remsim-client","swVersion":"0.1.0.17-6d8a"}}]} |
| 109 | ---- |