blob: 304a7f3f42770d3a8986925e0b83ff253ff96473 [file] [log] [blame]
Harald Welte5103ea02020-03-04 15:31:58 +01001[[remsim-server]]
Harald Welte51cfec02019-04-03 09:18:44 +02002== osmo-remsim-server
Harald Welte3c4d0062019-03-31 18:55:18 +02003
4=== Running
5
Harald Welte51cfec02019-04-03 09:18:44 +02006`osmo-remsim-server` currently has no command-line arguments. It will
7bind to INADDR_ANY and offer the following TCP ports:
Harald Welte3c4d0062019-03-31 18:55:18 +02008
Harald Welte51cfec02019-04-03 09:18:44 +02009* Port 9998 for the inbound control connections from `osmo-remsim-client`
10 and `osmo-remsim-bankd`
Harald Welte3c4d0062019-03-31 18:55:18 +020011* Port 9997 for the RESTful/JSON Web API (role: HTTP server)
12
13It is intended to make these settings (IP addresses, ports) configurable
14in future versions.
15
16=== Logging
17
Harald Welte51cfec02019-04-03 09:18:44 +020018`osmo-remsim-server` currently logs to stdout only, and the logging
19verbosity is not yet configurable. However, as the libosmocore logging
20framework is used, extending this is an easy modification.
Harald Welte3c4d0062019-03-31 18:55:18 +020021
Harald Welte5103ea02020-03-04 15:31:58 +010022[[rsres]]
Harald Welte3c4d0062019-03-31 18:55:18 +020023=== RESTful/JSON Web API
24
Harald Welte51cfec02019-04-03 09:18:44 +020025`osmo-remsim-server` provides a RESTful/JSON WEB API for application logic
Harald Welte3c4d0062019-03-31 18:55:18 +020026integration. The purpose of the API is to allow run-time configuration
27and monitoring of the entire osmo-remsim system.
28
29The API currently has version 1, and the URL prefix is /api/backend/v1
30
Harald Welteddbe43a2020-03-04 15:30:37 +010031WARNING: The RESTful/JSON Web API operates in plain-text,
32There is no authentication or encryption built into the protocol. It is
33assumed that the protocol is only spoken over trusted, controlled IP
34networks, such as inside a VPN or a closed / private corporate network.
35
Harald Welte3c4d0062019-03-31 18:55:18 +020036==== /api/backend/v1/clients
37
38*GET* obtains a JSON list where each element represents one currently
Harald Welte51cfec02019-04-03 09:18:44 +020039connected `osmo-remsim-client`.
Harald Welte3c4d0062019-03-31 18:55:18 +020040
41No other HTTP operation is implemented.
42
43==== /api/backend/v1/clients/:client_id
44
45*GET* obtains a single JSON object representing one specific currently
Harald Welte51cfec02019-04-03 09:18:44 +020046connected `osmo-remsim-client`.
Harald Welte3c4d0062019-03-31 18:55:18 +020047
48No other HTTP operation is implemented.
49
Harald Welte3afbf732019-05-08 17:23:12 +020050==== /api/backend/v1/banks
Harald Welte3c4d0062019-03-31 18:55:18 +020051
52*GET* obtains a JSON list where each element represents one currently
Harald Welte51cfec02019-04-03 09:18:44 +020053connected `osmo-remsim-bankd`.
Harald Welte3c4d0062019-03-31 18:55:18 +020054
55No other HTTP operation is implemented.
56
Harald Welte3afbf732019-05-08 17:23:12 +020057==== /api/backend/v1/banks/:bank_id
Harald Welte3c4d0062019-03-31 18:55:18 +020058
59*GET* obtains a single JSON object representing one specific currently
Harald Welte51cfec02019-04-03 09:18:44 +020060connected `osmo-remsim-bankd`.
Harald Welte3c4d0062019-03-31 18:55:18 +020061
62No other HTTP operation is implemented.
63
64==== /api/backend/v1/slotmaps
65
66*GET* obtains a JSON list where each element represents one provisioned
67slot mapping.
68
69*POST* creates a new slot mapping as specified in the JSON syntax
70contained in the HTTP body.
71
72No other HTTP operation is implemented.
73
74==== /api/backend/v1/slotmaps/:slotmap_id
75
76*DELETE* deletes a slot mapping by its identifier. If the mapping is
77currently in use, the related bankd is instructed to disconnect the
78client from the card.
79
80No other HTTP operation is implemented.
81
82==== /api/backend/v1/global-reset
83
Harald Welte51cfec02019-04-03 09:18:44 +020084*POST* performs a global reset of the `osmo-remsim-server` state. This
85means all mappings are removed.
Joachim Steigerc8bc5e72019-07-03 19:14:19 +020086
87==== Examples
88.remsim-server is on 10.2.3.4, one simbank with 5 cards: http://10.2.3.4:9997/api/backend/v1/banks
89----
90{"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}]}
91----
92.remsim-server is on 10.2.3.4, 4 clients: http://10.2.3.4:9997/api/backend/v1/clients
93----
94{"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"}}]}
95----