blob: 85f4da7e98b3f1422e6457b29ed25c5658ce11e2 [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
Harald Welte6a93cfb2021-12-09 12:56:27 +010016==== 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 Welte3c4d0062019-03-31 18:55:18 +020029=== Logging
30
Harald Welte6a93cfb2021-12-09 12:56:27 +010031`osmo-remsim-server` currently logs to stderr only; the logging
32verbosity is configurable via command line argument only. However, as
33the libosmocore logging framework is used, extending this is an easy
34modification.
Harald Welte3c4d0062019-03-31 18:55:18 +020035
Harald Welte5103ea02020-03-04 15:31:58 +010036[[rsres]]
Harald Welte3c4d0062019-03-31 18:55:18 +020037=== RESTful/JSON Web API
38
Harald Welte51cfec02019-04-03 09:18:44 +020039`osmo-remsim-server` provides a RESTful/JSON WEB API for application logic
Harald Welte3c4d0062019-03-31 18:55:18 +020040integration. The purpose of the API is to allow run-time configuration
41and monitoring of the entire osmo-remsim system.
42
43The API currently has version 1, and the URL prefix is /api/backend/v1
44
Harald Welteddbe43a2020-03-04 15:30:37 +010045WARNING: The RESTful/JSON Web API operates in plain-text,
46There is no authentication or encryption built into the protocol. It is
47assumed that the protocol is only spoken over trusted, controlled IP
48networks, such as inside a VPN or a closed / private corporate network.
49
Harald Welte3c4d0062019-03-31 18:55:18 +020050==== /api/backend/v1/clients
51
52*GET* obtains a JSON list where each element represents one currently
Harald Welte51cfec02019-04-03 09:18:44 +020053connected `osmo-remsim-client`.
Harald Welte3c4d0062019-03-31 18:55:18 +020054
55No 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 Welte51cfec02019-04-03 09:18:44 +020060connected `osmo-remsim-client`.
Harald Welte3c4d0062019-03-31 18:55:18 +020061
62No other HTTP operation is implemented.
63
Harald Welte3afbf732019-05-08 17:23:12 +020064==== /api/backend/v1/banks
Harald Welte3c4d0062019-03-31 18:55:18 +020065
66*GET* obtains a JSON list where each element represents one currently
Harald Welte51cfec02019-04-03 09:18:44 +020067connected `osmo-remsim-bankd`.
Harald Welte3c4d0062019-03-31 18:55:18 +020068
69No other HTTP operation is implemented.
70
Harald Welte3afbf732019-05-08 17:23:12 +020071==== /api/backend/v1/banks/:bank_id
Harald Welte3c4d0062019-03-31 18:55:18 +020072
73*GET* obtains a single JSON object representing one specific currently
Harald Welte51cfec02019-04-03 09:18:44 +020074connected `osmo-remsim-bankd`.
Harald Welte3c4d0062019-03-31 18:55:18 +020075
76No other HTTP operation is implemented.
77
78==== /api/backend/v1/slotmaps
79
80*GET* obtains a JSON list where each element represents one provisioned
81slot mapping.
82
83*POST* creates a new slot mapping as specified in the JSON syntax
84contained in the HTTP body.
85
86No 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
91currently in use, the related bankd is instructed to disconnect the
92client from the card.
93
94No other HTTP operation is implemented.
95
96==== /api/backend/v1/global-reset
97
Harald Welte51cfec02019-04-03 09:18:44 +020098*POST* performs a global reset of the `osmo-remsim-server` state. This
99means all mappings are removed.
Joachim Steigerc8bc5e72019-07-03 19:14:19 +0200100
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----