Skip to content

Commit 4e379c5

Browse files
committed
Update documentation
1 parent 4585157 commit 4e379c5

File tree

1 file changed

+29
-15
lines changed

1 file changed

+29
-15
lines changed

doc/http_api.md

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,20 @@ The API is designed around 3 main concepts: *system*, *config* and *proposal*.
2020
The *config* contains elements that can modify the *system*, the *proposal* or both. For example, the *dasd* config changes the *system*, and the *storage* config changes the *proposal*. In other cases like *network*, the config can affect to both *system* and *proposal*.
2121

2222
~~~
23+
GET /status
2324
GET /system
2425
GET /extended_config
25-
GET /extended_config/{scope}
2626
GET PUT PATCH /config
27-
GET PUT PATCH /config/{scope}
2827
GET POST PATCH /questions
2928
GET /proposal
30-
GET /status
3129
GET /issues
3230
POST /action
3331
~~~
3432

33+
### GET /status
34+
35+
Reports the status of the installation. It contains the installation state (*configuring*, *installing*, *finished*) and the active progresses.
36+
3537
### GET /system
3638

3739
Returns a JSON with the info of the system (storage devices, network connections, current localization, etc).
@@ -47,39 +49,51 @@ There is a distinction between *extended config* and *config*:
4749

4850
For example, if only the *locale* was configured by the user, then the *config* has no *keymap* property. Nevertheless, the *extended config* would have a *keymap* with the value from the default *extended config*.
4951

50-
The scope can be indicated to retrieve only a part of the config, for example *GET /extended_config/l10n*.
52+
### GET PUT /config
5153

52-
### GET PUT PATCH /config
54+
Reads or replaces the *config*. In case of patching, the given config is merged into the current *extended config*.
5355

54-
Reads, replaces or modifies the explicitly set *config*. In case of patching, the given config is merged into the current *extended config*.
56+
### PATCH /config
5557

56-
The scope can be indicated to manage only part of the config, for example *PUT /config/l10n*.
58+
Applies changes in the *config*. There is an own patch document:
5759

58-
### POST /action
60+
~~~json
61+
{
62+
"update": {
63+
"l10n": {
64+
"keymap": "es"
65+
}
66+
}
67+
}
68+
~~~
5969

60-
Allows performing actions that cannot be done as side effect of applying a config. For example, start the installation, reload the system, etc. The *actions schema* defines the possible actions, parameters, etc.
70+
The given config from the *update* key is merged into current *extended config*.
6171

62-
### GET /status
72+
The patch document could be extended in the future with more options, for example for resetting some parts of the config.
6373

64-
Reports the status of the installation. It contains the installation state (*configuring*, *installing*, *finished*) and the active progresses.
74+
See https://datatracker.ietf.org/doc/html/rfc5789#section-2
75+
76+
### POST /action
77+
78+
Allows performing actions that cannot be done as side effect of applying a config. For example, start the installation, reload the system, etc. The *actions schema* defines the possible actions, parameters, etc.
6579

66-
### Example: reload the system
80+
#### Example: reload the system
6781

6882
In some cases, clients need to request a system reload. For example, if you create a RAID device using the terminal, then you need to reload the system in order to see the new device. In the future, reloading the system could be automatically done (e.g., by listening udisk D-Bus). For now, reloading has to be manually requested.
6983

7084
~~~
71-
POST /action { "reloadSystem": { scope: "storage" } }
85+
POST /action { "reloadSystem": "storage" }
7286
~~~
7387

74-
### Example: change the system localization
88+
#### Example: change the system localization
7589

7690
Sometimes we need to directly modify the system without changing the config. For example, switching the locale of the running system (UI language).
7791

7892
~~~
7993
POST /action { "configureL10n": { language: "es_ES" } }
8094
~~~
8195

82-
### Example: start installation
96+
#### Example: start installation
8397

8498
The installation can be started by calling the proper action.
8599

0 commit comments

Comments
 (0)