Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 1 | == osmo-remsim-server |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 2 | |
| 3 | === Running |
| 4 | |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 5 | `osmo-remsim-server` currently has no command-line arguments. It will |
| 6 | bind to INADDR_ANY and offer the following TCP ports: |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 7 | |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 8 | * Port 9998 for the inbound control connections from `osmo-remsim-client` |
| 9 | and `osmo-remsim-bankd` |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 10 | * Port 9997 for the RESTful/JSON Web API (role: HTTP server) |
| 11 | |
| 12 | It is intended to make these settings (IP addresses, ports) configurable |
| 13 | in future versions. |
| 14 | |
| 15 | === Logging |
| 16 | |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 17 | `osmo-remsim-server` currently logs to stdout only, and the logging |
| 18 | verbosity is not yet configurable. However, as the libosmocore logging |
| 19 | framework is used, extending this is an easy modification. |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 20 | |
| 21 | === RESTful/JSON Web API |
| 22 | |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 23 | `osmo-remsim-server` provides a RESTful/JSON WEB API for application logic |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 24 | integration. The purpose of the API is to allow run-time configuration |
| 25 | and monitoring of the entire osmo-remsim system. |
| 26 | |
| 27 | The API currently has version 1, and the URL prefix is /api/backend/v1 |
| 28 | |
| 29 | ==== /api/backend/v1/clients |
| 30 | |
| 31 | *GET* obtains a JSON list where each element represents one currently |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 32 | connected `osmo-remsim-client`. |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 33 | |
| 34 | No other HTTP operation is implemented. |
| 35 | |
| 36 | ==== /api/backend/v1/clients/:client_id |
| 37 | |
| 38 | *GET* obtains a single JSON object representing one specific currently |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 39 | connected `osmo-remsim-client`. |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 40 | |
| 41 | No other HTTP operation is implemented. |
| 42 | |
Harald Welte | 3afbf73 | 2019-05-08 17:23:12 +0200 | [diff] [blame] | 43 | ==== /api/backend/v1/banks |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 44 | |
| 45 | *GET* obtains a JSON list where each element represents one currently |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 46 | connected `osmo-remsim-bankd`. |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 47 | |
| 48 | No other HTTP operation is implemented. |
| 49 | |
Harald Welte | 3afbf73 | 2019-05-08 17:23:12 +0200 | [diff] [blame] | 50 | ==== /api/backend/v1/banks/:bank_id |
Harald Welte | 3c4d006 | 2019-03-31 18:55:18 +0200 | [diff] [blame] | 51 | |
| 52 | *GET* obtains a single JSON object representing one specific currently |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 53 | connected `osmo-remsim-bankd`. |
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/slotmaps |
| 58 | |
| 59 | *GET* obtains a JSON list where each element represents one provisioned |
| 60 | slot mapping. |
| 61 | |
| 62 | *POST* creates a new slot mapping as specified in the JSON syntax |
| 63 | contained in the HTTP body. |
| 64 | |
| 65 | No other HTTP operation is implemented. |
| 66 | |
| 67 | ==== /api/backend/v1/slotmaps/:slotmap_id |
| 68 | |
| 69 | *DELETE* deletes a slot mapping by its identifier. If the mapping is |
| 70 | currently in use, the related bankd is instructed to disconnect the |
| 71 | client from the card. |
| 72 | |
| 73 | No other HTTP operation is implemented. |
| 74 | |
| 75 | ==== /api/backend/v1/global-reset |
| 76 | |
Harald Welte | 51cfec0 | 2019-04-03 09:18:44 +0200 | [diff] [blame] | 77 | *POST* performs a global reset of the `osmo-remsim-server` state. This |
| 78 | means all mappings are removed. |
Joachim Steiger | c8bc5e7 | 2019-07-03 19:14:19 +0200 | [diff] [blame] | 79 | |
| 80 | ==== Examples |
| 81 | .remsim-server is on 10.2.3.4, one simbank with 5 cards: http://10.2.3.4:9997/api/backend/v1/banks |
| 82 | ---- |
| 83 | {"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}]} |
| 84 | ---- |
| 85 | .remsim-server is on 10.2.3.4, 4 clients: http://10.2.3.4:9997/api/backend/v1/clients |
| 86 | ---- |
| 87 | {"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"}}]} |
| 88 | ---- |